iseeyou94056 Posted March 6, 2011 Posted March 6, 2011 one problem people can keep rating the same one over and over and people can rate there own topic if you know how to fix that please post the fix im just re learning to code so i forget how to do it First add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. in your db in forum_topics then open forums.php and scrool down to You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and scrool down untill you see You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. after that add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. then go into You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and under it add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. then find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. after $dlink add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. then make a file called forum2.php and put this inside it You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and i am pretty sure thats it if you know ways to make it better let me know Quote
iseeyou94056 Posted March 6, 2011 Author Posted March 6, 2011 if anyone could post up how to stop people from rating the same post more then once please post it up Quote
iseeyou94056 Posted March 7, 2011 Author Posted March 7, 2011 i dont know how to but i will use google and see what i can do Quote
bluegman991 Posted March 7, 2011 Posted March 7, 2011 just store it in database add another field to the user table called forum_liked when the vote update users set forum_liked=concat(',$forumvotedon') WHERE userid=$userid then if they try to vote again... if (in_array($thisforumid,$ir[forum_liked])) echo you already voted here ^^ warning that is not the exact code to use its just so you can get an idea of what to do Quote
Uridium Posted March 7, 2011 Posted March 7, 2011 Your SQL bts at top of page are wrong matey... ft_like int(11) defult 0 AND ft_dislike int(11) defult 0 should be [mysql]ALTER TABLE `forum_topics` ADD `ft_like` INT (11) DEFAULT 0;[/mysql] [mysql]ALTER TABLE `forum_topics` ADD `ft_dislike` INT (11) DEFAULT 0;[/mysql] Quote
lucky3809 Posted March 7, 2011 Posted March 7, 2011 (edited) took this from the viewuser profile count thread anyways haunted dawg had a code that only counted the user only and it didnt count multiple times only once... here is the profile code just to get an idea, the viewcount was added to users table. if($_GET['u'] != $ir['userid']) { mysql_query("UPDATE users SET pviews=pvies+1 WHERE userid='{$r['userid']}'") or die(mysql_error()); } the thread was this one View User Addon - Profile Views Edited November 10, 2012 by lucky3809 Quote
iseeyou94056 Posted March 8, 2011 Author Posted March 8, 2011 ok i edited the post i kinda have it so you cant vote on one topic at once the problem is you cant vote twice in a row after you vote on it if you try to again it will ytell you that you cant vite again but if you go vote on another then come back you can vote on it again can anyone please tell me how to make it so that all the different forum topic ids can be saved in there instead of updating it to 1 Quote
rulerofzu Posted March 8, 2011 Posted March 8, 2011 I would suggest you change the way your trying to do this. Intead of adding to the users and forum topic tables create a new table where you can record the userid, topic id, liked, dislike Then when a player likes or dislikes a topic you can record it in this new table. Which in turn makes it easier to then check for that topic ID. Also......why are you putting the code in a different file. Create a new forum function. Quote
Uridium Posted March 8, 2011 Posted March 8, 2011 I would suggest you change the way your trying to do this. Intead of adding to the users and forum topic tables create a new table where you can record the userid, topic id, liked, dislike Then when a player likes or dislikes a topic you can record it in this new table. Which in turn makes it easier to then check for that topic ID. Also......why are you putting the code in a different file. Create a new forum function. I Totally agree with rulerofzu on this one Quote
iseeyou94056 Posted March 9, 2011 Author Posted March 9, 2011 im working on that but i dont know what to do for the if func so far i have this You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. but this if fi\unc dont work You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
rulerofzu Posted March 9, 2011 Posted March 9, 2011 http://www.php.net/manual/en/functions.user-defined.php Quote
iseeyou94056 Posted March 9, 2011 Author Posted March 9, 2011 now i tried You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. i still cant figure it out Quote
sniko Posted March 9, 2011 Posted March 9, 2011 Good try with the updating....But you don't global anything in a if() statement. I would go about doing this with the following You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Although the function is un-needed, i hope it gives you the basic understanding of them :) Quote
War_Hero Posted March 13, 2011 Posted March 13, 2011 You could try this. I'm not sure if it will work, as I've not tested it: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
iseeyou94056 Posted March 15, 2011 Author Posted March 15, 2011 grrr i still cant get it to work right :/ Quote
iseeyou94056 Posted March 16, 2011 Author Posted March 16, 2011 can anyone tell me how to do this its one of the couple things keeping me from opening my game Quote
Zan Posted March 17, 2011 Posted March 17, 2011 hmmm we can add something like this [mysql]ALTER TABLE `forum_topics` ADD `liker` INT (11) DEFAULT 0; ALTER TABLE `forum_topics` ADD `disliker` INT (11) DEFAULT 0; ALTER TABLE `forum_topics` ADD `liked` INT (11) DEFAULT 0; ALTER TABLE `forum_topics` ADD `disliked` INT (11) DEFAULT 0;[/mysql] then You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Not 100% sure it will work..just my thinking..maybe someone can improve this codes ???? Quote
iseeyou94056 Posted March 18, 2011 Author Posted March 18, 2011 the if funcs look like they work so far but whats the querys to update it for when they rate it the first time Quote
Dayo Posted March 22, 2011 Posted March 22, 2011 Haven't read the full topic but if you are trying to stop a user rating multiple times I'll post up someting similar to what I used on my forum mod later tonight Quote
iseeyou94056 Posted March 24, 2011 Author Posted March 24, 2011 ok let me know when after you do it 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.