PDA

View Full Version : Forum Home Enhancements - Automated Simple Catagory Icons


MThornback
05-07-2007, 10:00 PM
This is an automated version of these hacks:

https://vborg.vbsupport.ru/showthread.php?p=1202535#post1202535
https://vborg.vbsupport.ru/showthread.php?t=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:


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


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

Replace with:

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

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

Replace with:


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

MThornback
05-08-2007, 04:17 AM
May 8th 2007
Because of the similarities between this mod and another, I've removed the template edit that I originally released rather than cause a problem!
May 8th 2007...later in the day?
I had another look at my code vs. the similar code, and with the exception of variable names, the organization of the logic of the template edits is tottaly different...I'm going to re-add the template code and leave it to wisdom of the staff if i'm in error.
I added Plugin Code & Template Instructions to the first post and txt file :)
May 16th 2007
Added missing ID tag to one of the find instructions, updated txt file also :)
June 12 2007
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.
July 5 2007
Now supports standard mark forum read double click! :)

dbirosel
05-08-2007, 05:50 AM
Doesn't this do the same as this?

https://vborg.vbsupport.ru/showthread.php?t=127426

MThornback
05-08-2007, 11:36 AM
Wow...the template edit is far too close for me to keep using it...thanks for pointing that out...

The plugin still separates the two releases, so i'm going to release it on its own.

projectego
05-08-2007, 01:39 PM
Looks pretty good to me! Thanks a bunch, MThornback! ;)

iogames
05-08-2007, 02:04 PM
Then... isn't ready yet?

Terminatoronly
05-08-2007, 03:14 PM
its nice but when u use this u will lose the ajax technology of the mark forum read via pressing on the icon of the category

MThornback
05-08-2007, 03:26 PM
Seems so, to be honest, it wasn't something I considered cause I never use it. Thanks for pointing it out :)

MThornback
05-08-2007, 03:54 PM
Then... isn't ready yet?

Nope, its ready to roll... :D

Veer
05-08-2007, 05:09 PM
Hi, MThornback (https://vborg.vbsupport.ru/member.php?u=82414) Nice job, Well done :)
Can you please make it more easy to install? i mean just a product to upload and some templates to edit.

I've installed Adrian's product, should i need to uninstall Adrian's product and template edits? before installing this hack.

Thanks.

MThornback
05-08-2007, 07:38 PM
I don't see a huge difference between installing a product or a plugin...it makes no difference to the function of the mod? Its just the difference between what link you click on and scrolling :p

If your using mine and his in conjunction...you need to edit his plugin on the forumbit_display hook to the instructions specs and do the template edits...otherwise you can uninstall his and install my plugin (no real loss of function on the front end...and probably recommended for the inexperienced updater rather than editing the plugin)

BadgerDog
05-15-2007, 03:40 PM
Installed.... (well, to be absolutely correct, just installing it)... :D

Thanks... nice mode and a good add-on to vBulletin... :up:

Regards,
Badger

BadgerDog
05-15-2007, 04:49 PM
Update... works fine... :up:

.... but, to get it to work on my server, I had to duplicate and put the exact same GIF files in two different places?

/forum/images/statusicon/

and

/forum/images/import/statusicon/

Is there a reason for this, or have I missed something?

Nice code and if I add the third "locked" icon that matches, it creates a really nice custom approach.

Thanks

Regards,
Badger

MThornback
05-16-2007, 05:27 AM
Do you direct one of your styles to a custom folder? That would be the only reason it would be affected :)

MThornback
05-16-2007, 05:47 AM
its nice but when u use this u will lose the ajax technology of the mark forum read via pressing on the icon of the category

If anyone is able to tell me what file deals with this...i'll take a look at it and see if I can come up with something

BadgerDog
05-16-2007, 09:58 AM
Do you direct one of your styles to a custom folder? That would be the only reason it would be affected :)


I use a custom style, so I bet that's it. :up:

Therefore, for clarity, I shouild make sure that I put all of the GIF files in both areas because of this?

Thanks :)

Regards,
Badger

MThornback
05-16-2007, 12:00 PM
by default vb pulls the status icons from images/statusicon/*.gif, each style which defines a separate path, would needs separate gifs. Just bear in mind there is more in that folder than your category images that needs to be copied over for each custom path (things that vb needs, not this hack) :)

So yes :)

BadgerDog
05-18-2007, 04:45 PM
Ok, not sure if this is a design thing or a bug.... :confused:

If I elect only to use one GIF icon for a forum, (ie: forum30_new.gif) and not use the reciprocal "forum30_old.gif", instead letting vBulletin use its default, then I get a RED X problem.

Did I misunderstand the default situation?

If there isn't a forumX_(old, new). gif, then I thought the code would let it slide so the system would use the default? It appears to be looking for _old, only because I installed an _new file?

Thanks

Regards,
Badger

MThornback
05-18-2007, 05:36 PM
The way its setup it dosen't support splitting the difference between both ways. If one exists the other is expected to exist as well.

:)

BadgerDog
05-18-2007, 05:40 PM
The way its setup it dosen't support splitting the difference between both ways. If one exists the other is expected to exist as well.

:)

Understood... :up:

Thanks... :)

I assume that you don't need a "lock" gif version in order to have the default lock icon display, or does it also have to be present if the any of the other two are there, in order to avoid the RED X?

Regards,
Badger

MThornback
05-20-2007, 09:56 PM
I'd make a lock.gif to have the complete set regardless....but yes its needed :)

MThornback
07-05-2007, 08:25 PM
This now works with VBs JS to mark a forum read :D

BadgerDog
07-05-2007, 09:26 PM
This now works with VBs JS to mark a forum read :D

Thanks for the update ... :up:

We've used your mod since it came out....

It's been a while, so for clarity, what do we need to do to upgrade? Is there a need to uninstall the previous version first, or can we just go ahead and import the XML?

Regards,
Badger

MThornback
07-06-2007, 01:03 AM
all thats changed is the template portion of the mod, so if you redo the edit you'll be set

BadgerDog
07-06-2007, 10:04 AM
all thats changed is the template portion of the mod, so if you redo the edit you'll be set

Updated ... :up:

Thanks ... :)

Nice mod... really enhances use of our forums. People look for the icon graphic to find forums as opposed to reading text.

Regards,
Badger

Chester87
08-14-2007, 09:52 AM
I cant get it to work.

I did all the template edits and install the thingy in forumbit_diplay hook. Even got the status icons in several maps just to see where it is directing to.

Do i need to change this line?
is_file("path/to/forum/images/statusicon/forum".

To an directory where the *.gif's are located?

Changed te gif's to the name of the forum.

forum419_old_lock.gif
forum419_new_lock.gif
forum419_old.gif
forum419_new.gif

But it aint working. What am i doing wrong?

MThornback
08-22-2007, 12:41 AM
path/to/forum needs to be changed, yes :)

CLF
05-27-2009, 05:01 PM
Just wanted to thank you for this mod. Looks great on my forum and I went with png icons.

INSTALLED!

Thank you! :):up: