Jump to content
MakeWebGames

Recommended Posts

Posted

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

Posted

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

Posted

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]

Posted (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 by lucky3809
Posted

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

Posted

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.

Posted
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

Posted

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.

Posted

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

Posted

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

Posted

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

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