vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   collapse help please (https://vborg.vbsupport.ru/showthread.php?t=74710)

trafix 01-20-2005 04:44 AM

collapse help please
 
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 :)

HTML Code:

<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:

HTML Code:

<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

1 Attachment(s)
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
PHP Code:

$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
PHP Code:

$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 :)


All times are GMT. The time now is 10:26 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.03616 seconds
  • Memory Usage 1,734KB
  • 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_html_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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