Jump to content
MakeWebGames

Uridium

Members
  • Posts

    2,686
  • Joined

  • Last visited

  • Days Won

    81

Everything posted by Uridium

  1. Re: [MCCODES V2] Fully Customise your game layout goto your game site and run the layoutinstall.php file first.. Then upload gamelayout.php You will need to edit header.php so heres one ive edited as a standard one to get you going.. 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> <style type="text/css"> <!-- body { background-color: #DEDEDE; margin-top: {$set['game_position']}px; margin-bottom: 0px; font-family:{$set['text_font1']};font-size:{$set['text_fontsize1']}px;color: {$set['text_font1colour']}; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:hover,a:link { color: {$set['text_fontcolour']};text-decoration: none; } table,tr,td { font-family:{$set['text_font']};font-size: {$set['text_fontsize']}px; } img { border:none; } textarea { font-family:{$set['text_font1']};font-size:{$set['text_fontsize1']}px;color: {$set['text_font1colour']}; } .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:#000000; 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=".{$set['centerpane_width']}." 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['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $db->query("UPDATE `users` SET `laston` = unix_timestamp(), `lastip` = '$IP' WHERE `userid` = $userid"); if(!$ir['email']) { global $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); $enopp=100-$enperc; $wiopp=100-$wiperc; $exopp=100-$experc; $bropp=100-$brperc; $hpopp=100-$hpperc; $d=""; $u=$ir['username']; if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="[img=donator.gif]"; } $gn=""; global $staffpage; print <<<OUT [img={$set['header_image']}] <table valign="right" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="{$set['menu_width']}%" bgcolor="#{$set['menu_colour']}" valign="top"> [b]Name:[/b] $gn{$u} [{$ir['userid']}] $d [b]Money:[/b] {$fm} [b]Level:[/b] {$ir['level']} [b]{$set['game_currency']}:[/b] {$ir['crystals']} [[url='logout.php']Emergency Logout[/url]] <hr /> [b]{$set['game_energy']}:[/b] {$enperc}% <img src=greenbar.png width=$enperc height=10><img src=redbar.png width=$enopp height=10> [b]{$set['game_will']}:[/b] {$wiperc}% <img src=bluebar.png width=$wiperc height=10><img src=redbar.png width=$wiopp height=10> [b]{$set['game_brave']}:[/b] {$ir['brave']}/{$ir['maxbrave']} <img src=yellowbar.png width=$brperc height=10><img src=redbar.png width=$bropp height=10> [b]{$set['game_exp']}:[/b] {$experc}% <img src=navybar.png width=$experc height=10><img src=redbar.png width=$exopp height=10> [b]{$set['game_health']}:[/b] {$hpperc}% <img src=greenbar.png width=$hpperc height=10><img src=redbar.png width=$hpopp height=10> <hr /> 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; print '</td><td width="2" class="linegrad" bgcolor="#'.$set['centerpane_colour'].'"> </td><td width="80%" bgcolor="#'.$set['centerpane_colour'].'" 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; print '</td><td width="2" class="linegrad" bgcolor="#'.$set['centerpane_colour'].'"> </td><td width="80%" bgcolor="#'.$set['centerpane_colour'].'" 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</body> </html> OUT; } } ?>
  2. Re: [MCCODES V2] Fully Customise your game layout Ok been tested by myself and Paddy Thanks for the help matey.. Call this file layoutinstall.php   <?php /* Settings Installer Re-modded from installer.php / Illusions 2009 */ session_start(); ob_start(); function valid_email($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Game Layout Configuration</title> <script language="JavaScript"> <!-- function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function DeleteCookie (name,path,domain) { if (GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // --> </script> <script language="JavaScript"> var usr; var pw; var sv; function getme() { usr = document.login.username; pw = document.login.password; sv = document.login.save; if (GetCookie('player') != null) { usr.value = GetCookie('username') pw.value = GetCookie('password') if (GetCookie('save') == 'true') { sv[0].checked = true; } } } function saveme() { if (usr.value.length != 0 && pw.value.length != 0) { if (sv[0].checked) { expdate = new Date(); expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000)); SetCookie('username', usr.value, expdate); SetCookie('password', pw.value, expdate); SetCookie('save', 'true', expdate); } if (sv[1].checked) { DeleteCookie('username'); DeleteCookie('password'); DeleteCookie('save'); } } else { alert('You must enter a username/password.'); return false; } } </script> <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:#FFFFFF; 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 onload="getme();"> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center">[img=title.jpg] <h2>Illusions Game Layout Installer</h2> <?php switch($_GET['code']) { case "install": install(); break; case "config": config(); break; default: diagnostics(); break; } function menuprint($highlight) { $items=array( 'diag' => '1. Diagnostics', 'input' => '2. Configuration', 'sql' => '3. Installation & Extras', ); $c=0; print "<hr />"; foreach($items as $k => $v) { $c++; if($c > 1) { print " >> "; } if($k==$highlight) { print "<font color='black'>{$v}</font>"; } else { print "<font color='gray'>{$v}</font>"; } } print "<hr />"; } function diagnostics() { menuprint("diag"); if (version_compare(phpversion(), '4.2.0') < 0) { $pv="<font color='red'>Failed</font>"; $pvf=0; } else { $pv="<font color='green'>PASSED</font>"; $pvf=1; } if(is_writable('./')) { $wv="<font color='green'>PASSED</font>"; $wvf=1; } else { $wv="<font color='red'>Failed</font>"; $wvf=0; } if(function_exists('mysql_connect') || function_exists('mysqli_connect')) { $dv="<font color='green'>PASSED</font>"; $dvf=1; } else { $dv="<font color='red'>Failed</font>"; $dvf=0; } if(str_replace('layoutinstall.php','',$_SERVER['SCRIPT_NAME']) == "/") { $av="<font color='green'>PASSED</font>"; $avf=1; } else { $av="<font color='red'>Failed</font>"; $avf=0; } print "<h3>Basic Diagnostic Results:</h3> <table width='80%' class='table' cellspacing='1'> <tr> <td>PHP version >= 4.2.0</td> <td>{$pv}</td> </tr> <tr> <td>Game folder writable</td> <td>{$wv}</td> </tr> <tr> <td>MySQL support in PHP present</td> <td>{$dv}</td> </tr> </table>"; if($pvf+$wvf+$dvf < 3) { print "<hr /><font color='red'>One of the basic diagnostics failed, so Setup cannot continue. Please fix the ones that failed and try again.</font><hr />"; } else { print "<hr />> [url='layoutinstall.php?code=config']Next Step[/url]<hr />"; } } function config() { menuprint("input"); print "<h3>Configuration:</h3> <center> <form action='layoutinstall.php?code=install' method='post'> <table width='75%' class='table' cellspacing='1'> <tr> <th colspan='2'>DO NOT FORGET THIS STEP!</th> </tr> <tr> <td align='center'>MySQL Driver</td> <td><select name='driver' type='dropdown'>"; if(function_exists('mysql_connect')) { print "<option value='mysql'>MySQL Standard</option>"; } if(function_exists('mysqli_connect')) { print "<option value='mysql'>MySQLi Enhanced</option>"; } print "</select></td> </tr> <tr> <td align='center'>Hostname [size="1"]This is usually localhost[/size]</td> <td><input type='text' name='hostname' value='localhost' /></td> </tr> <tr> <td align='center'>Username [size="1"]The user must be able to use the database[/size]</td> <td><input type='text' name='username' value='root' /></td> </tr> <tr> <td align='center'>Password</td> <td><input type='text' name='password' value='' /></td> </tr> <tr> <td align='center'>Database Name [size="1"]The database should not have any other software using it.[/size]</td> <td><input type='text' name='database' value='mcc' /></td> </tr> <tr> <th colspan='2'><h2>Game Layout Configuration </h2></th> </tr> <tr> <td align='center'>Header Image [size="1"]Insert your own Header Image as jpg, gif, png[/size]</td> <td><input type='text' name='header_image' value='title.jpg' /></td> </tr> <tr> <td align='center'>Center Panel Width [size="1"]Alter center width default is 970[/size]</td> <td><input type='text' name='centerpane_width' value='970' /></td> </tr> <tr> <td align='center'>Center panel Colour [size="1"]Change Center Panel colour by HEX Codes dont add #[/size]</td> <td><input type='text' name='centerpane_colour' value='' /> [url='colours.html']Colour Chart Viewer[/url]</td> </tr> <tr> <td align='center'>Center Panel Image [size="1"]If you dont want to use COLOUR you can use an image Make sure you leave the COLOUR HEX blank or Vice Versa[/size]</td> <td><input type='text' name='centerpane_image' value='' /></td> </tr> <tr> <td align='center'>Menu Colour [size="1"]Change Menu Colour HEX codes only[/size]</td> <td><input type='text' name='menu_colour' value='' /> [url='colours.html']Colour Chart Viewer[/url]</td> </tr> <tr> <td align='center'>Menu Image [size="1"]Change if you have an image if not leave blank and use the above MENU COLOUR option[/size]</td> <td><input type='text' name='menu_colour' value='' /></td> </tr> <tr> <td align='center'>Menu Position [size="1"]Enter the text left or right to move menu[/size]</td> <td><input type='text' name='menu_position' value='left' /></td> </tr> <tr> <td align='center'>Menu Width [size="1"]Change Menu Width default is 20%[/size]</td> <td><input type='text' name='menu_width' value='20' /></td> </tr> <tr> <td align='center'>Text Font ( Static ) [size="1"]Change to verdana, arial, gothic or upload you own TFF and use that[/size]</td> <td><input type='text' name='text_font' value='arial' /></td> </tr> <tr> <td align='center'>Text Font ( Static ) Colour [size="1"]Change Text Colour by HEX[/size]</td> <td><input type='text' name='text_fontcolour' value='' /> [url='colours.html']Colour Chart Viewer[/url]</td> </tr> <tr> <td align='center'>Text Font ( Hover ) [size="1"]Change to verdana, arial, gothic or upload you own TFF and use that[/size]</td> <td><input type='text' name='text_font1' value='arial' /></td> </tr> <tr> <td align='center'>Text Font ( HOVER ) Colour [size="1"]Change Text Colour by HEX[/size]</td> <td><input type='text' name='text_font1colour' value='' /> [url='colours.html']Colour Chart Viewer[/url]</td> </tr> <tr> <td align='center'>Text Font ( Static ) Size [size="1"]Change Text size font[/size]</td> <td><input type='text' name='text_fontsize' value='12' /></td> </tr> <tr> <td align='center'>Text Font ( HOVER ) Size [size="1"]Change Text size font[/size]</td> <td><input type='text' name='text_fontsize1' value='14' /></td> </tr> <tr> <td align='center'>Drop Page height [size="1"]If the Header is too high you can Drop it Default is 0 and 10 drops by 10 pixels[/size]</td> <td><input type='text' name='droptop_position' value='0' /></td> </tr> <tr> <td align='center'>Welcome Game Message [size="1"]This will allow you to place a Scrolling message under the header banner[/size]</td> <td><input type='text' name='game_message' value='Welcome to our game' /></td> </tr> <tr> <td colspan='2' align='center'><input type='submit' value='Install' /></td> </tr> </table></form></center>"; } function install() { menuprint("sql"); { print "Config Bypass Started "; print "Config Bypass Successful Attempting DB connection "; define('MONO_ON', 1); require "class/class_db_{$_POST['driver']}.php"; $db=new database; $db->configure($_POST['hostname'], $_POST['username'], $_POST['password'], $_POST['database'], 0); $db->connect(); $c=$db->connection_id; print "Connection Successful. Writing Main MySQL data. "; { if(!(strpos($line,"--") === 0) && trim($line) != "") //check for commented lines or blankies { $query.=$line; if(!(strpos($line,";") === FALSE)) { $db->query($query); $query=""; } } } print "Settings data was written. Now write Extra MySQL data. "; $username=$_POST['a_username']; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $db->query("INSERT INTO settings VALUES(NULL, 'header_image', '{$_POST['header_image']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'centerpane_width', '{$_POST['centerpane_width']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'centerpane_colour', '{$_POST['centerpane_colour']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'centerpane_image', '{$_POST['centerpane_image']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'menu_colour', '{$_POST['menu_colour']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'menu_image', '{$_POST['menu_image']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'menu_position', '{$_POST['menu_position']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'menu_width', '{$_POST['menu_width']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'text_font', '{$_POST['text_font']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'text_fontcolour', '{$_POST['text_fontcolour']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'text_font1', '{$_POST['text_font1']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'text_font1colour', '{$_POST['text_font1colour']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'text_fontsize', '{$_POST['text_fontsize']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'text_fontsize1', '{$_POST['text_fontsize1']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'droptop_position', '{$_POST['droptop_position']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'game_message', '{$_POST['game_message']}')"); $path=$_SERVER['HTTP_HOST']; print " <h2>[b]Settings Installation Successful![/b]</h2><hr /> >center><h1>!ATTENTION<h1></center> Once this Installer has been used you will be able to Edit Your Options via BASIC SETTINGS Panel in the Game"; } } ?> </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> </body> </html>   Call this file gamelayout.php   <?php include "sglobals.php"; //This contains data for game layout option switch($_GET['action']) { case 'layout': gamelayout(); break; default: index(); break; } function gamelayout() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { die("<h1>Access Denied</h1>"); } if($_POST['submit']) { unset($_POST['submit']); foreach($_POST as $k => $v) { $db->query("UPDATE `settings` SET conf_value='$v' WHERE conf_name='$k'"); } print "Layout updated! [url='gamelayout.php?action=layout']Back[/url]"; stafflog_add("Updated the Game Layout Settings"); } else { print "<h3>Game Layout Settings</h3><hr /> <form action='gamelayout.php?action=layout' method='post'> <input type='hidden' name='submit' value='1' /> Header Image: <input type='text' name='header_image' value='{$set['header_image']}' /> Center Panel Width: <input type='text' name='centerpane_width' value='{$set['centerpane_width']}' /> Center Panel Colour: <input type='text' name='centerpane_colour' value='{$set['centerpane_colour']}' />[url='colours.html'] Colour Chart Viewer[/url] Center Panel Image: <input type='text' name='centerpane_image' value='{$set['centerpane_image']}' /> <h2><center>MENU OPTIONS</center></h2> Menu Colour: <input type='text' name='menu_colour' value='{$set['menu_colour']}' />[url='colours.html'] Colour Chart Viewer[/url] Menu Image: <input type='text' name='menu_image' value='{$set['menu_image']}' /> Menu Position: <input type='text' name='menu_position' value='{$set['menu_position']}' /> Menu Width: <input type='text' name='menu_width' value='{$set['menu_width']}' /> <h2><center>TEXT OPTIONS</center></h2> Font Type ( STATIC ): <input type='text' name='text_font' value='{$set['text_font']}' /> Font Colour ( STATIC ): <input type='text' name='text_fontcolour' value='{$set['text_fontcolour']}' />[url='colours.html'] Colour Chart Viewer[/url] Font Type ( HOVER ): <input type='text' name='text_font1' value='{$set['text_font1']}' /> Font Colour ( HOVER ): <input type='text' name='text_font1colour' value='{$set['text_font1colour']}' />[url='colours.html'] Colour Chart Viewer[/url] Font Size ( STATIC ): <input type='text' name='text_fontsize' value='{$set['text_fontsize']}' /> Font Size ( HOVER ): <input type='text' name='text_fontsize1' value='{$set['text_fontsize1']}' /> <h2><center>EXTRA OPTIONS</center></h2> Drop Header Position: <input type='text' name='droptop_position' value='{$set['droptop_position']}' /> Scroller Message: <input type='text' name='game_message' value='{$set['game_message']}' /> <input type='submit' value='Update Settings' /></form>"; } } $h->endpage(); ?>   and add this to smenu.php   > [url='gamelayout.php?action=layout']Game Layout Settings[/url] ";
  3. Re: [MCCODES V2] Fully Customise your game layout Ok as promised all post a screenie first of the installer so you can see what new options are available to you and will post the finished product in about an hour when ive double checked everything..
  4. Re: [MCCODES V2] Fully Customise your game layout Will post working copy in a few :) also im now a GRANDAD :) daughter had a baby tonight ;)
  5. Re: [MCCODES V2] Fully Customise your game layout Script is Finished will Post Working Copy Later but for now its Bed time for meeeeeeeee :) Added some extra functions which wasnt in the top post
  6. Re: [MCCODES V2] Fully Customise your game layout   No need to Purchase my scripts they are all free
  7. Re: [MCCODES V2] Fully Customise your game layout This has got to be my worst nightmare come to life the fact that Gangsta wants to help must mean my scripts are complete crap ;)
  8. Re: [MCCODES V2] Fully Customise your game layout This isnt changed by the user but by the owner of the game users dont get to change anything
  9. This Mod when completedm will allow you to 1 = Set MAINMENU left or right of screen 2 = Alter any Colour of a layout from background, foreground, textbox color or add graphics 3 = Use your own TTF style Fonts 4 = Fully Functional Admin Panel to alter anything 5 = Easy Install with the installer. 6 = Resize overall Game layouts 7 = Only two files that needs Altering to make this work... header.php and staff.php I'm still working on this script but its about 75% completed...
  10. Re: Serious Help [Mccodes V2] What errors are being displayed.. 1 = is if from the installer 2 = is it after the installer   give us much info as poss :)
  11. Re: [Mccodes Lite] Jobs Yep thats better :) probably just a SMF bug just needed extra carriage returns
  12. Re: [Mccodes Lite] Jobs Nice one :)
  13. Re: [Mccodes Lite] Jobs Nice one :) Can you Repost the CRON matey it isnt showing up in your last post.. might need some extra return crriages after (/script)
  14. Re: [mccode v2] Donator and Non-Donator Lottery Just got round to using your script KIX very nicely done and has a lot of potential for addons Excellent :) +1 from me matey
  15. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... Someone mentionied that it would take ages to Alter each file to how it was supposed to be for this scripts to work. Thats true cant deny that but on the up side of this You can add the script first then alter your Individual Files as you go along as long as your $set is pointing a chosen name or even if you still have it as print" crystals " it will make no difference the script can recognise each. Then when all Edits are done you can change the name of anything as many times as you like from the admin panel.
  16. Re: [Mccodes V2] Set Up V2 the way you want it without altering files....   Cheers Matey :)
  17. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... This is a Self Installer and will allow you to add your items text if you already have a SQL in operation it will ONLY add to the SQL what you need and wont interfere with any other part of your game...... call this file installer2000.php   <?php /* Settings Installer Re-modded from installer.php / Illusions 2009 */ session_start(); ob_start(); function valid_email($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Mccodes Version 2</title> <script language="JavaScript"> <!-- function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function DeleteCookie (name,path,domain) { if (GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // --> </script> <script language="JavaScript"> var usr; var pw; var sv; function getme() { usr = document.login.username; pw = document.login.password; sv = document.login.save; if (GetCookie('player') != null) { usr.value = GetCookie('username') pw.value = GetCookie('password') if (GetCookie('save') == 'true') { sv[0].checked = true; } } } function saveme() { if (usr.value.length != 0 && pw.value.length != 0) { if (sv[0].checked) { expdate = new Date(); expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000)); SetCookie('username', usr.value, expdate); SetCookie('password', pw.value, expdate); SetCookie('save', 'true', expdate); } if (sv[1].checked) { DeleteCookie('username'); DeleteCookie('password'); DeleteCookie('save'); } } else { alert('You must enter a username/password.'); return false; } } </script> <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:#FFFFFF; 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 onload="getme();"> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center">[img=title.jpg] <h2>Installer</h2> <?php switch($_GET['code']) { case "install": install(); break; case "config": config(); break; default: diagnostics(); break; } function menuprint($highlight) { $items=array( 'diag' => '1. Diagnostics', 'input' => '2. Configuration', 'sql' => '3. Installation & Extras', ); $c=0; print "<hr />"; foreach($items as $k => $v) { $c++; if($c > 1) { print " >> "; } if($k==$highlight) { print "<font color='black'>{$v}</font>"; } else { print "<font color='gray'>{$v}</font>"; } } print "<hr />"; } function diagnostics() { menuprint("diag"); if (version_compare(phpversion(), '4.2.0') < 0) { $pv="<font color='red'>Failed</font>"; $pvf=0; } else { $pv="<font color='green'>OK</font>"; $pvf=1; } if(is_writable('./')) { $wv="<font color='green'>OK</font>"; $wvf=1; } else { $wv="<font color='red'>Failed</font>"; $wvf=0; } if(function_exists('mysql_connect') || function_exists('mysqli_connect')) { $dv="<font color='green'>OK</font>"; $dvf=1; } else { $dv="<font color='red'>Failed</font>"; $dvf=0; } if(str_replace('installer2000.php','',$_SERVER['SCRIPT_NAME']) == "/") { $av="<font color='green'>OK</font>"; $avf=1; } else { $av="<font color='red'>Failed</font>"; $avf=0; } print "<h3>Basic Diagnostic Results:</h3> <table width='80%' class='table' cellspacing='1'> <tr> <td>PHP version >= 4.2.0</td> <td>{$pv}</td> </tr> <tr> <td>Game folder writable</td> <td>{$wv}</td> </tr> <tr> <td>MySQL support in PHP present</td> <td>{$dv}</td> </tr> <tr> <td>Game installed at root level of domain or subdomain</td> <td>{$av}</td> </tr> </table>"; if($pvf+$wvf+$dvf+$avf < 4) { print "<hr /><font color='red'>One of the basic diagnostics failed, so Setup cannot continue. Please fix the ones that failed and try again.</font><hr />"; } else { print "<hr />> [url='installer2000.php?code=config']Next Step[/url]<hr />"; } } function config() { menuprint("input"); print "<h3>Configuration:</h3> <center> <form action='installer2000.php?code=install' method='post'> <table width='75%' class='table' cellspacing='1'> <tr> <th colspan='2'>Database Config</th> </tr> <tr> <td align='center'>MySQL Driver</td> <td><select name='driver' type='dropdown'>"; if(function_exists('mysql_connect')) { print "<option value='mysql'>MySQL Standard</option>"; } if(function_exists('mysqli_connect')) { print "<option value='mysql'>MySQLi Enhanced</option>"; } print "</select></td> </tr> <tr> <td align='center'>Hostname [size="1"]This is usually localhost[/size]</td> <td><input type='text' name='hostname' value='localhost' /></td> </tr> <tr> <td align='center'>Username [size="1"]The user must be able to use the database[/size]</td> <td><input type='text' name='username' value='root' /></td> </tr> <tr> <td align='center'>Password</td> <td><input type='text' name='password' value='' /></td> </tr> <tr> <td align='center'>Database Name [size="1"]The database should not have any other software using it.[/size]</td> <td><input type='text' name='database' value='mcc' /></td> </tr> <tr> <th colspan='2'><h2>Game Configuration </h2></th> </tr> <tr> <td align='center'>Game Currency [size="1"]Re-name your Game Currency IE Crystals, Gems, Points or make up your own[/size]</td> <td><input type='text' name='game_currency' value='Crystals' /></td> </tr> <tr> <td align='center'>Game Currency Symbol [size="1"]Do you want to show as $ or ? or other[/size]</td> <td><input type='text' name='game_value' value='$' /></td> </tr> <tr> <td align='center'>Change ENERGY [size="1"]Change ENERGY bar name to...[/size]</td> <td><input type='text' name='game_energy' value='Energy' /></td> </tr> <tr> <td align='center'>Change WILL [size="1"]Change WILL bar name to...[/size]</td> <td><input type='text' name='game_will' value='Will' /></td> </tr> <tr> <td align='center'>Change BRAVE [size="1"]Change BRAVE bar name to...[/size]</td> <td><input type='text' name='game_brave' value='Brave' /></td> </tr> <tr> <td align='center'>Change EXP [size="1"]Change EXP bar name to...[/size]</td> <td><input type='text' name='game_exp' value='EXP' /></td> </tr> <tr> <td align='center'>Change HEALTH [size="1"]Change HEALTH bar name to...[/size]</td> <td><input type='text' name='game_health' value='Health' /></td> </tr> <tr> <td colspan='2' align='center'><input type='submit' value='Install' /></td> </tr> </table></form></center>"; } function install() { menuprint("sql"); { print "Config Bypass Started "; print "Config Bypass Successful Attempting DB connection "; define('MONO_ON', 1); require "class/class_db_{$_POST['driver']}.php"; $db=new database; $db->configure($_POST['hostname'], $_POST['username'], $_POST['password'], $_POST['database'], 0); $db->connect(); $c=$db->connection_id; print "Connection Successful. Writing Main MySQL data. "; { if(!(strpos($line,"--") === 0) && trim($line) != "") //check for commented lines or blankies { $query.=$line; if(!(strpos($line,";") === FALSE)) { $db->query($query); $query=""; } } } print "Settings data was written. Now write Extra MySQL data. "; $username=$_POST['a_username']; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $db->query("INSERT INTO settings VALUES(NULL, 'game_currency', '{$_POST['game_currency']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'game_value', '{$_POST['game_value']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'game_energy', '{$_POST['game_energy']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'game_will', '{$_POST['game_will']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'game_brave', '{$_POST['game_brave']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'game_exp', '{$_POST['game_exp']}')"); $db->query("INSERT INTO settings VALUES(NULL, 'game_health', '{$_POST['game_health']}')"); $path=$_SERVER['HTTP_HOST']; print " <h2>[b]Settings Installation Successful![/b]</h2><hr /> >center><h1>!ATTENTION<h1></center> Once this Installer has been used you will be able to Edit Your Options via BASIC SETTINGS Panel in the Game"; } } ?> </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> </body> </html>   RENAME THIS FILE ONCE YOU HAVE RUN IT AND SEE THE SUCCESSFUL MESSAGE
  18. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... Hmm strange it worked fine for me try adding them manually one by one see if that cures it..
  19. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... Me personally id do it so there would never be any text events in a script and it was all editable from the admin panel lol thats me thinking outside the box yet again lol
  20. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... Is anyone using this mod as i was planning on expanding it but if its not of a great purpose too anyone i can concentrate on something else..
  21. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... The same principal applies for any other parts you want to change just create a new TABLE NAME and follow the above steps
  22. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... SQLS   ALTER TABLE `settings` ADD `game_currency` VARCHAR ( 255 ) not null default 'Crystals', ALTER TABLE `settings` ADD `game_value` VARCHAR ( 255 ) not null default '$', ALTER TABLE `settings` ADD `game_energy` VARCHAR ( 255 ) not null default 'Energy', ALTER TABLE `settings` ADD `game_will` VARCHAR ( 255 ) not null default 'Will', ALTER TABLE `settings` ADD `game_brave` VARCHAR ( 255 ) not null default 'Brave', ALTER TABLE `settings` ADD `game_exp` VARCHAR ( 255 ) not null default 'Exp', ALTER TABLE `settings` ADD `game_health` VARCHAR ( 255 ) not null default 'Health';   Now open up staff.php find Paypal Address: <input type='text' name='paypal' value='{$set['paypal']}' />   and underneath add these   Game Currency: <input type='text' name='game_currency' value='{$set['game_currency']}' /> Game Currency Symbol: <input type='text' name='game_value' value='{$set['game_value']}' /> Change ENERGY to.: <input type='text' name='game_energy' value='{$set['game_energy']}' /> Change WILL to.: <input type='text' name='game_will' value='{$set['game_will']}' /> Change BRAVE to.: <input type='text' name='game_brave' value='{$set['game_brave']}' /> Change EXP to.: <input type='text' name='game_exp' value='{$set['game_exp']}' /> Change HEALTH to.: <input type='text' name='game_health' value='{$set['game_health']}' />   on the ssame file on line 131-136 overwrite with this one   print "</select> {$set['game_energy']} Refill Price {$set['game_currency']}: <input type='text' name='ct_refillprice' value='{$set['ct_refillprice']}' /> IQ per {$set['game_currency']}: <input type='text' name='ct_iqpercrys' value='{$set['ct_iqpercrys']}' /> Money per {$set['game_currency']}: <input type='text' name='ct_moneypercrys' value='{$set['ct_moneypercrys']}' /> {$set['game_will']} Potion Item: ".item_dropdown($c, "willp_item", $set['willp_item'])." <input type='submit' value='Update Settings' /></form>";   now open up global_func.php this edit kindly done by POG1 Over write   <?php function money_formatter($muny,$symb='?') { return $symb.number_format($muny); }   with this one   <?php function money_formatter($value) { global $set; return $set['game_value'].' '. number_format($value); }   all you need to do now is change all text mentions of crystals to {$set['game_currency']} DONT alter the ones from any SQLS just the ones after PRINT or ECHO and for the Bars just change as you did with the Crystals ammending the $set name for each.
  23. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... in about 5 - 10 mins
  24. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... Yes once youve made the ammendments to each script then what ever item you put example BLOOD POINTS instead of WILL that will become BLOOD POINTS on all scripts that used to read as WILL
  25. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... I will post the working script once ive got the SQLS sorted...
×
×
  • Create New...