Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

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
  #12  
Old 01-24-2011, 12:37 AM
Welshy2008's Avatar
Welshy2008 Welshy2008 is offline
 
Join Date: Jul 2008
Location: UK
Posts: 904
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not working on 4.0.7

Please update.
Reply With Quote
Reply


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:52 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.03765 seconds
  • Memory Usage 2,235KB
  • Queries Executed 17 (?)
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
  • (6)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
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (3)postbit_attachment
  • (2)postbit_onlinestatus
  • (2)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