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)

Boofo 08-27-2002 01:41 AM

Bingo on the syntax error. :) I don't remember the exact query. It was when I ran the Update Thread Counters in the Admin CP that I got it. Also, like I said above. Every so often, when I click on the link to the last post title, it gives me an errorid (no thread identified error) and if I open Edit thread for that thread and click save without doing anything else, it fixes it. :)

Boofo 08-27-2002 05:57 AM

Scott, I've got an update to my problem here. This is the error I just got when I clicked on the link on the forum home to a new thread.

Quote:

No thread specified. If you followed a valid link, please notify the Webmaster
When I went in to the thread, there was only the first post in it (the new thread post). I did a test message (so there are 2 posts now in the thread) and when I went back to the forumhome and clicked on the link again, this time it worked and took me to the first post. I then erased the second message (the test message) and now there is only the original post left in it. When I clicked on the link in the forumhome, it works fine again. It must have something to do with there only being one post in the thread or something. I'm just guessing here. :) Any ideas on this one?

Do you think you can do a small update to fix this and the apostrophe problems before the updated version for 2.2.7 comes out? :) I'm still using 2.2.5 and will be at least until version 3 comes out.

Boofo 08-31-2002 07:34 PM

Scott, here is the db error I just got after clicking on the last post in one of the forums on the forumhome. Is there a way to fix it? :)

Quote:

Database error in vBulletin 2.2.5:

Invalid SQL: SELECT threadid FROM post WHERE username='Boofo's Babe' AND dateline='1030675088'
mysql error: You have an error in your SQL syntax near 's Babe' AND dateline='1030675088'' at line 1

mysql error number: 1064

Date: Saturday 31st of August 2002 09:28:05 PM
Script: http://www.bearfacts2.com/forum/foru...ead&forumid=23
Referer: http://www.bearfacts2.com/forum/index.php?s=

NTLDR 08-31-2002 07:39 PM

Quote:

Originally posted by Boofo
Scott, here is the db error I just got after clicking on the last post in one of the forums on the forumhome. Is there a way to fix it? :)
I don't know what query this is as I don't have the hack installed, but you need to addslashes to the username:

PHP Code:

username='".addslashes($username)."' 

$username is the part of the query that has the username it in, not sure what it is for this hack ;)

Scott MacVicar 08-31-2002 09:16 PM

Is this with another hack Boofo because i dont have a link to goto=newthread in my showthread.php, though the addslashes it what is missing from the query.

Boofo 09-01-2002 01:49 AM

I think I fixed it but I'm not sure if I did it right. :)

Here's the code I started out with:

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

And heres' what I changed it to:

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='".addslashes($foruminfo[lastposter])."' AND dateline='$foruminfo[lastpost]'"));
    header("Location: showthread.php?s=$session[sessionhash]&threadid=$lastthread[threadid]");
    exit;
  }
}

Also, I'm getting this error sometimes when I click on a last post on forumhome link. For some reason, when that happens, it isn't passing the threadid to the &threadid line. Any idea what could be causing that?

Quote:

No thread specified. If you followed a valid link, please notify the Webmaster

Baptizer 09-02-2002 06:51 PM

Hmm...
it seems as though this doesnt work for version 2.2.7..... :(
the section that involves:

PHP Code:

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="";
        } 

is not in 2.2.7...can smoeone help me? am i wasting my time?

N9ne 09-02-2002 09:27 PM

Has anyone confirmed that this works flawlessly on 2.2.7?

Baptizer 09-02-2002 09:47 PM

I compared the file from 2.2.6 to 2.2.7, and the code i mentioned is not in 2.2.7. I am thinking of going ahead with it anyhow, i really cannot live without the last post not showing up on the front forum page.....

I am guessing you havnt tried it yet?

Baptizer 09-03-2002 12:22 AM

I think i might have got this working on 2.2.7.

How do i right justify the LAST TOPIC in the LAST POST column? mine are being centered, and my box is big!


All times are GMT. The time now is 04:42 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.01689 seconds
  • Memory Usage 1,755KB
  • 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
  • (2)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