vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Sub Forum Icons help (https://vborg.vbsupport.ru/showthread.php?t=244522)

merk_aus 06-13-2010 05:07 AM

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.

DragonBlade 06-13-2010 06:12 AM

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

merk_aus 06-13-2010 06:25 AM

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.

DragonBlade 06-13-2010 07:07 AM

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.

merk_aus 06-13-2010 07:17 AM

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.


DragonBlade 06-13-2010 11:25 AM

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>


merk_aus 06-13-2010 11:27 AM

Now it's official I want to have your babies :D


All times are GMT. The time now is 07:32 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.01036 seconds
  • Memory Usage 1,744KB
  • 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
  • (6)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete