Log in

View Full Version : Why can't I access $datastore?


Boots
01-27-2005, 01:38 PM
<?php

// my custom portal

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'portal'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(
'birthdaycache',
'maxloggedin'
);

// pre-cache templates used by all actions
$globaltemplates = array(
'portal',
'forumhome_loggedinuser',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

chdir('/home/rc/public_html/forums/');
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once('./includes/functions_showthread.php');
require_once('./includes/functions_bigthree.php');

that is the start of my page... what else do I need to include to be able to gain access to the datastore? I'm trying to access the birthdaycache and having no luck.

Andreas
01-27-2005, 01:45 PM
$birthdaycache = unserialize($datastore['birthdaycache']);

Boots
01-27-2005, 01:50 PM
yep... I actualy copied/pasted the birthday code out of index.php and placed it in my file... it doesn't seem to do anything :(

same with maxloggedin ....

this code further down in the script does nothing...


// ### TODAY'S BIRTHDAYS #################################################
if ($vboptions['showbirthdays'])
{
$birthdaystore = unserialize($datastore['birthdaycache']);
if (!is_array($birthdaystore) OR ($today != $birthdaystore['day1'] AND $today != $birthdaystore['day2']))
{
// Need to update!
require_once('./includes/functions_databuild.php');
$birthdaystore = build_birthdays();
DEVDEBUG('Updated Birthdays');
}
switch($today)
{
case $birthdaystore['day1']:
$birthdays = $birthdaystore['users1'];
break;

case $birthdaystore['day2'];
$birthdays = $birthdaystore['users2'];
break;
}
// memory saving
unset($birthdaystore);

$show['birthdays'] = iif ($birthdays, true, false);
}
else
{
$show['birthdays'] = false;
}

figured it out! :D

ok is there something special you have to do to access the forumcache ? I'm doing the same thing as with the birthdaycache but I can't seem to get any valid data.

oh and this automerged doublepost thing is the WORST hack ever!