The vB Geek

The vB Geek (http://www.thevbgeek.com/index.php)
-   Add-ons (http://www.thevbgeek.com/forumdisplay.php?f=16)
-   -   Topic Image on vBA articles. (http://www.thevbgeek.com/showthread.php?t=421)

Cole 11-02-2005 08:13 PM

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:
PHP Code:

$news['message'] = substr($news['message'], 0strrpos(substr($news['message'], 0$mod_options['portal_news_maxchars']), ' ')) . '...' construct_phrase($vbphrase['read_more'], $vbulletin->options['bburl'], $news['threadid'], $session['sessionurl']);
                } 

Below Add:
PHP Code:

// 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. :)

HTML Code:

<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 08:53 PM

Superb! Looks great.

ihatetyping 11-02-2005 11:09 PM

Yes it does look great & thanks for sharing your coding skills "Cole". :D

NCangler 11-10-2005 12: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();

eko 11-10-2005 03:02 AM

any screenshots or demos of this? thanks great work

newave 11-14-2005 03:26 PM

Hello Cole,
Quote:

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 05: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 03:12 AM

For the template wouldn't be better
HTML Code:

<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>


Jorg 11-18-2005 11:38 PM

Cole, thanks for the contribution! This is exactly what I needed!
Lizardking, thanks for the modification!

:D

Cole 11-19-2005 04:56 PM

Quote:

Originally Posted by newave
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.


All times are GMT. The time now is 06:54 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

Release powered by GARS 2.1.9 ©2005-2006