The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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... |
#2
|
|||
|
|||
Can't anyone help me out?
Basically I just need to know how to read & interpret vb cookie data from a non-vb page... |
#3
|
|||
|
|||
What cookie?
|
#4
|
|||
|
|||
The cookie data for remembering the collapsed / expanded setting for content boxes ...
I think the cookie name is vbulletin_collapse |
#5
|
|||
|
|||
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); |
#6
|
||||
|
||||
If you IDs are set correctly and vB cookies are accessible it should be stored/loaded automatically - if you have required global.php
|
#7
|
|||
|
|||
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> Code:
style="$vbcollapse[collapseobj_a_cats]" |
#8
|
|||
|
|||
Try the attached...
|
#9
|
|||
|
|||
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. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|