vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Forum Home Enhancements - vB Category Icons (https://vborg.vbsupport.ru/showthread.php?t=82750)

Logikos 06-08-2005 10:00 PM

vB Category Icons
 
vB Category Icons

vBulletin 3.5.0 RC 1
www.vBHackers.com

What this does
This will allow you to setup a icon to display by the title of each forum you have. The look of the icon depends on how you want to set it up in the templates. This will work for all levels of sub-forums.

Note:
This hack will work for vBulletin Version 3.5.0 RC-1 and RC-2 ONLY!

To do list...
  • Time to install: 3 minutes
  • Queries to run: 1
  • File Mods: 0
  • Templates to edit: 2
  • Templates to add: 0
  • New Phrases: 1
  • New Plugins: 2

Template Edit
Alot of people want to get there icon like my screenshot. So you have bugged me enough for me to post how. :p Enjoy!

Replace Template: forumhome_forumbit_level1_post With The Folllowing:
HTML 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>

                                <table cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                        <td>$forum[forumhomeicon]</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>
                </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>

Replace Template: forumhome_forumbit_level2_post With The Folllowing:
HTML 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]">
                <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                        <td>$forum[forumhomeicon]</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>
$childforumbits

And Thats All! :)

Please read carefully and make all the necessary changes as stated. This is will work if installed properly.
PLEASE REMEMBER TO BACKUP BEFORE YOU BEGIN! If you like this hack


Help & Support
Before asking for support Please make sure you have done all necessary changes! If you still need support please post a reply here.

Please post bugs and errors here. Hope you like, feedback welcomed.

Andreas 06-09-2005 06:52 PM

You might want to update the instructions to save 1 file-edit, as this can be done with a plugin :)

Logikos 06-09-2005 06:53 PM

I can use the hooks for "class_db_forum.php"?

Andreas 06-09-2005 06:55 PM

Yes. See my post in your thread regarding this.

Logikos 06-09-2005 07:07 PM

See mine :p

Logikos 06-09-2005 07:17 PM

Hack Updated: Now using The Default Hooks System!

roundhost 06-09-2005 07:44 PM

You were quick to do this. Well done :D

Corriewf 06-09-2005 07:50 PM

You just had to have the first hack didnt you?


Good job :)

Logikos 06-10-2005 04:00 AM

hehe, i didn't get to have the first hack, but the first public hack. :p

sensimilla 06-10-2005 08:46 AM

great hack good to see it released already

mholtum 06-17-2005 06:10 AM

I am a little confused as to where to do this step:
Add $forum[forumhomeicon] in your forumhome_forumbit_level1_post and forumhome_forumbit_level2_post
to display on all your forums, and sub forums.

I know where the templates are, but where should I place the $forum[forumhomeicon]

Logikos 06-17-2005 06:12 AM

Quote:

Originally Posted by mholtum
I am a little confused as to where to do this step:
Add $forum[forumhomeicon] in your forumhome_forumbit_level1_post and forumhome_forumbit_level2_post
to display on all your forums, and sub forums.

I know where the templates are, but where should I place the $forum[forumhomeicon]

Where ever you add the $forum[forumhomeicon]. Thats where your icon will appear. Treat that variable as <img src="" border="0" alt="" />. Because thats whats stored inside $forum[forumhomeicon]. :)

mholtum 06-17-2005 06:17 AM

like this?:

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="$forum[forumhomeicon]" alt="" border="0" /></td>
                        <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>
                        <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>


Logikos 06-17-2005 06:21 AM

No like this:

HTML 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>$forum[forumhomeicon]</td>
                        <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>
                        <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>

You should understand what i meant in my above post now :)

mholtum 06-17-2005 06:33 AM

Ah, ok. but but I add it to the forumhome_forumbit_level2_post template no matter where I seem to put it it jacks my display up. Here is my current working template. Would you mind showing me where I need to insert that piece of code to make it look like your image? Sorry I am such a n00b.

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


Logikos 06-17-2005 07:48 AM

You enter the IMG info when your editing your forums in the Admincp. Pretend you want to edit a forum title or a forum description. It should be just underneath that. Also, to get it to look like my screenshot, you would need to mock up some HTML. I was feeling nice tonight so I edited my first post with a little tutorial on how to get the image like the screenshots. Also updated the screenshots as well.

mholtum 06-17-2005 08:26 AM

Thank you so much. I found where I was supposed to edit the image info.. Working Like a charm Thank you again.. I am feeling very stupid now.

OmaniMan 06-17-2005 08:42 AM

Thanks again dear Live ...

Logikos 06-17-2005 08:55 AM

Thanks everyone, glad you like. :)

pauloo 06-20-2005 05:07 PM

Thank you ! Is valided with W3C ;)

Logikos 06-21-2005 05:54 AM

All my work is ;)

Asterik 06-28-2005 02:45 AM

Can you use these icons in the forum display template? Because im having a problem that MIGHT be related to this: http://www.programmersforums.com/forumdisplay.php?f=7. As you can see, when i put icons in the sub forums, it gets alittle crazy :(. Is there any way to maybe fix this at all?

ub3r 07-02-2005 02:52 AM

Install! :D

Gio 07-12-2005 06:05 PM

Sorry for this noob quesion but what is a query? Which is the first step on the read me file.

Logikos 07-12-2005 10:14 PM

I can't find it here. But read this http://www.vbhackers.com/forum/thread82.html

Gio 07-13-2005 12:12 AM

Quote:

Originally Posted by Live Wire
I can't find it here. But read this http://www.vbhackers.com/forum/thread82.html

That worked great thanks. Next question.... Add phrase? Where do I do that part of the installation

Gio 07-13-2005 12:21 AM

Well I found out how to add phrases but its not quite working yet

Gio 07-13-2005 12:38 AM

I did it my first big hack too. It looks great! Thanks so much for this hack.

Logikos 07-13-2005 12:51 AM

Glad you got it working... Please click the install button to show support.

Gio 07-13-2005 12:58 AM

Quote:

Originally Posted by Live Wire
Glad you got it working... Please click the install button to show support.

I almost had to ask for help on how to do that too.. :nervous: I didnt know what you meant. But thanks I was stuck forever there. By the way what does the Query do by running it? What did it do. When I tred running the query thru the admincp it told me I didnt have permission...And this is my board. I installed and added 3 plugins/hacks.

Logikos 07-13-2005 02:15 AM

The query is so you can store the <img> info inside the database. In order to run querys in the Admincp you need to edit the config.php file. Change the following line:

Find:
PHP Code:

$canrunqueries ''

Replace With:
PHP Code:

$canrunqueries 'X'

Change X to your Userid. You can find your userid by clicking on your profile and seeing the number at the end of the URL. If your the owner of the site, this will ussally be 1.

Gio 07-13-2005 02:19 AM

Thanks again.

Loki12 07-13-2005 08:44 PM

The following does essentially the same thing, but is easier and quicker to install, I think...

http://www.vbulletin.com/forum/showthread.php?t=114545

Logikos 07-14-2005 03:30 AM

As stated in my other thread about that post on vb.com. I personaly like to keep things as orginaized as possiable, so there for its eaiser for me to just edit the forum info in the ADMINCP. As if you have more then one style, you would have to edit every template that contains the icon information. My way, you would just edit one field and be done.

Brinnie 07-22-2005 09:58 PM

Hi,

Please bear with my noobness, as I don't always know. But couldn't one add <img> tag to the forum description?

I think this is a great tutorial. Now if I could only kill the default status icons... Anyone have any ideas?

Wayne Luke 07-23-2005 04:15 AM

Quote:

Originally Posted by Live Wire
As stated in my other thread about that post on vb.com. I personaly like to keep things as orginaized as possiable, so there for its eaiser for me to just edit the forum info in the ADMINCP. As if you have more then one style, you would have to edit every template that contains the icon information. My way, you would just edit one field and be done.

If you use the imagedir stylevar, you wouldn't have to though. Just let it be inherited from the parent.

Andreas 07-26-2005 06:26 PM

@Live Wire
This Hack can be implemented without File Edits in RC 1 by using Hook forumadmin_edit_form, so you might want to update it :)

Logikos 07-26-2005 07:17 PM

lol, thanks mate. Gonna update.

GrendelKhan{TSU 07-27-2005 06:51 AM

figures I just installed this yesterday (LOVE IT AND showed support with "INSTALL" ;)), next day RC1 is out... heh. I take it I have to redo this if I update to RC1?

Logikos 07-27-2005 06:59 AM

All you will have to do is import a xml file from the admincp. Working on it now/


All times are GMT. The time now is 01:18 AM.

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.02286 seconds
  • Memory Usage 1,885KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_html_printable
  • (2)bbcode_php_printable
  • (4)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
  • (40)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