Announcement

Collapse
No announcement yet.

Getting the threadid of a thread

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting the threadid of a thread

    In a link with the format

    http://webdesignforums.net/showthread.php?goto=lastpost&forumid=16

    ...in which the threadid is not specified, the threadid also doesn't appear to be set in $thread['threadid'] or $threadinfo['threadid'] (in the phpinclude_end scope). I have some scripting (not hacks!) that rely on this. So how can I get the threadid from one of the preset variables?
    --filburt1, vBulletin.org/vBulletinTemplates.com moderator
    Web Design Forums.net: vB Board of the Month
    vBulletin Mail System (vBMS): webmail for your forum users

  • #2
    In showthread.php

    PHP Code:
     // goto last post
     
    case 'lastpost':
     
    $threadid intval($_REQUEST['threadid']); 
    so perhaps you can use the third line yourself to retreive the threadid

    Comment


    • #3
      $_REQUEST['threadid'] doesn't seem to be set, but trying anyway...
      --filburt1, vBulletin.org/vBulletinTemplates.com moderator
      Web Design Forums.net: vB Board of the Month
      vBulletin Mail System (vBMS): webmail for your forum users

      Comment


      • #4
        ...and it doesn't work.
        --filburt1, vBulletin.org/vBulletinTemplates.com moderator
        Web Design Forums.net: vB Board of the Month
        vBulletin Mail System (vBMS): webmail for your forum users

        Comment


        • #5
          Because a link of that format redirects to one that contains a threadid, the point is moot, but thanks anyway.
          --filburt1, vBulletin.org/vBulletinTemplates.com moderator
          Web Design Forums.net: vB Board of the Month
          vBulletin Mail System (vBMS): webmail for your forum users

          Comment


          • #6
            PHP Code:
             case 'lastpost':
              
            $threadid intval($_REQUEST['threadid']);
              if (!empty(
            $_REQUEST['forumid']))
              { 
            // this one needs to stay AS $_REQUEST!
               
            $forumid verify_id('forum'$forumid10);
               
            $thread $DB_site->query_first("
                SELECT threadid
                FROM " 
            TABLE_PREFIX "thread AS thread
                LEFT JOIN " 
            TABLE_PREFIX "deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')
                WHERE forumid IN (
            $foruminfo[childlist]) AND visible = 1 AND (sticky = 1 OR sticky = 0)
                AND lastpost >= " 
            . ($foruminfo['lastpost'] - 30) . " AND open <> 10 AND deletionlog.primaryid IS NULL
                ORDER BY lastpost DESC
                LIMIT 1
               "
            );
               
            $threadid $thread['threadid'];
              } 
            If you look @ the 2nd last line, it assigns the value to $threadid
            Perhaps that will work

            Comment


            • #7
              Oh lol, just read your 4th post

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...
              X