Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
In 6.5, but I think also in previous versions if there are posts in a topic from users which are no longer in the database, the posts are not displayed.

Yet the number of pages of a topic is calculated with the total number of posts.
The result is that sometimes for instance a topic has 5 pages,
but when you click on the 5th page, the page is empty.

This happens because of a too restricitve query used.

In showflat.php
this query:

Code
$query = "<br />	SELECT t1.B_Number,t2.U_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,.........<br />	FROM  {$config['tbprefix']}Posts AS t1,<br />	{$config['tbprefix']}Users AS t2<br />	WHERE t1.B_Main  = $current<br />	AND   t1.B_PosterId = t2.U_Number<br />	$Viewable<br />	ORDER BY B_Number<br />	$Limit<br />";


should be:

Code
$query = "<br />	SELECT t1.B_Number,t2.U_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,.........<br />	FROM  {$config['tbprefix']}Posts AS t1<br />	LEFT JOIN {$config['tbprefix']}Users AS t2 ON t1.B_PosterId = t2.U_Number<br />	WHERE t1.B_Main  = $current<br />	$Viewable<br />	ORDER BY B_Number<br />	$Limit<br />";



also the way how the number of pages is calculated is unnecessarily complicated.

this:

Code
$length = $length - 1;<br />$pages = $length / $Totaldisplay;<br />if (is_int($pages)) {<br />	$pages++;<br />}<br />$pages = ceil($pages); 


can be replaced by:

Code
$pages = ceil($length / $Totaldisplay);

Sponsored Links
Entire Thread
Subject Posted By Posted
showflat.php sometimes doesn't display all post in a topic Anno 01/24/2005 1:30 AM
Re: showflat.php sometimes doesn't display all post in a topic Twisty 01/24/2005 8:09 AM
Re: showflat.php sometimes doesn't display all post in a topic Anno 01/24/2005 4:06 PM
Re: showflat.php sometimes doesn't display all post in a topic Anno 01/24/2005 6:38 PM
Re: showflat.php sometimes doesn't display all post in a topic scroungr 01/24/2005 7:18 PM
Re: showflat.php sometimes doesn't display all post in a topic Anno 01/25/2005 1:43 AM
Re: showflat.php sometimes doesn't display all post in a topic Twisty 01/27/2005 6:07 AM

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
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,575
Posts293,932
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online 769
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 0
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,835
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)