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

Reply
 
Thread Tools
Latest Threads On Forum Home Details »»
Latest Threads On Forum Home
Version: 1.1.2, by Chris M Chris M is offline
Developer Last Online: Feb 2013 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 06-15-2005 Last Update: 10-23-2005 Installs: 458
Uses Plugins Template Edits
 
No support by the author.

[high]Installation Instructions[/high]

Step 1: Upload the .xml file to the Product Manager
Step 2: Modify the [high]FORUMHOME[/high] template
Find:
HTML Code:
<td class="alt1" width="100%"><div class="smallfont">$upcomingevents</div></td>
	</tr>
</tbody>
</if>
Add below:
HTML Code:
<!-- latest threads -->
<if condition="$show['latestthreads']">
<tbody>
	<tr>
		<td class="thead" colspan="2">
			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_latestthreads')"><img id="collapseimg_forumhome_latestthreads" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_latestthreads].gif" alt="" border="0" /></a>
			$vbphrase[latest_threads]
		</td>
	</tr>
</tbody>
<tbody id="collapseobj_forumhome_latestthreads" style="$vbcollapse[collapseobj_forumhome_latestthreads]">
	<tr>
		<td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_new.gif" alt="$vbphrase[latest_threads]" /></td>
		<td class="alt1"><div class="smallfont">$threadbits</div></td>
	</tr>
</tbody>
</if>
<!-- /latest threads -->
Step 3: Click [high]INSTALL[/high]

[high]Credits[/high]
NTLDR - For allowing me to port his vB3 hack of this

[high]Updates[/high]
Version 1.1.0: Simple update to make this work with vBulletin 3.5.0 Beta 2 - If you are installing for the first time, follow the installation instructions - If you are upgrading, please delete the previous plugin, and upload the new one - This new plugin also has the uncached template fix

Version 1.1.1: Simple update to fix a permissions bug - Wasn't showing on my board because I had already fixed it and forgot about it lol - To upgrade, simply replace the plugin with the one attached

Version 1.1.2: Simple update to fix a permissions bug again - To upgrade, simply replace the plugin with the one attached

Chris

Show Your Support

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

Comments
  #312  
Old 04-30-2006, 11:05 AM
jason_x jason_x is offline
 
Join Date: Oct 2004
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Vierie
Did you test it as a guest?
yes.

temporary solution:
i have added the forumid to $limitfids (hook forum_complete).

Code:
fetch_permissions($forum['forumid']);

$limitfids = "1,2";

// ## HIDE FORUMS WITHOUT THE CANVIEW PERMISSION ##
threads with this forumid will not show up on latest threads (unfortunately for all usergroups!).
Reply With Quote
  #313  
Old 04-30-2006, 04:53 PM
Pathor Pathor is offline
 
Join Date: Mar 2006
Location: Germany
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mike-D
Pathor? Your SN sounds known for me. Are you from vB Germany?

Yes, I am.

Welche Version hast Du ? L?uft hervorragend unter 3.54. Ich habe einige ?nderungen am Code gemacht, so das die ?bersicht nun als Tabelle dargestellt wird. Ist nur halt das Problem, das G?ste es auch seheh k?nnen, und das m?chte ich nicht. Hast Du irgendeine Idee, wie man das abschalten kann? Meine PHP Kentnisse sind sehr begrenzt - leider -Mike
Du musst eine if-condition um den ganzen Templatecode setzen.

<if condition="$bbuserinfo['userid']">
<Latest Threads on Forum Home>
</if>

Somit sehen nur registrierte Benutzer dein Forum.
Reply With Quote
  #314  
Old 04-30-2006, 06:52 PM
Pathor Pathor is offline
 
Join Date: Mar 2006
Location: Germany
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Danke mein Freund. Ich schulde Dir was. Wenn ich auch mal irgendwas f?r Dich tun kann - z?gere mich nicht, mich zu fragen -Micha
Kein Prob.
Quote:
Somit sehen nur registrierte Benutzer dein Forum.
Soll nat?rlich 'Plugin' am Ende hei?en.
Reply With Quote
  #315  
Old 05-13-2006, 10:31 AM
Tim Simms Tim Simms is offline
 
Join Date: May 2006
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I needed to be able to see the names of the forums in the list, so I modified it a bit... Here's the XML code:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="chrism_latestthreads" active="1">
	<title>Latest Threads on Forum Home</title>
	<description>This product will show the Latest Threads posted (using permissions) on your forumhome</description>
	<version>1.1.2</version>
	<codes>
	</codes>
	<templates>
		<template name="forumhome_latestthreadbit" templatetype="template" date="1129992702" username="Chris M" version="3.5.0"><![CDATA[<div class="smallfont">
	<if condition="$show['firstnew']">
		<a href="showthread.php?t=$thread[threadid]&amp;goto=newpost"><img src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]" border="0" /></a>
	</if>
	<if condition="$show['icon'] && !$show['firstnew']">
		<img src="$vboptions[bburl]/$thread[threadiconpath]" border="0" alt="$thread[threadicontitle]" title="$thread[threadicontitle]" style="vertical-align: text-middle" /> 
	</if>
	<a href="showthread.php?t=$thread[threadid]" title="$thread[preview]"><strong>$thread[title]</strong></a>
	<em>$vbphrase[last_post]:</em> $thread[date] <if condition="$vboptions['yestoday'] != 2"><span class="time">$thread[time]</span></if> <phrase 1="member.php?find=lastposter&amp;t=$thread[threadid]" 2="$thread[lastposter]">$vbphrase[by_x]</phrase>
	&raquo; $vbphrase[replies]: $thread[replycount]
	&raquo; $vbphrase[views]: $thread[views]
</div>]]></template>
	</templates>
	<plugins>
		<plugin active="1">
			<title>Latest Threads on Forum Home</title>
			<hookname>cache_templates</hookname>
			<phpcode><![CDATA[global $globaltemplates;

$globaltemplates = array_merge($globaltemplates, array('forumhome_latestthreadbit'));]]></phpcode>
		</plugin>
		<plugin active="1">
			<title>Latest Threads on Forum Home</title>
			<hookname>forumhome_complete</hookname>
			<phpcode><![CDATA[// #################### PROCESS LATEST THREADS #######################
// fetch the permissions for each forum
global $vbulletin;

$forumperms = array();
foreach($vbulletin->forumcache AS $forum) {

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

	// ## HIDE FORUMS WITHOUT THE CANVIEW PERMISSION ##
	if (!($forumperms[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums']) {
		$limitfids .= ','.$forum['forumid'];
	}
}
unset($forum);

if ($vbulletin->options['threadpreview'] > 0) {
	$previewfield = ', post.pagetext AS preview';
	$previewjoin = 'LEFT JOIN '.TABLE_PREFIX.'post AS post ON(post.postid = thread.firstpostid)';
}

$getthreads = $db->query_read("
	## GET LATEST THREADS ##
	SELECT thread.*,forum.title AS forumtitle,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, 
	".TABLE_PREFIX."forum AS forum WHERE forum.forumid = thread.forumid
	AND open <> 10
	AND thread.forumid NOT IN (0$limitfids)
	AND thread.visible = '1'
	AND deletionlog.primaryid IS NULL
	ORDER BY lastpost
	DESC LIMIT 5");

while($thread = $db->fetch_array($getthreads)) {

	$threads = true;
	$thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 22));
	$thread['date'] = vbdate($vbulletin->options['dateformat'], $thread['lastpost'], 1);
	$thread['time'] = vbdate($vbulletin->options['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']), false, true), $vbulletin->options['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 > $vbulletin->userinfo['lastvisit']) {
		$lastread = $bbforumview;
	} else {
		$lastread = $vbulletin->userinfo['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("\$threadbits .= \"".fetch_template('forumhome_latestthreadbit')."\";");
}
if ($threads) {
	$show['latestthreads'] = true;
}
// memory saving
unset($thread, $threads);
$db->free_result($getthreads);]]></phpcode>
		</plugin>
	</plugins>
	<phrases>
		<phrasetype name="GLOBAL" fieldname="global">
			<phrase name="latest_threads"><![CDATA[Latest Threads]]></phrase>
		</phrasetype>
	</phrases>
	<options>
	</options>
</product>

Then, in the FORUMHOME, here's the Lastest Threads section:

PHP Code:
<!-- latest threads -->
<if 
condition="$show['latestthreads']">
<
tbody>
    <
tr>
        <
td class="thead" colspan="2">
            <
a style="float:$stylevar[right]href="#top" onclick="return toggle_collapse('forumhome_latestthreads')"><img id="collapseimg_forumhome_latestthreads" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_latestthreads].gif" alt="" border="0" /></a>
            
$vbphrase[latest_threads]
        </
td>
    </
tr>
</
tbody>
<
tbody id="collapseobj_forumhome_latestthreads" style="$vbcollapse[collapseobj_forumhome_latestthreads]">
    <
tr>
        <
td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_new.gif" alt="$vbphrase[latest_threads]/></td>
        <
td class="alt1"><div class="smallfont">$threadbits</div></td>
    </
tr>
</
tbody>
</if>
<!-- /
latest threads --> 
Worked like a charm!
Reply With Quote
  #316  
Old 05-16-2006, 10:28 AM
somasimple's Avatar
somasimple somasimple is offline
 
Join Date: Aug 2005
Location: France
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Tim,

The forumtitle you used isn't used in any another place.
The modidfication doesn't show the forum title!
Reply With Quote
  #317  
Old 05-17-2006, 05:42 PM
criscokid criscokid is offline
 
Join Date: Nov 2003
Location: London, UK
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this mod be used to show the 'latest threads' block other than on forumhome? like on a portal front page?
Reply With Quote
  #318  
Old 05-18-2006, 08:53 AM
jokerz jokerz is offline
 
Join Date: Oct 2005
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack is not about the latest threads, it is only when you post the threads and it'll show the latest post in threads. Weird.. I thought its only list of new threads not new posts.

eg. If I post in old thread or new thread, both will show up as 'Latest Threads'
Reply With Quote
  #319  
Old 05-18-2006, 09:08 AM
harishankar harishankar is offline
 
Join Date: May 2006
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's exactly what I'm looking for jokerz. I wanted latest posts. I guess this is the mod.

For the "Latest threads" as you want it, I think there's a tutorial at vbulletin.com which does that using the external hook.
Reply With Quote
  #320  
Old 05-18-2006, 10:57 AM
criscokid criscokid is offline
 
Join Date: Nov 2003
Location: London, UK
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found the HowTo Display Latest Active Threads on ANY normal HTML page document. but it's only the 'last x threads posted' not 'last x postings posted' like this one is.

This is the one that I want - I just loosely used the term 'latest threads' as I took it from the title of this mod. Maybe it should be renamed to be more exact?

Anyway... is it possible to use this mod on a page other than on forumhome ( like on a portal front page)?
Reply With Quote
  #321  
Old 05-18-2006, 12:57 PM
harishankar harishankar is offline
 
Join Date: May 2006
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any way to control to number of new topics which appear?
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:00 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.06200 seconds
  • Memory Usage 2,346KB
  • 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_code
  • (2)bbcode_html
  • (1)bbcode_php
  • (4)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
  • (2)pagenav_pagelinkrel
  • (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