Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Latest X Threads on Forum Home Details »»
Latest X Threads on Forum Home
Version: 1.2, by Michael Biddle Michael Biddle is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 3.6.x Rating:
Released: 10-02-2007 Last Update: 03-26-2009 Installs: 124
Supported Uses Plugins Template Edits
 

Latest X Threads on Forum Index
by: whitemike
Demo: Here

What this does?

This will add the latest x posts onto your forum index

Features?
  1. Enable/Disable - Master Switch to Turn Latest Posts on or off
  2. Title - Change the title of the Site News
  3. Posts to Show - Number of Last Posts to show
  4. Cutoff Length - How many characters to show before the ... at the end
  5. Exclude Forums - Choose what forums you do not want to be listed
  6. Thread Title Width - Width of Title Table
  7. User Title Width - Width of User Table
  8. Forum Title Width - Width of Forum Table
  9. Auto Location - Enable/Disable auto location
  10. Location - Gives Options for Under navbar, above forum, or below forum
  11. Date & Time - Enable/Disable the time and date from being shown
Added?
  1. 2 Template
  2. 3 Plugins
  3. 11 Settings
  4. 29 Phrases
Installation?
  1. Import Product
Thats It!

Releases

1.1 - Fixed Moderated thread bug
1.0 - Initial release
Please Click Install if you use

For Latest X Posts on Forum Home CLICK HERE

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #72  
Old 07-01-2009, 01:27 AM
Michael Biddle Michael Biddle is offline
 
Join Date: Apr 2004
Location: Anaheim, CA
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Import the xml and set the settings in the vbulletin options. Cannot get any easier.
Reply With Quote
  #73  
Old 10-16-2009, 09:50 AM
Driven By Shine Driven By Shine is offline
 
Join Date: Oct 2009
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
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.
Reply With Quote
  #74  
Old 10-16-2009, 11:23 AM
Driven By Shine Driven By Shine is offline
 
Join Date: Oct 2009
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #75  
Old 10-16-2009, 11:41 AM
Driven By Shine Driven By Shine is offline
 
Join Date: Oct 2009
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #76  
Old 10-16-2009, 09:29 PM
Michael Biddle Michael Biddle is offline
 
Join Date: Apr 2004
Location: Anaheim, CA
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you got it all sorted. Enjoy!
Reply With Quote
  #77  
Old 10-22-2009, 09:44 AM
Driven By Shine Driven By Shine is offline
 
Join Date: Oct 2009
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #78  
Old 10-24-2009, 05:10 AM
Michael Biddle Michael Biddle is offline
 
Join Date: Apr 2004
Location: Anaheim, CA
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I made it a phrase. Search for Author in the phrases.
Reply With Quote
  #79  
Old 10-24-2009, 08:15 AM
Driven By Shine Driven By Shine is offline
 
Join Date: Oct 2009
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Michael Biddle View Post
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
Reply With Quote
  #80  
Old 10-24-2009, 08:24 AM
Driven By Shine Driven By Shine is offline
 
Join Date: Oct 2009
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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

Chris
Reply With Quote
  #81  
Old 10-25-2009, 07:29 AM
Michael Biddle Michael Biddle is offline
 
Join Date: Apr 2004
Location: Anaheim, CA
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad it all worked out for you.
Reply With Quote
Reply


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 05:08 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.04781 seconds
  • Memory Usage 2,364KB
  • Queries Executed 25 (?)
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
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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