
Tonka
Members-
Posts
450 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by Tonka
-
Re: Updated Explore V.2 that's an interesting idea
-
Re: crystal bank Update, been debugged abit <?php include "globals.php"; print "<h3>crystal Bank</h3>"; if($ir['crystalsbank']>-1) { switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money'] == 25000) { print "Congratulations, you bought a crystals bank account for \$25,000! [url='crystalsbank.php']Start using my account[/url]"; $db->query("UPDATE users SET money=money-25000,crystalsbank=0 WHERE userid=$userid"); } else { print "You do not have enough Money to open an account. [url='explore.php']Back to town...[/url]"; } } else { print "Open a crystals bank account today, just \$25,000! [url='crystalsbank.php?buy']> Yes, sign me up![/url]"; } } function index() { global $db, $ir,$c,$userid,$h; print "[b]You currently have {$ir['crystalsbank']} crystals in the bank.[/b] <table width='75%' cellspacing=1 class='table'> <tr> <td width='50%'>[b]Deposit crystals[/b] <form action='crystalsbank.php?action=deposit' method='post'> Amount: <input type='text' name='deposit' value='{$ir['crystalsbank']}' /> <input type='submit' value='Deposit' /></form></td> <td> [b]Withdraw crystals[/b] There is no fee on withdrawals.<form action='crystalsbank.php?action=withdraw' method='post'> Amount: <input type='text' name='withdraw' value='{$ir['crystalsbank']}' /> <input type='submit' value='Withdraw' /></form></td> </tr> </table>"; } function deposit() { global $db,$ir,$c,$userid,$h; $_POST['deposit']=abs((int) $_POST['deposit']); if($_POST['deposit'] > $ir['crystals']) { print "You do not have enough crystals to deposite in the bank bank."; } else { $gain=$_POST['deposit']-$fee; $ir['crystals']+=$gain; $db->query("UPDATE users SET crystalsbank=crystalsbank+$gain, crystals=crystals-{$_POST['deposit']} where userid=$userid"); print "You hand over {$_POST['deposit']} to be deposited, $gain is added to your account. [b]You now have {$ir['crystalsbank']} in the bank.[/b] [url='crystalsbank.php']> Back[/url]"; } } function withdraw() { global $db,$ir,$c,$userid,$h; $_POST['withdraw']=abs((int) $_POST['withdraw']); if($_POST['withdraw'] > $ir['crystalsbank']) { print "You do not have enough crystals to withdraw from the bank."; } else { $gain=$_POST['withdraw']; $ir['crystalsbank']-=$gain; $db->query("UPDATE users SET crystalsbank=crystalsbank-$gain, crystals=crystals+$gain where userid=$userid"); print "You ask to withdraw $gain, the banking lady grudgingly hands it over. [b]You now have {$ir['crystalsbank']} in the bank.[/b] [url='crystalsbank.php']> Back[/url]"; } } $h->endpage(); ?> also the mysql query you need is ALTER TABLE `users` ADD `crystalbank` INT( 11 ) NOT NULL DEFAULT '-1';
-
Re: [V2] Crystalbank Mod [V2] yes, this has already been posted, a few times actually
-
Re: crystal bank it does work, you just need to add the column to your users table ALTER TABLE `users` ADD `crystalbank` INT( 11 ) NOT NULL DEFAULT '-1';
-
Re: Cron Week Help i assume you mean when you need it to run, Depending on your servers configuration it going to be for saturday 0 0 * * 7 or 0 24 * * 7 for sunday 0 0 * * 0 or 0 24 * * 0
-
Re: create gang post your DB gangs table
-
Re: create gang have you added or removed anything from the database table?
-
Re: [V2] PJIRC Chat Mod [V2] uploaded to a different host tested by me and Spudinski, it downloads with no errors now
-
I got tired of having to go into the DB to edit or delete item types so here is what I made I also used some code for the delete function that was made by illusions http://criminalexistence.com/ceforums/index.php?topic=20112.0 Open staff_items.php Find case 'newitemtype': new_itemtype(); break; Add Below case 'edititemtype': edititemtype(); break; case 'edititemtypeform': edititemtypeform(); break; case 'edititemtypesub': edititemtypesub(); break; case 'delitemtype': delitemtype(); break; case 'delitemtypesub': delitemtypesub(); break; Find function newitemtype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO itemtypes VALUES(NULL, '".addslashes($_POST['name'])."')"); print "Item Type {$_POST['name']} added."; stafflog_add("Added item type {$_POST['name']}"); } else { print "<h3>Add Item Type</h3><hr /> <form action='staff_items.php?action=newitemtype' method='post'> Name: <input type='text' name='name' value' /> <input type='submit' value='Add Item Type' /></form>"; } } Add Below function edititemtype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove Item Type</h3><hr /> <form action='staff_items.php?action=edititemtypeform' method='post'> Name: ".itemtype_dropdown($c,'itmtype')." <input type='submit' value='Edit Item Type' /></form> "; } function edititemtypeform() { global $db,$ir,$c,$h,$userid; $d=$db->query("SELECT * FROM itemtypes WHERE itmtypeid={$_POST['itmtype']}"); $itemt=$db->fetch_row($d); print "<h3>Remove Item Type</h3><hr /> <form action='staff_items.php?action=edititemtypesub' method='post'> <input type='hidden' name='itmtypeid' value='{$_POST['itmtype']}' /> Name: <input type='text' name='rename' value='{$itemt['itmtypename']}' /> <input type='submit' value='Edit Item Type' /></form> "; } function edititemtypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $db->query("DELETE FROM itemtypes WHERE itmtypeid={$_POST['itmtypeid']}"); $db->query("INSERT INTO itemtypes VALUES('{$_POST['itmtypeid']}', '{$_POST['rename']}')"); print "The itemtype {$_POST['rename']} has been edited."; stafflog_add("Editted itemtype {$_POST['rename']}"); } function delitemtype() { global $db,$ir,$c,$h,$userid; print "<h3>Remove Item Type</h3><hr /> <form action='staff_items.php?action=delitemtypesub' method='post'> Name: ".itemtype_dropdown($c,'itmtype')." <input type='submit' value='Remove Item Type' /></form> "; } function delitemtypesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM itemtypes WHERE itmtypeid={$_POST['itmtype']}"); $itemt=$db->fetch_row($d); $db->query("DELETE FROM itemtypes WHERE itmtypeid={$_POST['itmtype']}"); print "The itemtype {$itemt['itmtypename']} has been removed from the game."; stafflog_add("Deleted itemtype {$itemt['itmtypename']}"); } Open smenu.php Find > [url='staff_items.php?action=newitemtype']Add Item Type[/url] "; Replace With > [url='staff_items.php?action=newitemtype']Add Item Type[/url] > [url='staff_items.php?action=edititemtype']Edit Item Type[/url] > [url='staff_items.php?action=delitemtype']Delete Item Type[/url] ";
-
Re: [V2] PJIRC Chat Mod [V2] both files recompressed and reuploaded, i also tested them to make sure they uncompress fine
-
[mccode] Reset your users without deleating them
Tonka replied to Redeye's topic in Free Modifications
Re: [v1 & v2]Reset your users without deleating them put reset.php in the staff panel -
Re: How To Install Pirjc I put together a mod for this, it can be found here http://criminalexistence.com/ceforums/index.php?topic=23091.0
-
I have put together an easy to install PJIRC chat mod. PJIRC is a Java-based Webchat Client, more info about it can be found here http://www.pjirc.com/main.php. Can be downloaded from http://www.squangle.org/mods/PJIRC.rar http://www.squangle.org/mods/PJIRC.zip NOTE: I did not code this, i just put it together from the instructions that are given with the original download Original PJIRC Files Can Be Found At http://www.pjirc.com/main.php EDIT: Changed the download links
-
Re: How To Install Pirjc make a file called chat.php and put it where you have the rest of the files for pjirc <?php print "<applet code=IRCApplet.class archive='irc.jar,pixx.jar' width=640 height=400> <param name='CABINETS' value='irc.cab,securedirc.cab,pixx.cab'> <param name='nick' value='Anonymous'> <param name='alternatenick' value='Anon???'> <param name='name' value='Java User'> <param name='host' value='216.86.156.64'> <param name='gui' value='pixx'> <param name='quitmessage' value='Now Leaving World of Conflict Chat'> <param name='asl' value='true'> <param name='style:bitmapsmileys' value='true'> <param name='style:smiley1' value=':) img/sourire.gif'> <param name='style:smiley2' value=':-) img/sourire.gif'> <param name='style:smiley3' value=':-D img/content.gif'> <param name='style:smiley4' value=':d img/content.gif'> <param name='style:smiley5' value=':-O img/OH-2.gif'> <param name='style:smiley6' value=':o img/OH-1.gif'> <param name='style:smiley7' value=':-P img/langue.gif'> <param name='style:smiley8' value=':p img/langue.gif'> <param name='style:smiley9' value=';-) img/clin-oeuil.gif'> <param name='style:smiley10' value=';) img/clin-oeuil.gif'> <param name='style:smiley11' value=':-( img/triste.gif'> <param name='style:smiley12' value=':( img/triste.gif'> <param name='style:smiley13' value=':-| img/OH-3.gif'> <param name='style:smiley14' value=':| img/OH-3.gif'> <param name='style:smiley15' value=':'( img/pleure.gif'> <param name='style:smiley16' value=':$ img/rouge.gif'> <param name='style:smiley17' value=':-$ img/rouge.gif'> <param name='style:smiley18' value='(H) img/cool.gif'> <param name='style:smiley19' value='(h) img/cool.gif'> <param name='style:smiley20' value=':-@ img/enerve1.gif'> <param name='style:smiley21' value=':@ img/enerve2.gif'> <param name='style:smiley22' value=':-S img/roll-eyes.gif'> <param name='style:smiley23' value=':s img/roll-eyes.gif'> <param name='style:floatingasl' value='true'> <param name='pixx:highlight' value='true'> <param name='pixx:highlightnick' value='true'> </applet>"; ?> This code is already configured to connect to the CE IRC server
-
Re: [V2] Donator Shop [V2] put this under include "globals.php"; if($ir['donatordays'] == 0) { echo("This feature is for donators only."); $h->endpage(); exit; }
-
Re: Merge Item's [V2] just call it merge.php and put a link on your items page saying Click here to merge items
-
Re: IPN help IPN is on, they were working but when i changed around my DP's/wills they stopped working
-
I'm having some trouble getting my both my donator pack and will potion IPN's to work, I've edited the ipn_donator.php to give out my item DP's. if anyone could help that would be great. ipn_donator.php <?php include "removed"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; require 'global_func.php'; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { // check the payment_status is Completed if($payment_status != "Completed") { fclose ($fp);die(""); } if($db->num_rows($db->query("SELECT * FROM dps_accepted WHERE dpTXN='{$txn_id}'")) > 0) { fclose ($fp);die(""); } // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email if($receiver_email != $set['paypal']) { fclose ($fp);die(""); } // check that payment_amount/payment_currency are correct if($payment_currency != "USD") { fclose ($fp);die(""); } // parse for pack $packr=explode('|',$item_name); if(str_replace("www.","",$packr[0]) != str_replace("www.","",$_SERVER['HTTP_HOST'])) { fclose($fp); die(""); } if($packr[1] != "DP") { fclose($fp);die(""); } $pack=$packr[2]; if( $pack != 1 and $pack != 2 and $pack != 3 and $pack != 4) { fclose($fp);die(""); } if($pack == 1 && $payment_amount != "3.00") { fclose ($fp);die(""); } if($pack == 2 && $payment_amount != "5.00") { fclose ($fp);die(""); } if($pack == 3 && $payment_amount != "10.00"){ fclose ($fp);die(""); } if($pack == 4 && $payment_amount != "20.00"){ fclose ($fp);die(""); } // grab IDs $buyer=$packr[3]; $for=$buyer; // all seems to be in order, credit it. if($pack==1) { $db->query("INSERT INTO inventory VALUES('',5,{$for},1)"); $d=DP1; $t="threedollars"; } else if($pack==2) { $db->query("INSERT INTO inventory VALUES('',6,{$for},1)"); $d=DP2; $t="fivedollars"; } else if($pack==3) { $db->query("INSERT INTO inventory VALUES('',7,{$for},1)"); $d=DP3; $t="tendollars"; } else if($pack==4) { $db->query("INSERT INTO inventory VALUES('',8,{$for},1)"); $d=DP4; $t="twentydollars"; } // process payment event_add($for, "Your \${$payment_amount} Pack {$pack} Donator Pack has been successfully credited to you.", $c); $db->query("INSERT INTO dps_accepted VALUES('', {$buyer}, {$for}, '$t', unix_timestamp(), '$txn_id')"); } else if (strcmp ($res, "INVALID") == 0) { }} fclose ($fp); } ?> ipn_wp.php <?php include "removed"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; require 'global_func.php'; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { // check the payment_status is Completed if($payment_status != "Completed") { fclose ($fp);die(""); } if($db->num_rows($db->query("SELECT * FROM dps_accepted WHERE dpTXN='{$txn_id}'", $c)) > 0) { fclose ($fp);die(""); } if($db->num_rows($db->query("SELECT * FROM willps_accepted WHERE dpTXN='{$txn_id}'", $c)) > 0) { fclose ($fp);die(""); } // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email if($receiver_email != $set['paypal']) { fclose ($fp);die(""); } // check that payment_amount/payment_currency are correct if($payment_currency != "USD") { fclose ($fp);die(""); } // parse for pack $packr=explode('|',$item_name); if(str_replace("www.","",$packr[0]) != str_replace("www.","",$_SERVER['HTTP_HOST'])) { fclose($fp); die(""); } if($packr[1] != "WP") { fclose($fp);die(""); } $pack=$packr[2]; if( $pack != 1 and $pack != 5) { fclose($fp);die(""); } if(($pack == 1) && $payment_amount != "1.00") { fclose ($fp);die(""); } if($pack == 5 && $payment_amount != "4.50") { fclose ($fp);die(""); } // grab IDs $buyer=$packr[3]; $for=$buyer; // all seems to be in order, credit it. if($pack==1) { item_add($for, $set['willp_item'], 1); } else if($pack==5) { item_add($for, $set['willp_item'], 5); } // process payment event_add($for, "Your \${$payment_amount} worth of Will Potions ($pack) has been successfully credited.", $c); $db->query("INSERT INTO willps_accepted VALUES('', {$buyer}, {$for}, '$pack', unix_timestamp(), '$txn_id')", $c); } else if (strcmp ($res, "INVALID") == 0) { fwrite($f,"Invalid?"); }} fclose ($fp); } ?>
-
Re: Tournaments mod For V2 for your editing problem this should work, just replace line 68 of the unedited files $p=mysql_query("SELECT * FROM torny WHERE tid={$_POST['tornyall']}"); also post your tornystaff.php because the one i have, the one from this post, there is no line 131
-
Re: Register.php create user on SMF Forum smf uses md5 with a salt
-
Re: online/offline/total users Yes you can, Find function userdata($ir,$lv,$fm,$cm,$dosessh=1) { Add Below $sql = "SELECT COUNT(userid) FROM users"; $rs = mysql_query($sql); $row = mysql_fetch_array($rs); $total_users = $row[0]; $sql = sprintf("SELECT COUNT(userid) FROM users WHERE (laston > %u)", time() - 900); $rs = mysql_query($sql); $row = mysql_fetch_array($rs); $users_online = $row[0]; $users_offline = $total_users - $users_online; and then just add Users Online: {$users_online} Users Offline: {$users_offline} Total Users: {$total_users} where every you want it to be displayed
-
Re: Stats in a way this was a mod request and a help request at the same time
-
Re: online/offline/total users this should work just fine for v1
-
Re: Help Needed with Loan Officer try this loanshark, http://criminalexistence.com/ceforums/index.php?topic=1571.0, you'll just need to convert it to v2
-
Re: Programs i use notepad2 http://www.flos-freeware.ch/notepad2.html