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 01-20-2005, 04:44 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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>
Reply With Quote
  #2  
Old 01-20-2005, 04:52 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #3  
Old 01-20-2005, 04:56 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Attached Images
File Type: gif help.gif (41.4 KB, 0 views)
Reply With Quote
  #4  
Old 01-20-2005, 04:58 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, should work.
But my first post still had some bugs ^.^
Reply With Quote
  #5  
Old 01-20-2005, 05:00 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 01-20-2005, 05:07 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 01-20-2005, 05:14 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 01-20-2005, 05:16 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 01-20-2005, 05:32 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wootness .... Thank you for your time

Lets re pach and reelease the upgrade
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 12:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04351 seconds
  • Memory Usage 2,271KB
  • Queries Executed 14 (?)
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_html
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete