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

Reply
 
Thread Tools
Thread title leads to new (unread) posts like Xenforo does, instead to the first post Details »»
Thread title leads to new (unread) posts like Xenforo does, instead to the first post
Version: 2.10, by Alan_SP Alan_SP is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 4.x.x Rating:
Released: 04-12-2012 Last Update: Never Installs: 16
Template Edits
Re-useable Code  
No support by the author.

We now have situtation where we have small image ( - Here I'm using image from vBorg, not image that's used in your forums) that leads us to first unread post in thread and the whole big thread title leads us to first post of thread. This is not the happiest solution in my opinion and I also heard that Xenforo uses thread title to lead you to first unread post.

I'm talking about this:



Version 2.10:

You need to edit template threadbit.

After some thinking I realized that using image is totally unnecessary, as thread title is enough for good UI. If thread has more than one page, we could always use page numbers available under thread title.

So, to remove image completely find this code and remove it:

HTML Code:
                                       <vb:if condition="$show['gotonewpost']"><a href="{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_newpost}, 'threadid', 'threadtitle'}" id="thread_gotonew_{vb:raw thread.realthreadid}"><img class="gotonewpost" src="{vb:stylevar imgdir_button}/firstnew.png" alt="{vb:rawphrase go_to_first_new_post}" /></a>
					</vb:if>
And, to make thread title function like it always should have, go and make this change:

Find:

HTML Code:
<a class="title<vb:if condition="$show['gotonewpost']"> threadtitle_unread</vb:if>" href="{vb:link thread, {vb:raw thread}, {vb:raw pageinfo}, 'threadid', 'threadtitle'}" id="thread_title_{vb:raw thread.realthreadid}">{vb:raw thread.threadtitle}</a>
Replace it with:

HTML Code:
<a class="title<vb:if condition="$show['gotonewpost']"> threadtitle_unread</vb:if>" href="{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_newpost}, 'threadid', 'threadtitle'}" id="thread_title_{vb:raw thread.realthreadid}">{vb:raw thread.threadtitle}</a>
Now thread title leads to first new post if there's a one, or leads to a last post. If there's more than one page, we could use page numbers below, like shown on this picture:



---------------------------------------

Fixed in version 2.10:
We need to use same id to be able to edit thread title by double click next to thread title. If we exchange id with image's id, then double click doesn't enable us to edit thread title.

In code above change is already made, and changed is this:

from
HTML Code:
id="thread_gotonew_{vb:raw thread.realthreadid}"
back to (that's original id)
HTML Code:
id="thread_title_{vb:raw thread.realthreadid}"
For some who maybe would like to use image , I'll leave version 1.00 below, but I corrected id error (i.e. id stays same).
---------------------------------------------------
Version 1.00:
Anyway, if you want that thread title leads to new (unread) post, and small image () leads to first post of the thread, it's relatively simple template edit.

You need to edit template threadbit.

Find this code:

HTML Code:
<vb:if condition="$show['gotonewpost']"><a href="{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_newpost}, 'threadid', 'threadtitle'}" id="thread_gotonew_{vb:raw thread.realthreadid}"><img class="gotonewpost" src="{vb:stylevar imgdir_button}/firstnew.png" alt="{vb:rawphrase go_to_first_new_post}" /></a>
Replace it with this code:

HTML Code:
<vb:if condition="$show['gotonewpost']"><a href="{vb:link thread, {vb:raw thread}, {vb:raw pageinfo}, 'threadid', 'threadtitle'}" id="thread_gotonew_{vb:raw thread.realthreadid}"><img class="gotonewpost" src="{vb:stylevar imgdir_button}/firstnew.png" alt="{vb:rawphrase go_to_first_new_post}" /></a>
This code makes little image leads you to the first post of thread, not as before to first unread post.

But, this image appears only if there are new posts in thread, so to make this image appear all the time, you need to remove this if statment in front of code:

HTML Code:
<vb:if condition="$show['gotonewpost']">
Don't forget to remove closing if statment:

HTML Code:
</vb:if>
Now you'll always have link that leads to first post of thread. This may be important to you because thread title (if you apply this template modification) leads to last post in thread if there are no new posts.

Second, more important change as it changes where thread title leads is this:

Find:

HTML Code:
<a class="title<vb:if condition="$show['gotonewpost']"> threadtitle_unread</vb:if>" href="{vb:link thread, {vb:raw thread}, {vb:raw pageinfo}, 'threadid', 'threadtitle'}" id="thread_title_{vb:raw thread.realthreadid}">{vb:raw thread.threadtitle}</a>
Replace it with:

HTML Code:
<a class="title<vb:if condition="$show['gotonewpost']"> threadtitle_unread</vb:if>" href="{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_newpost}, 'threadid', 'threadtitle'}" id="thread_title_{vb:raw thread.realthreadid}">{vb:raw thread.threadtitle}</a>
Now, when you and your users click on thread title it leads them to first unread post in the thread (or last, if there are no new posts) and if they click on icon, it leads them to the first post of thread.

You can also completely remove icon (by removing code, and not just replacing it), if you want that users go only to first unread post (or last, if there are no new posts in thread). But, if you want to keep icon (which I personally prefer, to go to first post in thread easily), I suggest that you also change phrase go_to_first_new_post, as icon now leads to first post, not first new post.

To explain what I did, I exchanged link (href) info between the two (icon and thread title), so you could fairly easy make template change even if this particular code changes with future versions of vBulletin.

Hope you'll find this useful. :up:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
5 благодарности(ей) от:
postcd, rollingzone, SaN-DeeP, Sunka, z3r0

Comments
  #12  
Old 03-02-2016, 01:37 PM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Images were deleted from imageshack.

Basicall, you loose image of arrow (shown in the first post of the read and you can see it here on vBorg) before thread title that lead to first unread post (or last post of the thread, depending on thread read status). You have only thread title as a link and it has function that arrow image does.

If you ever was on any Xenforo site, you know how links work there. This makes vBulletin site works in that way also. Which is more logical in my opinion, I hate when I need to target small image when I have large thread title.
Reply With Quote
  #13  
Old 09-19-2016, 05:46 PM
mtlurb mtlurb is offline
 
Join Date: Sep 2010
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello I am unable to implement this as the instructions are not too clear.

I tried but couldn't make it work.

Can the OP please do a step by step instruction instead of what we have right now?
Reply With Quote
  #14  
Old 09-21-2016, 10:17 PM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I admit I made a bit of a mess leaving old version on, for people with different tastes to choose from.

Now I made small change, describing which template to edit (threadbit) at the beginning.

After that, just remove code that removes arrow (first code) and find code you need to change into given code (second and third code). That's it.
Reply With Quote
  #15  
Old 10-27-2016, 09:34 AM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is very good for the user but are there any negative effects on seo?
Reply With Quote
  #16  
Old 10-27-2016, 06:04 PM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't tell. But I guess if it works for Xenforo, it should work in the same way for vBulletin.
Reply With Quote
  #17  
Old 12-19-2016, 11:40 PM
Leebo89122 Leebo89122 is offline
 
Join Date: Jun 2014
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this only work on threads inside of subforums or does it also work on searches such as "New Posts???"
Reply With Quote
  #18  
Old 01-10-2017, 12:48 AM
Leebo89122 Leebo89122 is offline
 
Join Date: Jun 2014
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Leebo89122 View Post
Does this only work on threads inside of subforums or does it also work on searches such as "New Posts???"
Found it......
If you look for the same phrases in the Search_threadbit you can make the same changes inside of searches such as "New Posts" and such.
Reply With Quote
2 благодарности(ей) от:
Alan_SP, Kane@airrifle
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 01:01 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04817 seconds
  • Memory Usage 2,316KB
  • Queries Executed 23 (?)
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
  • (11)bbcode_html
  • (1)bbcode_quote
  • (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
  • (8)post_thanks_box
  • (7)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete