Back to vBulletin 3.0 Add-Ons

Reply Count addon for "In Reply to" hack by WetWired
Mod Version: 1.00, by amykhar

This modification is in the archives.
vB Version: 3.0.3 Rating: (0 vote - 0 average) Installs: 3
Released: 11 Dec 2004 Last Update: Never Downloads: 0
Not Supported  

Original hack can be found here:

Spoiler (click to open)


vB3.0/hack version "frozen"; vB3.5/plugin version released
You can get the plugin for vb3.5 here. There will be no more releases for the vB3.0 version.

Description
This hack allows the display of the title and author of the post that each post is in response to. (See screenshot if clarification is needed)

The purpose of this hack is to provide missing information to linear view mode users. I got the idea from a board I visit that used to be UBB Threads, though my choice of presentation is a bit different.

See the attached screenshot for an example of how this can look. The hack itself only provides the additional items in $post, so it is up to the templates exactly how it looks. (The changes I used are included as an example in the hack instructions)

Complexity
This hack changes one file, requires no queries, and requires changes to one template.

Technical
This hack has been tested on vB3.0.3,vB3.0.0RC4 and vB3.0.0RC2.
It adds 1 query to showthread in linear mode, and adds 1 additional query in linear mode for each consecutive layer of deleted parents of posts displayed on a page. (If a displayed post is a reply to a deleted reply to an undeleted reply to a deleted reply to an undeleted post, 2 total queries are added to showthread, but if a displayed post is a reply to a deleted reply to a deleted reply to a deleted reply to an undeleted post, 4 total queries are added to showthread. If both examples are displayed in the same page, only 4 total queries are added to showthread.)

Update (v1.10 2004-03-01)
Version 1.10 released, which uses the beginning of a post as a title if the post does not have a title, and also trims long titles down to a decent size. Minor optimizations. regardinghackupdate.txt added for existing users, regardinghack.txt updated for new users.

Support
Please click the install button above if you install this hack.

The hack version of this modification will have no further updates, but I will still answer questions in this thread.
Attached Images
File Type: gif regardinghackexample.gif (16.4 KB, 815 views)
Attached Files
File Type: txt regardinghack.txt (8.0 KB, 196 views)
File Type: txt regardinghackupdate.txt (6.8 KB, 130 views)

Close


What my addon does is to place an incremental number in the "Re:" section of the post title.

For example, if I posted a post called "Test Post", the first reply would be "Re(1): Test Post". The second would be "Re (2): Test Post" and so on.

If a reply is made to "Re (1): Test Post", that reply becomes "Re (2) : Test Post"
First, install the WetWired's hack. Then,

In includes/functions_newpost.php Find the function fetch_quote_title

Replace the entire function with:

Code:
// ###################### Start fetch_quote_title #######################
// checks the parent post and thread for a title to fill the default title field
function fetch_quote_title($parentposttitle, $threadtitle)
{
	global $vboptions, $vbphrase;
	if ($vboptions['quotetitle'])
	{
		if ($parentposttitle != '')
		{
			$posttitle = $parentposttitle;
		}
		else
		{
			$posttitle = $threadtitle;
		}
		$posttitle = unhtmlspecialchars($posttitle);
		if(strstr($posttitle, "Re:"))
		{
		   list($prefix,$remainder) = split("\(",$posttitle,2);
		   list ($number,$newtitle) = split("\)",$remainder,2);
		   $posttitle = "Re: (". ($number+1) . ") ". $newtitle;
		}
		else {
		  $posttitle = "Re:(1)" . $posttitle;
		}
		//$posttitle = preg_replace('#^(' . preg_quote($vbphrase['reply_prefix'], '#') . '\s*)+#i', '', $posttitle);
		return "$posttitle";
	}
	else
	{
		return '';
	}
}
in newreply.php find:
Code:
$newpost['title'] = $_POST['title'];
Add after:
Code:
	if (!$newpost['title'])
	{
	   $newpost['title'] = $postinfo['title'];
	   $newpost['title']=fetch_quote_title($newpost['title'], $threadinfo['title']);
	}
Done.

Download

No files for download.

Screenshots

 

Similar Mods

"In reply to" Hack (threaded info for linear users) vBulletin 3.0 Full Releases

vblts.ru supports vBulletin®, 2022-2024