Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
vb3 Latest Forum Post Hack Details »»
vb3 Latest Forum Post Hack
Version: 1.00, by EH-Jay EH-Jay is offline
Developer Last Online: Oct 2009 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 02-26-2005 Last Update: Never Installs: 6
 
No support by the author.

Sorry for making all these hack posts but I'm all about the layout this hack is originally made by NTLDR, well that's what it says in the file. I'm pretty much using everything that he used, which you will see in the credits and in the coding. The only thing different from his hack and mine, is how it's displayed. Instead of at the bottom of the page under the statistics content, it's above all forums, where the Guest message is shown.. Anyway lets get started.

I'll go over the basics from the installation file.

Code:
Open index.php

Find 

'forumhome_subforumseparator_post'

Replace with

// [START HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ]
'forumhome_subforumseparator_post',
'forumhome_latestthreadbit'
// [END HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ]

Find

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###

Add above it
--DO NOT INCLUDE IN BELOW CODING--
Note: Change 5 in this part of the query to change the number of threads to show: DESC LIMIT 5
Change ORDER BY lastpost to ORDER BY dateline to stop it showing threads with new posts.
--DO NOT INCLUDE IN BELOW CODING--

// [START HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 2 ]
// #################### 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)';
}

$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 open = '1'
	AND forumid NOT IN (0$limitfids)
	AND thread.visible = '1'
	AND deletionlog.primaryid IS NULL
	ORDER BY lastpost
	DESC LIMIT 5");

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(=("|"|\'|).*\\2)?\](.*)\[/quote\]#siU', '', $thread['preview']);
	$thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode(fetch_censored_text($thread['preview']), false, true), $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("\$threadbits .= \"".fetch_template('forumhome_latestthreadbit')."\";");
}
if ($threads) {
	$show['latestthreads'] = true;
}
// memory saving
unset($thread, $threads);
$DB_site->free_result($getthreads);
// [END HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 2 ]

Create the following phrase

section: GLOBAL
name: latest_threads
text: Latest Threads
All that above was created by NTLDR and let all know that he owns that coding. Onto my revisions.

Code:
Open template FORUMHOME

Find

$forumbits

Above this add

<!-- remodded by Jay -->
<!-- [START HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ] -->
<!-- latest threads -->
<if condition="$show['latestthreads']">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
	<tr>
		<td class="tcat" colspan="2">$vbphrase[latest_threads]</td>
	</tr>
</thead>
<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>
			Last 5 posts on our forums
		</td>
	</tr>
</tbody>
<tbody id="collapseobj_forumhome_latestthreads" style="$vbcollapse[collapseobj_forumhome_latestthreads]">
	<tr>
		<td class="alt1"><div class="smallfont">$threadbits</div></td>
	</tr>
</tbody>
</table>
<br>
</if>
<!-- /latest threads -->
<!-- [END HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ] -->
<!-- remodded by Jay -->

Create a new template called forumhome_latestthreadbit

Insert this coding

<div class="smallfont">
	<if condition="$show['firstnew']">
		<a href="showthread.php?$session[sessionurl]threadid=$thread[threadid]&goto=newpost"><img src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]" border="0" /></a>
	</if>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="30%"><div class="smallfont"><a href="showthread.php?$session[sessionurl]threadid=$thread[threadid]" title="$thread[preview]"><strong>$thread[title]</strong></a></div></td>
<td width="30%"><div class="smallfont"><em>$vbphrase[last_post]:</em> $thread[date] <if condition="$vboptions['yestoday'] != 2"><span class="time">$thread[time]</span></if></div></td>
<td width="16%"><div class="smallfont"><phrase 1="member.php?$session[sessionurl]find=lastposter&threadid=$thread[threadid]" 2="$thread[lastposter]">$vbphrase[by_x]</phrase></div></td>
<td width="12%"><div class="smallfont">$vbphrase[replies]: $thread[replycount]</div></td>
<td width="12%"><div class="smallfont">$vbphrase[views]: $thread[views]</div></td>
</tr>
</table>
</div>
Done. Easy as that. It SHOULD work but you won't for sure until everything is installed. Like I said throughout I just remodded a already hack. Good luck.

Show Your Support

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

Comments
  #12  
Old 03-07-2005, 08:58 AM
dacho's Avatar
dacho dacho is offline
 
Join Date: Dec 2004
Location: Tell-Aviv
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if i want to put it in another site as a frame/iframe, and to see the 'Latest Threads' from choice forums ?
Reply With Quote
  #13  
Old 03-13-2005, 04:27 PM
EH-Jay's Avatar
EH-Jay EH-Jay is offline
 
Join Date: Oct 2004
Location: Canada
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Iframes... hmm. I don't know for sure. Maybe. But I never had to use iframes lol
Reply With Quote
  #14  
Old 03-14-2005, 06:26 PM
hollyboy's Avatar
hollyboy hollyboy is offline
 
Join Date: Mar 2004
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

screenshots please
Reply With Quote
  #15  
Old 03-14-2005, 07:48 PM
SimonHodgkiss SimonHodgkiss is offline
 
Join Date: Mar 2005
Location: UK
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Screenshots are needed !
Reply With Quote
  #16  
Old 03-14-2005, 10:37 PM
EH-Jay's Avatar
EH-Jay EH-Jay is offline
 
Join Date: Oct 2004
Location: Canada
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh yea lol. Let me get that.
Reply With Quote
  #17  
Old 03-14-2005, 11:26 PM
EH-Jay's Avatar
EH-Jay EH-Jay is offline
 
Join Date: Oct 2004
Location: Canada
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's a screen shot. It's way instead of at the bottom under the "Whose Online" area.
Reply With Quote
  #18  
Old 03-14-2005, 11:27 PM
EH-Jay's Avatar
EH-Jay EH-Jay is offline
 
Join Date: Oct 2004
Location: Canada
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

opps. Don't mind that banner. I put that in after. It won't show up in the mod.
Reply With Quote
  #19  
Old 03-15-2005, 12:33 AM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can edit the original thread starting post. It might be a good idea to put the proper code in there along with the screen shot.
Reply With Quote
  #20  
Old 03-15-2005, 09:32 PM
xug xug is offline
 
Join Date: Oct 2001
Location: The Grand Strand, SC
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A new era, the copycat era.

Please go ask permission and then publish and it's maybe even better to just post it in the thread of the original hack, so the forum doesn't get clutered
Reply With Quote
  #21  
Old 03-30-2005, 01:53 AM
ProperMethodz's Avatar
ProperMethodz ProperMethodz is offline
 
Join Date: Jan 2005
Location: Stamford CT
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Jay... what's the proper code to use here. And do I have to install the original hack first?
Reply With Quote
Reply

Thread Tools

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 09:01 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.04766 seconds
  • Memory Usage 2,315KB
  • Queries Executed 27 (?)
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
  • (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
  • (2)pagenav_pagelink
  • (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_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
  • 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