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)
-   -   Forum Display Enhancements - Thread title leads to new (unread) posts like Xenforo does, instead to the first post (https://vborg.vbsupport.ru/showthread.php?t=281497)

Alan_SP 04-12-2012 10:00 PM

Thread title leads to new (unread) posts like Xenforo does, instead to the first post
 
1 Attachment(s)
We now have situtation where we have small image (https://vborg.vbsupport.ru/images/cs...s/firstnew.gif - 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:

http://img163.imageshack.us/img163/4883/image002gt.png

Version 2.10:

You need to edit template threadbit.

After some thinking I realized that using image https://vborg.vbsupport.ru/images/cs...s/firstnew.gif 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:

http://img856.imageshack.us/img856/3466/image003ff.png

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

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 https://vborg.vbsupport.ru/images/cs...s/firstnew.gif, 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 (https://vborg.vbsupport.ru/images/cs...s/firstnew.gif) 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:

SaN-DeeP 05-04-2015 07:06 PM

Thanks always saw this stuff on some of my regular sites..
Probably some of biggest vbulletin sites..

Alan_SP 05-07-2015 04:35 PM

Yes, this seem way more logical to use thread titles for finding unread posts and not trying to hit little image in front of it.

broncoshq 02-27-2016 02:08 AM

Guys I'm having a bit of trouble with this, and I can't understand why.

I have set it up so users have the choice via their profile, using VB:IF to alternate between the original code, and the one listed here.

It works perfectly, unless the user is in a special permission group forum.

It's obviously a pain to test, because I need to be on when there are plenty of people posting.

Really appreciate any help.

Alan_SP 02-27-2016 04:37 PM

You can create test user with same permissions, log as that test user in one browser and test, while monitoring with other browser where you're logged as admin. I always have test user created and just change permissions depending on what I need to test.

Also, it would be interesting to see what code you're actually using to achieve this.

broncoshq 02-28-2016 06:26 AM

It seems to not be special forums as I thought earlier. It seems random as to whether it loads the last unread or the last. However, it certainly works more times than it doesn't, and not always on the same thread.

Code:

Code:

<vb:if condition="$bbuserinfo['field25'] == 'OFF'">


<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>




                    <vb:else />
                   

                    <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>

                                    </vb:if>


Alan_SP 02-28-2016 01:12 PM

Last unread post is last post if there aren't new posts in thread. If it acts randomly, it may be problem in the way your forum tracks what is last read post. You have option to select the way it is tracked.

Changed code (what I changed) just points to what vB thinks is last unread post that also could be last post of thread, nothing else.

I'd check this.

broncoshq 02-28-2016 11:13 PM

Where is this option available to look at?

I'm aware of what the change does, and how it should work. It just seems odd to me that this would be acting like this.

If I could see some options, that would be good.

Alan_SP 02-29-2016 12:35 PM

Yes, you go to ACP->Settings->Options->General Settings->Thread/Forum Read Marking Type

I'm using last option: Database (automatic forum marking)

JesWhite 03-02-2016 12:06 PM

is there any pic ?

i didnt understand...


All times are GMT. The time now is 09:57 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.01136 seconds
  • Memory Usage 1,762KB
  • 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
  • (11)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete