PHP fusion issues
hi i´m planning a site based on php-fusion, here users can solve some maths and logic, like here users solves hacking pieces. but, i cant set up a point system, i created some sql table called user_points, add point indicator on users profile and infusion panel, but how can i set up rankings e.g. if points are > greater than 200 set rank to "good math solver" etc. if anyone have some know-about in a php-fusion, then please help me! thanks in advance
I don't know a lot about PHP-Fusion, but this may help:
Make a new column in fusion_users called 'rank' or something, then on the page that adds points the account, make it select the number of points after it increases them, then use an if statement to edit the rank according to how many points they have.
Have a table which contains the missions which have been completed.
Then run a query like
markup$res = mysql_query ( "SELECT `missionname` FROM `missions` WHERE `username` = 'username'" ); if ( mysql_result ( $res, 0 ) == "completed" ) doAlreadyCompleted(); else doNotCompleted()
Edit, Whoops, too slow, sorry Mr_Cheese, at least he can see the query though
if you want here is the points system i made,
http://www.phpfusion-mods.com/infusions/moddb/mod_view.php?mod_id=241
it has an admin panel as well :)
so i have another problem… when i´m not looged in and i´ve try to access members.php i get this error: Notice: Undefined variable: rows in D:\files\progs\EasyPHP 2.0b1\www\fusion\members.php on line 56 so i´ve checked members.php line 56 and it looks good for me, here it is: if ($rows > 20) echo "<div align='center' style='margin-top:5px;'>".makePageNav($rowstart,20,$rows,3,FUSION_SELF."?sortby=$sortby&")."\n</div>\n"; so i dont know what is wrong, when i am logged in, there is no problem, does anyone know what can i do with this? so this is second problem: i have on my page new design, bud i cant get rid of green frame, here is an image: http://img96.imageshack.us/img96/3246/screenshot1352007104123ba0.jpg you can look on it, there can be viewed that frame, and php error too. how can write rank to the database? eg. when user points are 1000, write into database fusion_user table user_rank something like: "Best math solver" etc.. thanks in advance for help
so i have external file called ranking.php and in my profile i have include "ranking.php"; code is here:
if($points >= 100) {
dbquerry("UPDATE ".$db_prefix."users SET user_rank = '0' WHERE ".$db_prefix."users.user_id='$lookup'");
}```
so this code gathering user points... if the points are > thans 100, update the rank to "noob" but its not working what is wrong on this code? it have been called everywhere where i am displaying user rank but as i say, its not working, where i must fix it? thx
also thx to V1P3R ;)
dancuc wrote: so i have external file called ranking.php and in my profile i have include "ranking.php"; code is here:
if($points >= 100) {
dbquerry("UPDATE ".$db_prefix."users SET user_rank = '0' WHERE ".$db_prefix."users.user_id='$lookup'");
}```
so this code gathering user points... if the points are > thans 100, update the rank to "noob" but its not working what is wrong on this code? it have been called everywhere where i am displaying user rank but as i say, its not working, where i must fix it? thx
also thx to V1P3R ;)
Dbquery? What function is that?
eh… sry i dont have much experiences in MySQL using with php. so can you tell me the right syntax? thx [EDIT]i´ve tryed this:
dbquerry("UPDATE ".$db_prefix."users SET user_rank = '0' WHERE ".$db_prefix."users.user_id='$lookup'");
}
$points = dbquery("SELECT user_points FROM ".$db_prefix."users WHERE user_id='$lookup'");
if($points >= 100) {
upToNoob();
}```
but it doesnt work too..
[/EDIT]
Sigh, listen. I'm not going to spell it out for you, first learn then code, not the other way around.
I will point you however, to a useful piece of text: http://www.w3schools.com/php/php_mysql_insert.asp