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 11-11-2001 03:18 PM

look for

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

change to

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

your looking for the above one if you still can't find it your looking for

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

this in specific

The Realist 11-11-2001 04:01 PM

I cannot find the above, the nearest I can find is the below:

$lastposts=$DB_site->query_first("SELECT MAX(lastpost) AS lastpost FROM thread WHERE forumid=$forumid AND visible=1 AND open<>10");
if ($lastposts['lastpost']>$lastpost) {
$lastposts=$DB_site->query_first("SELECT lastpost,lastposter FROM thread WHERE lastpost='$lastposts[lastpost]'");
$lastpost=$lastposts['lastpost'];
$lastposter=$lastposts['lastposter'];
}

:(

Scott MacVicar 11-11-2001 06:19 PM

ok change the following
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']; 


to

PHP Code:

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


I'll update the documentation with this then

The Realist 11-11-2001 06:53 PM

Its still has not updated the posts that have already been made. Its working if a member posts a current message but it does not update at all with any old posts.

I have change what you stated above and still no joy?

:)

LuBi 11-12-2001 01:12 AM

This hack didn't work for me on 2.2 I get the following error.

Parse error: parse error in /www/htdocs/forums/newthread.php on line 375

It's the ?> at the end of the document. I use EditPlus 2 to edit my files, why is it doing this?

dxb 11-12-2001 05:54 AM

also this may couse a problem

PHP Code:

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

the new function file has the query changed to this

PHP Code:

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

you can see the $lastpostquery is added to the query

Scott MacVicar 11-12-2001 06:20 AM

dxb >
i took that into account and its mentioned within the readme for how to do it to 2.2.x and 2.0.x because of the difference.

Lubi >
does EditPlus have syntax highlighting for PHP? if so then it should show where it went wrong, if not PHPed from http://soysal.com does and is useful for spotting errors.
I honestly don't know what would cause an error like that, you were only updating 3 lines within newreply.php

LuBi 11-12-2001 06:25 AM

Well I dunno either I do have the sytax colors but the code isn't wrong I think the software must be doing something when I save the file. I've never had this problem with Textpad but I like Editplus 2 way better... I dunno but I can't install any hacks until I get this squared away :eek:

LuBi 11-14-2001 03:49 AM

How can I make the title of the post/thread a link to the post..? Basically like below... Icon and all...

http://www.suprascene.com/temp/likethis.gif

Ubb style.. Can someone maybe write the template because i don't have the slightest... :confused: thanks ;)

I had it like this on 2.0.3 but I dunno what to do...

mojotim 11-14-2001 09:46 AM

Hi, great hack.

This typo gave me some problems:
within it you may add $form['lasttitle'] to show

Duh, I should have checked that!


All times are GMT. The time now is 12: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.01317 seconds
  • Memory Usage 1,754KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)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