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

Reply
 
Thread Tools
Details »»

Version: , by Scott MacVicar Scott MacVicar is offline
Developer Last Online: Mar 2016 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 09-20-2001 Last Update: Never Installs: 85
 
No support by the author.

I had tried a version suggested by someone else instead of my own and well, all it did was send the load average up by about 10 times what it was.

This version inserts the last title into the forum database when it is updating the last post name and time. There is no difference in loading time as everything is called normally by vBulletin.

This works on 2.0.x and 2.2.x

Updated at 11:34 GMT on 28th September 2002

Thanks to floren for the latest update.

Show Your Support

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

Comments
  #212  
Old 08-01-2002, 11:59 PM
Austin Dea's Avatar
Austin Dea Austin Dea is offline
 
Join Date: Dec 2001
Location: Denver, CO, USA
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's not your fault it doesn't work...

It works fine, but I can't restrict the length so it's messing my tables up.
Reply With Quote
  #213  
Old 08-02-2002, 12:09 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

have you tried using space.gif to make all of the last post boxes the same length? When they are not joined, this is what you have to do.
Reply With Quote
  #214  
Old 08-02-2002, 12:41 AM
Austin Dea's Avatar
Austin Dea Austin Dea is offline
 
Join Date: Dec 2001
Location: Denver, CO, USA
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I don't want it as big as it is in the first place =P.
Reply With Quote
  #215  
Old 08-04-2002, 08:26 PM
Austin Dea's Avatar
Austin Dea Austin Dea is offline
 
Join Date: Dec 2001
Location: Denver, CO, USA
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bah, sorry guys. I figured out hwy it wasn't working. I missed this step...

PHP Code:
look for
      if (!
$hideprivateforums) {
        
$forumperms['canview']=1;
      }

*
above it add
$trueperm
['canview'] = $forumperms['canview']; 
Geez...sorry for all the confusion. It works perfectly fine on 2.2.6.
Reply With Quote
  #216  
Old 08-12-2002, 08:17 PM
Tim Wheatley's Avatar
Tim Wheatley Tim Wheatley is offline
 
Join Date: Nov 2001
Location: England
Posts: 489
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Um... reading through this I'm lost... what works - what doesn't - on 2.2.6?
Reply With Quote
  #217  
Old 08-13-2002, 03:30 AM
Austin Dea's Avatar
Austin Dea Austin Dea is offline
 
Join Date: Dec 2001
Location: Denver, CO, USA
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works on 2.2.6.
Reply With Quote
  #218  
Old 08-13-2002, 10:26 AM
Frank Frank is offline
 
Join Date: Nov 2001
Location: Toronto, Canada
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack
Reply With Quote
  #219  
Old 08-15-2002, 03:36 AM
dwh's Avatar
dwh dwh is offline
 
Join Date: Feb 2002
Posts: 278
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've modified this to work with icons...I tried it briefly but not sure if there are any issues...try it out...but only on a test board...please don't install on a production board until people say they have tested it...hopefully PPN will modify his instructions (I did not bother w/ any version older than 2.2.6 and I had a lot of trouble with this hack..mostly because of the $form['lasttitle'] which has 2 mistakes...$forum[lasttitle] is correct...but nonetheless, very good concept and very well done..thanks for your hard work PPN a+!

Quote:
I installed this hack on a **fresh** vBulletin 2.0.1, though as i'm updating this file i'll tell you i've tested it on 2.0.1, 2.0.2, 2.0.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.3b and 2.2.4. This means every version btw

first thing to do is to run this mysql query :P
ALTER TABLE `forum` ADD `lasttitle` VARCHAR(100) NOT NULL AFTER `lastposter`
ALTER TABLE `forum` ADD `lasticonid` SMALLINT(5) NOT NULL AFTER `lasttitle`

open /admin/functions.php
-----------------------------

on line 1456 look for
$lastposter='';

below add

//LT HACK
$lasttitle='';
$lasticonid='';
//END HACK
-------

then look for

$getchildforums=$DB_site->query("SELECT forumid,threadcount,replycount,parentlist,parentid ,lastpost,lastposter FROM forum WHERE INSTR(CONCAT(',',parentlist,','),',$forumid,')>0") ;

change to

//LT HACK
$getchildforums=$DB_site->query("SELECT forumid,threadcount,replycount,parentlist,parentid ,lastpost,lastposter,lasttitle,lasticonid FROM forum WHERE INSTR(CONCAT(',',parentlist,','),',$forumid,')>0") ;
//END LT HACK
-------

then look for

$lastpost=$getchildforum[lastpost];
$lastposter=$getchildforum[lastposter];

below add
//LT HACK
if($getchildforum[lasttitle]=='') {
$newtitle=$DB_site->fetch_array($DB_site->query("SELECT * FROM thread WHERE forumid='$forumid' AND lastposter='$getchildforum[lastposter]' AND lastpost='$getchildforum[lastpost]'"));
$lasttitle=$newtitle[title];
$lasticonid=$newtitle[iconid];
}
else {
$lasttitle=$getchildforum[lasttitle];
$lasticonid=$getchildforum[lasticonid];
}
//END LT HACK
-------

then look for

$lastposts=$DB_site->query_first("SELECT lastpost,lastposter FROM thread WHERE lastpost='$lastposts[lastpost]'");
$lastpost=$lastposts['lastpost'];
$lastposter=$lastposts['lastposter'];

change to
//LT HACK
$lastposts=$DB_site->query_first("SELECT lastpost,lastposter,title,iconid FROM thread WHERE lastpost='$lastposts[lastpost]'");
$lastpost=$lastposts['lastpost'];
$lastposter=$lastposts['lastposter'];
$lasttitle=$lastposts['title'];
$lasticonid=$lastpost['iconid'];
//END LT HACK
-------
FOR VB 2.2.x

look for
if ($lastpost!=$currentlastpost) {
$lastpostquery=",lastpost='$lastpost',lastposter=' ".addslashes($lastposter)."'";
} else {
$lastpostquery="";
}

change to
//LT HACK
if ($lastpost!=$currentlastpost) {
$lastpostquery=",lastpost='$lastpost',lastposter=' ".addslashes($lastposter)."',lasttitle='".addslash es($lasttitle)."',lasticonid='$iconid'";
} else {
$lastpostquery="";
}
//END LT HACK
save the file and upload

open /newthread.php
-----------------------------

on line 231 to 233 you should see the following
if ($visible==1) {
$DB_site->query("UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1, lastpost='".time()."',lastposter='".addslashes($po stusername)."' WHERE forumid IN ($foruminfo[parentlist])");
}

change it to
//LT HACK
if ($visible==1) {
$DB_site->query("UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1, lastpost='".time()."',lastposter='".addslashes($po stusername)."',lasttitle='".addslashes(htmlspecial chars($subject))."',lasticonid='".addslashes($icon id)."' WHERE forumid IN ($foruminfo[parentlist])");
}
//END LT HACK
save the file and upload

open /editpost.php
-----------------------------

on line 233 to 235 you should see the following
if ($isfirst and $title!="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
$DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."' WHERE threadid=$threadinfo[threadid]");
//$title="";
}

change it to
//LT HACK
if ($isfirst and $title!="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
$DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."' WHERE threadid=$threadinfo[threadid]");
$lastpost=$DB_site->query_first("SELECT * FROM forum WHERE forumid=$threadinfo[forumid]");
if($lastpost["lastpost"]==$threadinfo["dateline"]) {
$DB_site->query("UPDATE forum SET lasttitle='".addslashes(htmlspecialchars($title)). "',lasticonid='".addslashes($iconid)."' WHERE forumid=$threadinfo[forumid]");
}
//$title="";
}
//END LT HACK
save the file and upload

open /newreply.php
-----------------------------

on line 279 to 281 you should see the following
if ($visible==1) {
$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',last poster='".addslashes($postusername)."' WHERE forumid IN ($foruminfo[parentlist])");
}

change it to
//LT HACK
if ($visible==1) {
$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',last poster='".addslashes($postusername)."',lasttitle=' ".addslashes(htmlspecialchars($threadinfo[title]))."',lasticonid='".addslashes($iconid)."' WHERE forumid IN ($foruminfo[parentlist])");
}
//END LT HACK
save the file and upload

open /index.php
-----------------------------
ON LINE 91 for Version 2.2.6

look for

//Forum info
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');

CHANGE TO

//LT HACK
//Forum info
$forums=$DB_site->query('SELECT forum.*,icon.title as icontitle,icon.iconpath as iconpath FROM forum
LEFT JOIN icon
ON (forum.lasticonid=icon.iconid)
WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
//END LT HACK


look for
if (!$hideprivateforums) {
$forumperms['canview']=1;
}

above it add
//LT HACK
$trueperm['canview'] = $forumperms['canview'];
//END LT HACK

on line 266 to 267 you should see the following
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);

below there add
//LT HACK
if($trueperm['canview']) {
$forum['lasttitle']=unhtmlspecialchars($forum['lasttitle']);
if (strlen($forum['lasttitle']) > 30) {
$forum['lasttitle'] = substr($forum['lasttitle'], 0, 28);
$forum['lasttitle'] .= '..';
}
if ($forum['lasticonid']) {
$icon="<img src=\"$forum[iconpath]\" alt=\"$forum[icontitle]\" width=\"15\" height=\"15\" border=\"0\">";
} else {
$icon="<img src=\"images/icons/icon1.gif\">";
}
}
//END LT HACK
save the file and upload

open /forumdisplay.php
-----------------------------


LOOK FOR

//Forum info
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder,forumid');

CHANGE TO

//LT HACK
//Forum info
$forums=$DB_site->query('SELECT forum.*,icon.title as icontitle,icon.iconpath as iconpath FROM forum
LEFT JOIN icon
ON (forum.lasticonid=icon.iconid)
WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder,forumid');
//END LT HACK



look for
if (!$hideprivateforums) {
$forumperms['canview']=1;
}

above it add
$trueperm['canview'] = $forumperms['canview'];

on line 197 to 198 you should see the following
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);

below there add
//LT HACK
if($trueperm['canview']) {
$forum['lasttitle']=unhtmlspecialchars($forum['lasttitle']);
if (strlen($forum['lasttitle']) > 30) {
$forum['lasttitle'] = substr($forum['lasttitle'], 0, 28);
$forum['lasttitle'] .= '..';
}
if ($forum['lasticonid']) {
$icon="<img src=\"$forum[iconpath]\" alt=\"$forum[icontitle]\" width=\"15\" height=\"15\" border=\"0\">";
} else {
$icon="<img src=\"images/icons/icon1.gif\">";
}

}
//END LT HACK
save the file and upload


IN THE TEMPLATE, $icon will give you the full icon.

Ok, now to edit the templates, this isn't hard you just have to edit one.

In the control panel go to the "forumhome_lastpostby" template
within it you may add $forum['lasttitle'] to show the last thread title to be posted to, i chose the following format for my board.

<table cellpadding="0" cellspacing="0" border="0" width="100%" id="ltlink"><tr align="right">
<td nowrap><smallfont><a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]">$forum[lasttitle]</a><br>$forum[lastpostdate] <font color="#FF9C58">$forum[lastposttime]</font><br>
by <a href="member.php?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]"><b>$forum[lastposter]</b></a></smallfont></td>
<td nowrap>&nbsp;<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><img src="https://vborg.vbsupport.ru/images/lastpost.gif" border="0" alt="Go to last post"></a></td>
</tr></table>


After changing the template run Update Forums info, this can be found in the "Update counters..." section of the control panel. This will make the titles appear.
Support can be gained from the vBulletin forums only, any other form of contact will be ignored.


PPN
software@pp-network.com
Also, don't miss the fact that I added a new field in forums and the SQL is at the top of the modified instructions.
Reply With Quote
  #220  
Old 08-15-2002, 07:06 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you supply a screenshot?
Reply With Quote
  #221  
Old 08-16-2002, 04:44 PM
Webmasta XT's Avatar
Webmasta XT Webmasta XT is offline
 
Join Date: Mar 2002
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

damn, when editing admin/functions.php in vb 2.2.6

PHP Code:
then look for

      
$lastposts=$DB_site->query_first("SELECT lastpost,lastposter FROM thread WHERE lastpost='$lastposts[lastpost]'");
                        
$lastpost=$lastposts['lastpost'];
                        
$lastposter=$lastposts['lastposter'];

change to

      $lastposts
=$DB_site->query_first("SELECT lastpost,lastposter,title FROM thread WHERE lastpost='$lastposts[lastpost]'");
                        
$lastpost=$lastposts['lastpost'];
                        
$lastposter=$lastposts['lastposter'];
                        
$lasttitle=$lastposts['title']; 
That part is not possible, so I can't install the hack.. any help with this?
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 07:24 AM.


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.04625 seconds
  • Memory Usage 2,338KB
  • 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_php
  • (1)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