vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Forum Home Enhancements - [AJAX] Tabbed Forum Home (https://vborg.vbsupport.ru/showthread.php?t=175687)

vietfancy 04-11-2008 07:49 AM

Thanksssss!

exactly what i needed.

I have a little problem here. It seems doesn't work for me.

I edited the index_tab.php

PHP Code:

// define max depth for forums display based on $vbulletin->options[forumhomedepth]
define('MAXFORUMDEPTH'$vbulletin->options['forumhomedepth']);

$forumbits construct_forum_bit($forumid);
    
// Construct Tabbed Forum Home forumbits 
    // Category for Tab 2, pulls forum and sub form data from Category (Forum ID 1)
    // Category 1 for Tab 1
    
$forumbits1a construct_forum_bit(1,1,0); 
    
// Category 2 for Tab 1
    
$forumbits1b construct_forum_bit(42,1,0); 
    
// Category 1 for Tab 2
    
$forumbits2a construct_forum_bit(66,1,0); 
    
// Category 2 for Tab 2
    
$forumbits2b construct_forum_bit(61,1,0); 
    
// Category 3 for Tab 2
    
$forumbits2c construct_forum_bit(26,1,0); 
    
// Category 4 for Tab 2
    
$forumbits2d construct_forum_bit(5,1,0);
    
// Category 1 for Tab 3
    
$forumbits3a construct_forum_bit(9,1,0); 
    
// Category 1 for Tab 4
    
$forumbits4a construct_forum_bit(36,1,0); 
    
// Category 2 for Tab 4
    
$forumbits4b construct_forum_bit(40,1,0); 
eval(
'$forumhome_markread_script = "' fetch_template('forumhome_markread_script') . '";');

// ### BOARD STATISTICS ################################################# 

and here is my <!-- main --> <!-- /main-->

HTML Code:


<!-- main -->


<!-- Tabbed Forum Home Tabs Layout -->
<ul id="forumtabs" class="shadetabs">
<li><a href="#" rel="tcontent1" class="selected">Tab 1 Name</a></li>
<li><a href="#" rel="tcontent2">Tab 2 Name</a></li>
<li><a href="#" rel="tcontent3">Tab 3 Name</a></li>
<li><a href="#" rel="tcontent4">Tab 4 Name</a></li>
</ul>

<!-- /Tabbed Forum Home Tabs Layout -->
<!-- Tabbed Forum Home – START Tab 1 Content Layout -->
<div id="tcontent1" class="tabcontent">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>

</thead>

<tbody>
    <tr>
        <td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><a style="float:right" href="#top" onclick="return toggle_collapse('forumbit_1111')"><img id="collapseimg_forumbit_1111" src="images/buttons/collapse_tcat.gif" alt="" border="0" /></a><a href="forumdisplay.php?f=1">CATEGORY NAME</a></td>
    </tr>
</tbody>

<tbody id="collapseobj_forumbit_1111" style="">
$forumbits1a
</tbody>

<tbody>
    <tr>
        <td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><a style="float:right" href="#top" onclick="return toggle_collapse('forumbit_4242')"><img id="collapseimg_forumbit_4242" src="images/buttons/collapse_tcat.gif" alt="" border="0" /></a><a href="forumdisplay.php?f=42">CATEGORY NAME</a></td>
    </tr>
</tbody>

<tbody id="collapseobj_forumbit_4242" style="">
$forumbits1b
</tbody>

<tbody>
    <tr>
        <td class="tfoot" align="center" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><div class="smallfont"><strong>
            <a href="forumdisplay.php?$session[sessionurl]do=markread" rel="nofollow">$vbphrase[mark_forums_read]</a>
            <if condition="$vboptions['forumleaders']">&nbsp; &nbsp;
            <a href="showgroups.php$session[sessionurl_q]" rel="nofollow">$vbphrase[view_forum_leaders]</a></if>
        </strong></div></td>
    </tr>
</tbody>
</table>

$forumhome_markread_script

</div>
<!-- /Tabbed Forum Home – END Tab 1 Content Layout -->





<!-- Tabbed Forum Home – START Tab 2 Content Layout -->
<div id="tcontent2" class="tabcontent">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>

</thead>

<tbody>
    <tr>
        <td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><a style="float:right" href="#top" onclick="return toggle_collapse('forumbit_6666')"><img id="collapseimg_forumbit_6666" src="images/buttons/collapse_tcat.gif" alt="" border="0" /></a><a href="forumdisplay.php?f=66">CATEGORY NAME</a></td>
    </tr>
</tbody>

<tbody id="collapseobj_forumbit_6666" style="">
$forumbits2a
</tbody>

<tbody>
    <tr>
        <td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><a style="float:right" href="#top" onclick="return toggle_collapse('forumbit_6161')"><img id="collapseimg_forumbit_6161" src="images/buttons/collapse_tcat.gif" alt="" border="0" /></a><a href="forumdisplay.php?f=61">CATEGORY NAME</a></td>
    </tr>
</tbody>

<tbody id="collapseobj_forumbit_6161" style="">
$forumbits2b
</tbody>
<tbody>
    <tr>
        <td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><a style="float:right" href="#top" onclick="return toggle_collapse('forumbit_2626')"><img id="collapseimg_forumbit_2626" src="images/buttons/collapse_tcat.gif" alt="" border="0" /></a><a href="forumdisplay.php?f=26">CATEGORY NAME</a></td>
    </tr>
</tbody>

<tbody id="collapseobj_forumbit_2626" style="">
$forumbits2c
</tbody>

<tbody>
    <tr>
        <td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><a style="float:right" href="#top" onclick="return toggle_collapse('forumbit_555')"><img id="collapseimg_forumbit_555" src="images/buttons/collapse_tcat.gif" alt="" border="0" /></a><a href="forumdisplay.php?f=5">CATEGORY NAME</a></td>
    </tr>
</tbody>

<tbody id="collapseobj_forumbit_555" style="">
$forumbits2d
</tbody>

<tbody>
    <tr>
        <td class="tfoot" align="center" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><div class="smallfont"><strong>
            <a href="forumdisplay.php?$session[sessionurl]do=markread" rel="nofollow">$vbphrase[mark_forums_read]</a>
            <if condition="$vboptions['forumleaders']">&nbsp; &nbsp;
            <a href="showgroups.php$session[sessionurl_q]" rel="nofollow">$vbphrase[view_forum_leaders]</a></if>
        </strong></div></td>
    </tr>
</tbody>
</table>

$forumhome_markread_script

</div>
<!-- /Tabbed Forum Home – END Tab 3 Content Layout -->




<!-- Tabbed Forum Home – START Tab 3 Content Layout -->
<div id="tcontent3" class="tabcontent">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>

</thead>

<tbody>
    <tr>
        <td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><a style="float:right" href="#top" onclick="return toggle_collapse('forumbit_99')"><img id="collapseimg_forumbit_99" src="images/buttons/collapse_tcat.gif" alt="" border="0" /></a><a href="forumdisplay.php?f=6">CATEGORY NAME</a></td>
    </tr>
</tbody>

<tbody id="collapseobj_forumbit_99" style="">
$forumbits3a
</tbody>

<tbody>
    <tr>
        <td class="tfoot" align="center" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><div class="smallfont"><strong>
            <a href="forumdisplay.php?$session[sessionurl]do=markread" rel="nofollow">$vbphrase[mark_forums_read]</a>
            <if condition="$vboptions['forumleaders']">&nbsp; &nbsp;
            <a href="showgroups.php$session[sessionurl_q]" rel="nofollow">$vbphrase[view_forum_leaders]</a></if>
        </strong></div></td>
    </tr>
</tbody>
</table>

$forumhome_markread_script

</div>
<!-- /Tabbed Forum Home – END Tab 3 Content Layout -->



<!-- Tabbed Forum Home – START Tab 4 Content Layout -->
<div id="tcontent4" class="tabcontent">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>

</thead>

<tbody>
    <tr>
        <td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><a style="float:right" href="#top" onclick="return toggle_collapse('forumbit_3636')"><img id="collapseimg_forumbit_3636" src="images/buttons/collapse_tcat.gif" alt="" border="0" /></a><a href="forumdisplay.php?f=36">CATEGORY NAME</a></td>
    </tr>
</tbody>

<tbody id="collapseobj_forumbit_3636" style="">
$forumbits4a
</tbody>

<tbody>
    <tr>
        <td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><a style="float:right" href="#top" onclick="return toggle_collapse('forumbit_4040')"><img id="collapseimg_forumbit_4040" src="images/buttons/collapse_tcat.gif" alt="" border="0" /></a><a href="forumdisplay.php?f=40">CATEGORY NAME</a></td>
    </tr>
</tbody>

<tbody id="collapseobj_forumbit_4040" style="">
$forumbits4b
</tbody>


<tbody>
    <tr>
        <td class="tfoot" align="center" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><div class="smallfont"><strong>
            <a href="forumdisplay.php?$session[sessionurl]do=markread" rel="nofollow">$vbphrase[mark_forums_read]</a>
            <if condition="$vboptions['forumleaders']">&nbsp; &nbsp;
            <a href="showgroups.php$session[sessionurl_q]" rel="nofollow">$vbphrase[view_forum_leaders]</a></if>
        </strong></div></td>
    </tr>
</tbody>
</table>

$forumhome_markread_script

</div>
<!-- /Tabbed Forum Home – END Tab 4 Content Layout -->

<!-- /main -->
    <!-- Tabbed Forums switch tab script -->
    <script type="text/javascript">
    var myforumtabs=new ddtabcontent("forumtabs")
    myforumtabs.setpersist(true)
    myforumtabs.setselectedClassTarget("link")
    myforumtabs.init()
    </script>
    <!-- /end Tabbed Forums switch tab script -->

What did i do wrong?

Edited: I fixed it. Thanks for a cool hack.

Hornstar 04-11-2008 11:46 AM

My tab 1 is working, but tab 2 and tab 3 just display white under neath the tabs, no forums show up at all.

I used your code first, then modified it to my categories and names, but still just white.

Any idea what I may be missing?

bobster65 04-11-2008 11:59 AM

Quote:

Originally Posted by hornstar1337 (Post 1488183)
My tab 1 is working, but tab 2 and tab 3 just display white under neath the tabs, no forums show up at all.

I used your code first, then modified it to my categories and names, but still just white.

Any idea what I may be missing?

Hey Matt, can you post your Code so I can take a look at it (You can PM me if you wish)..

bobster65 04-11-2008 12:38 PM

Quote:

Originally Posted by CHIPIT (Post 1487972)
Thanks! Great mod, installed and nominated.
One thing though...

For dynamically selecting a tab we're supposed to use
<a href="javascript:instance.expandit(1)">Select 2nd Tab</a>

What is exactly is the instance? How is it defined? and when you say tab# starting with 0, would the first one (0) be the one with the first tabbed link, the first one in the code itself, or tcontent1??

Thank you :cool:

To answer your first question, the instance is the var name in this chunk of script that you added in Step 16: (Bold Red)

Code:

<!-- Tabbed Forums switch tab script -->
<script type="text/javascript">
var myforumtabs=new ddtabcontent("forumtabs")
myforumtabs.setpersist(true)
myforumtabs.setselectedClassTarget("link")
myforumtabs.init()
</script>
<!-- /end Tabbed Forums switch tab script -->


So to further expand on this function: instance.expandit(tabid_or_position)

This method lets you dynamically select any tab based on either its ID attribute (you need to first assign one to that tab), or position relative to its peer tab links. The method can be called anywhere on the page, such as inside a link on the page.

Parameter:

tabid or position: Either a string representing the tab link's ID, or an integer corresponding to that tab's position relative to its peers, to select. For the later, the counting starts at 0 (ie: 0=Tab 1, 1=Tab 2, 2=Tab 3 and so on).

So to answer your question, 0=the first tab. tcontent1=the content of the tab itself, not the ID of the tab.

Example:

Based on the following sample tabs layout, I added a tab ID to Tab 2. You don't need to do this as you can also just call the position as well.

Code:

<ul id="forumtabs" class="shadetabs">
<li><a href="#" rel="tcontent1" class="selected">Tab 1</a></li>
<li><a href="#" rel="tcontent2" id="roses">Tab 2</a></li>
<li><a href="#" rel="tcontent3">Tab 3</a></li>
<li><a href="#" rel="tcontent4">Tab 4</a></li>
</ul>


Here are some examples of how the links can be used:

This one uses the position parameter:
Code:

<!--Selects 4TH tab within instance "myforumtabs" -->
<a href="javascript:myforumtabs.expandit(3)">Tab 4</a>


this one uses the tabid parameter
:
Code:

<!--Selects tab with ID="roses" within instance "myforumtabs" -->
<a href="javascript:myforumtabs.expandit('roses')">Select "Roses" tab</a>


Hope that helped out and answered your questions..

Bobster

Big Boss 04-11-2008 02:09 PM

Oh my God! I was looking for this mod as I've seen it on vBSEO and it's finally here. Thanks a lot for the release! :D

Any plans on porting this over to 3.7.x as well?

bobster65 04-11-2008 02:10 PM

Quote:

Originally Posted by Big Boss (Post 1488289)
Oh my God! I was looking for this mod as I've seen it on vBSEO and it's finally here. Thanks a lot for the release! :D

Any plans on porting this over to 3.7.x as well?

Works fine with 3.7.x just not going to create a thread in the 3.7 forum until it goes gold :)

kollam003 04-11-2008 04:44 PM

i'm fixed i'm not much into editing could you have a look and help me : www.indianprofits.com

tmiland 04-11-2008 04:45 PM

Yo! :)
Is there any way to make the forum remember the collapse position?
Doesnt work now...

bobster65 04-11-2008 04:57 PM

Quote:

Originally Posted by tmiland (Post 1488385)
Yo! :)
Is there any way to make the forum remember the collapse position?
Doesnt work now...

you are correct.. I didn't even notice that (don't use the collapse feature much).. I'll have to look into it when I get time. Should be an easy fix tho. Thank you for pointing it out and its added to the list of "needs"

bobster65 04-11-2008 04:58 PM

Quote:

Originally Posted by kollam003 (Post 1488384)
i'm fixed i'm not much into editing could you have a look and help me : www.indianprofits.com

What do you need help with?


All times are GMT. The time now is 06:14 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.03827 seconds
  • Memory Usage 1,852KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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