DELETE-ME-NOW- Posted August 18, 2010 Share Posted August 18, 2010 Ok. SO i got a new mainmenu here, but the thing is. Im having problems accualy making it more compatible with MCCodes. For examle, adding the jailcount bit at the top and all that... eg, global $db,$c,$ir, $set; $hc=$set['hospital_count']; $jc=$set['jail_count']; $ec=$ir['new_events']; $mc=$ir['new_mail']; if($ir['hospital']) When i add that to the code, im getting unexpected <... my main menu code is here: <style type="text/css"> body {font-family:Arial, Helvetica, sans-serif, Tahoma; font-size:12px;} #vertmenu { font-family: Arial, Helvetica, sans-serif, Tahoma; font-size: 100%; width: 200px; padding: 0px; margin: 0px; } #vertmenu h1 { display: block; background-color:#FF9900; font-size: 100%; padding: 3px 0 5px 3px; border: 1px solid #000000; color: #333333; margin: 0px; width:205px; } #vertmenu ul { list-style: none; margin: 0px; padding: 0px; border: none; } #vertmenu ul li { margin: 0px; padding: 0px; } #vertmenu ul li a { font-size: 100%; display: block; border-bottom: 1px dashed #C39C4E; padding: 5px 0px 2px 4px; text-decoration: none; color: #666666; width:205px; } #vertmenu ul li a:hover, #vertmenu ul li a:focus { color: #000000; background-color: #eeeeee; } </style> </head> <body> <div id="vertmenu"> <h1>Player Menu</h1> <ul> [*][url="index.php"]Home[/url] [*][url="explore.php"]Explore[/url] [*][url="citybank.php"]Bank[/url] [*][url="crimes.php"]Crimes[/url] [*][url="gym.php"]Gym[/url] [*][url="yourgang.php"]Your Gang[/url] [*][url="inventory.php"]Inventory[/url] [*][url="events.php"]Events[/url] [*][url="jail.php"]Jail[/url] [*][url="hospital.php"]Hospital[/url] [*][url="search.php"]Search[/url] [/list] </div> <div id="vertmenu"> <h1>Communication</h1> <ul> [*][url="mailbox.php"]Mailbox[/url] [*][url="forum.php"]Forum[/url] [*][url="X.php"]Chat Room[/url] [/list] </div> <div id="vertmenu"> <h1>Account Settings</h1> <ul> [*][url="preferences.php"]Preferences[/url] [*][url="notepad.php"]Notes[/url] [/list] </div> If someone could assist me sort it, then it would be great. Also, other people can use the finished code on there game too if they want too :) Quote Link to comment Share on other sites More sharing options...
Paul Evans Posted August 18, 2010 Share Posted August 18, 2010 just curious is that the entire file? <?php include_once('globals.php'); global $db,$c,$ir, $set; $hc = $set['hospital_count']; $jc = $set['jail_count']; $ec = $ir['new_events']; $mc = $ir['new_mail']; echo <<<MainMenu <style type="text/css"> body {font-family:Arial, Helvetica, sans-serif, Tahoma; font-size:12px;} #vertmenu { font-family: Arial, Helvetica, sans-serif, Tahoma; font-size: 100%; width: 200px; padding: 0px; margin: 0px; } #vertmenu h1 { display: block; background-color:#FF9900; font-size: 100%; padding: 3px 0 5px 3px; border: 1px solid #000000; color: #333333; margin: 0px; width:205px; } #vertmenu ul { list-style: none; margin: 0px; padding: 0px; border: none; } #vertmenu ul li { margin: 0px; padding: 0px; } #vertmenu ul li a { font-size: 100%; display: block; border-bottom: 1px dashed #C39C4E; padding: 5px 0px 2px 4px; text-decoration: none; color: #666666; width:205px; } #vertmenu ul li a:hover, #vertmenu ul li a:focus { color: #000000; background-color: #eeeeee; } </style> </head> <body> <div id="vertmenu"> <h1>Player Menu</h1> <ul> [*][url="index.php"]Home[/url] [*][url="explore.php"]Explore[/url] [*][url="citybank.php"]Bank[/url] [*][url="crimes.php"]Crimes[/url] [*][url="gym.php"]Gym[/url] [*][url="yourgang.php"]Your Gang[/url] [*][url="inventory.php"]Inventory[/url] [*][url="events.php"]Events[/url] [*][url="jail.php"]Jail[/url] [*][url="hospital.php"]Hospital[/url] [*][url="search.php"]Search[/url] [/list] </div> <div id="vertmenu"> <h1>Communication</h1> <ul> [*][url="mailbox.php"]Mailbox[/url] [*][url="forum.php"]Forum[/url] [*][url="X.php"]Chat Room[/url] [/list] </div> <div id="vertmenu"> <h1>Account Settings</h1> <ul> [*][url="preferences.php"]Preferences[/url] [*][url="notepad.php"]Notes[/url] [/list] </div> MainMenu; ?> Maybe best to review the existing mainmenu file for ideas and maybe not use the heredoc but actual echos Quote Link to comment Share on other sites More sharing options...
DELETE-ME-NOW- Posted August 18, 2010 Author Share Posted August 18, 2010 yea thats the whole file. Btw, that one you just posted. Its working! Cheers! Quote Link to comment Share on other sites More sharing options...
Paul Evans Posted August 18, 2010 Share Posted August 18, 2010 Note though Ternary doesn't work in heredoc. Quote Link to comment Share on other sites More sharing options...
Djkanna Posted August 18, 2010 Share Posted August 18, 2010 <?php include_once('globals.php'); global $db,$c,$ir, $set; $hc = $set['hospital_count']; $jc = $set['jail_count']; $ec = $ir['new_events']; $mc = $ir['new_mail']; ?> <style> body {font-family:Arial, Helvetica, sans-serif, Tahoma; font-size:12px;} #vertmenu { font-family: Arial, Helvetica, sans-serif, Tahoma; font-size: 100%; width: 200px; padding: 0px; margin: 0px; } #vertmenu h1 { display: block; background-color:#FF9900; font-size: 100%; padding: 3px 0 5px 3px; border: 1px solid #000000; color: #333333; margin: 0px; width:205px; } #vertmenu ul { list-style: none; margin: 0px; padding: 0px; border: none; } #vertmenu ul li { margin: 0px; padding: 0px; } #vertmenu ul li a { font-size: 100%; display: block; border-bottom: 1px dashed #C39C4E; padding: 5px 0px 2px 4px; text-decoration: none; color: #666666; width:205px; } #vertmenu ul li a:hover, #vertmenu ul li a:focus { color: #000000; background-color: #eeeeee; } </style> </head> <body> <div id="vertmenu"> <h1>Player Menu</h1> <ul> [*][url="index.php"]Home[/url] [*][url="explore.php"]Explore[/url] [*][url="citybank.php"]Bank[/url] [*][url="crimes.php"]Crimes[/url] [*][url="gym.php"]Gym[/url] [*][url="yourgang.php"]Your Gang[/url] [*][url="inventory.php"]Inventory[/url] [*][url="events.php"]Events[/url] [*][url="jail.php"]Jail[/url] [*][url="hospital.php"]Hospital[/url] [*][url="search.php"]Search[/url] [/list] </div> <div id="vertmenu"> <h1>Communication</h1> <ul> [*][url="mailbox.php"]Mailbox[/url] [*][url="forum.php"]Forum[/url] [*][url="X.php"]Chat Room[/url] [/list] </div> <div id="vertmenu"> <h1>Account Settings</h1> <ul> [*][url="preferences.php"]Preferences[/url] [*][url="notepad.php"]Notes[/url] [/list] </div> Just open PHP tags for the php you need. Then to use those variables set [url="blah.php"]<?php echo number_format($mailCount); ?>[/url] Quote Link to comment Share on other sites More sharing options...
Paul Evans Posted August 18, 2010 Share Posted August 18, 2010 possible solution but i dislike to open / close the php tags? Quote Link to comment Share on other sites More sharing options...
Djkanna Posted August 18, 2010 Share Posted August 18, 2010 Well anything outside of the php tags is considered to be HTML or text, that's why you may also leave the closing php tag off the end of your script. So you may aswell take advantage of that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.