vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Recent post/threads mod help (https://vborg.vbsupport.ru/showthread.php?t=136092)

s0b 01-10-2007 11:59 AM

Recent post/threads mod help
 
I im doing a mod based in this mod of Zachariah.

That will allow me to show a list of the last 10 posts and threads in the forumhome but... it dont works fine.

The code gets the last threads fine, but in the last posts only repeat the results of the threads. Here is the code:

Code:

// last XX posts + threads in UserCP by tnguy3n
global $vbulletin;

// get last XX threads
$lastthreads = $vbulletin->db->query_read("
        SELECT thread.threadid, thread.lastpost, thread.title AS threadtitle, thread.forumid, thread.replycount, thread.lastposter, thread.dateline, thread.views, forum.forumid, forum.title AS forumtitle, user.userid, user.username
        FROM " . TABLE_PREFIX . "thread AS thread
        LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON(thread.forumid = forum.forumid)
        AND thread.visible = 1
        ORDER BY thread.dateline DESC
        LIMIT 0, 10
");
while($lastthread = $vbulletin->db->fetch_array($lastthreads))
{
        $threadtitle = $lastthread['threadtitle'];
        $forumtitle = $lastthread['forumtitle'];
        $forumid = $lastthread['forumid'];
        $dateline = vbdate($vbulletin->options['dateformat'], $lastthread['dateline']);
        $replies = vb_number_format($lastthread['replycount']);
        $views = vb_number_format($lastthread['views']);
        $lastposter = $lastthread['lastposter'];
        $lastpost = vbdate($vbulletin->options['dateformat'], $lastthread['lastpost']);
        // eval('$lastthreadsbit .= "' . fetch_template('forumhome_lastthreadsbit') . '";');
eval("\$lastthreadsbit .= \"".fetch_template('forumhome_lastthreadsbit')."\";");
}
eval('$showlastthreads .= "' . fetch_template('forumhome_lastthreads') . '";');
$db->free_result($lastthreads);

// get last XX posts
$lastposts = $vbulletin->db->query_read("
        SELECT thread.threadid, thread.title AS threadtitle, thread.forumid, thread.replycount, thread.postusername, thread.postuserid, thread.dateline AS threaddate, thread.views, thread.visible, post.threadid, post.username, post.userid, post.dateline AS lastpostdate, forum.forumid, forum.title AS forumtitle
        FROM " . TABLE_PREFIX . "post AS post
        LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON(thread.threadid = post.threadid)
        LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON(forum.forumid = thread.forumid)
        AND thread.visible = 1
        GROUP BY thread.threadid
        ORDER BY lastpostdate DESC
        LIMIT 0, 10
");
while($lastpost = $vbulletin->db->fetch_array($lastposts))
{
        $threadtitle = $lastpost['threadtitle'];
        $forumtitle = $lastpost['forumtitle'];
        $lastpostedate = vbdate($vbulletin->options['dateformat'], $lastpost['lastpostdate']);
        $replies = vb_number_format($lastpost['replycount']);
        $views = vb_number_format($lastpost['views']);
        $threadby = $lastpost['postusername'];
        $threaddate = vbdate($vbulletin->options['dateformat'], $lastpost['threaddate']);
        eval('$lastpostsbit .= "' . fetch_template('forumhome_lastpostsbit') . '";');
}
eval('$showlastposts .= "' . fetch_template('forumhome_lastposts') . '";');
$db->free_result($lastposts);
// end last XX posts + threads in forumhome

Some issue there?

Very much thanks

bump


All times are GMT. The time now is 07:21 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.00984 seconds
  • Memory Usage 1,722KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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