PDA

View Full Version : Specific image per forum category


Renada
Tue 24th Jun '08, 1:49pm
Hi all,

I would like to have a small image displayed in the top right hand corner of the first message in each thread. The image would be different for each forum category.

For instance:

Category A: All first posts in this category would have image 1

Category B: All first posts in this category would have image 2

Category C: All first posts in this category would have image 3

etc etc...

Does anyone know how I could do this and which template I need to edit please?

Regards,
Renada :)

Jake Bunce
Tue 24th Jun '08, 3:17pm
Edit the postbit:

Admin CP -> Styles & Templates -> Style Manager -> « » -> Postbit Templates -> postbit or postbit_legacy (depending on which layout you are using)

Use this code:


<if condition="$GLOBALS[forumid] == X">
<img src="path/to/image.gif" alt="" border="0" />
</if>


Where X is the forumid of the forum in which you want the image to show.

Renada
Tue 24th Jun '08, 8:15pm
Edit the postbit:

Admin CP -> Styles & Templates -> Style Manager -> « » -> Postbit Templates -> postbit or postbit_legacy (depending on which layout you are using)

Use this code:


<if condition="$GLOBALS[forumid] == X">
<img src="path/to/image.gif" alt="" border="0" />
</if>
Where X is the forumid of the forum in which you want the image to show.

Thanks Jake,

Will that code restrict the image to the first message of the thread only? Also for different forums do I just duplicate the code in the postbit with the relevant forum id and image?

Regards,
Renada

Jake Bunce
Wed 25th Jun '08, 5:08pm
Use this to restrict it to the first post:


<if condition="$GLOBALS[forumid] == X AND $post[postcount] == 1">
<img src="path/to/image.gif" alt="" border="0" />
</if>


Yes you can duplicate this code with different forumids to cover a range of images.