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 06-18-2005, 07:26 PM
teonix teonix is offline
 
Join Date: Jun 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Remembering "Collapsed" state on an non-vb page

I'm trying to display some data from the forum on my main page (its not a vbulletin page, and vbulletin is installed in /forums/ whereas the main page i'm working with is in the main directory of the site)

What i'm trying to accomplish is to display the data in a collapsable box using the collapse function of vbulletin.

So far i've managed to get the actual collapse/expand function working correctly, but I am having difficulties getting it to REMEMBER the last state of the box (collapsed or expanded).

I've checked that it is setting the information into the cookie, and it is, so the problem must lie within reading and interpreting the cookie data?

Any ideas?

Let me know if you need more information...
Reply With Quote
  #2  
Old 06-21-2005, 10:36 PM
teonix teonix is offline
 
Join Date: Jun 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't anyone help me out?

Basically I just need to know how to read & interpret vb cookie data from a non-vb page...
Reply With Quote
  #3  
Old 06-21-2005, 11:00 PM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What cookie?
Reply With Quote
  #4  
Old 06-22-2005, 06:47 AM
teonix teonix is offline
 
Join Date: Jun 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The cookie data for remembering the collapsed / expanded setting for content boxes ...

I think the cookie name is vbulletin_collapse
Reply With Quote
  #5  
Old 06-22-2005, 09:12 PM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That cookie holds the names from onclick="return toggle_collapse('name') ..." and each name is separated by \n so perhaps use something like the following:
Code:
$cookie_val = $_COOKIE['vbulletin_collapse'];
echo $cookie_val."<br>\n";
$cookie_arr = explode("\n",$cookie_val);
print_r($cookie_arr);
Reply With Quote
  #6  
Old 06-22-2005, 09:14 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you IDs are set correctly and vB cookies are accessible it should be stored/loaded automatically - if you have required global.php
Reply With Quote
  #7  
Old 06-22-2005, 11:02 PM
teonix teonix is offline
 
Join Date: Jun 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's what I can't seem to figure out.. I have the following in the top of my page, before any html .. I don't get any errors, so I assume its requiring it properly?

Code:
<?PHP 
chdir('./forums'); 
require_once('./global.php'); 

?>

the onclick="return toggle_collapse('auction_cats')" function is properly setting the cookies, but when you load the page .. the content box loads "expanded" regardless of what you last set it to...


Is there another file or function i'm missing? I am currently including the global.php file and the vbulletin_global.js .....

My code on my mainpage that is trying to use the function is

Code:
<div class="myaccsecond">
<a style="float: right;" href="#" onclick="return toggle_collapse('a_cats')">
<img id="collapseimg_a_cats" src="http://www.mywebsite.com/forums/images/buttons/collapse_tcat.gif" alt="Show / Hide" border="0" />
</a>Title Here</div>
<div id="collapseobj_a_cats" style="$vbcollapse[collapseobj_a_cats]">

Content Is In Here

</div>
Looking at this, I realize that I probably need to wrap this in <?PHP ?> tags somehow? Maybe?
Code:
style="$vbcollapse[collapseobj_a_cats]"
Reply With Quote
  #8  
Old 06-22-2005, 11:34 PM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try the attached...
Attached Files
File Type: txt teonix.txt (1.1 KB, 26 views)
Reply With Quote
  #9  
Old 06-23-2005, 06:14 AM
teonix teonix is offline
 
Join Date: Jun 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, I think i'm getting somewhere now

I believe the problem is being caused by the page not parsing the php, so i'm working on fixing this and we'll see where I get.

Thanks Calorie! You've been most helpful I'll be sure to bring this up again if I can't solve the rest of problem.
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 06:39 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.04072 seconds
  • Memory Usage 2,253KB
  • Queries Executed 12 (?)
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
  • (4)bbcode_code
  • (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_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