Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
Add "Post Excerpt" to search results Details »»
Add "Post Excerpt" to search results
Version: 1.00, by RustedBucket RustedBucket is offline
Developer Last Online: Sep 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.0.0 Rating:
Released: 01-07-2010 Last Update: Never Installs: 13
Template Edits
Re-useable Code Code Changes Translations  
No support by the author.

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.

Screenshots

File Type: jpg post-excerpt1.jpg (159.7 KB, 0 views)
File Type: jpg post-excerpt2.jpg (80.4 KB, 0 views)
File Type: jpg post-excerpt3.jpg (78.7 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-08-2010, 02:07 PM
RustedBucket RustedBucket is offline
 
Join Date: Nov 2004
Location: Albemarle, NC
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reserved
Reply With Quote
  #3  
Old 02-26-2010, 12:04 PM
baghdad4ever baghdad4ever is offline
 
Join Date: Apr 2007
Location: baghdad
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you verymuch
Reply With Quote
  #4  
Old 02-27-2010, 10:31 AM
baghdad4ever baghdad4ever is offline
 
Join Date: Apr 2007
Location: baghdad
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it is working with 4.0.2 pl1

http://www.baghdad4ever.net/dros/vbulletin4/search6.JPG
Reply With Quote
  #5  
Old 03-29-2010, 10:00 AM
Addams Addams is offline
 
Join Date: Jul 2009
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Aw, thanks! This is really useful ^^

How can I made it checked by default? Thanks!

Sorry for my english.
Reply With Quote
  #6  
Old 03-31-2010, 06:45 PM
sKippah sKippah is offline
 
Join Date: Oct 2008
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Absolutly nice. Tagged

Is there a way to get this also for 2 languages? I am running a german/english board, and it would be nice if the sentence "Show post excerpt" changes, when someone is changing the board language. Thanks a lot
Reply With Quote
  #7  
Old 05-11-2010, 10:33 AM
Muniesa Muniesa is offline
 
Join Date: Apr 2010
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the mod. Not as streamline as in vb3, but for a user mod it's great work!

For those interested in making the search tick the box by default, just insert

Code:
 checked="checked"
anywhere in the input type tag in steps 2 & 3.

E.g. I wrote had it as:

Code:
<input type="checkbox" name="showposts" checked="checked" 
     value="1" id="cb_postexcerpt" {vb:raw showpostschecked} />
Reply With Quote
  #8  
Old 06-11-2010, 11:51 AM
Welshy2008's Avatar
Welshy2008 Welshy2008 is offline
 
Join Date: Jul 2008
Location: UK
Posts: 904
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and working well on vB4.0.3 PL1 - Thank You.
Reply With Quote
  #9  
Old 08-17-2010, 12:09 PM
Welshy2008's Avatar
Welshy2008 Welshy2008 is offline
 
Join Date: Jul 2008
Location: UK
Posts: 904
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this confirmed as woring on vB4.0.5 and 4.0.6, Please?
Reply With Quote
  #10  
Old 09-24-2010, 07:44 AM
Welshy2008's Avatar
Welshy2008 Welshy2008 is offline
 
Join Date: Jul 2008
Location: UK
Posts: 904
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Didn't work on my 4.0.6.

By The way, in vB4.0.6 the following codes are replaced with the code shown underneath...


OP's original code in: (SEARCH _RESULTS_POSTBIT)

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>
In 4.0.6 it's replaced with:

Code:
			<vb:if condition="$show['inlinemod']">
			<span class="nodecontrols">
				<input type="checkbox" id="post_imod_checkbox_{vb:raw post.postid}" name="imodcheck[{vb:raw post.postid}]" />
			</span>
			</label>
			</vb:if>
OP's Original code in: (SEARCH_COMMON)

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>
In 4.0.6 it's replaced with:

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

OP's original code in: (SEARCH_INPUT_POST)


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>
In 4.0.6 it's replaced with:

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:54 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04385 seconds
  • Memory Usage 2,326KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (14)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (3)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete