Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2010, 05:07 AM
merk_aus merk_aus is offline
 
Join Date: Feb 2008
Location: Australia
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Sub Forum Icons help

Hey there everyone;
I was wondering if anyone could offer some assistance with something I am attempting to do with my site and that is to have custom sub forum images dependent on the forum.

At the moment when you have sub forums displaying on the ForumHome it displays an image:
images/statusicon/subforum_new-48.png

However what I would like to do is have it so:
Sub Forum 1 - displays image - images/statusicon/subforum_new-1.png
Sub Forum 2 - displays image - images/statusicon/subforum_new-2.png
Sub Forum 3 - displays image - images/statusicon/subforum_new-3.png

Before anyone directs me to modifications available on these forums I have attempted to install them however they don't actually change those sub forum images per forum.

I would really appreciate some help if someone knows how to do it.
Reply With Quote
  #2  
Old 06-13-2010, 06:12 AM
DragonBlade's Avatar
DragonBlade DragonBlade is offline
 
Join Date: May 2006
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can easily do this under the forum section's settings

Within Prefix for Forum Status Images, just put your custom path. For example, putting in:
subforum/

will point to:
images/statusicon/subforum

This subforum folder images must use the same filenames from the default ones:
forum_link-48.png
forum_new_lock-48.png
forum_new-48.png
forum_old_lock-48.png
forum_old-48.png
Reply With Quote
  #3  
Old 06-13-2010, 06:25 AM
merk_aus merk_aus is offline
 
Join Date: Feb 2008
Location: Australia
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No sorry - first of all thank you for your help - but I know how to change the Status Icons but what just suggested doesn't do what I have asked for.

I am looking at changing the icon that appears on the Forum Home Page when you have Sub Forums viewable on the home page - at the moment it displays:
http://www.yourdomain.com/images/sta...rum_new-48.png

What I would like for it to do is each sub forum has it's own little icon that displays ON THE FORUM HOME PAGE.

Thank you for attempting to help.
Reply With Quote
  #4  
Old 06-13-2010, 07:07 AM
DragonBlade's Avatar
DragonBlade DragonBlade is offline
 
Join Date: May 2006
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This requires template editing. Go to forumhome_subforumbit_post under forumhome:

Replace the code with this:

Code:
<li class="subforum">

<vb:if condition="$forum[forumid] == xx">
<img class="inlineimg" src="pathtoimage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />

<vb:elseif condition="$forum[forumid] == xx">
<img class="inlineimg" src="pathtoimage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />

<vb:else />
<img class="inlineimg" src="{vb:stylevar imgdir_statusicon}/subforum_{vb:raw forum.statusicon}-48.png" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
</vb:if>

<vb:if condition="$depth > 1"></vb:if>
<a href="{vb:link forum, {vb:raw forum}}">{vb:raw forum.title}</a>
</li>
xx is your forumid
pathtoimage is your location of the image you want to use

Of course, add more elseifs for more subforums.
Reply With Quote
  #5  
Old 06-13-2010, 07:17 AM
merk_aus merk_aus is offline
 
Join Date: Feb 2008
Location: Australia
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want to have your babies Thanks I thought it was something basic but have the biggest headache today and can't really think straight.

I really appreciate it - if you have paypal please send me a message so I can send you a small donation for your assistance, I really do appreciate your help.

--------------- Added [DATE]1276417513[/DATE] at [TIME]1276417513[/TIME] ---------------

UPDATE: Just an Update, I installed this however the Subforum Title and other subforums have disappeared (I understand the other sub forums as I need to put this information for them) however the sub forum titles are completely gone.

Sorry to be a pain but thought if we could get an update for this it would be greatly appreciated and useful to others.

--------------- Added [DATE]1276423235[/DATE] at [TIME]1276423235[/TIME] ---------------

I am hoping someone can help with this when attempting the above codes it comes up with:

Code:
The following error occurred when attempting to evaluate this template:
Invalid Tag Nesting
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
Reply With Quote
  #6  
Old 06-13-2010, 11:25 AM
DragonBlade's Avatar
DragonBlade DragonBlade is offline
 
Join Date: May 2006
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, forgot a trailing slash on the elseif.

Code:
<li class="subforum">

<vb:if condition="$forum[forumid] == xx">
<img class="inlineimg" src="pathtoximage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />

<vb:elseif condition="$forum[forumid] == yy" />
<img class="inlineimg" src="pathtoyimage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />

<vb:else />
<img class="inlineimg" src="{vb:stylevar imgdir_statusicon}/subforum_{vb:raw forum.statusicon}-48.png" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
</vb:if>

<vb:if condition="$depth > 1"></vb:if>
<a href="{vb:link forum, {vb:raw forum}}">{vb:raw forum.title}</a>
</li>
Also I should make myself clear.
You replace xx and pathtoximage for your first subsection.
You replace yy and pathtoyimage for your second subsection and etc.

If you need to change more, you just copy paste the else if statement code and add it after your last elseif code:
Code:
<vb:elseif condition="$forum[forumid] == zz" />
<img class="inlineimg" src="pathtozimage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
The end result should look like this:
Code:
<li class="subforum">

<vb:if condition="$forum[forumid] == xx">
<img class="inlineimg" src="pathtoximage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />

<vb:elseif condition="$forum[forumid] == yy" />
<img class="inlineimg" src="pathtoyimage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />

<vb:elseif condition="$forum[forumid] == zz" />
<img class="inlineimg" src="pathtozimage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />

<vb:else />
<img class="inlineimg" src="{vb:stylevar imgdir_statusicon}/subforum_{vb:raw forum.statusicon}-48.png" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
</vb:if>

<vb:if condition="$depth > 1"></vb:if>
<a href="{vb:link forum, {vb:raw forum}}">{vb:raw forum.title}</a>
</li>
You wanted the images to be linkable as well, then use this code instead:
Code:
<li class="subforum">

<vb:if condition="$forum[forumid] == xx">
<a href="{vb:link forum, {vb:raw forum}}"><img class="inlineimg" src="pathtoximage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />{vb:raw forum.title}</a>

<vb:elseif condition="$forum[forumid] == yy" />
<a href="{vb:link forum, {vb:raw forum}}"><img class="inlineimg" src="pathtoyimage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />{vb:raw forum.title}</a>

<vb:elseif condition="$forum[forumid] == zz" />
<a href="{vb:link forum, {vb:raw forum}}"><img class="inlineimg" src="pathtozimage" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />{vb:raw forum.title}</a>

<vb:else />
<img class="inlineimg" src="{vb:stylevar imgdir_statusicon}/subforum_{vb:raw forum.statusicon}-48.png" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
<a href="{vb:link forum, {vb:raw forum}}">{vb:raw forum.title}</a>
</vb:if>

</li>
Reply With Quote
  #7  
Old 06-13-2010, 11:27 AM
merk_aus merk_aus is offline
 
Join Date: Feb 2008
Location: Australia
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now it's official I want to have your babies
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:36 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.04120 seconds
  • Memory Usage 2,231KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete