Raid Posted October 9, 2007 Share Posted October 9, 2007 This is my first every mod, its a simple rating system allowing you to give users a good or bad rating. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Open viewusers.php Find: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add after: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Execute these sql querys: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add to day cron You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Please reply with any bugs or suggestions :-) Yea and replace the images with your own :roll: Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted October 9, 2007 Share Posted October 9, 2007 Re: Simple user rating system v2 Looks alright, Tho you dont really need 2 columns for the DB. if(!$ID) { print "Error - invaild player id."; $h->endpage(); exit; } if(!$ID) { print "Error - invaild action."; $h->endpage(); exit; } Repeated, I have no idea why... Quote Link to comment Share on other sites More sharing options...
Raid Posted October 9, 2007 Author Share Posted October 9, 2007 Re: Simple user rating system v2 whoops 2nd one should be if(!$action) { print "Error - invaild action."; $h->endpage(); exit; } updated the post.. Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted October 9, 2007 Share Posted October 9, 2007 Re: Simple user rating system v2 This isnt really major, But maybe you should secure the input variable used in the mysql query.. $ID = $_GET['ID']; ---> $ID = mysql_real_escape_string($_GET['ID']); Quote Link to comment Share on other sites More sharing options...
Raid Posted October 9, 2007 Author Share Posted October 9, 2007 Re: Simple user rating system v2 Yea good idea, thanks for the suggestions Quote Link to comment Share on other sites More sharing options...
HITMAN 17 Posted October 9, 2007 Share Posted October 9, 2007 Re: Simple user rating system v2 Parse error: syntax error, unexpected T_IF in /home/eyers/public_html/rating.php on line 29 Quote Link to comment Share on other sites More sharing options...
dementor Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 ill try convert it :-D Quote Link to comment Share on other sites More sharing options...
dementor Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 confused on y the cron is there Quote Link to comment Share on other sites More sharing options...
Solid Snake Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 the cron is so you can set how many times your game players are allowed to give ratings in this case its 1 rating per day and that dont meen if you give 1 a rating you cant give another a rating Quote Link to comment Share on other sites More sharing options...
dementor Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 so everyday same person can vote me up Quote Link to comment Share on other sites More sharing options...
Solid Snake Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 yep :roll: Quote Link to comment Share on other sites More sharing options...
HITMAN 17 Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 can someone fix error plz Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 how can we fix the error it don,t know what it is Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 how can we fix the error it don,t know what it is Parse error: syntax error, unexpected T_IF in /home/eyers/public_html/rating.php on line 29 I see no error in the script on line 29... Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 i just tested this script and it works fine :lol: :-o Quote Link to comment Share on other sites More sharing options...
Ghetto Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 Updated it a bit seen a few problems with it here's my version of it for V1. rating.php: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edit viewuser.php find: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add under: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. SQL: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. day cron: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. UPDATED: Font color changes red when minus rating normal on 0 rating and green on plus rating. Quote Link to comment Share on other sites More sharing options...
HITMAN 17 Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 Warning: include(mysql.php) [function.include]: failed to open stream: No such file or directory in /home/eyers/public_html/rating.php on line 10 Warning: include(mysql.php) [function.include]: failed to open stream: No such file or directory in /home/eyers/public_html/rating.php on line 10 Warning: include() [function.include]: Failed opening 'mysql.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eyers/public_html/rating.php on line 10 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/eyers/public_html/rating.php on line 12 Quote Link to comment Share on other sites More sharing options...
dementor Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 when u rate someone or where Quote Link to comment Share on other sites More sharing options...
HITMAN 17 Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 i converted this to v2 but get error Fatal error: Call to undefined method database::real_escape_string() in /home/eyers/public_html/rating.php on line 5 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. wats wrong with it Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 i converted this to v2 but get error Fatal error: Call to undefined method database::real_escape_string() in /home/eyers/public_html/rating.php on line 5 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. wats wrong with it Replace all the $db->real_escape_string with mysql_real_escape_string. Quote Link to comment Share on other sites More sharing options...
HITMAN 17 Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 another error Fatal error: Call to a member function query() on a non-object in /home/eyers/public_html/rating.php on line 39 Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 another error Fatal error: Call to a member function query() on a non-object in /home/eyers/public_html/rating.php on line 39 $result = $db->query("SELECT * FROM users WHERE userid='{$ID}'"); Try replacing that with: $result = mysql_query("SELECT * FROM users WHERE userid='{$ID}'"); You dont need to change ever single mysql_ to $db-> Quote Link to comment Share on other sites More sharing options...
HITMAN 17 Posted October 10, 2007 Share Posted October 10, 2007 Re: Simple user rating system v2 thnx isomer shall i post it on here Quote Link to comment Share on other sites More sharing options...
HITMAN 17 Posted October 11, 2007 Share Posted October 11, 2007 Re: Simple user rating system v2 i coverted this plz thank me You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
HITMAN 17 Posted October 11, 2007 Share Posted October 11, 2007 Re: Simple user rating system v2 do u have thumbs up pictures plz and add them Quote Link to comment Share on other sites More sharing options...
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.