Adventcalendar_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Adventcalendar_XH

Post by cmb » Wed Nov 27, 2013 4:14 pm

Holger wrote:there seems to be a little bug in Adventcalendars index.php.
Thanks for the fix. :) I'll make an update available today or tomorrow.
Korvell wrote:Tried changing the line and now I don't get the while screen. But it doesn't show the calendar either. And debug mode says nothing...
Um, strange. Is the system check of Adventcalendar all ok? Could you prepare the calendar in the plugin adminstration, so that the image with the "doors" was displayed? Have you used the base name of the calendar image in the plugin call on the page? For example, if you're using the demo image winter.jpg, you have to write:

Code: Select all

{{{PLUGIN:adventcalendar('winter');}}}
I shall improve the documentation for the next version.
Christoph M. Becker – Plugins for CMSimple_XH

Ulrich

Re: Adventcalendar_XH

Post by Ulrich » Wed Nov 27, 2013 7:22 pm

Ha...... thats the problem....

For example, if you're using the demo image winter.jpg, you have to write:


{{{PLUGIN:adventcalendar('winter');}}}

I shall improve the documentation for the next version.



You should clarify that part in the doc - I had the same problem.......

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Adventcalendar_XH

Post by cmb » Wed Nov 27, 2013 7:33 pm

Ulrich wrote:You should clarify that part in the doc - I had the same problem.......
Thanks for the feedback. :) I wonder, why I hadn't given an example based on the provided demo image -- presumably, I was in a hurry last year to get the plugin out in time.

Anyway, I shall also add an error message, if the calendar image resp. the calendar page does not exists. That's much more preferable than displaying nothing.
Christoph M. Becker – Plugins for CMSimple_XH

Korvell
Posts: 93
Joined: Thu May 22, 2008 10:33 pm

Re: Adventcalendar_XH

Post by Korvell » Wed Nov 27, 2013 8:50 pm

Yes - that was just what was needed - the right name of the calendar (winter). Now I see the image of the calendar.

Although another issue is now at hand; I might have misread/misunderstood something, but I though you could only "open" the days up to and including present day and the rest would be shut until the date was up.

I also am not too sure I have set up the right unix time in the config. I have tried various settings but still I have access to all dates in the calendar. I have used value for december 1st.: 1385852400

Lastly I observe a most likely wrong behavior; every other click on a date will not open a popup but shows a print-view of the page...

Korvell

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Adventcalendar_XH

Post by cmb » Wed Nov 27, 2013 9:09 pm

Korvell wrote:Yes - that was just what was needed - the right name of the calendar (winter). Now I see the image of the calendar.
Fine. :)
Korvell wrote:I also am not too sure I have set up the right unix time in the config. I have tried various settings but still I have access to all dates in the calendar. I have used value for december 1st.: 1385852400
The timestamp is fine (besides that I shall offer a more user friendly way to set it). However, when you're logged in as administrator, you'll always have access to all doors (so you can check, if everything is alright in advance). Just log out -- then none of the doors should be accessible.
Korvell wrote:Lastly I observe a most likely wrong behavior; every other click on a date will not open a popup but shows a print-view of the page...
It seems the lightbox doesn't work correctly in your environment. Do you get any JavaScript errors (press F12 and look for a console window)? Which browser do you use?
Christoph M. Becker – Plugins for CMSimple_XH

Korvell
Posts: 93
Joined: Thu May 22, 2008 10:33 pm

Re: Adventcalendar_XH

Post by Korvell » Wed Nov 27, 2013 9:38 pm

I use both Opera and Chrome and they both act the same. Also it doesn't seem to matter if I'm logged in or not if I can access a door. I'm not that experienced with the console window, but this is one line I get every other time:

Code: Select all

event.returnValue is deprecated. Please use the standard event.preventDefault() instead. 
And the other shows this:

Code: Select all

Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'colorbox'
If it helps here's a link to the test setup: http://hjertekulen.dk/?Test

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Adventcalendar_XH

Post by cmb » Wed Nov 27, 2013 10:14 pm

Korvell wrote:If it helps here's a link to the test setup:
Such links are very often helpful. :)

The problem that every other click opens the print view instead of the lightbox is caused by a clash with FancyBox. I'll have to do some debugging to hopefully find a solution.
Korvell wrote:Also it doesn't seem to matter if I'm logged in or not if I can access a door.
Indeed! Please double check the setting of time_start, and check the server time setting with the following plugin call, for example:

Code: Select all

{{{PLUGIN:date('Y-m-d');}}}
PS: The first error that is reported is harmless -- it seems that an issue with jQuery (I'm seeing it rather often with different scripts).
Last edited by cmb on Wed Nov 27, 2013 10:15 pm, edited 1 time in total.
Reason: added PS
Christoph M. Becker – Plugins for CMSimple_XH

Korvell
Posts: 93
Joined: Thu May 22, 2008 10:33 pm

Re: Adventcalendar_XH

Post by Korvell » Wed Nov 27, 2013 11:06 pm

Hmm - I thought I had set the right unix time, but must have forgot to save it. Reentering the (correct) time (1385852400) makes all doors unaccessible so it would look like it is working. Yay :) (Now - if only I could really test it to unlock the #1 door on December 1st, but of course by design it is not possible to trick the calendar into thinking it's December 1st.)
But I trust it will work and will let the site owner begin filling the appropriate pages, and if you manage to find a solution to the popup/printview that would be cool.

Thank you all for quick and useful responses. I'm a dedicated CMSimple fan and have followed the progress over the years and am amazed by the dedication and the people behind it.

Korvell

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Adventcalendar_XH

Post by cmb » Wed Nov 27, 2013 11:31 pm

Korvell wrote:Reentering the (correct) time (1385852400) makes all doors unaccessible so it would look like it is working.
Fine. :)
Korvell wrote:Now - if only I could really test it to unlock the #1 door on December 1st, but of course by design it is not possible to trick the calendar into thinking it's December 1st.
Well, you can simulate it by using another timestamp which is, say 1 minute in the future. After saving, log out, visit the page, and the door can't be opened until some more seconds have passed. This way you can even verify, that the timezone of the server is configured correctly (i.e. using CET).
Korvell wrote:and if you manage to find a solution to the popup/printview that would be cool.
I already found the cause of the issue: due to my misconfiguration the content of the lightbox wasn't encapsulated in an IFRAME, so other scripts using jQuery (in this case FancyBox) overwrote the necessary JS. Using an IFRAME is easy, but that means that the size of the lightbox will have to be configured (pixels or %), instead of automatically adjusting to size of the content.

Anyway, I'll release the new version today.
Christoph M. Becker – Plugins for CMSimple_XH

Korvell
Posts: 93
Joined: Thu May 22, 2008 10:33 pm

Re: Adventcalendar_XH

Post by Korvell » Thu Nov 28, 2013 9:17 am

Thx Christoph - the "simulation" worked flawless :D

Korvell

Post Reply