Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-05-2006, 03:20 AM
jgommel's Avatar
jgommel jgommel is offline
 
Join Date: Jun 2005
Location: Ohio
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Collapsible option on more than one response in the same thread?

How do I utilize the collapse option on more than one response within a thread...?

The question is more or less generalized towards the use of the collapse code within a thread, but it also directly reflects my use of the "Post thank You Hack" on my site. I currently have this hack installed and didn't care for the static look, not to mention it didn't place nice with with my current theme, so I decided to edit the code and while I was in there, I utilized the code to make the box collapsible.

The code below is the entire "post_thanks_postbit_legacy" template. I've attached a Before and After of the code. The after code has the collapse functions.

What's happening is that when a user comes across the first collapsible box in a thread, they can collapse it w/out an issue. When they come to the next one and click on the collapse button - it actually opens the first collapsed block, but does not collapse the current one. All precedding collapsible boxes will only hide and collapse the very first box in the thread.

I'd like to be able to click on one box and all boxes within the same thread collapse together. If I can have it so that a user can click to close boxes individually, that would be cool too.

Here's an example of what's happening: Click Here for an Example. Starting at the top, scroll down to the first collapsible box and close it. Now try to close the second one a few post down.

BEFORE
Code:
<div style="padding:5px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
<tr valign="top">
<td class="alt2" width="175">
<if condition="$number_rows == 1"><strong><phrase 1="$post[username]">$vbphrase[post_thanks_user_says]</phrase></strong>
<else /><strong><phrase 1="$post[post_thanks_amount]" 2="$post[username]">$vbphrase[post_thanks_users_say]</phrase></strong></if>
<if condition="$bbuserinfo[usergroupid] == 6"><br />
<a href="showthread.php?do=post_thanks_remove_all&amp;p=$post[postid]" onclick="post_thanks_remove_all_$post[postid](); return false;">$vbphrase[post_thanks_remove]</a>
</if>
<if condition="$post_thanks_user > 0 && $vboptions[post_thanks_delete_own] == 1"><br />
<a href="showthread.php?do=post_thanks_remove_user&amp;p=$post[postid]" onclick="post_thanks_remove_user_$post[postid](); return false;">$vbphrase[post_thanks_remove_user]</a>
</if>
</td>
<td class="alt1">
<div>$liste_user</div>
</td>
</tr>
</table>
</div>

AFTER
Code:
<table width="100%" style="background-image:url($stylevar[imgdir_misc]/cat_back.gif)" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="33" height="27" align="left" valign="top"><img src="$stylevar[imgdir_misc]/cat_top_ls.gif" width="33" height="27" alt=" " border="0" /></td>
            <td width="22" height="27" align="left" valign="top"><img src="$stylevar[imgdir_misc]/text_ls.gif" width="22" height="27" alt=" " border="0" /></td>
            <td width="50%" class="tcat" style="background-image:url($stylevar[imgdir_misc]/cat_top_text_bk.gif)" align="left">
                
            <div align="left" class="smallfont"><strong>$vbphrase[neo_thanks]</strong></div>
    
            </td>    
            <td width="30" height="27" align="left" valign="top"><img src="$stylevar[imgdir_misc]/cat_top_text_end.gif" width="30" height="27" alt=" " border="0" /></td>
            <td width="50%" height="27" align="left" valign="top"><img src="$stylevar[imgdir_misc]/cat_back.gif" width="50%" height="27" alt=" " border="0" /></td>
            <td width="10" height="27" align="left" valign="middle"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('thanks')"><img id="collapseimg_thanks" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_thanks].gif" alt="" border="0" /></a></td>
            <td width="20" height="27" align="right" valign="top"><img src="$stylevar[imgdir_misc]/cat_top_rs.gif" width="20" height="27" alt=" " border="0" /></td>
        </tr>
</table>


<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="1" border="0" width="100%" align="center">
    <tbody id="collapseobj_thanks" style="$vbcollapse[collapseobj_thanks]">
        <tr>
            <td class="alt2" width="175">
                <if condition="$number_rows == 1"><strong><phrase 1="$post[username]">$vbphrase[post_thanks_user_says]</phrase></strong>
<else /><strong><phrase 1="$post[post_thanks_amount]" 2="$post[username]">$vbphrase[post_thanks_users_say]</phrase></strong>
                </if>
                <if condition="$bbuserinfo[usergroupid] == 6"><br />
<a href="showthread.php?do=post_thanks_remove_all&amp;p=$post[postid]" onclick="post_thanks_remove_all_$post[postid](); return false;">$vbphrase[post_thanks_remove]</a>
                </if>
                <if condition="$post_thanks_user > 0 && $vboptions[post_thanks_delete_own] == 1"><br />
<a href="showthread.php?do=post_thanks_remove_user&amp;p=$post[postid]" onclick="post_thanks_remove_user_$post[postid](); return false;">$vbphrase[post_thanks_remove_user]</a>
                </if>
            </td>
            <td class="alt1" width"100%">
    <div>$liste_user</div>
            </td>
        </tr>
    </tbody>
</table>
I'd like to eventually do the same thing in the "postbit_legacy" template to hide/collapse a bunch of items in the sidebar (where the Avatar and items are)
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 07:56 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.04813 seconds
  • Memory Usage 2,178KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)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
  • (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