The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
vBulletin 4 article widget modification
Hello there,
I want to create an article widget and thought to ask some advice from you guys. I want a widget that will list articles from a preferred section. So far so good, i can use the default vBulletin 4 widget. But instead of having the poster's avatar images beside each thread listing, i want it to show the article's image. Do you think something like that could be possible by changing the appropriate template? ... and how? Thanx. |
#2
|
|||
|
|||
Anybody who knows how to do this?
|
#3
|
||||
|
||||
You'd have to change more than just the template, you would probably have to change the widget code also because I would guess the article image is not in the query. Look in packages/vbcms/widgets/recentarticle.php
|
#4
|
|||
|
|||
Thank you for your answer Lynne!
Although i think this is way beyond my coding knowledge, i will give it a shot and maybe understand what i must do. Ok... so heres the part i find that refers to the avatar: Code:
//get the avatar if (vB::$vbulletin->options['avatarenabled']) { $article['avatar'] = fetch_avatar_from_record($article); } $articles[$article['nodeid']] = $article; } |
#5
|
||||
|
||||
Actually, you can just ignore the avatar stuff. I mean, who cares if they grab the avatar? What I'm talking about is the query to grab the articles and whether the previewimage is in the query. It actually looks like it is - look around line 308. So, right around where they get the article is where you would need to define the previewimage variables. You probably want to change the height/width there also.
|
#6
|
|||
|
|||
Thank you for the answer Lynne.
Sorry but i don't get it. I mean ok the previewimage is in the query from what it looks like in line 308, if i get it right now. Nawww... i don't get it. I think this is way over my head for me to workaround. |
#7
|
||||
|
||||
Did you try just modifyin gthe template to use it? I mean, it looks like it is already available via the query.
HTML Code:
<vb:if condition="$article['previewimage']"> <img alt="previewimage" src="{vb:raw article.previewimage}" with="50" height="50" /> <vb:else /> show something else </vb:if> |
#8
|
|||
|
|||
I am going to try it and get back at you. Thank you!
|
#9
|
|||
|
|||
Worked like a charm! Yay!
Thank you so much Lynne! PS. Haven't found how to change the icon size though yet. The "height" "width" combo in the code does not work with this widget. It's fixed on 30X30. Edit: found it... stylevar. |
#10
|
|||
|
|||
HI Mihalis...
Could u share the code with us? I'm very interested in this widget modification.. Ty in advance. Ara |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|