简体   繁体   English

如何在MySQL上获取vBulletin线程ID?

[英]How can i get vBulletin thread id on MySQL?

$reviewsthread = $vbulletin->db->query_first("
    SELECT
        thread.threadid, thread.title,
        post.pagetext AS preview
    FROM
        ".TABLE_PREFIX."thread AS thread INNER JOIN
        ".TABLE_PREFIX."post AS post ON thread.firstpostid = post.postid
    WHERE
        thread.forumid = 12
        AND
        thread.title LIKE '%".$vbulletin->db->escape_string($moviedata['title'])."%'
    LIMIT
        1
");

Above is a part of php code to display the post content from a forum thread on external movie page. 上面是php代码的一部分,用于在外部电影页面上显示来自论坛主题的帖子内容。

Let's say that am viewing AVATAR movie page. 假设正在查看AVATAR电影页面。 It's automatically checking forum (only movie reviews forum which is id(12) ) if there is any thread title contains "avatar" word. 它会自动检查论坛(仅id(12)的电影评论论坛)是否有任何包含“头像”字样的主题。 If yes, then it is displaying the thread post content in the movie page. 如果是,则它将在电影页面中显示主题发布内容。

Since i would like to give a link to that thread, i need to know the thread title too. 由于我想提供该线程的链接,因此我也需要知道线程标题。

At this point i need help. 在这一点上我需要帮助。 How can i get the forum thread id so i can add a link html template such as : 我如何获取论坛线程ID,以便添加链接html模板,例如:

<a href="showthread.php?t=$moviereviewthreadid">Click here to read the entire review...</a>

Thanks in advance... Regards 在此先感谢...问候

Can you explain more? 你能解释更多吗?

it seems that the answer is inside your question ! 答案似乎在您的问题内!

the URL of threads in vb vb中线程的URL

<a href="SITE URL/showthread.php?t=THREAD ID > title </a>

so you may assign it to var then put it like you do : 因此您可以将其分配给var,然后像您一样放置它:

$moviereviewthreadid = $vbulletin->db->query_read("SELECT thread.threadid FROM ".TABLE_PREFIX."thread WHERE forumid = 12 ")

Then : 然后 :

<a href="showthread.php?t=$moviereviewthreadid">Click here to read the entire review...</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM