vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Home Enhancements - Latest X Threads on Forum Home (https://vborg.vbsupport.ru/showthread.php?t=159389)

Michael Biddle 01-23-2008 08:26 PM

Yes Onyx you are correct. I have just finished this and will be changing the latest posts one. So if using both, then this one will stay the same, and the other will be different.

fariborz khan 03-05-2008 05:22 AM

this hack is good but i have an idea ... i wish it show 20 last post in 4 step for example in 10 sec. that it show 5 last item then it change to last 5 post from 5--10 and in next 10 sec. it change pae to last 5 post from 10 to 15.
its very good for me becuse i havent meny space in main page.
or it scroll 20 last post in main page
please help me to modifiying it
thanks

drapton 03-09-2008 03:56 AM

HI white mike,

I want you to take a look at my forum...
I want to use your lates thread hack.. but my forum is a bit different. I will PM you the link maybe you can take a look and guide me on how to install it in the sidebar?

Let me know

fariborz khan 03-11-2008 06:36 AM

Quote:

Originally Posted by fariborz khan (Post 1457283)
this hack is good but i have an idea ... i wish it show 20 last post in 4 step for example in 10 sec. that it show 5 last item then it change to last 5 post from 5--10 and in next 10 sec. it change pae to last 5 post from 10 to 15.
its very good for me becuse i havent meny space in main page.
or it scroll 20 last post in main page
please help me to modifiying it
thanks

answer?

Michael Biddle 03-11-2008 02:00 PM

The answer is no. I will not completely change this modification. Sorry.

periphrastic 04-21-2008 07:35 PM

Quote:

Originally Posted by AngelBlue (Post 1371807)
Uninstalled due to threads from private forums showing up in the recent threads list.

this is happening to me as well

i've disabled it

Michael Biddle 04-22-2008 02:02 PM

Why not add them to the excluded forums list? That is what it is for. Also, if they do not have permissions to view it, then it will not show up. It is based on forum permissions.

periphrastic 04-22-2008 06:31 PM

hi whitemike, that's exactly what i did - added the forum ids, separated by commas, to the "excluded" forums. i understand that forum permissions will determine whether or not they can actually see what's inside the threads; however, i'd still rather those who do not have permission to view the forum, at all, to not see the threads.

but i have your latest posts mod. i'll just keep using that one, since the exclusions seem to work more effectively there.

thanks again.

livefreetv 07-01-2008 02:26 AM

Hey whitemikie,

First of all thanx very much for this amazing addon.

I have a question, Can you please tell me that how can i modify this addon to show in sidebar?

Thnx

trigatch4 07-10-2008 02:47 PM

Works on 3.7... is there a way to show the THREAD ICON to the left of each thread?

eviltechie 07-11-2008 12:18 PM

Nice mod! Thx.

I made a couple modifications for my use, and figured I'd share in case anyone else wants to do similar. I wanted to display the latest threads based on the last post instead of the first. So, whenever a new post is made in a thread it jumps to the top of the list...and also displays the author as the most recent poster.

Here's my edited code, it replaces the Main Code plugin which runs on forumhome_start.

PHP Code:

// enable to run this script
if ($vbulletin->options['latest_thread_enabled'])
{
    
$db->hide_errors();
    global 
$vbulletin;

    
// forum permissions
    
$forumpermissions = array();
    foreach(
$vbulletin->forumcache AS $forum)
    {
        
$forumpermissions[$forum["forumid"]] = fetch_permissions($forum['forumid']);
        if ((!(
$forumpermissions[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview'])) OR (!($forum['options'] & $vbulletin->bf_misc_forumoptions['active']) AND !$vbulletin->options['showprivateforums'] AND !in_array($vbulletin->userinfo['usergroupid'], array(5,6,7))))
        {
            
$forumids .= ','.$forum['forumid'];
        }
    }
    if (
$vbulletin->options['latest_thread_exclude']!='')
    {
        
$forumids .= ','.$vbulletin->options['latest_thread_exclude'];
    }
    
$forumids substr($forumids1);
    if (
$forumids!='')
    {
        
$latest_and "thread.forumid NOT IN($forumids)";
        
$latest_and_1 "forum.forumid NOT IN($forumids)";
    }
    
    
// converts options to nice variables
    
$limit $vbulletin->options['latest_thread_number'];
    
    
// query to get the last posts
    
$query $vbulletin->db->query_read("
        SELECT
            thread.forumid as forumid, thread.visible, thread.title as thread_title, thread.threadid as threadid, post.username as username, post.userid as userid, thread.dateline as date,
            forum.title as forum_title,
            post.postid, post.pagetext as pagetext
        FROM " 
TABLE_PREFIX "thread as thread
        LEFT JOIN " 
TABLE_PREFIX "post as post on (thread.lastpostid = post.postid)
        LEFT JOIN " 
TABLE_PREFIX "forum as forum on (thread.forumid = forum.forumid)
        WHERE thread.visible = 1 AND 
$latest_and AND $latest_and_1
        ORDER BY postid DESC
        LIMIT 
$limit"
    
);

    
// reset variables
    
$counter 0;
    
$latest_post_bits '';
    
    while (
$row $vbulletin->db->fetch_array($query))
    {
        
// allow to use alternate color in rows
        
require_once(DIR '/includes/functions.php');
        
exec_switch_bg();
        
        
// strips the bbcode out of the post
        
$row['pagetext'] = strip_bbcode($row['pagetext'], $stripquotes true$fast_and_dirty false$showlinks true);
        
        
// adds the cutoff ... with substr
        
$row['pagetext'] = substr($row['pagetext'], 0$vbulletin->options['latest_thread_cut']) . '...';

        
// convert pagetext to nice looking variable
        
$pagetext $row['pagetext'];
        
$username $row['username'];
        
$userid $row['userid'];
        
$forumid $row['forumid'];
        
$threadid $row['threadid'];
        
$postid $row['postid'];
        
$forumtitle $row['forum_title'];
        
$threadtitle $row['thread_title'];
        
$date vbdate($vbulletin->options['dateformat'], $row['date'], true);
        
$time vbdate($vbulletin->options['timeformat'], $row['date']);
        
        
// increments the counter +1
        
$show['latest_break'] = $counter++;
        
        eval(
'$latest_post_bits .= "' fetch_template('forumhome_latest_thread_bit') . '";');
    }
    
    
// free the query
    
$vbulletin->db->free_result($query);
    
    eval(
'$latest = "' fetch_template('forumhome_latest_thread') . '";');
    
    switch (
$vbulletin->options['latest_thread_location'])
        {
            case 
0$latest_location '$navbar'; break;
            case 
1$latest_location '<!-- main -->'; break;
            case 
2:    $latest_location '<!-- what\'s going on box -->'; break;
        }
    
    if (
$vbulletin->options['latest_thread_auto'])
    {
        
// adds location to forumhome template
        
$vbulletin->templatecache['FORUMHOME'] = str_replace(
            
$latest_location,
            
$latest_location.'$latest',
            
$vbulletin->templatecache['FORUMHOME']
        );
    }




I also modified the template code for forumhome_latest_thread_bit to the following to make the link jump to the latest post when clicked:

PHP Code:

<tr>
    <
td class="$bgclass">
        <
a href="$vboptions[bburl]/showthread.php?$session[sessionurl]t=$threadid&p=$postidclass="smallfont">$threadtitle</a>
        <if 
condition="$vboptions['latest_thread_time']"><span class="smallfont">$date $time</span></if>
        <if 
condition="$vboptions['latest_thread_cut'] != '0'"><div class="smallfont">$pagetext</div></if>
    </
td>
    <
td class="$bgclass">
        <
a href="$vboptions[bburl]/forumdisplay.php?$session[sessionurl]f=$forumidclass="smallfont">$forumtitle</a>
    </
td>
    <
td class="$bgclass">
        <
a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$useridclass="smallfont">$username</a>
    </
td>
</
tr


Seems to be working great thus far! Thanks again.

m4gnus 01-09-2009 12:08 PM

Hi I´m running Latest X Threads on my forum. The forum is in swedish so I Want to translate the column header "Latest 10 Threads" to swedish. I´m a newbe so I dont dare to change anything without asking here first.

My new forum:

Michael Biddle 01-10-2009 04:57 AM

It is a phrase, you can edit it from your admincp

dmknights 02-07-2009 09:16 AM

*Installed*
This works on my board & i have 3.8.1

Michael Biddle 02-09-2009 01:45 AM

Glad everything is working great!

ctfortner 02-12-2009 12:52 PM

I have been using this for a while, works great. One question, how could I set this for members only, not visible to guests? I tried editing the main code plugin with a
Code:

<if condition="!$show['guest']">
, but that didnt work. Not a programmer :)

Michael Biddle 02-12-2009 09:55 PM

To gain support please click install first ;)

ctfortner 02-13-2009 12:18 AM

my bad, installed. Any thoughts?

Michael Biddle 02-13-2009 01:19 AM

You could add that if at the beginning of the forumhome_latest_threads template

ctfortner 02-17-2009 12:20 PM

Hi, thanks for the response. What I did is added <if condition="!$show['guest']"> to the very to of the forumhome_latest_threads template and then added </if> to the very bottom. Is that correct? It did not change anything, still showed for guests.

I also tried putting it all together like this at the very top with no luck

Code:

<if condition="!$show['guest']">
</if>

thanks

ctfortner 02-17-2009 12:33 PM

my apologies, I think I have this figured out. thanks.

Michael Biddle 02-20-2009 12:30 AM

What if you put <if condition="$show['member']"> instead?

Michael Biddle 02-20-2009 12:31 AM

Ah glad you got it sorted. Did not go to next page to see your latest reply.

SuSpect 03-17-2009 12:16 AM

Hi,
How can i show this threads on all pages?

$latest code is working only in forumhome template. Not working in navbar template.

Michael Biddle 03-17-2009 02:55 AM

It will only work on the forumhome template at this time.

CLF 05-21-2009 09:17 PM

INSTALLED!

Thank you so much for this mod! Just what I needed! :)


One question though...

Is it possible to add thread icon before the thread title?
Thanks again!!!

Voted 5* ;)

Michael Biddle 05-22-2009 08:15 PM

I will throw something together tonight for you.

RichieBoy67 06-09-2009 03:25 AM

Is there a 3.8 version of this mod?

Thanks

RichieBoy67 06-09-2009 03:28 AM

Nevermind--I found it...

thanks

carforumsonline 06-24-2009 06:28 AM

I would really like use on my forum. Problem is that I have absolutely no idea where to place it!:confused: Can somebody please tell me how to locate the script, and where to insert in that script....if that's what I need to do that is?

I am also running the latest version of VB, so I presume that I will need to get the latest download, but where from?

Maybe someone could help me out and insert it for me? I could copy the correct script from my board and someone if they were kind enough...could insert what I need in to the right place?

Thanks in advance :)

Michael Biddle 07-01-2009 01:27 AM

Import the xml and set the settings in the vbulletin options. Cannot get any easier.

Driven By Shine 10-16-2009 09:50 AM

I am also wanting to do this aswell, this is a great mod so far and think it will be even better with the below adjustments. Im just not to sure what I need to replace the below code with.

I have installed the mod as it was downloaded so everything should be as normal.

www.paintcorrection.org/forum

Anyhelp would be so good.

Thanks in advance

Chris

Quote:

Originally Posted by eviltechie (Post 1572756)
Nice mod! Thx.

I made a couple modifications for my use, and figured I'd share in case anyone else wants to do similar. I wanted to display the latest threads based on the last post instead of the first. So, whenever a new post is made in a thread it jumps to the top of the list...and also displays the author as the most recent poster.

Here's my edited code, it replaces the Main Code plugin which runs on forumhome_start.

PHP Code:

// enable to run this script
if ($vbulletin->options['latest_thread_enabled'])
{
    
$db->hide_errors();
    global 
$vbulletin;

    
// forum permissions
    
$forumpermissions = array();
    foreach(
$vbulletin->forumcache AS $forum)
    {
        
$forumpermissions[$forum["forumid"]] = fetch_permissions($forum['forumid']);
        if ((!(
$forumpermissions[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview'])) OR (!($forum['options'] & $vbulletin->bf_misc_forumoptions['active']) AND !$vbulletin->options['showprivateforums'] AND !in_array($vbulletin->userinfo['usergroupid'], array(5,6,7))))
        {
            
$forumids .= ','.$forum['forumid'];
        }
    }
    if (
$vbulletin->options['latest_thread_exclude']!='')
    {
        
$forumids .= ','.$vbulletin->options['latest_thread_exclude'];
    }
    
$forumids substr($forumids1);
    if (
$forumids!='')
    {
        
$latest_and "thread.forumid NOT IN($forumids)";
        
$latest_and_1 "forum.forumid NOT IN($forumids)";
    }
    
    
// converts options to nice variables
    
$limit $vbulletin->options['latest_thread_number'];
    
    
// query to get the last posts
    
$query $vbulletin->db->query_read("
        SELECT
            thread.forumid as forumid, thread.visible, thread.title as thread_title, thread.threadid as threadid, post.username as username, post.userid as userid, thread.dateline as date,
            forum.title as forum_title,
            post.postid, post.pagetext as pagetext
        FROM " 
TABLE_PREFIX "thread as thread
        LEFT JOIN " 
TABLE_PREFIX "post as post on (thread.lastpostid = post.postid)
        LEFT JOIN " 
TABLE_PREFIX "forum as forum on (thread.forumid = forum.forumid)
        WHERE thread.visible = 1 AND 
$latest_and AND $latest_and_1
        ORDER BY postid DESC
        LIMIT 
$limit"
    
);

    
// reset variables
    
$counter 0;
    
$latest_post_bits '';
    
    while (
$row $vbulletin->db->fetch_array($query))
    {
        
// allow to use alternate color in rows
        
require_once(DIR '/includes/functions.php');
        
exec_switch_bg();
        
        
// strips the bbcode out of the post
        
$row['pagetext'] = strip_bbcode($row['pagetext'], $stripquotes true$fast_and_dirty false$showlinks true);
        
        
// adds the cutoff ... with substr
        
$row['pagetext'] = substr($row['pagetext'], 0$vbulletin->options['latest_thread_cut']) . '...';

        
// convert pagetext to nice looking variable
        
$pagetext $row['pagetext'];
        
$username $row['username'];
        
$userid $row['userid'];
        
$forumid $row['forumid'];
        
$threadid $row['threadid'];
        
$postid $row['postid'];
        
$forumtitle $row['forum_title'];
        
$threadtitle $row['thread_title'];
        
$date vbdate($vbulletin->options['dateformat'], $row['date'], true);
        
$time vbdate($vbulletin->options['timeformat'], $row['date']);
        
        
// increments the counter +1
        
$show['latest_break'] = $counter++;
        
        eval(
'$latest_post_bits .= "' fetch_template('forumhome_latest_thread_bit') . '";');
    }
    
    
// free the query
    
$vbulletin->db->free_result($query);
    
    eval(
'$latest = "' fetch_template('forumhome_latest_thread') . '";');
    
    switch (
$vbulletin->options['latest_thread_location'])
        {
            case 
0$latest_location '$navbar'; break;
            case 
1$latest_location '<!-- main -->'; break;
            case 
2:    $latest_location '<!-- what\'s going on box -->'; break;
        }
    
    if (
$vbulletin->options['latest_thread_auto'])
    {
        
// adds location to forumhome template
        
$vbulletin->templatecache['FORUMHOME'] = str_replace(
            
$latest_location,
            
$latest_location.'$latest',
            
$vbulletin->templatecache['FORUMHOME']
        );
    }




I also modified the template code for forumhome_latest_thread_bit to the following to make the link jump to the latest post when clicked:

PHP Code:

<tr>
    <
td class="$bgclass">
        <
a href="$vboptions[bburl]/showthread.php?$session[sessionurl]t=$threadid&p=$postidclass="smallfont">$threadtitle</a>
        <if 
condition="$vboptions['latest_thread_time']"><span class="smallfont">$date $time</span></if>
        <if 
condition="$vboptions['latest_thread_cut'] != '0'"><div class="smallfont">$pagetext</div></if>
    </
td>
    <
td class="$bgclass">
        <
a href="$vboptions[bburl]/forumdisplay.php?$session[sessionurl]f=$forumidclass="smallfont">$forumtitle</a>
    </
td>
    <
td class="$bgclass">
        <
a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$useridclass="smallfont">$username</a>
    </
td>
</
tr


Seems to be working great thus far! Thanks again.


Driven By Shine 10-16-2009 11:23 AM

Yeah for me I have made it work. Im very new at this and can follow instructions but really am flying blind when it comes to the code stuff.

One more question I now have 2 little tr>tr> on top of my latest thread box. and I cant find what I did to put them there. Any ideas.

http://www.paintcorrection.org/forum/index.php

Thanks again, ill keep checking the codes i inserted but if you can think of anything it would be really great.

Chris

Driven By Shine 10-16-2009 11:41 AM

Amazing, I found it.....was 2 spaces at the end of the code. WOW had no idea what was involved in all this.

Thank you to everyones hard work to make these mods available to people like me.

Thanks again

Chris

Michael Biddle 10-16-2009 09:29 PM

Glad you got it all sorted. Enjoy!

Driven By Shine 10-22-2009 09:44 AM

Michael,

this has been working very well and I am liking it heaps. So thank you again.

I was wondering is there is a way to change the wording of "Author" in the far right row.

I understand it probably wasnt needed originally but I have used the code above so that it displays the last poster of the latest thread. So author is kinda wrong now.

I would like it to say last poster or something like that.

Thanks again for all your hard work.

Chris

im using it here if you need to see what ive done but go easy on me its my first every attempt at anything like this
www.paintcorrection.org/forum

Michael Biddle 10-24-2009 05:10 AM

I made it a phrase. Search for Author in the phrases.

Driven By Shine 10-24-2009 08:15 AM

Quote:

Originally Posted by Michael Biddle (Post 1905468)
I made it a phrase. Search for Author in the phrases.

WOW Thanks for the super quick ammendment. Your a champ.

Although I not sure where to find the phrases, Ill have a search for it. I am but a humble car detailer, far from a IT guru, but I manage to fumble my way through. Ill let you know how I go.

Many Thanks again

Chris:)

Driven By Shine 10-24-2009 08:24 AM

I found it...... theres a phrase manager, who would have thought. LOL

Thanks again Michael, you have now idea how happy I am.

Chris

Michael Biddle 10-25-2009 07:29 AM

Glad it all worked out for you.


All times are GMT. The time now is 01:02 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.01576 seconds
  • Memory Usage 1,946KB
  • 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
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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