25$ Contest
Good [+1]Toggle ReplyLink» Nuclear replied on Tue Oct 21, 2003 @ 8:22pm |
For whoever can fix the discussion board script to not post double messages before I fix it... |
Good [+1]Toggle ReplyLink» lakester replied on Tue Oct 21, 2003 @ 9:38pm |
You could use javascript redirects. When a post is made, bring them to a confirmation page saying something like "Your post has been made, you will know be returned to the thread" and then it automatically redirects to the thread. |
Good [+1]Toggle ReplyLink» Nuclear replied on Tue Oct 21, 2003 @ 9:55pm |
Good [+1]Toggle ReplyLink» Screwhead replied on Tue Oct 21, 2003 @ 10:18pm |
Not properly though. Do like some other message boards. When you post, it loads a "Your post is succesful" page with a tiny (like 1second) timer that then brings you back to the discussion forum, but refreshed. |
Good [+1]Toggle ReplyLink» neoform replied on Tue Oct 21, 2003 @ 11:13pm |
Good [+1]Toggle ReplyLink» Purple_Lee replied on Tue Oct 21, 2003 @ 11:23pm |
Good [+1]Toggle ReplyLink» Zz.ee.vV replied on Wed Oct 22, 2003 @ 12:07am |
dude. its dead simple. i would need ur phpMyAdmin to have a clear idea of your tables to implement this, but the idea is eeeasy:
before adding new post to the dbase, do a SELECT for the exact same content with the exact same user on this very same date (or if you wanna be elaborate, posted within the last $time_to_cache_posts set to whatever you want, say 30mins) if you retrieve an element, display "double post"... no element? add the post... thats all :) |
Good [+1]Toggle ReplyLink» Mali replied on Wed Oct 22, 2003 @ 12:11am |
Good [+1]Toggle ReplyLink» Zz.ee.vV replied on Wed Oct 22, 2003 @ 1:52am |
thanks Heather :) nobody knows everything, but hey I do web design and coding for living... I write PHP every day hehe a message board is not really the most complex thing you can do with it :) |
Good [+1]Toggle ReplyLink» Nuclear replied on Wed Oct 22, 2003 @ 1:55am |
Good [+1]Toggle ReplyLink» Nuclear replied on Wed Oct 22, 2003 @ 1:57am |
It was simpler then that... I think I needed a stripslashes while comparing with the last post... Hopefully the problem is fixed now... |
Good [+1]Toggle ReplyLink» Nuclear replied on Wed Oct 22, 2003 @ 2:01am |
FROM
if ($show == 'added') { $mysql_query = "SELECT * FROM boardTopics$forum WHERE author = '$putmeAUTHOR' ORDER BY id DESC LIMIT 1"; $mysql_result = mysql_db_query($db_name, $mysql_query, $mysql_connection); $row = mysql_fetch_array($mysql_result); if ($row[body] == $putmeBODY && $row[subject] == $putmeSUBJECT && $row[author] == $putmeAUTHOR) { $nopost = 1; $show = 'listings'; } } TO if ($show == 'added') { $mysql_query = "SELECT * FROM boardTopics$forum WHERE author = '$putmeAUTHOR' ORDER BY id DESC LIMIT 1"; $mysql_result = mysql_db_query($db_name, $mysql_query, $mysql_connection); $row = mysql_fetch_array($mysql_result); if ($row[body] == stripslashes($putmeBODY) && $row[subject] == stripslashes($putmeSUBJECT) && $row[author] == $putmeAUTHOR) { $nopost = 1; $show = 'listings'; } } |
Good [+1]Toggle ReplyLink» Zz.ee.vV replied on Wed Oct 22, 2003 @ 2:04am |
so essentially you comparing it to this particular user's last post
that works too :) unless someone has a few ravewave windows open with different threads, using all of em... i dunno if i were you i'd WHERE thread as well as the author |
Good [+1]Toggle ReplyLink» Nuclear replied on Wed Oct 22, 2003 @ 3:11am |
Good [+1]Toggle ReplyLink» neoform replied on Wed Oct 22, 2003 @ 9:59am |
why not just check all the replies in the thread by that user to see if any are the same? |
Good [+1]Toggle ReplyLink» Nuclear replied on Wed Oct 22, 2003 @ 3:06pm |
Good [+1]Toggle ReplyLink» Zz.ee.vV replied on Wed Oct 22, 2003 @ 3:39pm |
yeah someone might have replied "lol" two days ago and wants to reply "lol" again hahaha
i think the last 5 post checking is prolly the simplest and best way to handle the multiple-windows-open thing. |
Good [+1]Toggle ReplyLink» neoform replied on Wed Oct 22, 2003 @ 5:23pm |
i dunno, why not stop duplication altogether? like say, no identical threads by the same user ever?
it'd stop the whole 75 "hi jeff" threads.. then maybe they'll just keep using the same one.. |
Good [+1]Toggle ReplyLink» OMGSTFUDIEPLZKTX replied on Thu Oct 23, 2003 @ 4:04am |
there are a few ways noah:
One, someone does a post, bring them to another page, then another. The double posts happen from refreshing pages that have been posted to, and the information gets posted again. So the page that it gets posted to should use a JAVASCRIPT redirect or a META redirect back to the discussion page. This is how most forums work to prevent double posts. The other but less reliable way is to check the contents of the message and subject. If BOTH the message and the subject are identical (use MD5 hashes of the content) as well as the person posting, then its probally a double post, but not necessarily. You could add date/time checkers too, but why bother when the first solution is the best one. |
Good [+1]Toggle ReplyLink» OMGSTFUDIEPLZKTX replied on Thu Oct 23, 2003 @ 4:09am |
$message = md5($_POST["message"]);
$subject = md5($_POST["subject"]); $sql = mysql_query('SELECT MD5(message) AS message, MD5(subject) AS subject, poster_id FROM posts WHERE message=''.$message.'' AND subject=''.$subject.'' AND poster_id=''.$_SESSION["userid"].''') or die(mysql_error()); if (mysql_num_rows($sql)) { // double post } else { // post is good, continue } but again, this isn't the best solution as it adds more pressure on the database than necessary and its not always reliable. |
25$ Contest
[ Top Of Page ] |
Post A Reply |
You must be logged in to post a reply.
[ Top Of Page ] |