The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Calling threadicon in a plugin
PHP Code:
How do I modify it so it can correctly call $thread[iconpath] which is the path of the thread icon? |
#2
|
|||
|
|||
The iconpath is being retrieved by the query, but I don't know what to tell you about using it because the code you posted is using $thread as a string and an array. What does the "while" line look like?
|
#3
|
||||
|
||||
This is a correct code for a plugin, but it still can't call for iconpath.
PHP Code:
|
#4
|
|||
|
|||
Do you have a table prefix defined? If so, you need to add an AS to the FROM line, like:
Code:
$topthreads = $db->query_read(" SELECT thread.threadid, thread.title, thread.iconid, icon.iconid, icon.iconpath FROM " . TABLE_PREFIX . "thread AS thread LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON (icon.iconid = thread.iconid) ORDER BY threadid ASC LIMIT 5 "); But I guess you don't have a prefix, otherwise the query wouldn't work at all. In any case, I tried that query in PHPMyAdmin and it works, but note that if a thread doesn't have an icon assigned (and it seems that most do not), the iconpath will be NULL. |
#5
|
||||
|
||||
Thanks alot!
I managed to get it work. This is a correct code: PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|