The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Make the current forum's name to appear(inside a template)
Hello, is there anyway that i can print on the screen the name of the current forum i am serfing?
I need this to be done from within a template. I use this code as a header of a table Quote:
I want this to print: Latest 6 Uploads In "The name of the current forum" So if i am serfing a forum named "News" i want this to print Latest 6 Uploads In News |
#2
|
||||
|
||||
You can do that if the variable is available. You've said nothing about what template you are trying to do this in.
|
#3
|
|||
|
|||
This template is called "lattest_x_attachments_forumdisplay" and i call this template inside forumdisplay.
Is there other info that i could provide you? This is the "lattest_x_attachments_forumdisplay" template Quote:
|
#4
|
||||
|
||||
What hook location are you using to eval that template? Go find that hook in the code. Then look above that code and see what variables are available to you for use.
|
#5
|
|||
|
|||
Code:
eval('$latest_x_attachments_forumdisplay = "' . fetch_template('latest_x_attachments_forumdisplay') . '";'); global $db, $vbulletin, $vbphrase, $latest_x_attachments; The plugin has some queries in it. Code:
$query = $vbulletin->db->query_read(" SELECT a.attachmentid, a.userid, p.username, a.dateline, a.filename, a.filesize, a.counter, p.postid, p.pagetext, t.threadid, t.title FROM " . TABLE_PREFIX . "attachment AS a LEFT JOIN " . TABLE_PREFIX . "post AS p ON (a.postid = p.postid) LEFT JOIN " . TABLE_PREFIX . "thread AS t ON (p.threadid = t.threadid) WHERE a.thumbnail_filesize > '0' AND t.forumid = '" . $foruminfo['forumid'] . "' $order"); |
#6
|
||||
|
||||
That query doesn't grab the forumid at all. It references it in the where statement, but you don't have it in the select statement at all, so it's not available. You will probably have to JOIN on the forum table to get the forum title.
|
#7
|
|||
|
|||
ok let's say that i did this...
i put the forum's name at the select and include the forum table with an inner join... how can i use it at the template? |
#8
|
||||
|
||||
You didn't show the line after the query that would provide me with the variable name to give you, so I don't know, but something like $variablename[title] probably (assuming the eval is within the while statement).
|
#9
|
|||
|
|||
Ok i got it.
Because my Sql is rusty could you please provide me the correct code? --------------- Added [DATE]1245698588[/DATE] at [TIME]1245698588[/TIME] --------------- Ok i made it Code:
$query = $vbulletin->db->query_read(" SELECT a.attachmentid, a.userid, p.username, a.dateline, a.filename, a.filesize, a.counter, p.postid, p.pagetext, t.threadid, t.title, f.title FROM " . TABLE_PREFIX . "attachment AS a LEFT JOIN " . TABLE_PREFIX . "post AS p ON (a.postid = p.postid) LEFT JOIN " . TABLE_PREFIX . "thread AS t ON (p.threadid = t.threadid) LEFT JOIN " . TABLE_PREFIX . "forum AS f ON (f.forumid = t.forumid) WHERE a.thumbnail_filesize > '0' AND t.forumid = '" . $foruminfo['forumid'] . "' $order"); $thumbnails = ''; while($i < $max && $rows = $db->fetch_array($query)) { if($foruminfo['forumid']) { $i++; $array[$i][attachmentid] = $rows['attachmentid']; $array[$i][postid] = $rows['postid']; $array[$i][thumbnail] = $rows['thumbnail']; $array[$i][dateline] = $rows['dateline']; $array[$i][filename] = $rows['filename']; $array[$i][filesize] = $rows['filesize']; $array[$i][userid] = $rows['userid']; $array[$i][username] = $rows['username']; $array[$i][title] = $rows['title']; //$array[$i][title] = $rows['title']; } How can i use it? |
#10
|
||||
|
||||
Then in your select, say "f.title as ftitle" and then you would use "$array[$i][ftitle] = $rows['ftitle']", etc.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|