The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
![]()
I searched for a few terms but couldn't really find anything helpful. I've been trying for the past couple hours trying to get this to work. I'm trying to pull thread information from the latest one posted in our News forum and display bits of it in the HEADER template.
I've also tried putting the same code in FORUMHOME template in case it was something associated with the hook I chose but still does not work. I did something very similar to this on vBulletin 3.x (used the plugin code and called it via $news1_title, etc) but seems I'm missing something here. Also would like to note that this is pretty much ripped straight from my external news script, which I posted here for viewing (since I'm not using it on the site atm): http://pokemontopaz.net/sandbox/ Plugin code (using forumhome_complete hook): Code:
$postchars = 250; $news1 = $db->query_first('SELECT title,threadid,views,replycount,postusername,postuserid,dateline FROM ' . TABLE_PREFIX . 'thread WHERE 1 AND forumid = 4 ORDER BY dateline DESC LIMIT 0 , 1'); $news1_title = "<a href=\"forums/showthread.php?" . $vbulletin->session->vars['sessionurl'] . "t=$news1[threadid]\">$news1[title]</a>"; $news1_readmore = "<a href=\"forums/showthread.php?" . $vbulletin->session->vars['sessionurl'] . "t=$news1[threadid]\">[Read More]</a>"; $news1_comment = "<a href=\"forums/newreply.php?do=newreply&noquote=1&" . $vbulletin->session->vars['sessionurl'] . "t=$news1[threadid]\">[Post Comment]</a>"; $news1_replies = "$news1[replycount]"; $news1_views = "$news1[views]"; $news1_post = $db->query_first('SELECT pagetext FROM ' . TABLE_PREFIX . 'post WHERE 1 AND threadid = ' . $news1[threadid] . ' ORDER BY dateline ASC LIMIT 0 , 1'); $news1_postfull = "$news1_post[pagetext]"; $news1_postshort = substr($news1_post[pagetext],0,$postchars); $news1_date = vbdate($vbulletin->options['dateformat'], $news1['dateline']); $news1_time = vbdate($vbulletin->options['timeformat'], $news1['dateline']); $news1_posturl = "<a href=\"forums/member.php?" . $news1[postuserid] . "\">" . $news1[postusername] . "</a>"; Code:
<div id="lugianewscontent"> <h3>$news1_title by $news1_posturl on $news1_date</h3> <p>$news1_postshort... [$news1_readmore]</p> <p>Replies: $news1_replies - Views: $news1_views $news1_comment</p> </div> |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|