Jump to content
MakeWebGames

Uridium

Members
  • Posts

    2,701
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by Uridium

  1. 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.
  2. Re: [Mccodes V2] Set Up V2 the way you want it without altering files....   Cheers Matey :)
  3. 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
  4. 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..
  5. 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
  6. 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..
  7. 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
  8. 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.
  9. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... in about 5 - 10 mins
  10. 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
  11. 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...
  12. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... few screen shots From Install From Admin Panel From Users View test site link Reg and i will give you staff staus to test out the features... http://www.testsite.murder-city.com Can I just mention a big thanks to POG1 for his help with the removal of $ to let users choose their own currency symbol
  13. Re: [Mccodes V2] Set Up V2 the way you want it without altering files.... Thats correct but once youve done my inserts to the scripts for that you will never need to alter the files again
  14. I was bored stupid so set about the installer.php on mcc v2 i was fed up of seeing crystals energy, brave, willl, $ signs and wanted to make a version where Admins can alter any of the things they like And ive cracked it Admin can alter anything they want via the admin panel change the name of the bars to suit them, the currency even renaming links all without altering any files ( FRESH INSTALL ONLY ) I'll put up a working demo site for you to view and use. And thanks to Crazy-T for the hosting :)
  15. Re: money_formatter on MCCODES V2 Cheers POG that worked 1st attempt :) Thank you +1
  16. im working on a way so staff can alter currency via the staff panel rather than files problem is i cant get this line to do what i want it to do.. function money_formatter($muny,$symb='$') i want to remove the $ and make it so it selects a pre-defined outcome... function money_formatter($muny,$symb='{$set['game_currency']}') i get parse errors with this method however so what woud be the correct way to do it. Parse error: syntax error, unexpected T_STRING, expecting ')' in C:\xampp\htdocs\global_func.php on line 2
  17. Re: [NEED Help][MCCODES V2] Item Pic Mod   ? Ive just given you 2 options.
  18. Re: [NEED Help][MCCODES V2] Item Pic Mod if you want learn mcc use this bit...... on line 24 add <th>Image</th> before the <th>Item</th> Then on line 32 change colspan to 6 not 5 The reason for 6 is because your adding a one new row so if you add another it would become 7 and so on ---------------------------------------------------------------------------------------------------   if you cant be bothered then copy and paste this one.   <?php include "globals.php"; $_GET['shop'] = abs((int) $_GET['shop']); if(!$_GET['shop']) { print "You begin looking through town and you see a few shops. "; $q=$db->query("SELECT * FROM shops WHERE shopLOCATION={$ir['location']}"); print "<table width=85% cellspacing=1 class='table'><tr style='background: gray;'><th>Shop</th><th>Description</th></tr>"; while($r=$db->fetch_row($q)) { print "<tr><td>[url='shops.php?shop={$r[']{$r['shopNAME']}[/url]</td><td>{$r['shopDESCRIPTION']}</td></tr>"; } print "</table>"; } else { $sd=$db->query("SELECT * FROM shops WHERE shopID={$_GET['shop']}"); if($db->num_rows($sd)) { $shopdata=$db->fetch_row($sd); if($shopdata['shopLOCATION'] == $ir['location']) { print "Browsing items at [b]{$shopdata['shopNAME']}...[/b] <table cellspacing=1 class='table'><tr style='background: gray;'><th>Image</th><th>Item</th><th>Description</th><th>Price</th><th>Sell Price</th><th>Buy</th></tr>"; $qtwo=$db->query("SELECT si.*,i.*,it.* FROM shopitems si LEFT JOIN items i ON si.sitemITEMID=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE si.sitemSHOP={$_GET['shop']} ORDER BY i.itmtype ASC, i.itmbuyprice ASC, i.itmname ASC"); $lt=""; while($r=$db->fetch_row($qtwo)) { if($lt!=$r['itmtypename']) { $lt=$r['itmtypename']; print "\n<tr style='background: gray;'><th colspan=5>{$lt}</th></tr>"; } print "\n<tr><td>{$r['itmname']}</td><td>[img=itmpics/{$r[]</td><td>\${$r['itmbuyprice']}</td><td>\${$r['itmsellprice']}</td><td><form action='itembuy.php?ID={$r['itmid']}' method='post'>Qty: <input type='text' name='qty' value='1' /><input type='submit' value='Buy' /></form></td></tr>"; } print "</table>"; } else { print "You are trying to access a shop in another city!"; } } else { print "You are trying to access an invalid shop!"; } } $h->endpage(); ?>   this will set the image next to the ITEM
  19. Re: [v2]Diamond market [v2] Just bare in mind though Casey adding more items like GEMS would mean altering more than 1 script.. example there must be about 15 scripts within MCC that are related to crystals so to alter one would mean to alter all :)
  20. Re: [v2]Diamond market [v2] Not a problem i noticed on your that atleast yours points to the right tables whereas MDK's was still pointing to CR.. +1 though
  21. Re: [Mccodes V2] Streets I typed streets in the search and found quite a few full running files. im sure i posted a working version with an image and users can fight NPC's
  22. Re: [v2]Diamond market [v2] [REMOVED] so the Lemmings dont follow :)
  23. Re: [V2]My own v2 Explore page [V2] if its any consolation silent at least you reached 26 posts on one topic lol
  24. Re: [V2]My own v2 Explore page [V2]   your not winning aany brownie points here silent.. take heed you wont win this one older postees are more respected :)
  25. Re: [V2]My own v2 Explore page [V2] Regardless of what hes done let him learn from this issue and drop the complaining
×
×
  • Create New...