PDA

View Full Version : Only Show Posts With Attachments On Showthread


NTLDR
01-11-2004, 10:00 PM
Author: NTLDR
Version: 1.0.0
vB Compatibility: vB3 Gamma, RC1, RC2

Description:

This hack will allow you to only show posts which contain attachments on showthread.php.

Usage:
showthread.php?threadid=1&attachments=1

(i.e add &attachments=1 onto the URL).

File Edits:

In showthread.php find:


if ($threadedmode == 0)
{


Add after:


// show only threads with attachments
if ($_REQUEST['attachments'] == 1) {
$attachsql = 'AND post.attach <> 0';
$attachwhere = true;
} else {
$attachsql = '';
$attachwhere = false;
}


Find:


WHERE threadid = $threadid AND visible = 1 $delthreadlimit

Add after:


$attachsql



Find (just after the last edit):


WHERE threadid = $threadid AND visible = 1


Add after:


$attachsql


Find:


$postids = "post.postid IN (0" . $ids . ")";


Add after:


if (empty($ids) && $attachwhere) {
eval(print_standard_error('error_sorry_no_attachme nts'));
}


Add the following phrase to the Front-End Error Message group:
Varname: sorry_no_attachments
Text:
Sorry, this thread doesn't contain any attachments.

Please click install if you use this hack :)

Dark Shogun
01-12-2004, 10:24 PM
Just posting a txt in case someone wanted it like in the other thread.

Dark Shogun