Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2003
Posts: 215
R
RandyJG Offline OP
Junior Member
OP Offline
Junior Member
R
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
R
RandyJG Offline OP
Junior Member
OP Offline
Junior Member
R
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
D
Addict
Offline
Addict
D
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
B
bud Offline
Newbie
Offline
Newbie
B
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
R
RandyJG Offline OP
Junior Member
OP Offline
Junior Member
R
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
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,551
Posts293,833
Members13,838
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online 403
Topics Created 0
Posts Made 0
Users Online 2
Birthdays 30
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,808
Greg Hard 4,625
Top Posters(30 Days)
isaac 25
WebGuy 6
Gizmo 2
Top Likes Received
isaac 62
Gizmo 12
Brett 7
Morgan 2
Top Likes Received (30 Days)
isaac 16
WebGuy 2
Gizmo 2
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2020 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Release build 20201027.dev)
Responsive Width:

PHP: 5.4.45 Page Time: 0.034s Queries: 25 (0.009s) Memory: 3.2872 MB (Peak: 3.4789 MB) Data Comp: Zlib Server Time: 2020-10-31 07:48:35 UTC
Valid HTML 5 and Valid CSS