vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Hot forum topics on forumhome (https://vborg.vbsupport.ru/showthread.php?t=66213)

Zacharicus 06-16-2004 02:43 AM

Hot forum topics on forumhome
 
1 Attachment(s)
I'm running vB3.0.1 and I would love to be able to have hot topic listing like shown on the attached jpg image on my forumhome.

Is this feasible? Is there anything out there similar?

Thanks guys


Zacharicus
www.intelligencenetwork.net
www.mindsofintelligence.com

MindTrix 06-16-2004 05:37 AM

<a href="https://vborg.vbsupport.ru/showthread.php?t=60544&highlight=recent+threads" target="_blank">https://vborg.vbsupport.ru/showt...recent+threads</a>

that one shows the last 10 threads made

rharbison 08-07-2004 07:24 PM

Instead of just showing the last 10 threads made, any way to show the 10 most active, based on number of posts in X days, with X being set by the mod?

aranthorn 08-10-2005 03:35 AM

Well, I modified NTLDR's 'Latest Threads On Forum Home' hack to do it
In Index.php
PHP Code:

// #################### PROCESS LATEST THREADS #######################
// fetch the permissions for each forum
$forumperms = array();

foreach(
$forumcache AS $forum) {

    
$forumperms["$forum[forumid]"] = fetch_permissions($forum['forumid']);

    
// ## HIDE FORUMS WITHOUT THE CANVIEW OR CANVIEWOTHERS PERMISSION ##
    
if (!($forumperms["$forum[forumid]"] & CANVIEW) || !($forumperms["$forum[forumid]"] & CANVIEWOTHERS)) {
        
$limitfids .= ','.$forum['forumid'];
    }
}
unset(
$forum);

if (
$vboptions['threadpreview'] > 0) {
    
$previewfield ', post.pagetext AS preview';
    
$previewjoin 'LEFT JOIN '.TABLE_PREFIX.'post AS post ON(post.postid = thread.firstpostid)';
}
$datecut2 TIMENOW - (7*24*60*60);
$getthreads $DB_site->query("
    ## GET LATEST THREADS ##
    SELECT thread.*,thread.iconid AS threadiconid 
$previewfield
    FROM "
.TABLE_PREFIX."thread AS thread
    LEFT JOIN "
.TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')
    
$previewjoin
    WHERE thread.dateline > 
$datecut2
    AND open = '1'
    AND forumid NOT IN (0
$limitfids)
    AND thread.visible = '1'
    AND deletionlog.primaryid IS NULL
    ORDER BY replycount
    DESC LIMIT 50"
);

while(
$thread $DB_site->fetch_array($getthreads)) {

    
$threads true;
    
$thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 22));
    
$thread['date'] = vbdate($vboptions['dateformat'], $thread['lastpost'], 1);
    
$thread['time'] = vbdate($vboptions['timeformat'], $thread['lastpost']);
    
$thread['preview'] = preg_replace('#\[quote(=(&quot;|"|\'|).*\\2)?\](.*)\[/quote\]#siU'''$thread['preview']);
    
$thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode(fetch_censored_text($thread['preview']), falsetrue), $vboptions['threadpreview']));
    
$thread['replycount'] = vb_number_format($thread['replycount']);
    
$thread['views'] = vb_number_format($thread['views']);

    
// thread icon
    
$show['icon'] = false;
  
$icon fetch_iconinfo($thread['iconid']);

  if (
is_array($icon)) {
      
$show['icon'] = true;
      
$thread['threadiconpath'] = $icon['iconpath'];
      
$thread['threadicontitle'] = $icon['title'];
  }

    
// show goto new post
    
$show['firstnew'] = false;
    
$bbforumview fetch_bbarray_cookie('forum_view'$thread['forumid']);

    if (
$bbforumview $bbuserinfo['lastvisit']) {
        
$lastread $bbforumview;
    } else {
        
$lastread $bbuserinfo['lastvisit'];
    }

    if (
$thread['lastpost'] > $lastread) {

        
$threadview fetch_bbarray_cookie('thread_lastview'$thread['threadid']);

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

    
exec_switch_bg();

    eval(
"\$dungeonbit2 .= \"".fetch_template('dungeonbit_2')."\";");
}
if (
$threads) {
    
$show['latestthreads'] = true;
}
// memory saving
unset($thread$threads);
$DB_site->free_result($getthreads); 

Then made a template called 'dungeonbit_2'
HTML Code:

<div class="smallfont">
        <if condition="$show['firstnew']">
                <a href="showthread.php?$session[sessionurl]threadid=$thread[threadid]&goto=newpost"><img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /></a>
        </if>
        <if condition="$show['icon'] && !$show['firstnew']">
                <img src="$thread[threadiconpath]" border="0" alt="$thread[threadicontitle]" title="$thread[threadicontitle]" style="vertical-align: text-middle" />
        </if>
        <a href="showthread.php?$session[sessionurl]threadid=$thread[threadid]" title="$thread[preview]"><strong>$thread[title]</strong></a>
        </if> <phrase 1="member.php?$session[sessionurl]find=lastposter&threadid=$thread[threadid]" 2="$thread[postusername]">$vbphrase[by_x]</phrase>
</div>

Then just plopped the $dungeonbit2 string on the FORUMHOME template where I wanted it.

PennylessZ28 09-16-2005 03:24 AM

Quote:

Originally Posted by aranthorn
Well, I modified NTLDR's 'Latest Threads On Forum Home' hack to do it
In Index.php
PHP Code:

// #################### PROCESS LATEST THREADS #######################
// fetch the permissions for each forum
$forumperms = array();

foreach(
$forumcache AS $forum) {

    
$forumperms["$forum[forumid]"] = fetch_permissions($forum['forumid']);

    
// ## HIDE FORUMS WITHOUT THE CANVIEW OR CANVIEWOTHERS PERMISSION ##
    
if (!($forumperms["$forum[forumid]"] & CANVIEW) || !($forumperms["$forum[forumid]"] & CANVIEWOTHERS)) {
        
$limitfids .= ','.$forum['forumid'];
    }
}
unset(
$forum);

if (
$vboptions['threadpreview'] > 0) {
    
$previewfield ', post.pagetext AS preview';
    
$previewjoin 'LEFT JOIN '.TABLE_PREFIX.'post AS post ON(post.postid = thread.firstpostid)';
}
$datecut2 TIMENOW - (7*24*60*60);
$getthreads $DB_site->query("
    ## GET LATEST THREADS ##
    SELECT thread.*,thread.iconid AS threadiconid 
$previewfield
    FROM "
.TABLE_PREFIX."thread AS thread
    LEFT JOIN "
.TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')
    
$previewjoin
    WHERE thread.dateline > 
$datecut2
    AND open = '1'
    AND forumid NOT IN (0
$limitfids)
    AND thread.visible = '1'
    AND deletionlog.primaryid IS NULL
    ORDER BY replycount
    DESC LIMIT 50"
);

while(
$thread $DB_site->fetch_array($getthreads)) {

    
$threads true;
    
$thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 22));
    
$thread['date'] = vbdate($vboptions['dateformat'], $thread['lastpost'], 1);
    
$thread['time'] = vbdate($vboptions['timeformat'], $thread['lastpost']);
    
$thread['preview'] = preg_replace('#\[quote(=(&quot;|"|\'|).*\\2)?\](.*)\[/quote\]#siU'''$thread['preview']);
    
$thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode(fetch_censored_text($thread['preview']), falsetrue), $vboptions['threadpreview']));
    
$thread['replycount'] = vb_number_format($thread['replycount']);
    
$thread['views'] = vb_number_format($thread['views']);

    
// thread icon
    
$show['icon'] = false;
  
$icon fetch_iconinfo($thread['iconid']);

  if (
is_array($icon)) {
      
$show['icon'] = true;
      
$thread['threadiconpath'] = $icon['iconpath'];
      
$thread['threadicontitle'] = $icon['title'];
  }

    
// show goto new post
    
$show['firstnew'] = false;
    
$bbforumview fetch_bbarray_cookie('forum_view'$thread['forumid']);

    if (
$bbforumview $bbuserinfo['lastvisit']) {
        
$lastread $bbforumview;
    } else {
        
$lastread $bbuserinfo['lastvisit'];
    }

    if (
$thread['lastpost'] > $lastread) {

        
$threadview fetch_bbarray_cookie('thread_lastview'$thread['threadid']);

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

    
exec_switch_bg();

    eval(
"\$dungeonbit2 .= \"".fetch_template('dungeonbit_2')."\";");
}
if (
$threads) {
    
$show['latestthreads'] = true;
}
// memory saving
unset($thread$threads);
$DB_site->free_result($getthreads); 

Then made a template called 'dungeonbit_2'
HTML Code:

<div class="smallfont">
        <if condition="$show['firstnew']">
                <a href="showthread.php?$session[sessionurl]threadid=$thread[threadid]&goto=newpost"><img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /></a>
        </if>
        <if condition="$show['icon'] && !$show['firstnew']">
                <img src="$thread[threadiconpath]" border="0" alt="$thread[threadicontitle]" title="$thread[threadicontitle]" style="vertical-align: text-middle" />
        </if>
        <a href="showthread.php?$session[sessionurl]threadid=$thread[threadid]" title="$thread[preview]"><strong>$thread[title]</strong></a>
        </if> <phrase 1="member.php?$session[sessionurl]find=lastposter&threadid=$thread[threadid]" 2="$thread[postusername]">$vbphrase[by_x]</phrase>
</div>

Then just plopped the $dungeonbit2 string on the FORUMHOME template where I wanted it.


Not to dig up an old thread, but what if you wanted to do both The Latest Threads, and Hot Threads?


All times are GMT. The time now is 10:03 AM.

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.01292 seconds
  • Memory Usage 1,836KB
  • 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_html_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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