Back to vBulletin 4.x Template Modifications

Add "Post Excerpt" to search results
Mod Version: 1.00, by RustedBucket

vB Version: 4.0.0 Rating: (2 votes - 5.00 average) Installs: 13
Released: 08 Jan 2010 Last Update: Never Downloads: 0
Not Supported Template Edits Code Changes Re-usable Code Translations  

This mod is will add a post excerpt to the search results when searching for posts (like it was in VB 3.x).

What do I need to do?
There are two parts to this mod.
  • First step adds the post excerpt to the search_results_postbit template. This will make the excerpt display if you're using the Find All Threads by "User" In User Profile.
    Requires 1 template edit.
  • Second step modifies the Advanced Search to add a check box to select whether or not to show the excerpt when using global search.
    Requires 2 template edits

Installation

PART 1
AdminCP -> Styles & Templates -> Style Manager -> *YOUR STYLE* - I used the Default Style -> Search Templates -> SEARCH _RESULTS_POSTBIT

FIND:
Code:
<vb:if condition="$show['inlinemod']">
<!-- fourth block -->
<label class="threadimod td">
<input type="checkbox" id="post_imod_checkbox_{vb:raw post.postid}" name="imodcheck[{vb:raw post.postid}]" />
</label>
</vb:if>
ADD BELOW:
Code:
<div style="clear:both; border:1px dashed #c4c4c4; padding:10px; margin:10px 5px 5px 5px; background-color:#fefdf2;">
{vb:raw post.pagetext}
</div>
SAVE

* Yes I hardcoded the styling, the assumption being this will get added back to the core.
** If you don't care about having the excerpt show when using the global advanced search you can stop here. Otherwise continue..

PART 2
AdminCP -> Styles & Templates -> Style Manager -> *YOUR STYLE* - I used the Default Style -> Search Templates -> SEARCH_COMMON

FIND:
Code:
	<vb:if condition="$show['nocache']">
	<div class="blockrow">
		<label for="cb_nocache">
			<input type="checkbox" name="nocache" value="1" id="cb_nocache" {vb:raw nocachechecked}/>&nbsp;{vb:rawphrase do_not_use_cached_results}
		</label>
	</div>
	</vb:if>
ADD ABOVE
Code:
	<vb:if condition="!$show['searchthread']">
	<div class="blockrow">
		<label for="cb_postexcerpt">Show post excerpt &nbsp;
			<input type="checkbox" name="showposts" value="1" id="cb_postexcerpt" {vb:raw showpostschecked} />
		</label>	
	</div>
	</vb:if>
SAVE

AdminCP -> Styles & Templates -> Style Manager -> *YOUR STYLE* - I used the Default Style -> Search Templates -> SEARCH_INPUT_POST

FIND:
Code:
	<vb:if condition="$show['nocache']">
	<div class="blockrow">
		<label for="cb_nocache">
			<input type="checkbox" name="nocache" value="1" id="cb_nocache" {vb:raw nocachechecked}/>{vb:rawphrase do_not_use_cached_results}
		</label>
	</div>
	</vb:if>
ADD ABOVE

Code:
	<vb:if condition="!$show['searchthread']">
	<div class="blockrow">
		<label for="cb_postexcerpt">Show post excerpt &nbsp;
			<input type="checkbox" name="showposts" value="1" id="cb_postexcerpt" {vb:raw showpostschecked} />
		</label>	
	</div>
	</vb:if>
SAVE

And that is it - Job Done !

Please click "Installed" and rate this Thread.

Thank You.

Download

No files for download.

Screenshots

Click image for larger version
Name:	post-excerpt1.jpg
Views:	618
Size:	159.7 KB
ID:	109474   Click image for larger version
Name:	post-excerpt2.jpg
Views:	560
Size:	80.4 KB
ID:	109475   Click image for larger version
Name:	post-excerpt3.jpg
Views:	444
Size:	78.7 KB
ID:	109476  


vblts.ru supports vBulletin®, 2022-2024