LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / Sidebar
Posted:  14 Oct 2013 17:58
I am attempting to use the sidebar on my MODx Evo website and I suspect the problem I have is a a modx one not a luxcal one but I will ask anyway.  works just fine but when I put the code inside a Modx snippet

$sbHeader = 'All other events';
$sbUpDays = '7';
// current directory
echo getcwd() . "n";
include './luxcal/lcsbar.php';

and call this snippet in a page at it errors out with "SQL error. See 'logs/mysql.log'"

The mysql.log reads:

Script name: /index.php
MySQL error: Table 'luxcal._settings' doesn't exist
Query string: SELECT name, value FROM _settings

My knowledge of PHP is minimal but in an attempt to debug I included a series of echo statements in a file lcsbar_diagnostic
a section of which now reads

//save and set cwd
$cwd = getcwd();

require_once './common/toolbox.php'; //get toolbox

$calID = dbConnect(); //connect to database
echo "<br>value of calID=  " . $calID . " <br>";

if (!empty($sbCal)) { $calID = $sbCal; } //select calendar
echo "<br>value of sbCal variable (NB maybe empty) =  " . $sbCal . " <br> ";

echo "  <br> Value of set variable =  " . $set . "<br>";
if (!isset($set)) { $set = getSettings(); } //get settings from db
echo "<br>immediately after getting strings from db!";
date_default_timezone_set($set['timeZone']); //set time zone

When I run this standalone it works fine but when run from the snippet from the page as before:

I get the following:
value of calID= lux

value of sbCal variable (NB maybe empty) =

Value of set variable =
SQL error. See 'logs/mysql.log'
Posted:  18 Oct 2013 04:00
Hi John,

Sidebar has to be in a php file, you can simply rename your html file to a php file and it should work fine.

"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at
Posted:  31 Oct 2013 15:49
Not quite that simple with MODX.

My page isn't really a page at all but somethng that MODx produces on the fly. Part of what is called to make up the page is a MODx snippet which is php.  It is not possible to "just" rename the page but thanks for the suggestion.