vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Functions for setting and getting cookies? (https://vborg.vbsupport.ru/showthread.php?t=159994)

ToryS 10-11-2007 11:19 AM

Functions for setting and getting cookies?
 
Namely the Collapse cookies. I am trying to write a script, but for some reason my cookies aren't being fetched to set the tbody style to be none or empty.

Sorry if I am not explaining it clearly, but I am not sure how to say what I am trying to do, hehe.

It has something to do with $vbulletin->GPC['vbulletin_collapse'], but I can't figure out how exactly that function works.

Does anyone know how to save collapsed/expanded tables?

To clear things up a bit, when I click the expand/collapse image, the cookie DOES get written. The thing I am having problems with is the cookie getting pulled and set when the page reloads.

Analogpoint 10-11-2007 02:40 PM

The cookie is read automatically in global.php

All you have to do is create your collapsible box correctly.

Replace what's in red

Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="180">
<thead>
<tr>
    <td class="thead">
        <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('MYBOX')"><img id="collapseimg_MYBOX" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_MYBOX].gif" alt="" border="0" /></a>
        TITLE HERE
    </td>
</tr>
</thead>
<tbody id="collapseobj_MYBOX" style="$vbcollapse[collapseobj_MYBOX]">
<tr>
    <td class="alt1" nowrap="nowrap">CONTENTS HERE</td>
</tr>
</tbody>
</table>


ToryS 10-12-2007 12:24 PM

Ohh okay, I don't know why I didn't even think about that.

Thanks!


All times are GMT. The time now is 06:30 AM.

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.00942 seconds
  • Memory Usage 1,712KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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