Jump to content
MakeWebGames

Recommended Posts

Posted

Ok, I've currently set about putting mainmenu.php into a table. I got it done succesfully, however there is only a slight problem. I had it so if you had a mail, event or announcement the link went white, although I'm having a bit of a problem incorporating that into a table, its probably very simple I know, so don't start slaying me, I'm just asking for help. Here is my mainmenu:

<?php
global $db,$c,$ir, $set;
$hc=$set['hospital_count'];
$jc=$set['jail_count'];
$ec=$ir['new_events'];
$mc=$ir['new_mail'];
$ac=$ir['new_announcements'];

print "
<table width=100% border=7>
<tr height=25>
<td colspan=\"2\">
Main Menu
</td>
</tr>
<tr height='25'>
<td valign=top>
[url='index.php']Home[/url]

</td>
<td valign=top>
[url='inventory.php']Items[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='events.php']Events ($ec)[/url]

</td>
<td valign=top>
[url='mailbox.php']Mailbox ($mc)[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='announcements.php']Announcement ($ac)[/url]

</td>
<td valign=top>
[url='explore.php']Explore[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='gym.php']Gym[/url]

</td>
<td valign=top>
[url='crystaltemple.php?spend=refill']Refill[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='job.php']Your Job[/url]

</td>
<td valign=top>
[url='criminal.php']Crimes[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='education.php']Local School[/url]

</td>
<td valign=top>
[url='polling.php']Polling Booth[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='hospital.php']Hospital ($hc)[/url]

</td>
<td valign=top>
[url='jail.php']Jail ($jc)[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='forums.php']Forums[/url]

</td>
<td valign=top>
[url='newspaper.php']Newspaper[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='search.php']Search[/url]

</td>
<td valign=top>
[url='usersonline.php']Users Online[/url]

</td>
<tr height=25>
<td colspan=\"2\">
Donators Only
</td>
</tr>
<tr height=25>
<td valign=top>
[url='friendslist.php']Friends List[/url]

</td>
<td valign=top>
[url='blacklist.php']Black List[/url]

</td>
</tr>
<tr height=25>
<td colspan=\"2\">
Personal Preferences
</td>
</tr>
<tr height=25>
<td valign=top>
[url='preferences.php']Preferences[/url]

</td>
<td valign=top>
[url='preport.php']Player Report[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='breport.php']Bug Report[/url]

</td>
<td valign=top>
[url='helptutorial.php']Help Tutorial[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='gamerules.php']Game Rules[/url]

</td>
<td valign=top>
[url='viewuser.php?u={$ir[']My Profile[/url]

</td>
</tr>
<tr height=25>
<td colspan=\"2\">
Exit Area
</td>
</tr>
<tr height=25>
<td colspan=\"2\">
[url='logout.php']Logout[/url]
</td>
</tr>
</table>

"
?>

 

There it is, and what I want to put it in is the following.

Mailbox:

if($mc > 0) { print "[url='mailbox.php']Mailbox ($mc)[/url]
"; }
else { print "[url='mailbox.php']Mailbox (0)[/url]
"; }

 

Events:

if($ec > 0) { print "[url='events.php']Events ($ec)[/url]
"; }
else { print "[url='events.php']Events (0)[/url]
"; }

 

Announcements:

if($ac > 0) { print "[url='announcements.php']Announcement ($ac)[/url]
"; }
else { print "[url='announcements.php']Mailbox (0)[/url]
"; }

 

If anyone could fix it up for me it would be highly appreciated. Thanks. Faz

Posted

Re: Table Help

try this, it works, i have tested it, you might wanna change the border tho :o pretty hench lol! enjoy :)

<?php
global $db,$c,$ir, $set;
$hc=$set['hospital_count'];
$jc=$set['jail_count'];
$ec=$ir['new_events'];
$mc=$ir['new_mail'];
$ac=$ir['new_announcements'];

print "
<table width=100% border=7>
<tr height=25>
<td colspan=2>
Main Menu
</td>
</tr>
<tr height=25>
<td valign=top>
[url='index.php']Home[/url]

</td>
<td valign=top>
[url='inventory.php']Items[/url]

</td>
</tr>
<tr height=25>
<td valign=top>";
if($ec > 0) { print "[url='events.php']Events ($ec)[/url]
"; }
else { print "[url='events.php']Events (0)[/url]
"; }
print "
</td>
<td valign=top>";
if($mc > 0) { print "[url='mailbox.php']Mailbox ($mc)[/url]
"; }
else { print "[url='mailbox.php']Mailbox (0)[/url]
"; }
print "
</td>
</tr>
<tr height=25>
<td valign=top>";
if($ac > 0) { print "[url='announcements.php']Announcement ($ac)[/url]
"; }
else { print "[url='announcements.php']Mailbox (0)[/url]
"; }
print "
</td>
<td valign=top>
[url='explore.php']Explore[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='gym.php']Gym[/url]

</td>
<td valign=top>
[url='crystaltemple.php?spend=refill']Refill[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='job.php']Your Job[/url]

</td>
<td valign=top>
[url='criminal.php']Crimes[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='education.php']Local School[/url]

</td>
<td valign=top>
[url='polling.php']Polling Booth[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='hospital.php']Hospital ($hc)[/url]

</td>
<td valign=top>
[url='jail.php']Jail ($jc)[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='forums.php']Forums[/url]

</td>
<td valign=top>
[url='newspaper.php']Newspaper[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='search.php']Search[/url]

</td>
<td valign=top>
[url='usersonline.php']Users Online[/url]

</td>
<tr height=25>
<td colspan=2>
Donators Only
</td>
</tr>
<tr height=25>
<td valign=top>
[url='friendslist.php']Friends List[/url]

</td>
<td valign=top>
[url='blacklist.php']Black List[/url]

</td>
</tr>
<tr height=25>
<td colspan=2>
Personal Preferences
</td>
</tr>
<tr height=25>
<td valign=top>
[url='preferences.php']Preferences[/url]

</td>
<td valign=top>
[url='preport.php']Player Report[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='breport.php']Bug Report[/url]

</td>
<td valign=top>
[url='helptutorial.php']Help Tutorial[/url]

</td>
</tr>
<tr height=25>
<td valign=top>
[url='gamerules.php']Game Rules[/url]

</td>
<td valign=top>
[url='viewuser.php?u={$ir[']My Profile[/url]

</td>
</tr>
<tr height=25>
<td colspan=2>
Exit Area
</td>
</tr>
<tr height=25>
<td colspan=2>
[url='logout.php']Logout[/url]
</td>
</tr>
</table>

";
?>
Posted

Re: Table Help

Thanks a lot! It is really appreciated. I had it going, it was just the damn if statements, Now I have that done, I'm gonna try and put it in a if statement so staff panel and donator features only come up if you are one of them without breaking everything! lol

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...