Thread: Forum Home Enhancements - Forum Category Icons (Advanced)
View Single Post
  #778  
Old 03-02-2014, 12:26 AM
Bluefin221 Bluefin221 is offline
 
Join Date: Jul 2008
Location: Scotland
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Disco_Stu View Post
Here are my changes. I suggest you make a copy of your original code first as I am not responsible for any changes to your forums you make.

To display the sub forum icons:

Styles & Templates>Search In Templates>forumhome_subforums

Look for this line of code:

Code:
<a href="{vb:link forum, {vb:raw row}}">{vb:raw row.title}</a>{vb:raw row.comma}
and replace it (comment it out - I don't like to hard delete) with this code:

Code:
<br>
<div style="width:65px;">
<center><a href="{vb:link forum, {vb:raw row}}"><img src="images/{vb:raw vboptions.forumiconimg_folder}/{vb:raw row.forumiconimg}" /><br>{vb:raw row.title}</a></center>
</div>
That's all there is to it. Note that I left off the comma between subforums. If you want that then include "{vb:raw row.comma}" after "</a>". Also I included a <div> to control the width of the icon display and a <center> to center the title below the icon.

I also added a line break at the top of forumhome_subforums to add a line between the forum and sub forums.

If you want to control how many subforums are displayed on each line (I limit it to 4) then do this:

At the top of forumhome_subforums add this:

Code:
<script type="text/javascript">
var counter = 0;
</script>


Then after this line of code

Code:
<vb:each from="subforums" value="row">
add this:

Code:
<script type="text/javascript">
   counter = counter + 1;
   if(counter >4)
     {
       counter = 1;
       document.write("<br>");
     }
  
</script>
I also have some spacing code in the above code to move the sub forums to the right a bit but that's really up to you how you want to position the icons.

If you want to get rid of the "Sub-Forum" heading then comment out or delete this line of code at the top of forumhome_subforums:

Code:
<h4 class="subforumlistlabel">{vb:rawphrase subforums}:</h4>



To add the forum or sub forum icon at the top of a thread do this:

Styles & Templates>Search In Templates>FORUMDISPLAY

after "{vb:raw navbar}" add this line of code:

Code:
<img src="images/{vb:raw vboptions.forumiconimg_folder}/{vb:raw foruminfo.forumiconimg}" />
And that's all there is to it.
This just will not work for me, I do have vsa sub forum manager as a mod and I read somewhere this mod wont work with it in sub forums, my main forums are perfect however sub forums I cannot get any icons to show at all. If I disable the VSA sub forum manager its just a complete mess.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01137 seconds
  • Memory Usage 1,790KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete