The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
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&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&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&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&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> |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|