[英]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代码的一部分,用于在外部电影页面上显示来自论坛主题的帖子内容。
假设正在查看AVATAR电影页面。 它会自动检查论坛(仅id(12)的电影评论论坛)是否有任何包含“头像”字样的主题。 如果是,则它将在电影页面中显示主题发布内容。
由于我想提供该线程的链接,因此我也需要知道线程标题。
在这一点上我需要帮助。 我如何获取论坛线程ID,以便添加链接html模板,例如:
<a href="showthread.php?t=$moviereviewthreadid">Click here to read the entire review...</a>
在此先感谢...问候
你能解释更多吗?
答案似乎在您的问题内!
vb中线程的URL
<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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.