Announcement

Collapse
No announcement yet.

How To Add Little Images For Certain Forums In The Forum Listing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jake Bunce
    replied
    Getting back to just displaying single images next to forums (not the on/off images)...

    To add images to category forums, you can use similar code. Edit this template:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_forumbit_level1_nopost

    Add the red code:

    Code:
    <tbody>
    	<tr>
    		<td class="tcat" colspan="<if condition="$vboptions[showmoderatorcolumn]">6<else />5</if>">
    			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumbit_$forumid')"><img id="collapseimg_forumbit_$forumid" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_forumid}.gif" alt="" border="0" /></a>
    
    			[color=red]<if condition="in_array($forum['forumid'], array(X,Y,Z))">
    				<img src="images/forum_pics/$forum[forumid].gif" align="left" style="margin-right: 9px" alt="" border="0" />
    			</if>[/color]
    
    			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
    			<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    			<if condition="$show['subforums']"><div class="smallfont"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    		</td>
    	</tr>
    </tbody>
    <if condition="$childforumbits">
    <tbody id="collapseobj_forumbit_$forumid" style="{$collapseobj_forumid}">
    $childforumbits
    </tbody>
    </if>
    And edit this template:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_forumbit_level2_nopost

    Add the red code:

    Code:
    <tr>
    	<td class="tcat"><span class="smallfont">&nbsp;</span></td>
    	<td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">5<else />4</if>">
    
    		[color=red]<if condition="in_array($forum['forumid'], array(X,Y,Z))">
    			<img src="images/forum_pics/$forum[forumid].gif" align="left" style="margin-right: 9px" alt="" border="0" />
    		</if>[/color]
    
    		<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
    		<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    		<if condition="$show['subforums']"><div class="smallfont"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    	</td>
    </tr>
    $childforumbits
    Where X,Y,Z is a comma separated list of forumids for the categories for which you want the images to show.

    As before, upload the pictures to the images/forum_pics directory using the specified naming convention.

    See the attached images to see what this looks like.
    Attached Files

    Leave a comment:


  • Jake Bunce
    replied
    Along the same lines as this modification, many people want to not just add the extra images, but to completely replace the on/off images with the extra images.

    If you have a full set of on/off images, one for every forumid on your forum, then make the following changes:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_forumbit_level2_post

    Replace the red code:

    Code:
    <tr align="center">
    	<td class="alt2"><img src="[color=red]$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif[/color]" alt="" border="0" /></td>
    	<td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]">
    		<div>
    			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
    			<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
    		</div>
    		<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    		<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
    		<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    	</td>
    	<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    	<td class="alt1">$forum[threadcount]</td>
    	<td class="alt2">$forum[replycount]</td>
    	<if condition="$vboptions['showmoderatorcolumn']">
    	<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
    	</if>
    </tr>
    $childforumbits
    ...with the blue code:

    Code:
    <tr align="center">
    	<td class="alt2"><img src="[color=blue]images/forum_pics/$forum[forumid]_$forum[statusicon].gif[/color]" alt="" border="0" /></td>
    	<td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]">
    		<div>
    			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
    			<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
    		</div>
    		<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    		<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
    		<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    	</td>
    	<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    	<td class="alt1">$forum[threadcount]</td>
    	<td class="alt2">$forum[replycount]</td>
    	<if condition="$vboptions['showmoderatorcolumn']">
    	<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
    	</if>
    </tr>
    $childforumbits
    Make the same change to this template:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_forumbit_level1_post

    Code:
    <tbody>
    	<tr align="center">
    		<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">
    		
    		<table cellpadding="0" cellspacing="0" border="0">
    		<tr>
    			<td><img src="[color=blue]images/forum_pics/$forum[forumid]_$forum[statusicon].gif[/color]" alt="" border="0" /></td>
    			<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
    			<td>
    			<div>
    				<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
    				<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
    			</div>
    			<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    			<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
    			<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    			</td>
    		</tr>
    		</table>
    		
    		</td>
    		<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    		<td class="alt1">$forum[threadcount]</td>
    		<td class="alt2">$forum[replycount]</td>
    		<if condition="$vboptions['showmoderatorcolumn']">
    		<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
    		</if>
    	</tr>
    </tbody>
    <if condition="$childforumbits">
    <tbody>
    	$childforumbits
    </tbody>
    </if>
    As before, you need to create a new folder named forum_pics inside of the images folder within your forum directory. Upload the images using this naming convention:

    forumid_old.gif
    forumid_new.gif

    If the forumid of the forum is 3, then you would name its images like this:

    3_old.gif
    3_new.gif

    That's it.

    The previous instructions assume you have a complete set of on/off images, one for every forumid on your forum. If you don't have a complete set, and you just want to replace the on/off images for specific forums, then you can use this blue code instead.

    Using the forumhome_forumbit_level2_post template as an example:

    Code:
    <tr align="center">
    	<td class="alt2"><img src="[color=blue]<if condition="in_array($forum[forumid], array([color=red]X,Y,Z[/color]))">images/forum_pics/$forum[forumid]_$forum[statusicon].gif<else />$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif</if>[/color]" alt="" border="0" /></td>
    	<td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]">
    		<div>
    			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
    			<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
    		</div>
    		<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    		<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
    		<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    	</td>
    	<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    	<td class="alt1">$forum[threadcount]</td>
    	<td class="alt2">$forum[replycount]</td>
    	<if condition="$vboptions['showmoderatorcolumn']">
    	<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
    	</if>
    </tr>
    $childforumbits
    Use the same code in the forumhome_forumbit_level1_post template:

    Code:
    <tbody>
    	<tr align="center">
    		<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">
    		
    		<table cellpadding="0" cellspacing="0" border="0">
    		<tr>
    			<td><img src="[color=blue]<if condition="in_array($forum[forumid], array([color=red]X,Y,Z[/color]))">images/forum_pics/$forum[forumid]_$forum[statusicon].gif<else />$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif</if>[/color]" alt="" border="0" /></td>
    			<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
    			<td>
    			<div>
    				<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
    				<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
    			</div>
    			<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    			<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
    			<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    			</td>
    		</tr>
    		</table>
    		
    		</td>
    		<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    		<td class="alt1">$forum[threadcount]</td>
    		<td class="alt2">$forum[replycount]</td>
    		<if condition="$vboptions['showmoderatorcolumn']">
    		<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
    		</if>
    	</tr>
    </tbody>
    <if condition="$childforumbits">
    <tbody>
    	$childforumbits
    </tbody>
    </if>
    Where X,Y,Z is a comma separated list of forumids for which you have custom on/off images. Do like in the previous instructions and upload your images to the images/forum_pics directory using the specified naming convention.

    Now the X,Y,Z forums will use your custom images, while all other forums will continue to use the standard on/off images.

    Leave a comment:


  • Jake Bunce
    replied
    And to make this work for level1 forums:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_forumbit_level1_post

    Add the red code:

    Code:
    <tbody>
    	<tr align="center">
    		<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">
    		
    		<table cellpadding="0" cellspacing="0" border="0">
    		<tr>
    			<td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
    			<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
    			<td>
    
    			[color=red]<td>
    				<if condition="in_array($forum['forumid'], array(X,Y,Z))">
    					<img src="images/forum_pics/$forum[forumid].gif" alt="" border="0" />
    				</if>
    			</td>
    
    			<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
    			<td>[/color]
    
    			<div>
    				<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
    				<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
    			</div>
    			<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    			<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
    			<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    			</td>
    		</tr>
    		</table>
    		
    		</td>
    		<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    		<td class="alt1">$forum[threadcount]</td>
    		<td class="alt2">$forum[replycount]</td>
    		<if condition="$vboptions['showmoderatorcolumn']">
    		<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
    		</if>
    	</tr>
    </tbody>
    <if condition="$childforumbits">
    <tbody>
    	$childforumbits
    </tbody>
    </if>
    Don't forget to change the X,Y,Z.

    Leave a comment:


  • How To Add Little Images For Certain Forums In The Forum Listing

    See attached picture to see what this looks like.

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_forumbit_level2_post

    Add the red code:

    Code:
    <tr align="center">
    	<td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
    	<td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]">
    
    		[color=red]<if condition="in_array($forum['forumid'], array(X,Y,Z))">
    			<img src="images/forum_pics/$forum[forumid].gif" align="left" style="margin-right: 9px" alt="" border="0" />
    		</if>[/color]
    
    		<div>
    			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
    			<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
    		</div>
    		<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    		<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
    		<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    	</td>
    	<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    	<td class="alt1">$forum[threadcount]</td>
    	<td class="alt2">$forum[replycount]</td>
    	<if condition="$vboptions['showmoderatorcolumn']">
    	<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
    	</if>
    </tr>
    $childforumbits
    Where X,Y,Z is a comma-separated list of forumids that have images.

    After making this change you need to upload the images. Create a new folder named forum_pics inside of the images folder within your forum directory. Upload the images using this naming convention:

    forumid.gif

    If the forumid of the forum is 3, then you would name its image 3.gif

    edit: added style="margin-right: 9px" to the code so the image is spaced slightly from the forum title and description.
    Attached Files
    Last edited by Jake Bunce; Fri 17 Sep '04, 8:50am.
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X