vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Collapsible option on more than one response in the same thread? (https://vborg.vbsupport.ru/showthread.php?t=125842)

jgommel 09-05-2006 02:20 AM

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)


All times are GMT. The time now is 12:15 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.02926 seconds
  • Memory Usage 1,737KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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