Back to vBulletin 3.6 Add-ons

Automated Simple Catagory Icons
Mod Version: 1.01, by MThornback

This modification is in the archives.
vB Version: 3.6.7 Rating: (1 vote - 5.00 average) Installs: 17
Released: 08 May 2007 Last Update: 06 Jul 2007 Downloads: 266
Not Supported Uses Plugins Template Edits  

This is an automated version of these hacks:

Spoiler (click to open)


To automate this somewhat....

make a new plugin on the forumbit_display hook.

Code:
$showCustom[$forum['forumid']] = false;
if (is_file("path/to/forum/images/statusicon/forum".$forum['forumid']."_new.gif")) {
    $showCustom[$forum['forumid']] = true;
}
In the template edits, replace the authors code with this (its still the authors code...which is why i'm not releasing it as my own...its just moved around and with a few conditionals):

Code:
<td>
			<if condition="$vboptions[customimg_enabled] == 1">
				<if condition="$forum[customimg] == ''">
					<if condition="$showCustom[$forum[forumid]] == true">
						<img src="$stylevar[imgdir_statusicon]/forum$forum[forumid]_$forum[statusicon].gif" alt="" border="0" />
					<else />
						<img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" />
					</if>
				<else />
						<img src="$forum[customimg]" alt="" border="0" id="forum_statusicon_$forum[forumid]" />
				</if>
			<else />
				<if condition="$showCustom[$forum[forumid]] == true">
					<img src="$stylevar[imgdir_statusicon]/forum$forum[forumid]_$forum[statusicon].gif" alt="" border="0" />
				<else />
					<img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" />
				</if>
			</if>
			</td>

If it works (it does for me) it should replace for forums that have an image in the right folder, otherwise display the default. The best of both worlds

Enjoy!

Close

http://www.vbulletin.org/forum/showt...=127426&page=2

by Starbug & Adrian., all credit goes to them for the original concept. Thanks to Brad Flynn for his help also.

Also: Thank you to BadgerDog for noticing I missed an ID off one of the find instructions

What it does:
Allows you to use a set of custom icons on a per forum basis. No settings needed, the plugin will look for a set of images that meet the conditions I outline in the instructions and display them if they exist. The default VB icons if they don't.

NOTE:
You will need your forum icons to be named like this:

forumx_old.gif
forumx_old_lock.gif
etc...

where x is the forum id number

for the new images to work. If you don't, only the defaults will appear.

Please Remember to make all 4 icons "new" "old" "new_lock" & "old_lock" an error has been reported that if all 4 don't exist, guests and unregistered may not see the default icons.

Instructions:
Use either the installer or the plugin to make a new plugin.
OR create it yourself on the on the forumbit_display hook. With this code:

Code:
$showCustom[$forum['forumid']] = false;
if (is_file("path/to/forum/images/statusicon/forum".$forum['forumid']."_new.gif")) {
    $showCustom[$forum['forumid']] = true;
}
In forumhome_forumbit_level1_post find:

Code:
<img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" />
Replace with:
Code:
<if condition="$vboptions[customimg_enabled] == 1">
	<if condition="$forum[customimg] == ''">
		<if condition="$showCustom[$forum[forumid]] == true">
			<img src="$stylevar[imgdir_statusicon]/forum$forum[forumid]_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]"/>
		<else />
			<img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" />
		</if>
		<else />
			<img src="$forum[customimg]" alt="" border="0" id="forum_statusicon_$forum[forumid]" id="forum_statusicon_$forum[forumid]"/>
		</if>
		<else />
		<if condition="$showCustom[$forum[forumid]] == true">
			<img src="$stylevar[imgdir_statusicon]/forum$forum[forumid]_$forum[statusicon].gif" alt="" border="0" />
		<else />
			<img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" />
	</if>
</if>


In forumhome_forumbit_level2_post find:

Code:
<img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" />
Replace with:

Code:
<if condition="$vboptions[customimg_enabled] == 1">
	<if condition="$forum[customimg] == ''">
		<if condition="$showCustom[$forum[forumid]] == true">
			<img src="$stylevar[imgdir_statusicon]/forum$forum[forumid]_$forum[statusicon].gif" alt="" border="0" />
		<else />
			<img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" id="forum_statusicon_$forum[forumid]"/>
		</if>
		<else />
			<img src="$forum[customimg]" alt="" border="0" id="forum_statusicon_$forum[forumid]" />
		</if>
		<else />
		<if condition="$showCustom[$forum[forumid]] == true">
			<img src="$stylevar[imgdir_statusicon]/forum$forum[forumid]_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]"/>
		<else />
			<img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" />
	</if>
</if>

Download

This modification is archived, downloads are still allowed.

File Type: %1$s vbulletin-plugins.xml (449 Bytes, 107 downloads)
File Type: %1$s automated_simplecat.txt (3.3 KB, 80 downloads)
File Type: %1$s product-asci.xml (770 Bytes, 72 downloads)

Similar Mods

Forum Home Enhancements Catagory Icons vBulletin 3.6 Add-ons

vblts.ru supports vBulletin®, 2022-2024