Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Latest Threads On Forum Home Details »»
Latest Threads On Forum Home
Version: 1.00, by NTLDR (Coder) NTLDR is offline
Developer Last Online: Oct 2004 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-20-2004 Last Update: Never Installs: 170
 
No support by the author.

Latest Threads On Forum Home
Version: 1.0.2
vB-version: 3.0.0 Release Candidate 2
Developer: NTLDR
Install-difficulty: 1
File-edits: 2
Template-edits: 1

Description of the Hack:
This is taken from my vBindex hack and will display the latest X threads on your forum home page. Permissions are done automatically so forums users can't view will be excluded. Includes thread icon/goto new post image (if the thread is unread), title, last post info, number of views and replies.



Files modified for this Hack:
index.php


New templates for this Hack:
forumhome_latestthreadbit


Templates modified for this Hack:
FORUMHOME

New phrases for this Hack:
latest_threads

Show Your Support

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

Comments
  #152  
Old 03-01-2005, 11:38 AM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by James Collins
yes it does
Perfect!

Thx.
Reply With Quote
  #153  
Old 03-05-2005, 08:46 AM
SkyShadow SkyShadow is offline
 
Join Date: Jun 2003
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can somebody tell me how I would display the latest threads in a sidebar instead?
Reply With Quote
  #154  
Old 03-30-2005, 03:59 AM
ProperMethodz's Avatar
ProperMethodz ProperMethodz is offline
 
Join Date: Jan 2005
Location: Stamford CT
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi... I'm really frustrated. This will be the second hack I am attempting to install, and isn't going so well.

I followed your instrctions to a "t" and am getting a parse error. I read through this entire thread and found where you say that it can only happen if you copy and paste the code incorrectly. Yet I still get the following error:

Parse error: parse error, unexpected T_STRING in /home/xhmgami/public_html/forum/index.php on line 460

I'm pretty damn sure I did it correctly.

I found my file and saved to desktop. I made a copy and opened in DW.

I then did a search for 'forumhome_subforumseparator_post', in DW this was RED and was towards the top of the page on line 49 <--- given to me by DW.

I then highlighted that line and replaced it with everything here:
Code:
// [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 ]
From there I searched for:
Code:
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
It found one instance at the bottom. I then put my cursor above that line and pasted:
Code:
// [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(=(&quot;|"|\'|).*\\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 ]
From there I went to my admin panel and did a search in templates for the following code:
Code:
class="smallfont">$upcomingevents</div></td>
	</tr>
</tbody>
</if>
There was a close table tag there that I had to push down a line so that I could add this:
Code:
<!-- [START HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ] -->
<!-- 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">&nbsp;</td>
		<td class="alt1"><div class="smallfont">$threadbits</div></td>
	</tr>
</tbody>
</if>
<!-- /latest threads -->
<!-- [END HACK='Latest Threads On Forum Home' AUTHOR='NTLDR' VERSION='1.0.0' CHANGEID= 1 ] -->
now I moved on to creating a new template... this took me a second or two to figure out but I got her done...
I created: forumhome_latestthreadbit
Then added the code:
Code:
<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>
	<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?$session[sessionurl]threadid=$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?$session[sessionurl]find=lastposter&threadid=$thread[threadid]" 2="$thread[lastposter]">$vbphrase[by_x]</phrase>
	? $vbphrase[replies]: $thread[replycount]
	? $vbphrase[views]: $thread[views]
</div>
Last I created the phrase... that was the easiest part.

I then uploaded my index.php and recieved the error.

Now on line 460 in DW this is what I see:
$thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbc ode(fetch_censored_text($thread['preview']), false, true), $vboptions['threadpreview']));

I don't know if this is the correct line you are looking for. But I'm quite the n00b at this.

Please help.
Reply With Quote
  #155  
Old 03-30-2005, 05:01 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode(fetch_censored_text($threa d['preview']), falsetrue), $vboptions['threadpreview'])); 
There is a space in '$threa d['preview']), '.

PS DreamWeaver with standard settings is not the best editor for your php-files.
Reply With Quote
  #156  
Old 03-30-2005, 11:52 AM
Sun Boy Sun Boy is offline
 
Join Date: Feb 2003
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i would like to use hack like this but on non-vb page witout vb templates
some thing like the one on www.hotscripts.com

but i dont know how to do it exactly
so could you explan to me how to do it ?
Reply With Quote
  #157  
Old 03-30-2005, 05:03 PM
ProperMethodz's Avatar
ProperMethodz ProperMethodz is offline
 
Join Date: Jan 2005
Location: Stamford CT
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
PHP Code:
$thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode(fetch_censored_text($threa d['preview']), falsetrue), $vboptions['threadpreview'])); 
There is a space in '$threa d['preview']), '.

PS DreamWeaver with standard settings is not the best editor for your php-files.
What do you suggest? When I open it in notepad it's all hosed.
Reply With Quote
  #158  
Old 03-30-2005, 05:38 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There are many good editors around, some payed, some free.

Personally i use UltraEdit, since i know it will work correct on every unix and windows file, and it has some nice code highlighting features (and a lot more).
Reply With Quote
  #159  
Old 03-30-2005, 07:44 PM
ProperMethodz's Avatar
ProperMethodz ProperMethodz is offline
 
Join Date: Jan 2005
Location: Stamford CT
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks... and thanks for your help.

It works now...

www.7hmgaming.com
Reply With Quote
  #160  
Old 03-30-2005, 07:46 PM
ProperMethodz's Avatar
ProperMethodz ProperMethodz is offline
 
Join Date: Jan 2005
Location: Stamford CT
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sun Boy
i would like to use hack like this but on non-vb page witout vb templates
some thing like the one on www.hotscripts.com

but i dont know how to do it exactly
so could you explan to me how to do it ?
I would also like to do this... Is there instructions somewhere on how this is done? Also, I would like to be able to list all latest posts within a given time rather then within a number. I would like this to display through an I frame which I have on my home page.
Reply With Quote
  #161  
Old 04-07-2005, 09:56 PM
osariase osariase is offline
 
Join Date: Mar 2005
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HI NTDL
I installed your hack its is beautiful. one thing I found is that you asked to do some changes in index.php, I couldn't find the line of code u mentioned so I checked forum.php and it was there so i did the changes there. But I was expecting to be in my homepage which is the index (advanced cmps) like the other modules. I want it in the home page instead of below the forums.

My question is how do iI put it there on my index just like rest such as welcome block etc.

Could you please tell me how i can do that thanks
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 04:46 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.17255 seconds
  • Memory Usage 2,333KB
  • 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
  • (6)bbcode_code
  • (2)bbcode_php
  • (3)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
  • (1)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