vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Home Enhancements - Automated Simple Catagory Icons (https://vborg.vbsupport.ru/showthread.php?t=146714)

MThornback 05-07-2007 10:00 PM

Automated Simple Catagory Icons
 
This is an automated version of these hacks:

https://vborg.vbsupport.ru/showthrea...35#post1202535
https://vborg.vbsupport.ru/showthrea...=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>


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

Quote:

Originally Posted by iogames (Post 1243671)
Then... isn't ready yet?

Nope, its ready to roll... :D

Veer 05-08-2007 05:09 PM

Hi, MThornback 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.


All times are GMT. The time now is 01:08 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01181 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete