PDA

View Full Version : View all posts in a thread


Osmosis
11-28-2003, 07:15 AM
I searched for about a half hour and couldnt find this hack, but it seems pretty simple and I'm surprised it wasn't easy to find. I would like to replace the 'Last Page' link (or add a new link) and have it link to a page showing all of the posts in a particular thread.

I'll be trying to solve this myself since it seems like no-one is interested in doing this, but its a feature on another forum I frequent and I'd like to have it for mine. I'm using 2.3.0

NTLDR
11-28-2003, 02:54 PM
I wouldn't recomend this is you have any large threads. I hate to think of the problems it will cause when someone trys to view a thread with a few hundred posts in it.

However you'll want to change the LIMIT part of the main query in showthread.php, I don't use vB2 any more and don't have a copy handy, but it would be similar to the following:

LIMIT ".($limitlower - 1).",$perpage

Osmosis
11-28-2003, 06:23 PM
I'm not that worried about it on my forum, its very rare to see a thread with even 50 posts, but I do understand how that could get hard on the database on a busier forum. I'm confused as to which query you call the 'main' query, as there are quite a few queries in showthread.php. There is no reference to LIMIT in $post, the LIMIT in $getlastpost is DESC LIMIT as is the case with most other occurances. In fact, your PHP is almost the exact $postorder variable.

I'm sorry if I am posting the obvious, I havent attempted any unknown hacks before but only predeveloped hacks with documentation.

Osmosis
12-01-2003, 07:02 AM
ba-bump? I havent been able to solve this problem, and I have users begging me for this feature. Can anyone help?

NTLDR
12-01-2003, 09:29 AM
Find:

ORDER BY dateline $postorder LIMIT ".($limitlower-1).",$perpage
");

Replace with:

ORDER BY dateline $postorder ".iif($action != 'showall', "LIMIT ".($limitlower-1).",$perpage", '')
);

Then use showthread.php?action=showall&threadid=THETHREADID (ie add action=showall to the URL).

Untested but it should work.

Osmosis
12-04-2003, 07:12 AM
I cant find any queries resembling that in showthread.php, I think I understand the premise behind them and so I will experiment with different iterations of those. The two places in showthread.php which might be the ones you're referring to are if ($posts=$DB_site->query_first("SELECT postid,dateline FROM post WHERE post.threadid=$threadid AND post.visible=1 AND post.dateline>'$bbuserinfo[lastvisit]' ORDER BY dateline LIMIT 1")) { or ORDER BY dateline $postorder. I suspect the one I need to work on is the second.

Thanks for the push in the right direction, NTLDR. I really do appreciate you taking the time to give this thought.

NTLDR
12-04-2003, 10:50 AM
Here is the full query to find from an unhacked 2.3.3:

$getpostids=$DB_site->query("
SELECT post.postid FROM post
WHERE post.threadid='$threadid' AND post.visible=1
ORDER BY dateline $postorder LIMIT ".($limitlower-1).",$perpage
");

Osmosis
12-18-2003, 08:52 PM
There appears to be no pretty way to do this with 2.3.0, as adding that to my (currently blank) $getpostids=""; causes a parse error whenever I try to navigate pages. I'm going to see about upgrading my VB to 2.3.3 and then I'll try this again, but upgrading may introduce a whole new host of problems with my moderately modified forum.