vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Last post on forum home, working version (https://vborg.vbsupport.ru/showthread.php?t=28561)

Scott MacVicar 09-20-2001 10:00 PM

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.

valid 09-21-2001 11:09 AM

DEMO? Screenshot?

anything?

Scott MacVicar 09-21-2001 12:11 PM

ok here is a screen shot

h4p3 09-21-2001 01:20 PM

PPN, if you move a thread, will it display the correct title? That was the problem in all the other "Last post on forum home" versions.

Scott MacVicar 09-21-2001 02:07 PM

yes, i just tested it and it worked ok, but for some reason it left the date and last poster the same in the forum it was being moved from, i will have a look at the vB code just now for that reason.

Delete
Merge
Edit
Copy
all work well its just the move one.

h4p3 09-21-2001 03:12 PM

Yep, many code hackers had this problem, but never solved it ;)

Scott MacVicar 09-21-2001 03:39 PM

ok delete works, it just doesn' t work if the post being deleted is the only post in the forums.

In an unhacked version it still shows date and name even if the hack is not installed, a bug in vBulletin maybe?

anyway everything works apart from if your delete/moving a thread which is the only one within the forum.

Amasov 09-21-2001 04:00 PM

After I tried out the other 2 hacks, I thought this one works.

But it doesn't. I'm running 2.0.3 and either I'm gettin' a Parse Error (as you mentioned the variable in your hack "$form['lasttitle']") or nothing appears ($forum[lasttitle]).

What I'm doing wrong ?

Regards,
Chris.

Scott MacVicar 09-21-2001 04:17 PM

paste in the parse error pls.

the new topics won't take effect until someone posts a reply or new thread.

Amasov 09-21-2001 04:29 PM

As you stated in your installation textfile
Quote:

In the control panel go to the "forumhome_lastpostby" template
within it you may add $form['lasttitle'] to show the last thread title to be posted to, i chose the following format for my board.
(I think the parse error occured while the writing ($form('lasttitle) was'nt legal)

I changed it to this:

Code:

<table cellpadding="0" cellspacing="0" border="0" width="100%" id="ltlink"><tr align="right">
                <td nowrap><smallfont>$forum[lasttitle]<br>$forum[lastpostdate] <font color="{timecolor}">$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="{imagesfolder}/lastpost.gif" border="0" alt="Go to last post"></a></td>
        </tr></table>

Nothin' happened.
(I think there is nothing in the variable "$forum[lasttitle]" or it's also not legal, therefore nothing appears)

Regards,
Chris.

Scott MacVicar 09-21-2001 05:38 PM

ok, i discovered what it was, i will re-document in about 20mins after i have had some nice kebab :P

Amasov 09-21-2001 05:43 PM

Roger, have a nice eating. ;)

Scott MacVicar 09-21-2001 06:02 PM

ok, i updated the documentation now to go have a beer :P

Amasov 09-21-2001 06:28 PM

Cheers!:)

Thanks for updating. I'll try it in a few hours.

Thanks.

Regards,
Chris.

inetd 09-22-2001 12:07 PM

In last post column it is displayed New worm &amp;quot;Ni.. Ni. though original thread title New worm [u]"Nimida"[/u.] Please fix it.
And how to reduce quantity of symbols deduced in the title of a thread?

Scott MacVicar 09-22-2001 03:10 PM

sorry about this i forgot to unhtmlspecialchars the title.


within index.php and forumdisplay.php look for the follow lines which you added.

PHP Code:

          if (strlen($forum['lasttitle']) > 30) {
            
$forum['lasttitle'] = substr($forum['lasttitle'], 028);
            
$forum['lasttitle'] .= '..';
          } 

above that add the following
PHP Code:

$forum['lasttitle']=unhtmlspecialchars($forum['lasttitle']); 

this should solve the problem with the characters not being converted.

Also the decision on length is made by the top code a quick explanation is, if the length is over 30, remove everything after 28 characters and add two dots to the end.

Hope this helps, instruction file now updated.

inetd 09-22-2001 03:42 PM

Thx, PPN!
GOOD WORK!:)

Scott MacVicar 09-22-2001 03:45 PM

so this is one of the first versions to work without bringing the server to its knees?

:P

Goddess Washu 09-22-2001 07:05 PM

Mine works perfectly fine... Although I just combined a bunch of the ones that were posted before, sorta mad my own... don't remember what I did...

Alien 09-23-2001 09:29 AM

Works great, you did a really good job on this... Thanks so much!

I do have a question though.. How would I get the title to link to the actual post?

Thanks again!. :D

Scott MacVicar 09-23-2001 09:47 AM

change
$forum[lasttitle]

to

<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]">$forum[lasttitle]</a>

within the "forumhome_lastpostby" template

and didn't you forums use to be UBB?

bbqfan 09-23-2001 09:56 AM

i have posted the new code of similar hack:
http://www.vbulletin.com/forum/show...&threadid=28489

maybe it interests you... :)

Alien 09-23-2001 10:10 AM

PPN: Any way to get that to link to the BEGINNING of that particular topic, since the -> arrow already goes to the last *post*?

This possible too?

...and yes, formally UBB.

Scott MacVicar 09-23-2001 10:40 AM

ok open showthread.php and above

PHP Code:

if ($goto=="nextnewest") {
  
$thread verifyid("thread",$threadid,1,1); 

add

PHP Code:

// goto newest thread
if ($goto=="newthread") {
  if (isset(
$forumid) and $forumid!=0) {
    
$foruminfo=verifyid("forum",$forumid,1,1);
    
$forumid=$foruminfo['forumid'];
    
$lastthread=$DB_site->fetch_array($DB_site->query("SELECT threadid FROM post WHERE username='$foruminfo[lastposter]' AND dateline='$foruminfo[lastpost]'"));
    
header("Location: showthread.php?s=$session[sessionhash]&threadid=$lastthread[threadid]");
    exit;
  }


now change the bit i told you to to
PHP Code:

<a href="showthread.php?s=$session[sessionhash]&goto=newthread&forumid=$forum[forumid]">$forum[lasttitle]</a

sorry it took so long to reply, i thought vBulletin would have had a way to do this, but it didn't so i wrote one.

Alien 09-23-2001 10:51 AM

Thanks so much!

Hey, what sorta resource difference does it take to run this new link, as opposed to doing it the previous way without the extra query above?

I have over 35 forums.. Want to keep things snappy. :)

Scott MacVicar 09-23-2001 10:53 AM

none, you are still running one query if you use the current vBulletin equivalent or the one i posted. It should have no adverse effect on the forums.

Alien 09-23-2001 10:58 AM

Kick ass. :)

Final question (yeah right lol):

Occasionally there is a topic with a quote in it like:

What are "Private Messages"?

For the quotes above, it would only show &quot;

Any way around that? I know it's filtering out junk, was just wondering if it was possible to get quotes back (but only if it does not introduce a security problem.

Thanks again!

Scott MacVicar 09-23-2001 11:49 AM

i just posted the topic identical to what you used, make sure in index.php that
PHP Code:

          $forum['lasttitle']=unhtmlspecialchars($forum['lasttitle']); 

was added when you were pasting information. Either that or I have missed something else out in the hack, which i hope i haven't.

cyrus 09-23-2001 11:59 AM

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

floleb7 09-23-2001 01:59 PM

in phpmyadmin

Alien 09-23-2001 02:23 PM

Hey..

Yeah, I checked my index.php file and it does contain that code below.. I see it is working well on your forum, so it must just be something minor somehow...

Hmmm. :)

Quote:

Originally posted by PPN
i just posted the topic identical to what you used, make sure in index.php that
PHP Code:

          $forum['lasttitle']=unhtmlspecialchars($forum['lasttitle']); 

was added when you were pasting information. Either that or I have missed something else out in the hack, which i hope i haven't.


dxb 11-04-2001 01:50 AM

PPN any updates for this hack

Scott MacVicar 11-04-2001 09:42 AM

updated to work with 2.2.0 there was a small difference with the functions.php, it was just a change in the way the query was run, the update file has been updated to accomodate this.

I also adjust what i presumed was the problem that Alien was experiencing.

Thomas P 11-04-2001 10:27 AM

Hi,

does it let you edit & update the length of the last title through the cp?
Does it support different settings depending on the forum (on/off & length)?
Thanks,
-Tom

dxb 11-04-2001 11:21 PM

hi there PPN

I just downloaded your file and I cant find this

PHP Code:


if ($lastposts['lastpost']) {
    if (
$lastposts['lastpost']>$lastpost or $lastposts['lastpost']<$currentlastpost) {
      
$lastposts=$DB_site->query_first("SELECT lastpost,lastposter FROM thread WHERE lastpost='$lastposts[lastpost]'");
                        
$lastpost=$lastposts['lastpost'];
                        
$lastposter=$lastposts['lastposter'];
                }
  } 

the closes i was able to find is

PHP Code:


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


and also this query seems to be changed a bit

PHP Code:


$DB_site
->query("UPDATE forum SET replycount='$numberposts',threadcount='$numberthreads',lastpost='$lastpost',lastposter='".addslashes(htmlspecialchars($lastposter))."' WHERE forumid='$forumid'"); 

to this


PHP Code:


$DB_site
->query("UPDATE forum SET replycount='$numberposts',threadcount='$numberthreads$lastpostquery WHERE forumid='$forumid'"); 


I tried to work on them but with no success :(

Scott MacVicar 11-05-2001 06:28 AM

Ok instructions updated.

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'];

-------
FOR 
VB 2.0.x

on line 1498 look 
for
  
$DB_site->query("UPDATE forum SET 

replycount='
$numberposts',threadcount='$numberthreads',lastpost='$lastpost',lastposter='".addslashes(htmlspecialc

hars
($lastposter))."' WHERE forumid='$forumid'"); 

change it to

  $DB_site
->query("UPDATE forum SET 

replycount='
$numberposts',threadcount='$numberthreads',lastpost='$lastpost',lastposter='".addslashes(htmlspecialc

hars
($lastposter))."',lasttitle='".addslashes($lasttitle)."' WHERE forumid='$forumid'"); 

FOR 
VB 2.2.x

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

change to

        
if ($lastpost!=$currentlastpost) {
                

$lastpostquery=",lastpost='$lastpost',lastposter='".addslashes($lastposter)."',lasttitle='".addslashes($lasttitle)."'";
        } else {
                
$lastpostquery="";
        } 


Thomas P 11-05-2001 08:54 AM

Quote:

Originally posted by Thomas P
Hi,

does it let you edit & update the length of the last title through the cp?
Does it support different settings depending on the forum (on/off & length)?
Thanks,
-Tom

I guess this means "no"... well is there any possibility to change the length of the last title appearing?
-Tom

dxb 11-05-2001 10:35 AM

Sorry PPN I got lost here ... the instruction file in the first post of this hack is still not updated ....

and million thanks for your :)

Scott MacVicar 11-05-2001 01:49 PM

It won't let me update the file or add a new one i keep getting this error.

Will bring it up to FireFly

Scott MacVicar 11-05-2001 02:15 PM

yep its been updated, Firefly made sure it was now...

I don't want to post the contents of the file but try making sure its not your cache causing problems.


All times are GMT. The time now is 04:49 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.02917 seconds
  • Memory Usage 1,869KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (12)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete