vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Miscellaneous Hacks - Widget/General Search Template Modification - Recent Posts (https://vborg.vbsupport.ru/showthread.php?t=236236)

sqzdog 02-17-2010 10:00 PM

Widget/General Search Template Modification - Recent Posts
 
1 Attachment(s)
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.

Juggernaut 02-19-2010 11:11 PM

I liked your modification, and I think my widget looks better now :D

sqzdog 02-19-2010 11:33 PM

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!

Steverd 02-26-2010 08:47 PM

Installed and looks 100x BETTER!!!

Thanks,
Steve

dankreiner 07-10-2010 02:22 AM

not working for me in 4.04, any updates?


All times are GMT. The time now is 01:05 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.01057 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete