PDA

View Full Version : Topic Icons


BoNfiRe
06-12-2004, 07:33 AM
I have installed this hack (http://www.vbulletin.org/forum/showthread.php?&threadid=66095) for vb, and wanted to also show the topic icons in my portal I have added $forum[forumhomeicon] to the template now I gather I need to edit my news.php file to include this so I edited it, and added $forum[forumhomeicon] = 'I_just_Don't_Know_What_Goes_Here';

Could anyone please help

TIA B

Brian
06-13-2004, 11:46 AM
news.php - Look for:

pagetext, allowsmilie

Replace that with:

pagetext, allowsmilie, forumhomeicon

And that should do the trick. :)

Our Sponsors
 

BoNfiRe
06-13-2004, 12:20 PM
news.php - Look for:

pagetext, allowsmilie

Replace that with:

pagetext, allowsmilie, forumhomeicon

And that should do the trick. :)

I tried but get the following mysql error mysql error: Unknown column 'forumhomeicon' in 'field list'

Not sure but the query is in the forum table will I not need to tell it to look in there for it ? ( Dunno how or even if you do :confused: lol ) I even tried forum.forumhomeicon thinking that may help but as you can see I know nothing about php lol

Brian
06-13-2004, 03:18 PM
Ahh, sorry about that. I forgot that the forum table isn't joined in that query. If you'll replace that entire query with this, then it should work. :)



$getnews = $DB_site->query("
SELECT " . iif($vba_options['portal_news_showrating'], 'IF(votenum >= ' . $vboptions['showvotes'] . ', votenum, 0) AS votenum, IF(votenum >= ' . $vboptions['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . "
thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, thread.lastposter, thread.lastpost, IF(views<=thread.replycount, thread.replycount+1, views) AS views, thread.forumid, post.postid, pagetext, allowsmilie, forumhomeicon
" . iif ($vba_options['portal_news_showsignature'], ', showsignature, usertextfield.signature') . "
" . iif ($vba_options['portal_news_showicon'] , ',thread.iconid AS threadiconid, iconpath AS threadiconpath') . "
" . iif ($vba_options['portal_news_showavatar'] , ', avatarpath, NOT ISNULL(avatardata) AS hascustom, customavatar.dateline AS avatardateline, avatarrevision') . "
" . iif ($vba_options['portal_news_showsubscribed'] AND $bbuserinfo['userid'] , ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed ') . "
" . iif ($vba_options['portal_news_showattachments'], ', attachment.filename, attachment.filesize, attachment.visible, attachmentid, counter, thumbnail, LENGTH(thumbnail) AS thumbnailsize') . "
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "forum USING (forumid)
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.firstpostid)
" . iif ($vba_options['portal_news_showicon'] , 'LEFT JOIN ' . TABLE_PREFIX . 'icon USING (iconid)') . "
" . iif ($vba_options['portal_news_showattachments'] , 'LEFT JOIN ' . TABLE_PREFIX . 'attachment AS attachment ON (post.postid = attachment.postid)') . "
" . iif ($vba_options['portal_news_showavatar'] OR $vba_options['portal_news_showsignature'],
'LEFT JOIN ' . TABLE_PREFIX . 'user AS user ON (user.userid = post.userid)
') . "
" . iif ($vba_options['portal_news_showsignature'], 'LEFT JOIN ' . TABLE_PREFIX . 'usertextfield AS usertextfield ON (post.userid = usertextfield.userid)') . "
" . iif ($vba_options['portal_news_showavatar'] , '
LEFT JOIN ' . TABLE_PREFIX . 'avatar as avatar ON (avatar.avatarid = user.avatarid)
LEFT JOIN ' . TABLE_PREFIX . 'customavatar as customavatar ON (customavatar.userid = user.userid)
') . "
" . iif ($vba_options['portal_news_showsubscribed'] AND $bbuserinfo['userid'] , ' LEFT JOIN ' . TABLE_PREFIX . 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = \'' . $bbuserinfo['userid'] . '\')') . "
$deljoin
WHERE thread.forumid IN($vba_options[portal_news_forumid]) AND thread.visible = 1 AND thread.open != 10 $notdeleted
GROUP BY post.postid
ORDER BY " . iif($vboptions['stickynewsthreads'], 'sticky DESC,') . " postdateline DESC" . iif($vboptions['shownewsattach'], ', attachmentid') . "
$newslimit");

Our Sponsors
 

BoNfiRe
06-13-2004, 04:20 PM
OK well no error and i c what you have done but no image. I'm stll wondering if I still need to add the global $forum[forumhomeicon] = 'blah'; to news.php ?

I have tried loads of variations but to no avail :(

Brian
06-13-2004, 04:39 PM
Ahhh, I didn't notice what variable you were using in the template at first. Try $news[forumhomeicon] instead. ;)

BoNfiRe
06-13-2004, 05:05 PM
sweet worked a treat Brian thx a lot :)