
danger boy
Members-
Posts
764 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by danger boy
-
Re: [mccode v2] Preferences Its probably to get his post count up :P Lol.
-
Re: Setting up a new game.. Looks like i beat you. :wink: Lol.
-
Re: [mccode v2] Preferences o problem. Always glad to help :wink:
-
Re: [mccode v2] Preferences Ok i have just secured a few querys for Sniko` So here we go <?php include "globals.php"; switch($_GET['action']) { case 'sexchange2': do_sex_change(); break; case 'sexchange': conf_sex_change(); break; case 'passchange2': do_pass_change(); break; case 'passchange': pass_change(); break; case 'namechange2': do_name_change(); break; case 'namechange': name_change(); break; case 'picchange2': do_pic_change(); break; case 'picchange': pic_change(); break; case 'forumchange2': do_forum_change(); break; case 'forumchange': forum_change(); break; default: prefs_home(); break; } function prefs_home() { global $db,$ir,$c,$userid,$h; print "<h3>Preferences</h3> [b][url='preferences.php?action=sexchange']Sex Change[/url][/b] <hr width=10px> Current Gender:<font color=yellow> {$ir['gender']}</font> [b][url='preferences.php?action=passchange']Password Change[/url][/b] <hr width=10px> Current Password: <font color=yellow>[i]Private[/i]</font> [b][url='preferences.php?action=namechange']Name Change[/url][/b] <hr width=10px> Current Name:<font color=yellow> {$ir['username']}</font> [b][url='preferences.php?action=picchange']Display Pic Change[/url][/b] <hr width=10px> Current Display Picture: [img={$ir[] [b][url='preferences.php?action=forumchange']Forum Info Change[/url][/b] <hr width=10px> Current Forum Signiture: <font color=yellow>{$ir['forums_signature']}</font> "; } function conf_sex_change() { global $ir,$c,$userid,$h; if($ir['gender'] == "Male") { $g="Female"; } else { $g="Male"; } print "Are you sure you want to become a $g? [url='preferences.php?action=sexchange2']Yes[/url] | [url='preferences.php']No[/url]"; } function do_sex_change() { global $db,$ir,$c,$userid,$h; if($ir['gender'] == "Male") { $g="Female"; } else { $g="Male"; } $UserUpdate = sprintf ( "UPDATE users SET gender = '$g' WHERE (userid = %u)", $userid); mysql_query($UserUpdate); print "Success, you are now $g! [url='preferences.php']Back[/url]"; } function pass_change() { global $ir,$c,$userid,$h; print "<h3>Password Change</h3><form action='preferences.php?action=passchange2' method='post'>Current Password: <input type='password' name='oldpw' /> New Password: <input type='password' name='newpw' /> Confirm: <input type='password' name='newpw2' /> <input type='submit' value='Change PW' /></form>"; } function do_pass_change() { global $db,$ir,$c,$userid,$h; if(md5($_POST['oldpw']) != $ir['userpass']) { print "The current password you entered was wrong. [url='preferences.php?action=passchange']> Back[/url]"; } else if($_POST['newpw'] !== $_POST['newpw2']) { print "The new passwords you entered did not match! [url='preferences.php?action=passchange']> Back[/url]"; } else { $UserUpdate = sprintf ( "UPDATE users SET userpass=md5('{$_POST['newpw']}') WHERE (userid = %u)", $userid); mysql_query($UserUpdate); print "Password changed!"; } } function name_change() { global $ir,$c,$userid,$h; print "<h3>Name Change</h3> Please note that you still use the same name to login, this procedure simply changes the name that is displayed. <form action='preferences.php?action=namechange2' method='post'> New Name: <input type='text' name='newname' /> <input type='submit' value='Change Name' /></form>"; } function do_name_change() { global $db,$ir,$c,$userid,$h; // Edited by zero-affect if($_POST['newname'] == "" || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " || $_POST['newname'] == " " && $_POST['newname'] == " ") { $i = mysql_query("SELECT * FROM users WHERE username='{$_POST['username']}'") or die(mysql_error()); if(mysql_num_rows($i)) {echo 'Username already in use!';$h->endpage(); exit; } print "You did not enter a new name. [url='preferences.php?action=namechange']> Back[/url]"; } else { $_POST['newname']=str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['newname']); $_POST['newname']=str_replace(array("{", "}", "\\\'"), array("<", ">", "'"), $_POST['newname']); $_POST['newname']=str_replace(array("eval", "alert", "\\\'"), array(".", ".", "."), $_POST['newname']); $checkun=$db->num_rows($db->query("SELECT * FROM users WHERE username='{$_POST['newname']}' AND userid!=$userid")); if($checkun) { echo "Username is already in use."; $h->endpage(); exit; } $checkln=$db->num_rows($db->query("SELECT * FROM users WHERE login_name='{$_POST['newname']}' AND userid!=$userid")); if($checkln) { echo "Username is already in use."; $h->endpage(); exit; } $UserUpdate = sprintf ( "UPDATE users SET username ='{$_POST['newname']}' WHERE (userid = %u)", $userid); mysql_query($UserUpdate); print "Username changed!"; } } function pic_change() { global $ir,$c,$userid,$h; print "<h3>Pic Change</h3> Please note that this must be externally hosted, [url='http://imageshack.us']ImageShack[/url] is our recommendation. Any images that are not 150x150 will be automatically resized <form action='preferences.php?action=picchange2' method='post'> New Pic: <input type='text' name='newpic' value='{$ir['display_pic']}' /> <input type='submit' value='Change Name' /></form>"; } function do_pic_change() { global $db,$ir,$c,$userid,$h; if($_POST['newpic'] == "") { print "You did not enter a new pic. [url='preferences.php?action=picchange']> Back[/url]"; } else { $_POST['newpic']=str_replace('\\\'',''', $_POST['newpic']); $userupdate = sprintf("UPDATE users SET display_pic = '{$_POST['newpic']}' WHERE userid = '%u' ", ($userid)); mysql_query($userupdate); print "Pic changed!"; } } function forum_change() { global $ir,$c,$userid,$h; print "<h3>Forum Info Change</h3> Please note that the avatar must be externally hosted, [url='http://imageshack.us']ImageShack[/url] is our recommendation. Any avatars that are not 100x100 will be automatically resized <form action='preferences.php?action=forumchange2' method='post'> Avatar: <input type='text' name='forums_avatar' value='{$ir['forums_avatar']}' /> Signature (you may use BBcode): <textarea rows=10 cols=50 name='forums_signature'>{$ir['forums_signature']}</textarea> <input type='submit' value='Change Info' /></form>"; } function do_forum_change() { global $db,$ir,$c,$userid,$h; $_POST['forums_avatar']=str_replace(array("<", ">"), array("<", ">"), $_POST['forums_avatar']); $UserUpdate = sprintf ( "UPDATE users SET forums_avatar='{$_POST['forums_avatar']} , forums_signature='{$_POST['forums_signature']}' WHERE (userid = %u)", $userid); mysql_query($UserUpdate); print "Forum Info changed!"; } $h->endpage(); ?>
-
Re: How to use sprintf? Well how i would use sprintf in that query would be changing the one you posted to $UserUpdate = sprintf("UPDATE users SET example = example + 1 WHERE (userid = %u)", $userid); mysql_query($UserUpdate);
-
Re: Merry Christmas Merry christmas to you all. Hope you have a good one :wink:
-
[mccode] Working Proxy Blocker - Blocks MOST Proxies [$10.00]
danger boy replied to John99's topic in Paid Modifications
Re: Working Proxy Blocker - Blocks MOST Proxies [$10] Crazy T Who the hell are you? :S and why you advertising my site :S as corrupted-streets. is MINE. -
Re: Calling it a Day :) I'm sure everyone is going to miss you with all the work you have done for this community. Whatever you decide to do in the future i wish it goes welll for you. Have a great christmas and a happy new year And take care of yourself :wink:
-
Re: Setting up a new game.. No problem. I was glad i could help. :wink:
-
Re: Guess the next poster nope i am :) zero next
-
Re: Guess the next poster zero next
-
Re: Guess the next poster no armageddondude next
-
Re: Counting (nr game) 2150
-
Re: [mccodes] Horoscopes Looks good brings something different to a game. +1 mate.
-
Re: [mccode v2] Donator Packs To Items LOl What are you trying to say? Explain properly please.
-
Re: [MOD] V2 Fight the good Fight Simple and stops the cheats from leaving the fight good work.
-
Re: [mccode v2] cMarket Total Limiter Cool Feature and good work.
-
Re: Counting (nr game) 2148
-
Re: Counting (nr game) 2146
-
Re: Counting (nr game) 2144
-
Re: Playstation 3 Lol its a cool game if anyone is thinking to buy it or not then my advice is to buy it as it is a really good game brought to us buy EA sports.
-
Re: Playstation 3 I have a ps3 anbd its great. My favourite games are GTA IV and Fifa 09
-
Re: Counting (nr game) 2142
-
Re: Guess the next poster Nope spudinski's next.
-
Re: Counting (nr game) 2140