Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Last Post Title in Forumhome & Forumdisplay Details »
Last Post Title in Forumhome & Forumdisplay
Mod Version: 1.00, by (Guest)  is offline
Developer Last Online: Dec 1969 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: Rating: (0 vote - 0 average) Installs: 0
Released: 20 Sep 2001 Last Update: Never Downloads:
Not Supported  

Vision 2.1

i promised to reduse the extra queries to 1. in this 1 query, we can get the last post title, last thread title and last icon... so it have a shorter load time...

i still believe my this hack Release is the simplest mode to display the last post titles in Forumhome & Forumdisplay Page, because it dosen't need any action in database, and just modify 2 places in 2 files... furthermore, now the new vision have reduced the load time very much...

many thanks to PPN for his help...

OK, let's go!

1. change index.php and forumdisplay.php:

find in index.php:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

find in forumdisplay.php:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

below these add:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


2. i have made the post icons display... so change the template forumhome_lastpostby to:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

DONE!




------------------------------------------------------------------------------
The Older Vision
a PHP+MySQL newbie's bad exercise...
if you find interest in this you can compare it with the last Release...


someone has posted this type hack, but this Release has a little difference. and in the other's release there's some bugs(about the subforums' last post title), now it has been fixed:

1. change index.php and forumdisplay.php:

find in index.php:

// prepare template vars
if (!$showforumdescription) {
$forum['description']='';
}


find in forumdisplay.php:

// dates
if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);


below these add:

// start last post title hack by cx
$forum_this = $DB_site->query_first("SELECT parentlist FROM forum WHERE forumid=$forum[forumid]");
$forum_this_parents = explode(',', $forum_this[parentlist]);
$forum_this_parents_count = count($forum_this_parents);

$forum_sons = $DB_site->query('SELECT parentlist,forumid FROM forum');
while ($forum_son = $DB_site->fetch_array($forum_sons)) {
$forum_parentlist = $forum_son[parentlist];
$forum_parents = explode(',', $forum_parentlist);
$forum_parents_count = count($forum_parents);
if ($forum_parents[$forum_parents_count - $forum_this_parents_count] == $forum[forumid]) {
$forum_son_all[] = $forum_son[forumid];
}
}

if ($forum_son_all != '') {
$forum_sons = implode(',', $forum_son_all);

$lastposttitlex = $DB_site->query_first("SELECT post.title FROM thread,post WHERE thread.forumid IN($forum_sons) AND post.threadid=thread.threadid AND post.visible=1 ORDER BY post.dateline DESC");
$lastposttitle = ''.$lastposttitlex[title];

if ($lastposttitle == '') {
$lastposttitlex = $DB_site->query_first("SELECT title FROM thread WHERE forumid IN($forum_sons) AND visible=1 ORDER BY lastpost DESC");
$lastposttitle = 'RE: '.$lastposttitlex[title];
}

if (strlen($lastposttitle) > 30) {
$lastposttitle = substr($lastposttitle, 0, 28);
$lastposttitle .= '..';
}
}
// end last post title hack by cx


2. change the template forumhome_lastpostby to:

<div align=right><smallfontbr><nobr><a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]" title="turn to last new post">$lastposttitle</a></nobr><br><nobr>$forum[lastpostdate] <font color="#666686">$forum[lastposttime]</font></nobr><br><nobr>by <a href="member.php?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]">$forum[lastposter]</a></nobr></smallfont></div>


3. done! easy and funny job

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 20 Sep 2001, 08:23
Sinecure's Avatar
Sinecure Sinecure is offline
 
Join Date: Oct 2001
Not Downloaded
Is there an example/preview we can see?? Perhaps a URL??
__________________
Lyle Warren
Former vBulletin.org Administrator

<<------General Information------>>
ICQ: 437747379
Email: [email protected]

Website: Pixeljunction.com
My Board: Board.Pixeljunction.com

<<------My Button Sets------>>
Aqua Sets: Aqua Blue - Aqua Orange
XP Sets: XP Blue - XP Blank - XP Black - XP Camo - XP Green
Reply With Quote
  #3  
Old 20 Sep 2001, 08:56
Goldfinger's Avatar
Goldfinger Goldfinger is offline
 
Join Date: Oct 2001
Not Downloaded
yes an example would be nice before i add it to my hack list .
Reply With Quote
  #4  
Old 20 Sep 2001, 12:11
Delhaze Delhaze is offline
 
Join Date: Oct 2001
Not Downloaded
Nice work, i've been waiting for someone to fix the subforum bug, but wasn't sure if anyone would figure out the parent/child stuff.

This doesn't include the icon that the old hack now inlcudes, any chance you (or someone) can add it please ?
Reply With Quote
  #5  
Old 20 Sep 2001, 16:44
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Not Downloaded
This increased loading time on the forum by over 7 seconds. This is far too long, so i removed the hack.
__________________
Scott MacVicar
vBulletin Developer
Reply With Quote
  #6  
Old 20 Sep 2001, 16:47
h4p3 h4p3 is offline
 
Join Date: Oct 2001
Not Downloaded
Originally posted by PPN
This increased loading time on the forum by over 7 seconds. This is far too long, so i removed the hack.
Right, installed it on my main board, 40 user online -> server load 11 *lol*
Reply With Quote
  #7  
Old 20 Sep 2001, 17:06
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Not Downloaded
I'll post the version i was using before i tried to install this one, i wrote it so when someone posted it added the title to the forum table. Then it is selected anyway when the forum is loading. I never managed to get it compatible with sub-forums, i will work on that just now.
__________________
Scott MacVicar
vBulletin Developer
Reply With Quote
  #8  
Old 21 Sep 2001, 03:33
Goldfinger's Avatar
Goldfinger Goldfinger is offline
 
Join Date: Oct 2001
Not Downloaded
well obviously it adds loading time he queried the database 4 times in this script.. way to many times. try another way.
Reply With Quote
  #9  
Old 21 Sep 2001, 08:06
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Not Downloaded
64 users on board was 0.48
after this hack it hit 9.46

and that was with 39 forums

i just have to finish testing my versio and hopefully it should work well.
__________________
Scott MacVicar
vBulletin Developer
Reply With Quote
  #10  
Old 23 Sep 2001, 10:49
bbqfan
Guest
 
Not Downloaded
Cool

yes i have chage my code in the first post. or you can see the screenshot here...
Attached Images
File Type: jpg last_title.jpg (25.3 KB, 222 views)
Reply With Quote
  #11  
Old 23 Sep 2001, 11:14
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Not Downloaded
you don't need
$permissions_this = getpermissions($forum['forumid']);

this is already called eariler in the function in the form

just use $forumperms['canview']

so
if ($permissions_this['canview']) {
becomes
if ($forumperms['canview']) {

this hack also runs 3 extra queries per forum, so if you have a large board with say 40 users online and 50 forums. Then thats 6000 extra queries, they would usually only have to run 2000 to get forum info. This will have a large impact on server load.
__________________
Scott MacVicar
vBulletin Developer
Reply With Quote
  #12  
Old 23 Sep 2001, 11:29
bbqfan
Guest
 
Not Downloaded
Originally posted by PPN
you don't need
$permissions_this = getpermissions($forum['forumid']);

this is already called eariler in the function in the form

just use $forumperms['canview']

so
if ($permissions_this['canview']) {
becomes
if ($forumperms['canview']) {

this hack also runs 3 extra queries per forum, so if you have a large board with say 40 users online and 50 forums. Then thats 6000 extra queries, they would usually only have to run 2000 to get forum info. This will have a large impact on server load.
yes, u r right...
i have seen your hack and i think it's great.
but i don't like to modify my database...

maybe i can reduce the 3 extra queries to 1...

my hack is just for another choice...
Reply With Quote
  #13  
Old 23 Sep 2001, 15:12
bbqfan
Guest
 
Not Downloaded
Arrow

OK the last update codes have been added in the first post.
this will be the final vision----i hope

now just 1 query for 1 forum...
Reply With Quote
  #14  
Old 23 Sep 2001, 15:47
Freddie Bingham's Avatar
Freddie Bingham Freddie Bingham is offline
 
Join Date: Oct 2001
Not Downloaded
bbqfan please enter your license information into your profile.
Reply With Quote
  #15  
Old 26 Sep 2001, 12:52
davibou davibou is offline
 
Join Date: Oct 2001
Not Downloaded
hello i'm french so excuse me for my bad english!!

I found a bug in your hack


When you repply to a tread if you dont use icon for the repply
nothing appear for the title just Re:

Can you update the hack or found the bug please ??

Or if there is no bug tell me please


This hack is great ....
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 00:05.

Layout Options | Width: Wide Color: