Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
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.

Sponsored Links
romka #229341 12/15/2002 6:20 PM
Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
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.

romka #229342 12/15/2002 7:26 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
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.

romka #229343 12/16/2002 11:38 AM
Joined: Jul 2002
Posts: 19
bud Offline
Newbie
Newbie
Offline
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.
marsl95 #229344 12/16/2002 7:25 PM
Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
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

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)