Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-21-2004, 10:03 AM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vBadvanced CMPS + Latest Topics + Non VB .php files

Hi Guys,
I am impressed by the way VB CMPS Latest Topics Display an example is shown on vbadvanced.com.

I would like to know how can i display the same on non vbulletin php pages ? and also control various properties for same. ?

Original Hack Thread: https://vborg.vbsupport.ru/showthread.php?t=65797

Code for latesttopics.php file from the above hack:
Code:
<?php
// ++=========================================================================++
// || vBadvanced CMPS 1.0.0												   ||
// || ? 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved	  ||
// || This file may not be redistributed in whole or significant part.		||
// || http://vbadvanced.com												   ||
// ++ ========================================================================++
// ######################### Latest Forum Topics #########################
if ($vba_options['portal_threads_maxthreads'])
{
 $inforums = '';
 if ($vba_options['portal_threads_forumids'])
 {
  if (!empty($forumperms))
  {
   $inforums = array();
   $threadsforums = explode(',', $vba_options['portal_threads_forumids']);
   foreach ($threadsforums AS $tforum)
   {
	if (!in_array($tforum, $forumperms))
	{
	 $inforums[] = $tforum;
	}
   }
   if (!empty($inforums))
   {
	$inforums = implode(',', $inforums);
   }
  }
  else
  {
   $inforums = $vba_options['portal_threads_forumids'];
  }
  if ($inforums)
  {
   $inforums = 'AND thread.forumid IN (' . $inforums . ')';
  }
 }
 $foruminfo['allowratings'] = $vba_options['portal_threads_showrating'];
 $show['lastpost'] = $vba_options['portal_threads_lastpost'];
 if ($vba_options['portal_threads_showsubscribed'] AND $bbuserinfo['userid'])
 {
  $query['subfields'] = ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed';
  $query['subjoin'] = 'LEFT JOIN ' . TABLE_PREFIX . 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = ' . $bbuserinfo['userid'] . ')';
 }
 if ($vba_options['portal_threads_showpreview'] AND $vboptions['threadpreview'])
 {
  $query['previewfields'] = ', post.pagetext AS preview';
  $query['previewjoin'] = 'LEFT JOIN ' . TABLE_PREFIX . 'post AS post ON (post.postid = thread.firstpostid)';
 }
 if ($vba_options['portal_threads_showforum'])
 {
  $query['forumfields'] = ',thread.forumid, forum.title AS forumtitle';
  $query['forumjoin'] = 'LEFT JOIN ' . TABLE_PREFIX . 'forum AS forum ON (thread.forumid = forum.forumid)';
 }
 if ($vba_options['portal_threads_showicon'])
 {
  $query['iconfields'] = ', thread.iconid AS threadiconid, iconpath AS threadiconpath';
  $query['iconjoin'] = 'LEFT JOIN ' . TABLE_PREFIX . 'icon USING (iconid)';
 }
  $threads = $DB_site->query("
	SELECT 
	" . iif($vba_options['portal_threads_showrating'], 'IF(votenum >= ' . $vboptions['showvotes'] . ', votenum, 0) AS votenum, IF(votenum >= ' . $vboptions['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . "
	thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid
	$query[iconfields]
   $query[forumfields]
   $query[previewfields]
   $query[subfields]
   FROM " . TABLE_PREFIX . "thread as thread
   $query[iconjoin]
   $query[forumjoin]
   $query[previewjoin]
   $deljoin
   $query[subjoin]
   WHERE open <> '10' AND thread.visible = 1 $iforumperms $inforums $notdeleted 
   ORDER BY lastpost DESC 
   LIMIT $vba_options[portal_threads_maxthreads]
 ");
  while ($thread = $DB_site->fetch_array($threads))
  {
  if (strlen($thread['title']) > $vba_options['portal_threads_maxchars'] AND $vba_options['portal_threads_maxchars'])
  {
   $thread['title'] = fetch_trimmed_title($thread['title'], $vba_options['portal_threads_maxchars']);
  }
  $thread = process_thread_array($thread, '', $vba_options['portal_threads_showicon']);
  $getbgrow = getrowcolor();
  eval('$threadbits .= "' . fetch_template('adv_portal_latesttopicbits') . '";');
  }
 eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_latesttopics') . '";');
  $DB_site->free_result($threads);
  unset($thread, $threadbits, $foruminfo, $query, $inforums);
}
?>
Regards,
Sandy...
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 11:54 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.02871 seconds
  • Memory Usage 2,220KB
  • Queries Executed 11 (?)
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_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