
ividen
Members-
Posts
6 -
Joined
-
Last visited
Never
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
ividen's Achievements
Newbie (1/14)
0
Reputation
-
hi, yh i cant do that sorry, i tried doing that myself, it does work fine in mozilla firefox but i cant seem to get it to work right in Internet Explorer.
-
hmm hmmm so has anyone added this to there site? if so please let me know if this works and is ok
-
it makes the header more custom so it can be updated with the colours etc from the staff panel so you dont have to keep going into the cpanel all the time to change the style of the game and you can update the welcome messages and the intro from the staff panel aswell
-
ok from reading the forum i have relised that someything similer has been done but hey i though mines different so i though i would post it here for you guys to mess around with or something. it is based on the default mccodes codes. This mod makes it easier to change th styles of the header like colour, table colours, stat names and messages in and aroundthe header it has been tested and works, i know its very very basic but it is one of my first done by me without help so +1s would be nice, thanks staff.php <?php include "sglobals.php"; //This contains general thingies switch($_GET['action']) { case 'basicset': basicsettings(); break; case 'announce': announcements(); break; default: index(); break; } function basicsettings() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { die("403"); } if($_POST['submit']) { unset($_POST['submit']); foreach($_POST as $k => $v) { $db->query("UPDATE `settings` SET conf_value='$v' WHERE conf_name='$k'"); } print "Settings updated! [url='staff.php?action=basicset']Back[/url]"; stafflog_add("Updated the basic game settings"); } else { print "<h3>-----------Basic Settings-----------</h3><hr /> <form action='staff.php?action=basicset' method='post'> <input type='hidden' name='submit' value='1' /> Todays Message: <input type='text' name='todaymessage' value='{$set['todaymessage']}' /> Todays Message Colour: <input type='text' name='todaymessagecolor' value='{$set['todaymessagecolor']}' /> Todays Message Size: <input type='text' name='todaymessagesize' value='{$set['todaymessagesize']}' /> <hr /> Game Name: <input type='text' name='game_name' value='{$set['game_name']}' /> Game Owner: <input type='text' name='game_owner' value='{$set['game_owner']}' /> Game Description: <textarea rows='7' cols='50' name='game_description'>{$set['game_description']}</textarea> logged in Intro Message: <textarea rows='7' cols='50' name='intro_description'>{$set['intro_description']}</textarea> Intro Colour: <input type='text' name='intro_color' value='{$set['intro_color']}' /> <hr /> <h2>-----------Side Menu-----------</h2> Energy Name: <input type='text' name='energyname' value='{$set['energyname']}' /> Will Name: <input type='text' name='willname' value='{$set['willname']}' /> Brave Name: <input type='text' name='bravename' value='{$set['bravename']}' /> EXP Name: <input type='text' name='expname' value='{$set['expname']}' /> Health Name: <input type='text' name='healthname' value='{$set['healthname']}' /> Hunger Name: <input type='text' name='hungername' value='{$set['hungername']}' /> <hr /> <h2>-----------Layout-----------</h2> Main Menu Colour: <input type='text' name='menucolor' value='{$set['menucolor']}' /> Main Backround Colour: <input type='text' name='bkcolor1' value='{$set['bkcolor1']}' /> Side Background Colour: <input type='text' name='bkcolor' value='{$set['bkcolor']}' /> Header Picture:<input type='text' name='headerpic' value='{$set['headerpic']}' /> Font Colour (Non-Link): <input type='text' name='nonlinkcolor' value='{$set['nonlinkcolor']}' /> Font Colour (Link): <input type='text' name='linkcolor' value='{$set['linkcolor']}' /> Text Box Colour: <input type='text' name='textboxcolor' value='{$set['textboxcolor']}' /> Clock Colour: <input type='text' name='clockcolor' value='{$set['clockcolor']}' /> Link Font Size: <input type='text' name='linksize' value='{$set['linksize']}' /> Table Border Colour: <input type='text' name='tableborder' value='{$set['tableborder']}' /> Table Background Colour: <input type='text' name='tablebackground' value='{$set['tablebackground']}' /> <hr /> Paypal Address: <input type='text' name='paypal' value='{$set['paypal']}' /> Gym/Crimes Validation: <select name='validate_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['validate_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Validation Period: <select name='validate_period' type='dropdown'>"; $opt=array( "5" => "Every 5 Minutes", "15" => "Every 15 Minutes", "60" => "Every Hour", "login" => "Every Login" ); foreach($opt as $k => $v) { if($k == $set['validate_period']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Registration CAPTCHA: <select name='regcap_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['regcap_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Send Crystals: <select name='sendcrys_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['sendcrys_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Bank Xfers: <select name='sendbank_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['sendbank_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Energy Refill Price (crystals): <input type='text' name='ct_refillprice' value='{$set['ct_refillprice']}' /> IQ per crystal: <input type='text' name='ct_iqpercrys' value='{$set['ct_iqpercrys']}' /> Money per crystal: <input type='text' name='ct_moneypercrys' value='{$set['ct_moneypercrys']}' /> Will Potion Item: ".item_dropdown($c, "willp_item", $set['willp_item'])." <input type='submit' value='Update Settings' /></form>"; } } function announcements() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { die("403"); } if($_POST['text']) { $db->query("INSERT INTO announcements VALUES('{$_POST['text']}', unix_timestamp())"); $db->query("UPDATE users SET new_announcements=new_announcements+1"); print "Announcement added! > [url='staff.php']Back[/url]"; stafflog_add("Added a new announcement"); } else { print "Adding an announcement... Please try to make sure the announcement is concise and covers everything you want it to.<form action='staff.php?action=announce' method='post'> Announcement text: <textarea name='text' rows='10' cols='60'></textarea> <input type='submit' value='Add Announcement' /></form>"; } } function index() { global $db,$ir,$c,$h,$userid,$set, $_CONFIG; $pv=phpversion(); $mv=$db->fetch_single($db->query("SELECT VERSION()")); $dv=$_CONFIG['driver']; if($ir['user_level']==2) { $versionno=20300; $version="2.0.3"; print "<h3>System Info</h3><hr /> <table width='75%' cellspacing='1' class='table'> <tr> <th>PHP Version:</th> <td>$pv</td> </tr> <tr> <th>MySQL Version:</th> <td>$mv</td> </tr> <tr> <th>MySQL Driver:</th> <td>$dv</td> </tr> <tr> <th>Codes Version</th> <td>$version (Build: $versionno)</td> </tr> </table><hr /> <h3>Last 10 Staff Actions</h3><hr /> <table width='100%' cellspacing='1' class='table'> <tr> <th>Staff</th> <th>Action</th> <th>Time</th> <th>IP</th> </tr>"; $q=$db->query("SELECT s.*, u.* FROM stafflog AS s LEFT JOIN users AS u ON s.user=u.userid ORDER BY s.time DESC LIMIT 10"); while($r=$db->fetch_row($q)) { print "<tr><td>{$r['username']} [{$r['user']}]</td> <td>{$r['action']}</td> <td>".date('F j Y g:i:s a', $r['time'])."</td> <td>{$r['ip']}</td></tr>"; } print "</table><hr />"; } print "<h3>Staff Notepad</h3><hr />"; if($_POST['pad']) { $db->query("UPDATE settings SET conf_value='{$_POST['pad']}' WHERE conf_name='staff_pad'"); $set['staff_pad']=stripslashes($_POST['pad']); print "[b]Staff Notepad Updated![/b]<hr />"; } print "<form action='staff.php' method='post'> <textarea rows='10' cols='60' name='pad'>".htmlspecialchars($set['staff_pad'])."</textarea> <input type='submit' value='Update Notepad' /></form>"; } $h->endpage(); ?> header.php <?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> <link rel="icon" href="favicon.ico" type="x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="x-icon" /> <style type="text/css"> <!-- body { background-color: {$set['bkcolor']}; margin-top: 0px; margin-bottom: 0px; font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:{$set['linksize']}px;color: {$set['nonlinkcolor']}; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:hover,a:link { color: {$set['linkcolor']};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: {$set['textboxcolor']}; } .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:{$set['bkcolor1']}; vertical-align:top; text-align:center; } .table { background-color:{$set['tableborder']}; } .table3 { background-color:#000000; } .table td { background-color:{$set['tablebackground']}; height:22px; } .table3 td { background-color:#ffffff; } td .alt { background-color:#cccccc; 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="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"> EOF; } function userdata($ir,$lv,$fm,$cm,$dosessh=1) { global $db,$c,$userid, $set; $IP = $_SERVER['REMOTE_ADDR']; $db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid"); if(!$ir['email']) { global $set, $domain; die ("<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID."); } if($dosessh && ($_SESSION['attacking'] || $ir['attacking'])) { print "You lost all your EXP for running from the fight."; $db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid"); $_SESSION['attacking']=0; } $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $wiperc=(int) ($ir['will']/$ir['maxwill']*100); $experc=(int) ($ir['exp']/$ir['exp_needed']*100); $brperc=(int) ($ir['brave']/$ir['maxbrave']*100); $hpperc=(int) ($ir['hp']/$ir['maxhp']*100); $hnperc=(int) ($ir['hunger']/$ir['maxhunger']*100); $enopp=100-$enperc; $wiopp=100-$wiperc; $exopp=100-$experc; $bropp=100-$brperc; $hpopp=100-$hpperc; $hnopp=100-$hnperc; $d=""; $u=$ir['username']; if($ir['donatordays']) { $u = "<font color={$ir['usernamecolor']}>{$ir['username']}</font>";$d="[img=donator.gif]"; } $gn=""; global $set, $staffpage; $bgcolor = '#ffffff'; print <<<OUT [img={$set['headerpic']}] <font color='{$set['todaymessagecolor']}' size='{$set['todaymessagesize']}'> <marquee>News: {$set['todaymessage']}</marquee> </font> <table width="100%" border="1" cellpadding="0" cellspacing="0"> <tr> <td width="20%" bgcolor="{$set['menucolor']}" valign="top"> [b]Name:[/b] $gn{$u} [{$ir['userid']}] $d [b]Level:[/b] {$ir['level']} [b]Money:[/b] {$fm} [b]Bank:[/b] \${$ir['bankmoney']} [b]Cyber Bank:[/b] \${$ir['cybermoney']} [b]Crystals:[/b] {$ir['crystals']} [[url='logout.php']Emergency Logout[/url]] <hr /> [b]{$set['energyname']}:[/b] {$enperc}% <img src=greenbar.gif width=$enperc height=10><img src=redbar.gif width=$enopp height=10> [b]{$set['willname']}:[/b] {$wiperc}% <img src=bluebar.gif width=$wiperc height=10><img src=redbar.gif width=$wiopp height=10> [b]{$set['bravename']}:[/b] {$ir['brave']}/{$ir['maxbrave']} <img src=yellowbar.gif width=$brperc height=10><img src=redbar.gif width=$bropp height=10> [b]{$set['expname']}:[/b] {$experc}% <img src=bluebar.gif width=$experc height=10><img src=redbar.gif width=$exopp height=10> [b]{$set['healthname']}:[/b] {$hpperc}% <img src=greenbar.gif width=$hpperc height=10><img src=redbar.gif width=$hpopp height=10> OUT; 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 = ''; 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![/url] -|- [url='voting.php']Vote for {$set['game_name']} Now[/b][/url] "; } function smenuarea() { include "smenu.php"; global $ir,$c; $bgcolor = 'FFFFFF'; print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"></td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"><center>'; } function endpage() { global $db; print <<<OUT </center> </td> </tr> </table></td> <td class="rgrad"></td> </tr> <tr> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"></td> <td class="dgrad"></td> <td class="dgradr"></td> </tr> </table> </td> </tr> </table> {$db->num_queries} queries on this page. [url='http://www.darlek-wars.com/home.html']Game Copyright 2010, Peterisgb[/url]</body> </html> OUT; } } ?> [mysql]-- -------------------------------------------------------- -- -- Table structure for table `settings` -- CREATE TABLE IF NOT EXISTS `settings` ( `conf_id` int(11) NOT NULL auto_increment, `conf_name` varchar(255) NOT NULL default '', `conf_value` text NOT NULL, PRIMARY KEY (`conf_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=40 ; -- -------------------------------------------------------- -- -- Dumping data for table `settings` -- INSERT INTO `settings` (`conf_id`, `conf_name`, `conf_value`) VALUES (17, 'energyname', 'Energy'), (18, 'willname', 'Will'), (19, 'expname', 'EXP'), (20, 'healthname', 'Health'), (21, 'bravename', 'Brave'), (22, 'menucolor', '#000000'), (23, 'bkcolor', '#000000'), (24, 'nonlinkcolor', 'blue'), (25, 'linkcolor', 'red'), (26, 'textboxcolor', 'black'), (27, 'bkcolor1', '#000000'), (28, 'headerpic', 'title.jpg'), (29, 'clockcolor', 'blue'), (30, 'linksize', '12'), (31, 'textfont', 'arial'), (32, 'tableborder', '#000000'), (33, 'tablebackground', '#dedede'), (34, 'intro_description', 'message here'), (35, 'intro_color', 'green'), (36, 'todaymessage', 'welcomeon'), (37, 'todaymessagecolor', 'green'), (38, 'todaymessagesize', '4'); [/mysql]
-
nice nice mod but whats with all the print ""; in it, surely you dont need all of them????
-
yh yh go for it, this is a good idea, great :)