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)

Frank-kun 06-01-2002 01:57 PM

Hey, how about that, I solved my own problem ;)

I believe that in 2.2.6, the file to update forum post counts and lastposters was changed, so that the "title" is not part of the SELECT statement that is called in order to get the lastposts info. Because of this, $lasttitle is set to blank because according to the code, it tries to set itself using the "title" variable.

As a quick fix, you can simply have the SELECT statement call the title column again. So if you have this hack installed, your code should look like this:

in admin/functions.php:

PHP Code:

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

Just replace it with:

PHP Code:

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

...and you should have no problems with moving/deleting with PPN's Last Title hack.

Now, I don't know if the "title" was taken out of the code for some reason to fix a bug, but if it was, perhaps a better fix that preserves the bugfix might be more useful. But this one's a quick fix.

Thanks again PPN for a great hack.

Boofo 06-01-2002 02:01 PM

Do you need to chnage it to this for 2.2.5 too or just 2.2.6?

Frank-kun 06-01-2002 06:55 PM

Quote:

Originally posted by Boofo
Do you need to chnage it to this for 2.2.5 too or just 2.2.6?
Probably just for 2.2.6. If you're working ok with the hack and you have 2.2.5 you should probably just leave it be. But if you're having problems when you move or delete posts, then you should probably try to apply the change.

Boofo 06-01-2002 07:33 PM

Would it mess anything up to just go ahead and add it to avoid any problmes that could arise? I mean, if it won't hurt anything then it might be a good idea to go ahead and update it.

Quote:

Originally posted by Frank-kun


Probably just for 2.2.6. If you're working ok with the hack and you have 2.2.5 you should probably just leave it be. But if you're having problems when you move or delete posts, then you should probably try to apply the change.


alanvo 07-03-2002 08:55 AM

it screws up my tables, why is that, can anybody please help me...

http://www.demsang.net/forums

Boofo 07-03-2002 09:42 AM

You need to change the length you want the last time to be in this line:

Code:

$forum['lasttitle'] = substr($forum['lasttitle'], 0, 28);
The default length of the last title is 28 right now. Either make it a smaller number or add space.gif to your forumhome_forumbit_level1_nopost like this:

Code:

<td bgcolor="#1D6AA0" nowrap><smallfont color="#EEEEFF"><img src="https://vborg.vbsupport.ru/images/space.gif" width="200" height="1"><br><b>Last Post</b></smallfont></td>
Quote:

Originally posted by alanvo
it screws up my tables, why is that, can anybody please help me...

http://www.demsang.net/forums


fonzerelli_79 07-04-2002 12:23 PM

i installed the hack on my test forums and everything seems fine when i upload the files

when i change the template though i get this error on the forums home

Quote:

Parse error: parse error, expecting `']'' in ......./index.php(362) : eval()'d code on line 2
any ideas folks? ;)

Dark Jim 07-07-2002 11:02 PM

I would also like to have the posticon used last next to it on the forum home. :)

N9ne 07-09-2002 08:03 PM

[QUOTE]Originally posted by PPN
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.

Boofo 07-16-2002 09:21 PM

Scott,

Have you had a chance to look at the problem I am haing with apostrophes in the last poster name? (Posts 185 and 186 of this thread). :)


All times are GMT. The time now is 04:02 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.01576 seconds
  • Memory Usage 1,774KB
  • 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
  • (2)bbcode_code_printable
  • (5)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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