Ask your WordPress questions! Pay money and get answers fast! (more info)

Javascript debugging and short code for plugin


HI there

I have a question concerning a javascript error that causes some faults within our site. It´s a plugin called wordpress-ics-importer. We have the problem that the "previous" and "next" buttons are not working. Please have a look at
Additional to that I´d like to have a short code that I can add to the feature box of our blog on the index page, but the plugin doesn´t support this.

Thanks for any ideas and help.

Answers (2)


Jarret Minkler answers:

The buttons call the file ajax-load.php which contains code to setup the pagination

if(isset($_GET['eventsPage']) && isset($_GET['eventsStart']) && isset($_GET['eventsEnd']) && isset($_GET['eventsFile'])) {

$icsOptions = WPICSImporter::getAdminOptions();

$gmt_start = $_GET['eventsStart'];

$gmt_end = $_GET['eventsEnd'];

if($icsOptions['limit_type']=='days') {

$gmt_start += (int)$icsOptions['event_limit']*24*3600*(int)$_GET['eventsPage'];

$gmt_end += (int)$icsOptions['event_limit']*24*3600*(int)$_GET['eventsPage'];

$icsOptions['event_limit'] = 0;

$start = 0;

} else {

$gmt_end = NULL;

$start = $icsOptions['event_limit'] * ((int)$_GET['eventsPage']);

$icsOptions['event_limit'] = $icsOptions['event_limit'] * ((int)$_GET['eventsPage']+1);


$output = ICalEvents::display_events(unserialize(base64_decode($_GET['eventsFile'])), $gmt_start, $gmt_end, $icsOptions['event_limit'], $start, $_GET['uuid']);

echo $output;



What is your admin setting for the event_limit? Try putting this line before

$output = ICalEvents::display_events(unserialize(base64_decode($_GET['eventsFile'])), $gmt_start, $gmt_end, $icsOptions['event_limit'], $start, $_GET['uuid']);

echo "gmtstart: $gmt_start gmtend: $gmt_end event_limit: " . $icsOptions['event_limit'] ." start: $start";

This will give you a clue to where the pagination is going wrong. The previous and Next Buttons will change the eventPage value correctly, but it seems the start and end dates are not getting set correctly for some reason possibly due to your admin settings.

Frank K comments:

Hi Jarret
Sorry, for the delay- I´m happy that you are trying to solve this problem. I did add the line you suggested and as you can see [[LINK href=""]][[/LINK]] it does show some values. Added to that I send you a screen shot with the admin settings that set. Would it be helpful if I send you the plugin ?

Thanks for helping F