RSS

LuxCal Forum

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

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / sidebar php to insert into webpage not working
Posted:  05 May 2016 15:59
Hello,

Totally new to LuxCal here - installed as a test.

The actual calendar seems to have installed fine - http://www.mjwebbassociates.com/luxcal-test/index.php

But attempting to add a upcoming events sidebar to a web page isn't working for me - http://www.mjwebbassociates.com/sidebar-test.php

Initially I had the test page as an HTML file, but then realised I'd need extra code in an htaccess file (to run the PHP inside the HTML) so simply switched the file suffix.

The code inside the sidebar-test.php file is simply:

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="luxcal-test/css/css_sbar.php">
<script type="text/javascript" src="luxcal-test/common/toolbox.js"></script>
</head>

<body>
<?php
$sbClass = {sidebar class}; *
$sbCal = {calendar ID}; *
$sbContent = {sidebar content}; *
$sbHeader = {sidebar title}; *
$sbGroups = {list of user groups for which events to show}; *
$sbCats = {list of event categories to show}; *
$sbUsersIn = {list of users to include}; *
$sbUsersEx = {list of users to exclude}; *
$sbMaxNbr = {max. number of events to show}; *
$sbUpDays = {max. number of days to show}; *
$sbWeekDay = {week day for which events to show}; *
include './luxcal-test/lcsbar.php';
?>

</body>
</html>

...following the installation help documentation.

Any ideas? Am I missing the bleeding obvious?

Cheers,
m.
Posted:  05 May 2016 16:00
(I've just edited off the initial doctype tag, incase that was at issue - no difference)
Posted:  05 May 2016 17:24
The sidebar would normally be in a homepage index.php not the calendar as you can see here. http://hnphockeylondon.ca/

Within the index.php file is the call to include the calendar as a sidebar. Here is the code I have in index.php which has it look ahead 14 days.

<?php
$sbClass = 'sideBar';
$sbUpDays = '14';
include './schedule/lcsbar.php';
?>


I hope this helps.

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  05 May 2016 18:17
Thanks Dan,

Interestingly this works:

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="luxcal-test/css/css_sbar.php">
<script type="text/javascript" src="luxcal-test/common/toolbox.js"></script>
</head>

<body>
<?php
$sbClass = 'sideBar';
$sbUpDays = '14';
include './luxcal-test/lcsbar.php';
?>

</body>
</html>

Thanks again!
Posted:  05 May 2016 19:37
Glad you got it sorted out.

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  05 May 2016 19:53   Last Edited By: Roel B.
Hi M.,

Yes, Dan's example is a good example.

In your post above, all the lines starting with "$sb", are optional. Normally you will need none or only one or two of them.
And - this is the most important - the curly braces and the text in between is just a very short description of what should go there.
So the curly braces and the text in between should be replaced by the appropriate text or value (between quotes).

Dan's example is a good one:
$sbClass = 'sideBar'; means that the sidebar's style (location, size, border, border color, etc.) is defined by, and can be changed with the style 'sideBar' in the file 'luxcal-test/css/css_sbar.php'. (Even this line could be removed, because the default class is already 'sideBar'.
$sbUpDays; means that the sidebar will show the upcoming events for the next 14 days. (This line could also be omitted; it will then take the value specified on the admin's Settings page - under 'Stand-Alone Sidebar'.
A more detailed description of all possible $sb" parameters can be found in the installation_guide.html, section 6b.

So in your case the following would suffice . . .
<?php
include './luxcal-test/lcsbar.php';
?>

I can't make it easier for you wink

Roel
Posted:  06 May 2016 10:13
Ah! I was missing the obvious!

Thanks :)