vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Having a recent/latest replies block (https://vborg.vbsupport.ru/showthread.php?t=315693)

^SuiCyde^ 11-28-2014 10:32 PM

Having a recent/latest replies block
 
Hi, I'm looking for a block on the right-hand side of the forum showing the latest replies posted.

I've been using the VietBB Sidebar Column, but this only shows Latest Threads, where it organises the list by most recently replied to, and displays the thread title, but unfortunately the link is to the thread itself (not the post just made in it) and the thread starter is also shown instead of the last poster.

The best I've been able to is add another link below with &goto=newpost

But what I'm looking for is a link to the last post, and to display the username of that post.

Here's what I've got so far:

Code:

<tr>
    <td class="$class">
        <div class="smallfont"><a href="showthread.php?$session[sessionurl]t=$+++++++_sclt[threadid]"><strong>$+++++++_sclt[title]</strong></a></div>
<div class="smallfont"><a href="showthread.php?$session[sessionurl]t=$+++++++_sclt[threadid]&goto=newpost"><img src="/images/theme/buttons/firstnew.gif" alt="Go To First Unread Reply"></a>- $vbphrase[sclt_by] <a href="member.php?$session[sessionurl]u=$+++++++_sclt[postuserid]">$+++++++_sclt[postusername]</a></div>
    </td>
</tr>


https://vborg.vbsupport.ru/external/2014/11/4.png

So if you can imagine, I'd like to replace $+++++++_sclt[postusername] with whatever variable calls up the name of the very last poster in the thread, and also be able to link to that post instead of the first unread one.

Is there an easy way to accomplish this?

Thanks!

(And why can't I post the variable in this thread, is it filtered as a swear word or something? Even without the $ sigh it's still censored.)

blind-eddie 11-29-2014 12:58 AM

Do you use vbadvanced? If so, you can achieve what you are after with ease on your forum pages or you can use the following.

Code:

<tr>
<td class="$bgclass">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
<tr>
        <td class="alt1" style="text-align:justify">
<script type="text/javascript" src="external.php?type=js"></script> <script language="" type="text/javascript"> <!--
                for (var x in threads)
                {
                document.writeln("<a href=\"showthread.php?t="+threads[x].threadid+"&goto=newpost\"><img class=\"inlineimg\" src=\"$stylevar[imgdir_button]/lastpost.gif\" alt=\"$vbphrase[go_to_last_post]\" border=\"0\" /></a> <a href=\"showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> <br />");
                }
                //--> </script> </td>
</tr>
</table>
</td>
</tr>


^SuiCyde^ 11-29-2014 07:35 PM

Thanks for your reply.

Where would I paste that code? I tried putting into the Latest Threads block in Edit Templates but it doesn't show up, and the whole block disappears.

I just installed vBadvanced CMPS. If this way is easier, can you show me how to implement it there?

blind-eddie 11-30-2014 01:02 AM

Visit this link, scroll down on left, you will see side column created by vbadvanced and integrated on the forum home or on any other page you wish.

To learn how to integrate vba within your vbulletin pages, please visit this page to learn more.
After learning this, you wont be using VietBB Sidebar Column ever again.

Also, I edited my post above with proper code to show linked latest post as well as thread name.


All times are GMT. The time now is 03:31 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.03673 seconds
  • Memory Usage 1,724KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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