Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
Prev Previous Post   Next Post Next
  #1  
Old 01-10-2007, 11:59 AM
s0b s0b is offline
 
Join Date: Oct 2006
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
 

Thread Tools
Display Modes

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 07:09 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06869 seconds
  • Memory Usage 2,233KB
  • Queries Executed 12 (?)
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
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • 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_threaded
  • showthread_threaded_construct_link
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete