View Full Version : Topic Image on vBA articles.
I whipped this up for my forums a couple weeks ago. :)
This will display the topic image along with the article on vBA home (If you get the feed from the forum where articles are defined, you will see the article image in the template).
Modifications needed (in #FORUM_DIR#/modules/news.php): [vBA File]
Find:
$news['message'] = substr($news['message'], 0, strrpos(substr($news['message'], 0, $mod_options['portal_news_maxchars']), ' ')) . '...' . construct_phrase($vbphrase['read_more'], $vbulletin->options['bburl'], $news['threadid'], $session['sessionurl']);
}
Below Add:
// GARS modification
$geek = array();
$getgeek = $db->query_read("SELECT header_image FROM " . TABLE_PREFIX . "gars WHERE threadid=" .$news['threadid'] . "");
while ($geeksql = $db->fetch_array($getgeek)) {
$geek[] = $geeksql['header_image'];
}
// / GARS modification
Then, in templates, you can insert in the vBA newsbit (adv_portal_newsbit)
this code anywhere where you want the image to appear for that article.
Better template modification contributed by Lizard King. :)
<if condition="$geek[0]"> <img align="$stylevar[left]" src="$geek[0]" alt="" style="padding:6px" alt="" border="0"/> <else /> <img align="$stylevar[left]" style="padding:6px" alt="" border="0" src="$news[avatarpath]" title="$news[postusername]'s $vbphrase[avatar]" /> </if>
Demo: http://www.digitalsupremacy.com
Enjoy.
The Geek
11-02-2005, 09:53 PM
Superb! Looks great.
ihatetyping
11-03-2005, 12:09 AM
Yes it does look great & thanks for sharing your coding skills "Cole". :D
NCangler
11-10-2005, 01:40 AM
I tried to use this but when I made the edit to new.php I get this error message:
Parse error: parse error, unexpected T_VARIABLE in /forums/modules/news.php on line 180
Line 180 is: $geek = array();
any screenshots or demos of this? thanks great work
newave
11-14-2005, 04:26 PM
Hello Cole,
This will display the topic image along with the article on vBA home
What is "vBA" ? Is it the vbarticle extension ? vbarticle is not for Vb 3.5 isn't it ?
I can see on your home page (http://www.digitalsupremacy.com) that the list of articles display articles from different forums and sub-categries forums. Is it possible to do this with GARS (we've bought it and we made a lot of tests, but can't find the way to do this :rolleyes: ) ?...
Thanks for your help...
Best Regards
KW802
11-16-2005, 06:40 PM
newave, "vBa" is short for vBadvanced. In this case it's the vBadvanced CMPS portal that is being referenced.
http://www.vbadvanced.com
Lizard King
11-17-2005, 04:12 AM
For the template wouldn't be better
<if condition="$geek[0]">
<img align="$stylevar[left]" src="$geek[0]" alt="" style="padding:6px" alt="" border="0"/>
<else />
<img align="$stylevar[left]" style="padding:6px" alt="" border="0" src="$news[avatarpath]" title="$news[postusername]'s $vbphrase[avatar]" />
</if>
Cole, thanks for the contribution! This is exactly what I needed!
Lizardking, thanks for the modification!
:D
Hello Cole,
What is "vBA" ? Is it the vbarticle extension ? vbarticle is not for Vb 3.5 isn't it ?
I can see on your home page (http://www.digitalsupremacy.com) that the list of articles display articles from different forums and sub-categries forums. Is it possible to do this with GARS (we've bought it and we made a lot of tests, but can't find the way to do this :rolleyes: ) ?...
Thanks for your help...
Best Regards
Since GARS transforms your normal forums into an article type system, you can use vBadvanced(vBA is a CMPS system) to show those entries from the forums on your forumhome. But, vBadvanced does not have the feature that allows you to put the topic image you have uploaded on the frontpage, and this modification allows you to do so.
Stachel
11-19-2005, 07:35 PM
That's excellent!
Will definitely use that after I get GARS installed!
Stachel
`
Stachel
11-19-2005, 07:40 PM
This will display the topic image along with the article on vBA home (If you get the feed from the forum where articles are defined, you will see the article image in the template).If 3 images are posted with the main article, which one is put on the home page? The first one?
http://www.digitalsupremacy.comNice forum, & look & feel of site! I will join!
Stachel
If 3 images are posted with the main article, which one is put on the home page? The first one?
Nice forum, & look & feel of site! I will join!
Stachel
GARS has an image upload feature (Like the image for the article, this takes that and puts it on the front page. :)
And thanks for the comments about my website. :)
Uh, anyone who wants to show their support for the modification:
Install Please @ vB.Org
http://www.vbulletin.org/forum/showthread.php?t=99486
Fleabag
05-23-2006, 05:56 AM
Doesn't seem to work with Gars 2.0. :(
Orangeflea
09-19-2006, 07:04 PM
Can someone re-release this to work for the current version of GARS? I'd really, really like the option of putting an article image on my vba homepage.
The Geek
09-19-2006, 08:38 PM
Did you try this? http://www.thevbgeek.com/showthread.php?t=1439
Fleabag
10-03-2006, 03:37 PM
I have that running for other modules. But I just need the image on the vBa news. This would let me replace it, but then I don't get number of views, date posted e.t.c. :(
I had no problem installing it with the lates gars, vbadvanced en vbulletin version.
Fleabag
10-03-2006, 04:08 PM
And you used these instructions, Jorg?
Fleabag
10-03-2006, 08:35 PM
Works for me as well now! Thanks for the push Jorg. :)
serhat
05-23-2007, 06:28 PM
Looks like this is not compatible with vbadvanced 3.0 ?
GrendelKhan{TSU}
07-02-2007, 08:51 AM
anyone got another working demo?
www.digitalsupremacy.com is down.
and is it working for vbadvanced 3.0?
serhat
07-12-2007, 05:02 AM
I need this working for vba 3.0. Anyone?
I do not have a GARS license anymore, so I cannot do the modification, or else I would (it is a very simple code edit).
Has anyone got this working for vba 3.0?
Cocko
11-03-2008, 04:09 PM
Has anyone got this working for vba 3.0?
Would be interresting.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.