vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Add-On Modules & Modifications

 
 
Thread Tools Display Modes
  #1  
Old 02-16-2005, 02:00 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Latest Topics - Combine "Show New Posts" with "Goto New Post"

Here's a simple modification that combines the ability to let users know when there are new posts and to quickly get to them.

Basically, what this does is cause threads with new posts to be displayed in bold. When a thread has new posts clicking the thread title will take the use to the new posts. If the thread is not in bold then clicking the title will take the user to the first post in the thread. While I'm not normally an advocate of using different behaviors when clicking the "same" thing this one seems pretty intuitive.

See the screen shots for more information.

In the adv_portal_latesttopicbits template find
Code:
            <span class="smallfont"><strong><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" title="<if condition="$thread[preview]">$thread[preview]

</if>$vbphrase[by] $thread[postusername] <if condition="$vba_options['portal_threads_showdate']">$thread[postdate] $thread[posttime]</if>">$thread[title]</a></strong></span>
Replace with
Code:
            <span class="smallfont"><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]<if condition="$show['gotonewpost']">&amp;goto=newpost</if>" title="<if condition="$thread[preview]">$thread[preview]

</if>$vbphrase[by] $thread[postusername] <if condition="$vba_options['portal_threads_showdate']">$thread[postdate] $thread[posttime]</if>"><if condition="$show['gotonewpost']"><strong>$thread[title]</strong><else />$thread[title]</if></a></span>
I found is necssary to modify the latesttopics.php module in order to get $show['gotonewpost'] to work reliably. Not sure what the issue was but this works and is a very easy change to make.

In the latesttopics module find
Code:
                $thread = process_thread_array($thread, '', $vba_options['portal_threads_showicon']);

                $getbgrow = exec_switch_bg();
Replace with
Code:
                $thread = process_thread_array($thread, '', $vba_options['portal_threads_showicon']);

                // show new posts in thread
                $show['gotonewpost'] = false;
                $lastread = $bbuserinfo['lastvisit'];
                if ($thread['lastpost'] > $lastread)
                {
                        $threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']);

                        if ($thread['lastpost'] > $threadview)
                        {
                                $show['gotonewpost'] = true;
                        }
                }

                $getbgrow = exec_switch_bg();
Attached Images
File Type: jpg lft-before.jpg (10.9 KB, 119 views)
File Type: jpg lft-after.jpg (11.3 KB, 104 views)
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
  #2  
Old 08-08-2005, 03:31 AM
buurman buurman is offline
Junior Member
 
Join Date: Jan 2005
Posts: 21
Default Re: Latest Topics - Combine "Show New Posts" with "Goto New Post"

Did the above, but still aint getting bold titles in my latest posts..


To bad, would really like to have those.. its simply a must have...
  #3  
Old 08-08-2005, 10:10 AM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
Default Re: Latest Topics - Combine "Show New Posts" with "Goto New Post"

Tom, nice idea.
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Organize "latest forum topics" by date of thread creation (rather than last post) Noah Troubleshooting / "How do I..." Questions 3 12-26-2004 12:28 PM
Signature Updates all "old" and "New" posts? boo Chit Chat 2 12-04-2004 05:38 PM
Problem with "Latest Topics from specific forum" module Bergman Troubleshooting / "How do I..." Questions 1 11-15-2004 03:53 PM


All times are GMT -4. The time now is 02:01 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.