RSS

LuxCal Forum

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

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / Can't get post to sidebar to work.
Posted:  09 Dec 2012 16:02   Last Edited By: Danwestlake
Hello,

I wanted to get events to show in my current website. It uses php and tpl files.

First I tried.

Code:


<?php
            $sbUsersIn = {pplumb};
            include 'http://www.eventsbyus.ca/london/lcsbar.php';
            ?>


It generated this error.

Quote:


Parse error: syntax error, unexpected '{' in file_default.tpl on line 324


I then changed it to this.

Code:


<?php
            $sbUsersIn = 'pplumb';
            include 'http://www.eventsbyus.ca/london/lcsbar.php';
            ?>


It doesn't generate an error, it also doesn't display. I tried adding 'echo' which I saw elsewhere for other things and all that did was echo pplumb.

I viewed the source of the page and the only part that shows is the comments.

Quote:


<!-- Begin events from Events Calendar -->
                        <!-- End events from Events Calendar -->


Here is the url in case anyone has any suggestions. http://www.harlo.ca/3-bedroom.html

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  09 Dec 2012 18:14   Last Edited By: Roel B.
Hi Dan,
With the the statement:

$sbUsersIn = ...

you can filter on user IDs. If you want to do this, then you should use this as follows:

$sbUsersIn = '2,3';

Where 2,3 is a list with one or more user IDs whose events will be included in the sidebar. See also the example in the installation_guide.html - at the end of section 5b.

I suggest to start without any filters, until the sidebar properly works. Then later, if you want, you can add filters and a custom title.

As a first step you can try out the sidebar directly (without "including" it), by launching it directly via the URL http://www.eventsbyus.ca/london/lcsbar.php. It should then display full-screen, unformatted.
However, when you launch this URL, then you will see that the side bar doesn't work because on your server the "URL file-access is disabled in the server configuration". This is probably a security measure; because I don't know your server, I can't help very much here.

If you want an example of what you should see if you start the sidebar when launching it directly, you can have a look at the LuxSoft's demo sidebar: LuxCal demo sidebar - direct link

Furthermore, I expect server security problems because the calendar is not in the same domain as the http://www.harlo.ca site. It will probably be difficult to include PHP-code (the sidebar) from a different domain. It could however be done via an iframe.

Roel
Posted:  09 Dec 2012 20:52
Hi Roel,

Thanks, that is helping me to get on the right track.

The first part of the problem which you pointed out is the user ID is not the user name. Of course they start at 0 and go from there.

When you are in LuxCal it doesn't show the user ID, just the user name.  With only the public, admin and 1 user it isn't hard to figure out. Perhaps in one of the updates you could have their user id in the first column.

I suspected that the across domains might be an issue, it was just a test first to see if I can get it to work. I can install LuxCal on that domain for further testing which is what I would do anyway.

If you check www.harlo.ca it is for rental properties. That script lacks a calendar or event feature. I'm hoping I can tie the two together so that when a person has a unit that is becoming available they will be able to enter it into LuxCal and then tie it to their listing.

Say I've given my 60 day notice to move out and now I want to find an apartment that will be becoming available in 60 days. Hopefully I can make it work.

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  10 Dec 2012 02:45
Ok this really has me baffled and scratching my head.

I've installed LuxCal so it is on the same domain. I'm the only user and have entered an event for Dec 14th.

I run the straight url http://www.harlo.ca/luxcal/lcsbar.php and it works perfectly.

Quote:


Upcoming Events
Friday 14 December 2012
Test for my Birthday


I put it in my tpl file and even allowed for extra user id's.

Code:


<!-- Begin events from Events Calendar -->
            <?php
            $sbUsersIn = '0,1,2,3';
            include '/home/content/40/5928640/html/hostedsites/harlo.ca/luxcal/lcsbar.php';
            ?>
            <!-- End events from Events Calendar -->


I don't get an error, it works but says there isn't any upcoming events.

Quote:


Upcoming Events
No upcoming events.


Any suggestions?

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  10 Dec 2012 10:49
It will only show significant events, so maybe your birthday is excluded cool
Just kidding of course,

And what happens if you leave out the user ID filter altogether?
Posted:  10 Dec 2012 12:12
It didn't make a difference.

It didn't return an error and still said there weren't any events.

I figured ok if it is working but not returning any events is it looking at the wrong data file for the events.

I went in, checked and rechecked the path and still no error and it says no events.

I wondered if the flags were reversed $sbUsersEx instead of $sbUsersIn, tried that and it didn't make a difference.

I double checked it was to select the user not events.

Then I thought. Ok, lets get real basic here. Create a simple html file and throw it in the root directory. This is where it gets even weirder. This same code in the .tpl file that shows there aren't any events doesn't generate an error and doesn't show anything, not even the.

Quote:


Upcoming Events
No upcoming events.


Why is it that I'm getting a feeling it is something so simple I've missed like a spelling mistake, you know, e before i instead of i before e or there is a stupid extra space somewhere. ARG!!!

Oh yeah, turning 56, still alive, haven't lost my mind yet (getting there) and been married 35 years. Pretty significant. winkthump_up
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  10 Dec 2012 12:33
Ok I may have stumbled on something here.

I thought I would try adding the calendar to the html file in an iframe to see if it worked.

I added this line.

Quote:


<iframe src="http://www.harlo.ca/luxcal/?hdr=0&cP=2"></iframe>


Not only did it work but now the events from the other code showed up.

Fluke? Cache issue?

I removed the line for the calendar, refreshed the html page and poof nothing was showing again, not even the text saying there were no events.

I thought I would test it with the mini calendar. The mini calendar shows up but nothing with the event.

Any suggestions?

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  10 Dec 2012 13:52
Like you I've the feeling you're very close, must be a minor thing . . .

If the calendar is in a sub-directory of the parent page, then try the following code:

Code:


<!-- Begin events from Events Calendar -->
<?php
include './luxcal/lcsbar.php';
?>
<!-- End events from Events Calendar -->


I had a look again at your www.harlo.ca site and saw that the sidebar was not formatted. I could not find the following required code in the head-section of the parent page:

Code:


<link rel="stylesheet" type="text/css" href="./luxcal/css/css_sbar.php">
<script src="./luxcal/common/toolbox.js"></script>

Roel
Posted:  10 Dec 2012 14:27
Ok I changed the code to just.

Code:


<!-- Begin events from Events Calendar -->
<?php
include './luxcal/lcsbar.php';
?>
<!-- End events from Events Calendar -->


I left out the $sbUsersIn = '0,1,2,3'; part so it was just the code you mentioned.

Regarding the css part which I also added.

Code:


<link rel="stylesheet" type="text/css" href="./luxcal/css/css_sbar.php">
<script src="./luxcal/common/toolbox.js"></script>


All it did was make it pretty. Doesn't flow with my site, but it's off to the right in a red box now. biggrin I'll have to adjust when I get it working.

http://www.harlo.ca/luxcal/images/sidebar.png

My template file is in a different area which is why I included the full server path to the file to try and make sure it got found.

My question is this. Using the html file nothing showed but as soon as I put an iframe with the calendar in it the sbar data showed.

We know a direct link works. I can also get it to display. I just can't get it to display data when it displays.

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  10 Dec 2012 15:39   Last Edited By: Roel B.
At least it looks prettier!

Because the side bar is viewed by public (not logged in) users, please check the following:
- On the admin's Categories page: Is for the category you used for your birthday test Public set to "yes"?
- Is your test event not set to "private"?
- On the admin's Settings page: at the very bottom: does the "Days to look ahead in sidebar" show sufficient days?

Maybe try to add another test event for one of the coming days in a different category.

If this doesn't help, could you create a temporary user account for me with admin rights and send me the un + pw by email.
Posted:  10 Dec 2012 18:01
Yes the category is set to Public.
No it isn't set to private. Private turned off.
Set to 90 days.

Tried changing category to No Category from existing category. Didn't make a difference. The code still displays without error, just doesn't display any events.

I assume you mean Admin account for the calendar installation?

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  10 Dec 2012 18:29   Last Edited By: Roel B.
Yes, thanks.
Roel
Posted:  10 Dec 2012 18:57   Last Edited By: Roel B.
So far I couldn't find the problem.
Are there any error logs in the file luxcal/logs/mysql.log?

What puzzles me is that when it's run stand-alone, the upcoming events do show up and when included they don't.
Normally (on my test sites) there is no difference.
Posted:  10 Dec 2012 21:01
No there aren't any error logs in the logs directory.

Here is a link to the page where you can see the pretty box live. http://www.harlo.ca/3-bedroom.html

I created a simple html page and put it in the root of the main program. You can see it's blank. It didn't generate any errors. You can view it to make sure I have it correct. http://www.harlo.ca/luxcal-sidebar.htm

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  10 Dec 2012 21:21
Is there anything is .htaccess of php5.ini that might be causing the issue?
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  10 Dec 2012 23:21   Last Edited By: Roel B.
No, I don't think this has any influence.
I went through the lcsbar.php code and can't see anything causing this problem. The heart of the calendar is the "retrieve" function (in the file retrieve.php). This function is called by the lcsbar.php script to retrieve the requested upcoming events. For one or another reason this retrieve function doesn't retrieve the expected events. This function itself is very reliable and has not changed since long, so there must be an external factor preventing this retrieve function to collect the events from the database.
Tomorrow I will prepare a lcsbar.php file for you with some test entries added to it, which should give us more info of where it fails.
Roel

PS. Your "simple html page" doesn't work. The HTML code is not served by the PHP processor. Most probably because you used the extension .htm and not .html.
That's the reason it doesn't say anything, not event "No upcoming events".
Posted:  10 Dec 2012 23:36   Last Edited By: Danwestlake
I just took a look at the retrieve.php file. I'm reaching here. I changed the date order from d.M.y to M.d.Y (I don't believe I changed the year in any way).

There is a big difference between the 2nd month and the 2nd day. I'll try switching the date order back to see if that makes any difference.

It didn't make a difference. sad

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  11 Dec 2012 00:16
I'm more thinking in the direction of connecting to the wrong (empty) database. You have probably more than one db installed.

But then I still can't explain why it works well when launched stand-alone.
Posted:  11 Dec 2012 02:04   Last Edited By: Danwestlake
On harlo.ca I only have the one calendar installed.

I also added the l to luxcal-sidebar.html and it's still blank.

I wondered if for some reason the main php script on the site had something to do with it. I tried eventsbyus.ca where I have 21 installations but no php scripts. Same results.

If when the script ran it reported which calendar it was pulling from that would help I'm sure.
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  11 Dec 2012 12:05
Hi Roel,

In your example above where you have a direct link to lcsbar.php, can a variable parameter or value be passed to it like (I'll get this wrong) http://www.luxsoft.eu/luxcal/lcsbar.php?u=1 where it will return the upcoming events for user id 1?

If it can, it might be the easiest to implement and fix. In lcsbar.php if you haven't already you could specify the path to the calendar so no many how many you have it is hitting the right one.

One thing I also noticed in the settings setup is it says "If the sidebar is in use.", does that mean it has to be loaded somewhere for the events to apply in the session?

For all events, simply having http://www.luxsoft.eu/luxcal/lcsbar.php is fine and it works. That was why I was asking about simply passing the value directly to it.

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  11 Dec 2012 14:26
Hi Roel,

I've got something that might help. I got thinking about what you said:

PS. Your "simple html page" doesn't work. The HTML code is not served by the PHP processor. Most probably because you used the extension .htm and not .html.
That's the reason it doesn't say anything, not event "No upcoming events".


So I simply renamed index2.html to index.php and it works. Here is the link. http://harlo.ca/index2.php

Hopefully that will enable you to get it to work in a non php file. In my websites (I have a couple that use my main script) they use php and tpl files. They then use friendly url's and create the html file which you see here. http://www.harlo.ca/3-bedroom.html

I've included a section of the template.tpl file where it is placed which might help us find a solution. If you at the link you can see where I have it appearing below the "More listings from this user" and above the "Phone Number" (because of the css it's out of place)

Code:


            <!---- Begin Add link for More listings from this user ---->
            <a href="<?php echo BASE_URL; ?>/search_results.php?user_id=<?php echo $user_id; ?>">More listings from this user</a>
            <!---- End Add link for More listings from this user ---->
            <br />
            <?php
$sbUsersIn = '0,1,2,3';
include '/home/content/40/5928640/html/hostedsites/harlo.ca/luxcal/lcsbar.php';
?>

            <br />
            <?php if($phone) { ?>
                <?php echo $lang['public_listing_phone']; ?>: <?php echo $this->escape($phone); ?><br /><br />
            <?php } ?>
            <?php if($fax) { ?>
                <?php echo $lang['public_listing_fax']; ?>: <?php echo $this->escape($fax); ?><br /><br />
            <?php } ?>
            <?php echo $this->escape($address); ?><br /><br />
           
            <?php echo $map; ?>


Does this help at all?

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  13 Dec 2012 05:18
I'm getting close to getting to work perfectly.

In my main script I've included the lcsbar.php which has it returning the events. My next step is to clean it up a bit but at least the events are displaying now. smile

Here is a link to the page. http://www.harlo.ca/3-bedroom.html
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  14 Dec 2012 11:33
Hello,

The problem I'm running into now is it displays but always all events even when I ask for events by 1 user id.

Code:


<?php
$sbUsersIn = '1';
?>


This displays all user id's even though I only a one.

Code:


<?php
$sbUsersIn = '5';
?>


This displays all user id's even though I asked for a different one.

Code:


<?php
$sbUsersIn = '6';
?>


This displays all for an existing user that hasn't posted any events when it shouldn't display anything.

I must be entering the $sbUsersIn = '5'; incorrectly or for some reason the request isn't getting to LuxCal.

Any suggestions anyone?

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

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html