Jump to content
MakeWebGames

Recommended Posts

Posted

can anyone tell me how i would make all the main menu link to appear

like this

Home
Inventory
Events (0)
Mailbox (0)
Explore
Gym
Crimes
Your Job
Local School
Hospital (0)
Jail (0)
Forums
Announcements (0)
Newspaper
Search

instead of like this

  Home
  Inventory
Events (0)
 Mailbox (0)
  Explore
 Gym
 Crimes
   Your Job
  Local School
 Hospital (0)
 Jail (0)
Forums
 Announcements (0)
Newspaper
   Search 

 

this is my main menu

 <?php
global $db,$c,$ir, $set;
$hc=$set['hospital_count'];
$jc=$set['jail_count'];
$ec=$ir['new_events'];
$mc=$ir['new_mail'];
if($ir['hospital'])
{
 print "[url='hospital.php']Hospital ($hc)[/url]

 [url='inventory.php']Inventory[/url]
";
}
elseif($ir['jail'])
{
 print "[url='jail.php']Jail ($jc)[/url]
";
}
else
{
 print "[url='index.php']Home[/url]

 [url='inventory.php']Inventory[/url]
";
}
if($ec > 0) { print "[url='events.php']Events ($ec)[/url]
"; }
else { print "[url='events.php']Events (0)[/url]
"; }
if($mc > 0) { print "[url='mailbox.php']Mailbox ($mc)[/url]
"; }
else { print "[url='mailbox.php']Mailbox (0)[/url]
"; }
if($ir['jail'] and !$ir['hospital'])
{
 print "[url='gym.php']Jail Gym[/url]

 [url='hospital.php']Hospital ($hc)[/url]
";
}
else if (!$ir['hospital'])
{
 print "[url='explore.php']Explore[/url]

 [url='gym.php']Gym[/url]

 [url='criminal.php']Crimes[/url]

 [url='job.php']Your Job[/url]

 [url='education.php']Local School[/url]

 [url='hospital.php']Hospital ($hc)[/url]

 [url='jail.php']Jail ($jc)[/url]
";
}
else
{
 print "[url='jail.php']Jail ($jc)[/url]
";
}
print "[url='forums.php']Forums[/url]
";
if($ir['new_announcements'])
{
print "[url='ann.php']Announcements ({$ir['new_announcements']})[/url]
";
}
else
{
print "[url='ann.php']Announcements (0)[/url]
";
}
print "
[url='newspaper.php']Newspaper[/url]

[url='search.php']Search[/url]
";
if(!$ir['jail'] && $ir['gang'])
{
 print "[url='yourgang.php']Your Gang[/url]
";
}
if($ir['user_level'] > 1)
{
print "<hr />
[url='staff.php']Staff Panel[/url]
\n";



print "<hr />[b]Staff Online:[/b]
";
$q=$db->query("SELECT * FROM users WHERE laston>(unix_timestamp()-15*60) AND user_level>1 ORDER BY userid ASC");
while($r=$db->fetch_row($q))
{
$la=time()-$r['laston'];
$unit="secs";
if($la >= 60)
{
$la=(int) ($la/60);
$unit="mins";
}
if($la >= 60)
{
$la=(int) ($la/60);
$unit="hours";
if($la >= 24)
{
$la=(int) ($la/24);
$unit="days";
}
}
print "[url='viewuser.php?u={$r[']{$r['username']}[/url] ($la $unit)
";
}
}
if($ir['donatordays'])
{
print "<hr />
[b]Donators Only[/b]

[url='friendslist.php']Friends List[/url]

[url='blacklist.php']Black List[/url]";
}
print "<hr />
[url='preferences.php']Preferences[/url]

[url='preport.php']Player Report[/url]

[url='helptutorial.php']Help Tutorial[/url]

[url='gamerules.php']Game Rules[/url]

[url='viewuser.php?u={$ir[']My Profile[/url]

[url='logout.php']Logout[/url]


Time is now

";
echo date ('F j, Y')."
".date('g:i:s a');

?>
Posted

Re: menu help

here is my header its the normal mcodes header with afew edits

 <?php
class headers {
function startheaders() {
global $ir, $set;
echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{$set['game_name']}</title>
<style type="text/css">
<!--
body {
background-color: #DEDEDE;
margin-top: 0px;
margin-bottom: 0px;
font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:12px;color: black;
  scrollbar-base-color: #005B70; 
  scrollbar-arrow-color: #F3960B;
  scrollbar-DarkShadow-Color: #000000;
}
a:visited,a:active,a:hover,a:link { color: black;text-decoration: none; }
table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; }
img { border:none; }
textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: black; }
.table2 {
}
.lgrad {
background-image:url(lgrad.jpg);
background-repeat:repeat-y;
width:19px;
}
.linegrad {
background-image:url(linegrad.PNG);
background-repeat:repeat-y;
background-align: center;
width:2px;
}
.rgrad {
background-image:url(rgrad.jpg);
background-repeat:repeat-y;
width:19px;
}
.dgrad {
background-image:url(dgrad.jpg);
background-repeat:repeat-x;
height:38px;
}
.dgradl {
background-image:url(dgradl.jpg);
background-repeat:no-repeat;
height:38px;
width:38px;
}
.dgradr {
background-image:url(dgradr.jpg);
background-repeat:no-repeat;
height:38px;
width:38px;
}
.center {
width:932px;
background-color:#cccccc;
vertical-align:top;
text-align:center;
}
.table {
background-color:#000000;
}
.table3 {
background-color:#000000;
}
.table td {
background-color:#DEDEDE;
height:22px;
}
.table3 td {
background-color:#CCCCCC;
}
td .alt {
background-color:#EEEEEE;
height:22px;
}
td .h {
background-image:url(tablehgrad.png);
background-repeat:repeat-x;
font-weight: bold;
background-color: #D6D6D6;
}
.table th {
background-image:url(tablehgrad.png);
background-repeat:repeat-x;
font-weight: bold;
background-color: #D6D6D6;
}
-->
</style></head>
<body>
<center>
<table width="970" border="0" cellpadding="1" cellspacing="0" class="table2">
<tr>
<td class="lgrad"></td>
<td class="center">
EOF;
}
function userdata($ir, $dosessh=1) {
 global $db, $c, $userid, $set;
$db->query(sprintf("UPDATE `users` SET `laston`=unix_timestamp(), `lastip`='%s' WHERE `userid`='%u'", getip(), intval($userid)));
 if (trim($ir['email']) == '') {
  header('Location: NoEmail.php');
  session_unset();
  session_destroy();
 }


 $EnergyPerc = abs(@intval($ir['energy'] / $ir['maxenergy'] * '100'));
 $MoralePerc = abs(@intval($ir['will'] / $ir['maxwill'] * '100'));
 $BravePerc = abs(@intval($ir['brave'] / $ir['maxbrave'] * '100'));
 $HealthPerc = abs(@intval($ir['hp'] / $ir['maxhp'] * '100'));
 $ExpPerc = abs(@intval($ir['exp'] / $ir['exp_needed'] * '100'));
 $EnergyGone = '100' - $EnergyPerc;
 $MoraleGone = '100' - $MoralePerc;
 $BraveGone = '100' - $BravePerc;
 $HealthGone = '100' - $HealthPerc;
 $ExpGone = '100' - $ExpPerc;
 global $staffpage;
 $bgcolor = 'cccccc';
 echo '
 <a name="Top"><div id="container"></a>
  <div id="h-wrapper">
   <div id="h-left">
    <div class="leftmenutitle"></div>
    <div id="panel1">';
  echo sprintf("[b]Name:[/b] [url='viewuser.php?u=%d']%s[/url] [%s] %s 
", $ir['userid'], ($ir['donatordays']) ? '<span style="color: #0D961F;">'.stripslashes($ir['username']).'</span>' : stripslashes($ir['username']), number_format($ir['userid']), ($ir['donatordays']) ? '[img=donator.gif]' : '');
  echo sprintf("[b]Money:[/b] %s 
", number_format($ir['money']));
         echo sprintf("[b]Level:[/b] %s 
", number_format($ir['level']));
         echo sprintf("[b]Crystals:[/b] %s 
", number_format($ir['crystals']));

         echo '
 </div>
</div>	
   <div id="header"></div>
   <div id="h-right">
    <div class="leftmenutitle"></div>
    <div id="panel">';
         echo sprintf("[b]Energy:[/b] %s%% [url='crystaltemple.php?spend=refill'][R][/url]
", $EnergyPerc);
  echo sprintf("[img=Bars/BarGreen.gif][img=Bars/BarRed.gif]
", 
$EnergyPerc, $EnergyGone);
  echo sprintf("[b]Will:[/b] %s / %s
", $ir['will'], $ir['maxwill']);
  echo sprintf("[img=Bars/BarOrange.gif][img=Bars/BarRed.gif]
", 
$MoralePerc, $MoraleGone);
  echo sprintf("[b]Brave:[/b] %d/%d 
", number_format($ir['brave']), number_format($ir['maxbrave']));
  echo sprintf("[img=Bars/BarBrown.gif][img=Bars/BarRed.gif]
", $BravePerc, $BraveGone);
  if ($userid == '1') {
  echo sprintf("[b]EXP:[/b] %s%%
", $ExpPerc);
         echo sprintf("[img=Bars/BarBrown.gif][img=Bars/BarRed.gif]
", 
$ExpPerc, $ExpGone);
}
echo "

";
if($ir['fedjail'])
{
$q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid");
$r=$db->fetch_row($q);
die("[b]<font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s).

Reason: {$r['fed_reason']}</font>[/b]</body></html>");
}
if(file_exists('ipbans/'.$IP))
{
die("[b]<font color=red size=+1>Your IP has been banned from {$set['game_name']}, there is no way around this.</font>[/b]</body></html>");
}
}
function menuarea()
{
include "mainmenu.php";
global $ir,$c;
$bgcolor = 'cccccc';
print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"> </td><td width="80%"  bgcolor="#'.$bgcolor.'" valign="top">
<center>';
if($ir['hospital'])
{
 print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes.
";
}
if($ir['jail'])
{
 print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes.
";
}
print "[url='donator.php'][b]Donate to {$set['game_name']} now for game benefits![/b][/url]
";
}
function smenuarea()
{
include "smenu.php";
global $ir,$c;
$bgcolor = 'cccccc';
print '</td><td width="1" class="linegrad" bgcolor="#cccccc'.$bgcolor.'"> </td><td width="80%"  bgcolor="#cccccc'.$bgcolor.'" valign="top"><center>';
}
function endpage() {
 global $db;
  echo '


      > [url="index.php"]Home[/url]

     </div>
     <div class="rightcontent3"></div>
 </div>
   </div>
  </div>
 </div>
 <div id="wrapper3"></div>
</div>

</div></body>
</html>';
}
}
?>

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...