View Full Version : collapse help please
trafix
01-20-2005, 04:44 AM
I am trying to add collapsable genres to my vb jukebox i have used the code belos to form the genre sections, and the sections do open and close when clicking the image ..... however any that i have closed once i refresh display as open again ....... what do i need to do to fix this so colsed genres stay closed on refresh?
Tnx in advance :)
<tbody>
<tr>
<td class="tcat" colspan="5">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumbit_$jbgenre')"><img id="collapseimg_forumbit_$jbgenre" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_jbgenre}.gif" alt="" border="0" /></a>
$genrename[genre]</div>
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumbit_$jbgenre" style="{$collapseobj_jbgenre}">
$playlist
</tbody>
Andreas
01-20-2005, 04:52 AM
Looks strange ...
Try this:
<tbody>
<tr>
<td class="tcat" colspan="5">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumbit_$jbgenre')"><img id="collapseimg_forumbit_$jbgenre" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumbit_$jbgenre].gif" alt="" border="0" /></a>
$genrename[genre]</div>
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumbit_$jbgenre" style="$vbcollapse[collapseobj_forumbit_$jbgenre]">
$playlist
</tbody>
trafix
01-20-2005, 04:56 AM
Thanks Kirby i used your code and the same thing happens ..... is there any php code required for my script maybe?
heres a screenie
your revised error gives me an error
Parse error: parse error, unexpected T_VARIABLE, expecting ']' in /var/www/html/upload/includes/adminfunctions_template.php(3054) : eval()'d code on line 4
Andreas
01-20-2005, 04:58 AM
No, should work.
But my first post still had some bugs ^.^
trafix
01-20-2005, 05:00 AM
ill try it again :)
same error when i try to save the template
The following error occurred when attempting to evaluate this template:
Parse error: parse error, unexpected T_VARIABLE, expecting ']' in /var/www/html/upload/includes/adminfunctions_template.php(3054) : eval()'d code on line 4
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
Andreas
01-20-2005, 05:07 AM
Theoretically, this is the correct code, but as you need a variable as part of the key for $vbcollapse parsing fails.
(To see what I mean just put $foo[foo_$bar] in an empty template and try to save it)
Therefore you must construct variables in PHP that hold
$vbcollapse["collapseobj_forumbit_$jbgenre"]
$vbcollapse["collapseimg_forumbit_$jbgenre"]
I forgot about this problem when posting the code as I did not try to compile it ;)
trafix
01-20-2005, 05:14 AM
ok so if i add in the php
$jbcollapse1 = "$vbcollapse["collapseobj_forumbit_$jbgenre"]";
$jbcollapse2 = "$vbcollapse["collapseimg_forumbit_$jbgenre"]";
and adjust the template likewise ... it should work?
Andreas
01-20-2005, 05:16 AM
I'd try
$jbcollapse1 = $vbcollapse["collapseobj_forumbit_$jbgenre"];
$jbcollapse2 = $vbcollapse["collapseimg_forumbit_$jbgenre"];
as your code most likely would result in compile errors (due to the double quotes).
But then it should work.
trafix
01-20-2005, 05:32 AM
Wootness .... Thank you for your time :)
Lets re pach and reelease the upgrade :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.