LegendFTW Posted February 26, 2011 Posted February 26, 2011 tried the user display pic mod function pic_change() { global $db,$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['forums_avatar']=$_POST['newpic']; $_POST['forums_avatar']=str_replace(array("<", ">",addslashes("'"),addslashes('"')), array("<", ">","'","""), $_POST['forums_avatar']); if(strpos($_POST['forums_avatar'],".php") !== false || strpos($_POST['forums_avatar'],".asp") !== false || strpos($_POST['forums_avatar'],".aspx") !== false || strpos($_POST['forums_avatar'],".htm") !== false) { print("Invalid characters [url='preferences.php?action=picchange']> Back[/url]"); $h->endpage(); exit; } if(strpos($_POST['forums_avatar'],".gif") === false && strpos($_POST['forums_avatar'],".jpg") === false && strpos($_POST['forums_avatar'],".png") === false && strpos($_POST['forums_avatar'],".jpeg") === false) { print("Invalid extension, please use a gif, jpg or png image [url='preferences.php?action=picchange']> Back[/url]"); $h->endpage(); exit; } $db->query("UPDATE users SET display_pic='{$_POST['forums_avatar']}' WHERE userid=$userid"); print "Pic changed!"; } } and I keep getting this error when I try to add this to the preferences: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/damagedc/public_html/preferences.php on line 215 Quote
LegendFTW Posted February 26, 2011 Author Posted February 26, 2011 also this is wat i have atm: function pic_change() { global $db,$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['forums_avatar']=$_POST['newpic']; $_POST['forums_avatar']=str_replace(array("<", ">",addslashes("'"),addslashes('"')), array("<", ">","'","""), $_POST['forums_avatar']); if(strpos($_POST['forums_avatar'],".php") !== false || strpos($_POST['forums_avatar'],".asp") !== false || strpos($_POST['forums_avatar'],".aspx") !== false || strpos($_POST['forums_avatar'],".htm") !== false) { print("Invalid characters [url='preferences.php?action=picchange']> Back[/url]"); $h->endpage(); exit; } if(strpos($_POST['forums_avatar'],".gif") === false && strpos($_POST['forums_avatar'],".jpg") === false && strpos($_POST['forums_avatar'],".png") === false && strpos($_POST['forums_avatar'],".jpeg") === false) { print("Invalid extension, please use a gif, jpg or png image [url='preferences.php?action=picchange']> Back[/url]"); $h->endpage(); exit; } $db->query("UPDATE users SET display_pic='{$_POST['forums_avatar']}' WHERE userid=$userid"); print "Pic changed!"; } } I would really appreciate it if someone could make it so forum avatars are still in use and sort of merge these two codes Thanks Quote
Paul Evans Posted February 26, 2011 Posted February 26, 2011 just curious what version of mc this is as it's not actually secure Quote
rulerofzu Posted February 26, 2011 Posted February 26, 2011 Paul thats the default 2.0.2c preferences file. Quote
rulerofzu Posted February 26, 2011 Posted February 26, 2011 As for the error....must be something else as the default 2.0.2c preferences file is only 200 lines long. Added anything else to make it error at line 215? Quote
Paul Evans Posted February 26, 2011 Posted February 26, 2011 post the entire mod, that would be great. Quote
LegendFTW Posted February 26, 2011 Author Posted February 26, 2011 mod can be found here: [mccode v2] Updated Display Pic System Quote
Paul Evans Posted February 26, 2011 Posted February 26, 2011 wow i would suggest against using that mod, if you have a valid mc license i'd probably wait for the new patch that seems rather secure IMPO Quote
Joshua Posted February 26, 2011 Posted February 26, 2011 Just curious on the new Patched one Paul Have you tried entering the display_pic hack with ##;.jpg ? Quote
Paul Evans Posted February 26, 2011 Posted February 26, 2011 Yeah i give quite afew hacks ago on the new engine (MCv2.0.3) spent a good few hours attempting hacks, give it a go let me know if you got anything http://v203.mccodes.com/ Quote
Djkanna Posted February 27, 2011 Posted February 27, 2011 Yeah i give quite afew hacks ago on the new engine (MCv2.0.3) spent a good few hours attempting hacks, give it a go let me know if you got anything http://v203.mccodes.com/ I can make it hang ^.^ @OP: Why not just use the display pic as the forum avatar? Edit: Nevermind mis- read the second post. Quote
LegendFTW Posted February 27, 2011 Author Posted February 27, 2011 ok i will stick with the previous one then but if someone does make a secure version for this please pm me cause i think its a great mod if it could also have the forum avatar included with multiple images Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.