Thread: Forum Home Enhancements - Tabbed Forumhome 1.0.0 (Light)
View Single Post
  #67  
Old 09-01-2008, 06:03 PM
sinucello sinucello is offline
 
Join Date: Apr 2006
Location: dutch-german border
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

I had a closer look at the mod and will post now a summary of my understanding of how the mod works and how it can be improved:
  1. It adds a div element with the id "forumhome_tabs_switch_content" which will contain the first category of forums on your forum-startpage. This category will be displayed initially / by default when loading the page.
  2. Then all categories including their forums are displayed again and wrapped with a div element with the id "forumhome_tabs_$forum[forumid]". This means the first category will be included twice in the generated HTML-Source code which unnecessarily increases the size and loading time of the start page. It`s also confusing for visually impaired people if their screen-readers read the first cat twice.
  3. The categories also get a "display: none" inline style so they don`t appear but instead work as content-containers for the little java-script that pulls the content in these containers to the "forumhome_tabs_switch_content" when clicking on a tab.
  4. To make the containers invisible via an inline style has the drawback of making all categories and their forums inaccessible for users that have deactivated JavaScript.

So the three major disadvantages are:
  • repetition of the first category and all it`s forums
  • non-functional links in the tabs when JS is turned off
  • all categories and their forums are hidden and unaccessible when JS is turned off

To get rid of the disadvantages you should change the tab-links from
Code:
<a href="#" onclick
to
Code:
<a href="#forumhome_tabs_$forum[forumid]" onclick
in template: g_forumhome_tabs_headbits
so they work as link to local anchors when JS is not available.

To make the local anchors work, you should give the div-content-containers a name attribute with the same value as their id:
Code:
<div style="display: none;" id="forumhome_tabs_$forum[forumid]" name="forumhome_tabs_$forum[forumid]">
in template g_forumhome_tabs_forumbit_1

That was the easy part. I don`t have enough knowledge and experience yet to make the next steps myself but it shouldn`t be too difficult for someone who knows a bit of DOM-scripting.

Basically you should remove the style="display: none;" for the content containers and stop the repitition of the first category. Then you should give the first category a different id then the other categories (might be there already) and hide all the other categories via DOM-script instead with inline style.

After that you would have to change the JS-function that gets called by the tab links so it switches the desired category visible and all others invisible.

I`ll try to solve it myself and find the necessary DOM-script snippets. But I hope there are few devs here who can help.

edit: I think I found a solution: http://www.stilbuero.de/2006/05/13/a...s-with-jquery/
Will try tomorrow.

all the best,
Sacha
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01145 seconds
  • Memory Usage 1,779KB
  • 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
  • (3)bbcode_code
  • (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