如何在 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
");

以上是 php 代码的一部分,用于在外部电影页面上显示论坛线程的帖子内容。

假设正在查看阿凡达电影页面。它会自动检查论坛(只有 id(12( 的电影评论论坛(是否有任何线程标题包含"头像"字。如果是,则在电影页面中显示主题帖子内容。

由于我想提供指向该线程的链接,因此我还需要知道线程标题。

在这一点上,我需要帮助。如何获取论坛线程 ID,以便添加链接 html 模板,例如:

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

提前感谢...问候

你能解释更多吗?

似乎答案就在你的问题里面!

vb 中线程的网址

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

所以你可以把它分配给var,然后像你一样放它:

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

然后:

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