RSS

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.

http://www.bishopsteignton.org.uk/Luxcal/lcsbar.php  works just fine but when I put the code inside a Modx snippet

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

and call this snippet in a page at http://www.bishopsteignton.org.uk/whats-on-sidebar.html it errors out with "SQL error. See 'logs/mysql.log'"

The mysql.log reads:

2013-10-14T12:44:20+01:00
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();
chdir(dirname(__FILE__));

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 http://www.bishopsteignton.org.uk/Luxcal/lcsbar_diagnostic.php it works fine but when run from the snippet from the page as before:

http://www.bishopsteignton.org.uk/whats-on-sidebar.html

I get the following:

D:Domainsbishopsteignton.org.ukwwwroot
value of calID= lux

value of sbCal variable (NB maybe empty) =

Value of set variable =
SQL error. See 'logs/mysql.log'
__________________
John
__________________
John
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.

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  31 Oct 2013 15:49
Not quite that simple with MODX.

My page http://www.bishopsteignton.org.uk/whats-on-sidebar 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.
__________________
John