Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
Widget/General Search Template Modification - Recent Posts Details »»
Widget/General Search Template Modification - Recent Posts
Version: 1.00, by sqzdog sqzdog is offline
Developer Last Online: Sep 2011 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.0.2 Rating:
Released: 02-17-2010 Last Update: Never Installs: 9
Template Edits
Re-useable Code  
No support by the author.

When displaying recent posts from the forum in your CMS, the title of the post is below the text of the post. To me, that just didn't look right.

So, I created a new template and named it vbcms_searchresult_post_toptitle and this puts the title above the content of the forum post. This is the only difference between the stock template and my template.

First, create the new template:

Go to: Style Manager

Select: Add New Template

Title: vbcms_searchresult_post_toptitle

Template:

Code:
<div class="cms_widget_post_bit">
<vb:if condition="post.posttitle">
	<h4 class="cms_widget_post_header">
	  <a href="showthread.php?{vb:raw session.sessionurl}t={vb:raw post.threadid}">{vb:raw post.threadtitle}</a>
	</h4>
	</vb:if>
	<p class="cms_widget_post_content">{vb:raw post.pagetext} <a href="showthread.php?{vb:raw session.sessionurl}p={vb:raw post.postid}#post{vb:raw post.postid}"><img src="{vb:stylevar imgdir_button}/lastpost-{vb:stylevar right}.png" alt="{vb:rawphrase go_to_last_post}" /></a></p>

	<div class="meta">
		<div class="cms_widget_post_userinfo"><a href="{vb:link member, {vb:raw userinfo}}">{vb:raw post.postuserid}{vb:raw post.username}</a> {vb:rawphrase on} {vb:date {vb:raw post.postdateline}, {vb:raw dateformat}}</div>
	</div>

	<vb:comment>
	<div class="cms_widget_views">{vb:raw post.replycount}&nbsp;{vb:rawphrase replies}</div>
	</vb:comment>
</div>
Click "SAVE" and you are done.

Now, just create your widget using the "general search" widget and configure it using the template name: vbcms_searchresult_post_toptitle

SCREENSHOTS:

The first screen shot is the stock template

The second screen shot is the new template.

Screenshots

File Type: jpg old.jpg (40.7 KB, 0 views)
File Type: jpg new.jpg (40.7 KB, 0 views)

Show Your Support

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

Comments
  #2  
Old 02-19-2010, 11:11 PM
Juggernaut Juggernaut is offline
 
Join Date: Dec 2009
Location: California
Posts: 589
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I liked your modification, and I think my widget looks better now
Reply With Quote
  #3  
Old 02-19-2010, 11:33 PM
sqzdog sqzdog is offline
 
Join Date: Apr 2005
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you. It was my first ever mod and just involved moving the code closer to the top of the template. I'm still pleased that it didn't crash my site!
Reply With Quote
  #4  
Old 02-26-2010, 08:47 PM
Steverd Steverd is offline
 
Join Date: Sep 2009
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and looks 100x BETTER!!!

Thanks,
Steve
Reply With Quote
  #5  
Old 07-10-2010, 02:22 AM
dankreiner dankreiner is offline
 
Join Date: Jun 2009
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not working for me in 4.04, any updates?
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 04:53 PM.


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.03654 seconds
  • Memory Usage 2,251KB
  • Queries Executed 19 (?)
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
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (2)postbit_attachment
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete