|
|
Joined: Mar 2003
Posts: 215
Junior Member
|
Junior Member
Joined: Mar 2003
Posts: 215 |
Ubb threads 6.0.2
I removed this from the addpost.php file:
// ---------------------------------------------------------------- // Now we need to see if this post has already been made, basically // protects from spamming
$query = " SELECT B_Number FROM w3t_Posts WHERE B_Username = '$Username_q' AND B_Subject = '$Subject_q' AND B_Body = '$BodySig' AND B_Board = '$Board_q' "; $sth = $dbh -> do_query($query); list($B_Number) = $dbh -> fetch_array($sth); if ($B_Number) { $html -> not_right($ubbt_lang['NO_DUPS'],$Cat); }
Now this let me post two replies with the same subject and no body...which is what the users want to be able to do. But when I posted 2 new threads it resulted in errors viewing those 2 threads/topics: "There was a problem looking up the post in our database"
Does anyone have suggestions as to how I can allow users to reply to different topics with the same response they had in another topic in the same forum?
Thanks.
|
|
|
|
Joined: Mar 2003
Posts: 215
Junior Member
|
Junior Member
Joined: Mar 2003
Posts: 215 |
I also tried adding a restriction of having the Parent id match. This was to allow no duplicates within a sub-thread and no duplicate topics. This appeared to work, but this also has the same error when viewing a new topic that matches a reply to a topic.
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
Have you considered upgrading to 6.1.1 (or 6.2br2)?
It might not automatically resolve the problem, but it could make it easier for other people to assist you with this, since most people here are probably using 6.1.1.
|
|
|
|
Joined: Jul 2002
Posts: 19
Newbie
|
Newbie
Joined: Jul 2002
Posts: 19 |
You've got a little flawed logic here. After adding a post the routine tries to determine the post number by looking up the post using subject, body, board, and user name. In your case, this isn't a unique post.
A simple fix would be to change select following the insert of the post to include the date posted in the where clause:
// ------------------------------------------------------------------ // Now we need to find out what the number of the post we entered was $query = " SELECT B_Number FROM w3t_Posts WHERE B_Username= '$Username_q' AND B_Subject = '$Subject_q' AND B_Body = '$BodySig' AND B_Board = '$Board_q' AND B_Posted = '$date' "; $sth = $dbh ->do_query($query); list($Mnumber) = $dbh -> fetch_array($sth);
Last edited by bud; 12/16/2002 11:49 AM.
|
|
|
|
Joined: Mar 2003
Posts: 215
Junior Member
|
Junior Member
Joined: Mar 2003
Posts: 215 |
That appears to be the problem, fetching the new entry with a non-secondary key with the assumption there's no duplicates. It's working now.
Thanks
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|