Jump to content
MakeWebGames

Lunny

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by Lunny

  1. Re: Passport [V2] Although it's a simple mod, I have to say its a really good one! :mrgreen: You can link passport.php to your index and the passport, although simple, looks great.
  2. Re: Generate Password   Thanks MTG. :mrgreen:
  3. Re: Generate Password   Eeeeh? The purpose of this mod is - if the user can't think of a password, he can just generate one. It doesn't stop multi's or anything like that (I'm not a good enough coder to do those sorts of things yet). You can't use it to exploit anything. It's just JavaScript, which this JavaScript has no connection to your game(s)
  4. Re: Generate Password   This isn't a security verification, The Corpse, therefore there is no need to send to an email. That just makes things more complicated for the user, also it's time consuming.
  5. Re: Generate Password Well, it generates a password and the user can note it down on a peice of paper or something. You click generate and it comes up like: gkdo4gn, so the user knows what the outcome is.
  6. Re: userlist.php with a few mods to it V2 I help code Brad's game and I have to admit that this mod is quite handy and looks pretty sweet as well. So, I would recommend trying it out :-)
  7. Re: Gift.php [edited] Hey Brandon. Erm.. I'm not sure if your SQL is correct. From what I've seen in other mods, shouldn't it be like this: ALTER TABLE `users` ADD `gift` int (11) not null default 0   Just helping :-)
  8. This is not my modification, but I have modified it to fit with Mccodes. My friend, Jason made this, but I thought it may be a cool addition to your games. Open up register.php and find: <td colspan=3 align=center><input type=submit value=Submit></td> </tr> </table> </form>   Replace it with: <td colspan=3 align=center><input type=submit value=Submit></td> </tr> </table> </form> "; } ?>   Under that add: <script> var keylist="abcdefghijklmnopqrstuvwxyz123456789" var temp='' function generatepass(plength){ temp='' for (i=0;i<plength;i++) temp+=keylist.charAt(Math.floor(Math.random()*keylist.length)) return temp } function populateform(enterlength){ document.pgenerate.output.value=generatepass(enterlength) } </script> <center>Password Help <form name="pgenerate"> <input type="text" size=18 name="output"> <input type="button" value="Generate Password" onClick="populateform(this.form.thelength.value)"> [b]Password Length:[/b] <input type="text" name="thelength" size=3 value="7"> </form></center>   Replace: > [url='login.php']Go Back[/url]"; } print <<<OUT   With just: > [url='login.php']Go Back[/url]   Also, you wouldn't be needing: OUT; ?>   And thats it. Basically all it does is generate a password if you can think of one. You can choose the length of the password too. Hope you all like it :-)
  9. Re: [mccode] Profile Signatures I know this is an old thread, but I wanted this in v2. I have converted everything correctly and fixed all errors. Well one is left. "Fatal error: Call to a member function query() on a non-object in *** preferences.php on line 154" I've managed to get to the stage were you type what you want in the signature, but as soon you hit "Change profile signature" the above error appears. Here is the code in preferences.php print "Username changed!"; } } function signature_change() { global $ir,$c,$userid,$h; print "<h3>Profile Signature Change</h3> <form action='preferences.php?action=signature2' method='post'> New Profile Signature: <textarea rows=7 cols=40 name='newsignature'>{$ir['signature']}</textarea> <input type='submit' value='Change Profile Signature' /></form> [b]Current Profile Signature :[/b]{$r['signature']}"; } function do_signature_change() { global $ir,$c,$userid,$h; if($_POST['newsignature'] == "") { print "You did not enter a new signature. [url='preferences.php?action=signature']Back[/url]"; } else { $db->query("UPDATE users SET signature='{$_POST['signature']}' WHERE userid=$userid"); print "Profile Signature changed!"; } }   $db->query("UPDATE users SET signature='{$_POST['signature']}' WHERE userid=$userid"); <-- Line 154 Any suggestions or help would be appreciated. Thanks, Lunny
  10. Re: Paper Ads Thank you Z?v??. You've just boosted my confidence on posting on here now. :lol: I was worried that I might get flamed. Also, to see the basic concept of the idea, sign up to Magictallguy's and I site at: Tech Wars I'm not trying to advertise or anything, but just to give you ideas. I've made mine on a seperate page were you can show banners and the URL. Thank you for the comments and thanks again to you Z?v?? :-)
  11. Hello everyone, I'm a very very basic php coder, because I'm in the stages of learning the language at the moment. This is my first mod I've made myself, but you may think its basic because you are all great coders anyhow :lol: Just a word of warning: please do check through the codes before you try! I'm not sure if there are any errors in there so please be careful. If you spot any please post a correct version of it. I don't want to your games to be messed up. UPDATE!!! If you have installed this mod, accept my apologies, but I have missed a few things. Re-install paperads.php and create the table. Again I'm sorry, but now this should work ok. Post if you spot an error, thanks. [21/02/08][20:29] Well firstly create a file called: paperads.php <?php include "globals.php"; print <<<EOF <h3>Paper Advertisements:</h2> <center> If you wish to advertise your website in <Your game name> newspaper you will have to choose an option from below [list=1] [*]1 month ad: £10 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type=hidden name=cmd value=_xclick> <input type="hidden" name="business" value="{$set['paypal']}"> <input type="hidden" name="item_name" value="{$domain}|PaperAd|1|{$userid}"> <input type="hidden" name="amount" value="10.00"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://{$domain}/paperaddone.php?action=done&type=standard"> <input type="hidden" name="cancel_return" value="http://{$domain}/paperaddone.php?action=cancel"> <input type="hidden" name="notify_url" value="http://{$domain}/ipn_paperads.php"> <input type="hidden" name="cn" value="Your Player ID"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="tax" value="0"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> [*]3 month ad: £25 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type=hidden name=cmd value=_xclick> <input type="hidden" name="business" value="{$set['paypal']}"> <input type="hidden" name="item_name" value="{$domain}|PaperAd|2|{$userid}"> <input type="hidden" name="amount" value="25.00"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://{$domain}/paperaddone.php?action=done&type=standard"> <input type="hidden" name="cancel_return" value="http://{$domain}/paperaddone.php?action=cancel"> <input type="hidden" name="notify_url" value="http://{$domain}/ipn_paperads.php"> <input type="hidden" name="cn" value="Your Player ID"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="tax" value="0"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> [*]5 month ad: £40 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type=hidden name=cmd value=_xclick> <input type="hidden" name="business" value="{$set['paypal']}"> <input type="hidden" name="item_name" value="{$domain}|PaperAd|3|{$userid}"> <input type="hidden" name="amount" value="40.00"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://{$domain}/paperaddone.php?action=done&type=standard"> <input type="hidden" name="cancel_return" value="http://{$domain}/paperaddone.php?action=cancel"> <input type="hidden" name="notify_url" value="http://{$domain}/ipn_paperads.php"> <input type="hidden" name="cn" value="Your Player ID"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="tax" value="0"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> [*]6 month ad: £75 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type=hidden name=cmd value=_xclick> <input type="hidden" name="business" value="{$set['paypal']}"> <input type="hidden" name="item_name" value="{$domain}|PaperAd|4|{$userid}"> <input type="hidden" name="amount" value="75.00"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://{$domain}/paperaddone.php?action=done&type=standard"> <input type="hidden" name="cancel_return" value="http://{$domain}/paperaddone.php?action=cancel"> <input type="hidden" name="notify_url" value="http://{$domain}/ipn_paperads.php"> <input type="hidden" name="cn" value="Your Player ID"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="tax" value="0"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> [*]8 month ad: £145 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type=hidden name=cmd value=_xclick> <input type="hidden" name="business" value="{$set['paypal']}"> <input type="hidden" name="item_name" value="{$domain}|PaperAd|5|{$userid}"> <input type="hidden" name="amount" value="145.00"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://{$domain}/paperaddone.php?action=done&type=standard"> <input type="hidden" name="cancel_return" value="http://{$domain}/paperaddone.php?action=cancel"> <input type="hidden" name="notify_url" value="http://{$domain}/ipn_paperads.php"> <input type="hidden" name="cn" value="Your Player ID"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="tax" value="0"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> [*]10 month ad: £280 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type=hidden name=cmd value=_xclick> <input type="hidden" name="business" value="{$set['paypal']}"> <input type="hidden" name="item_name" value="{$domain}|PaperAd|6|{$userid}"> <input type="hidden" name="amount" value="280.00"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://{$domain}/paperaddone.php?action=done&type=standard"> <input type="hidden" name="cancel_return" value="http://{$domain}/paperaddone.php?action=cancel"> <input type="hidden" name="notify_url" value="http://{$domain}/ipn_paperads.php"> <input type="hidden" name="cn" value="Your Player ID"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="tax" value="0"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> [*]1 year ad: £550 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type=hidden name=cmd value=_xclick> <input type="hidden" name="business" value="{$set['paypal']}"> <input type="hidden" name="item_name" value="{$domain}|PaperAd|7|{$userid}"> <input type="hidden" name="amount" value="550.00"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://{$domain}/paperaddone.php?action=done&type=standard"> <input type="hidden" name="cancel_return" value="http://{$domain}/paperaddone.php?action=cancel"> <input type="hidden" name="notify_url" value="http://{$domain}/ipn_paperads.php"> <input type="hidden" name="cn" value="Your Player ID"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="tax" value="0"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form> Once paid there are no refunds, so please be sure on which you want to choose. </p></center> EOF; $h->endpage(); ?>   Then create another file: paperaddone.php <?php include "globals.php"; if($_GET['action'] == "cancel") { print "You have cancelled your advertisement."; } else if($_GET['action'] == "done") { if(!$_GET['tx']) { die ("Get a life."); } print "Thank you for your payment to {$set['game_name']}. Your transaction has been completed, and a receipt for your purchase has been emailed to you. You may log into your account at [url='http://www.paypal.com']www.paypal.com[/url] to view details of this transaction. Your ad should be in the newspaper within a few minutes, if not, contact an admin for assistance."; } $h->endpage(); ?>   And finally: ipn_paperads.php <? include "config.php"; 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 pas_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 != "GBP") { fclose ($fp); die(""); } // parse for paperads $paperads=explode('|',$item_name); if(str_replace("www.","",$packr[0]) != str_replace("www.","",$_SERVER['HTTP_HOST'])) { fclose($fp); die(""); } if($paperads[1] != "Paperads") { fclose($fp); die(""); } $pack=$paperads[2]; if( $paperads != 1 and $paperads != 2 and $paperads != 3 and $paperads != 4 and $paperads != 5 and $paperads != 6 and $paperads != 7) { fclose($fp); die(""); } if( ( $paperads == 1) && $payment_amount != "10.00") { fclose ($fp); die(""); } if($paperads == 2 && $payment_amount != "25.00") { fclose ($fp); die(""); } if($pack == 3 && $payment_amount != "40.00") { fclose ($fp); die(""); } if($pack == 4 && $payment_amount != "75.00") { fclose ($fp); die(""); } if($pack == 5 && $payment_amount != "145.00") { fclose ($fp); die(""); } if($pack == 6 && $payment_amount != "280.00") { fclose ($fp); die(""); } if($pack == 7 && $payment_amount != "550.00") { fclose ($fp); die(""); } // grab IDs $buyer=$paperads[3]; $for=$buyer; // process payment event_add($for, "Your \${$payment_amount} PaperAd {$paperads} has been successfully gone through.", $c); event_add if($ir['user_level']==2) { print "($ir['userid']== > ) has paid for {$paperads}. Mail this user for more information." $db->query("INSERT INTO pas_accepted VALUES('', {$buyer}, {$for}, '$t', unix_timestamp(), '$txn_id')"); } else if (strcmp ($res, "INVALID") == 0) { } } fclose ($fp); } ?>   Add this table in your SQL: CREATE TABLE `pas_accepted` ( `paID` int(11) NOT NULL auto_increment, `paBUYER` int(11) NOT NULL default '0', `paFOR` int(11) NOT NULL default '0', `paTYPE` varchar(255) NOT NULL default '', `paTIME` int(11) NOT NULL default '0', `paTXN` varchar(255) NOT NULL default '', PRIMARY KEY (`paID`) ) ENGINE=MyISAM ;   As I've said before, I am new to these things, so there may be errors in the code. Please check carefully. :-) When the payment has gone through you can post the persons website URL where ever you like in the newspaper. I would say where the image "Paper Ads" is. Thats where I got the idea from :-) Also, please dont flame me, but I would appreciate corrections and advice. Thanks :) PS - modify it all you like to fit your needs Edit: You'll have to make a link to paperads.php Sorry I forgot to mention that.. :lol:
  12. Re: [v1] Bar Room w/ Chat FREE Hey, Cyanide. I've tried out you're mod exactly how you did it, but I got this error. I don't know if you are aware of it, but I thought that I should let you know. Here it is:   Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in *******barroom.php on line 73   I'm not a coder or anything, I'm still a newb at it, but my friend is teaching me, so I'm on my way :wink:
×
×
  • Create New...