Jump to content
MakeWebGames

Recommended Posts

Posted

This is my first every mod, its a simple rating system allowing you to give users a good or bad rating.

ratingbr7.png

 

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:

  • Replies 69
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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...

Posted

Re: Simple user rating system v2

whoops 2nd one should be

if(!$action) {

print "Error - invaild action.";

$h->endpage();

exit;

}

updated the post..

Posted

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']);

Posted

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

Guest Anonymous
Posted

Re: Simple user rating system v2

how can we fix the error it don,t know what it is

Posted

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...

Guest Anonymous
Posted

Re: Simple user rating system v2

i just tested this script and it works fine :lol: :-o

Posted

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.

Posted

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

Posted

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

Posted

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.

Posted

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->

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...