Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8560447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:16:41+00:00 2026-06-11T16:16:41+00:00

I am using a JQuery eventcalendar plugin from this website . Does anybody know

  • 0

I am using a JQuery eventcalendar plugin from this website.

Does anybody know how I can send a variable through to JSON so i can filter the data outputted. Can i send it in the link or would i need to use AJAX? Any pointers would be appreciated.
Thanks in advance.

<div id="cal"></div>

$("#cal").eventCalendar({
  // link to events json
  eventsjson: 'file.php' 
});

file.php

<?php
header('Content-type: text/json');

$var = $_GET["var"];

$sqldata = mysql_query('
SELECT
UNIX_TIMESTAMP(start_date) AS date,
employee AS title, 
days AS description,
UNIX_TIMESTAMP(end_date) AS url
FROM requests WHERE approved = 1
');

$posts = array();

while($row = mysql_fetch_assoc($sqldata))
{
    $row['date'] = $row['date'].'000';
    $row['url'] = $row['url'].'000';
    $row['description'] = $row['description'].' Days';
    $posts[] = $row;
}
mysql_free_result($sqldata);
die(json_encode($posts));

?>


function getEvents(limit, year, month, day, direction) {
    var limit = limit || 0;
    var year = year || '';
    var day = day || '';

    // to avoid problem with january (month = 0)

    if (typeof month != 'undefined') {
        var month = month;
    } else {
        var month = '';
    }

    //var month = month || '';
    flags.wrap.find('.eventsCalendar-loading').fadeIn();

    if (eventsOpts.jsonData) {
        // user send a json in the plugin params
        eventsOpts.cacheJson = true;

        flags.eventsJson = eventsOpts.jsonData;
        getEventsData(flags.eventsJson, limit, year, month, day, direction);

    } else if (!eventsOpts.cacheJson || !direction) {
        // first load: load json and save it to future filters
        $.getJSON(eventsOpts.eventsjson + "?limit="+limit+"&year="+year+"&month="+month+"&day="+day, function(data) {
            flags.eventsJson = data; // save data to future filters
            getEventsData(flags.eventsJson, limit, year, month, day, direction);
        }).error(function() { 
            showError("error getting json: ");
        });
    } else {
        // filter previus saved json
        getEventsData(flags.eventsJson, limit, year, month, day, direction);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:16:42+00:00Added an answer on June 11, 2026 at 4:16 pm

    The code of this plugin has:

    $.getJSON(eventsOpts.eventsjson + "?limit="+limit+"&year="+year+"&month="+month+"&day="+day, function(data)...
    

    Meaning if you add a parameter to the link it will not work…

    you will need to change the plugin code a bit to test for the existence of parameters and only then add the internal ones, something like:

    var URL = eventsOpts.eventsjson;
    URL += (eventsOpts.eventsjson.indexOf('?') < 0) ? '?' : '&';
    URL += "limit="+limit+"&year="+year+"&month="+month+"&day="+day;
    $.getJSON(URL, function(data)... 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using jquery, How can I create multiple draggables using loops through javascript? I want
Using Jquery AJAX to get a value from a PHP script. This line works
using jquery's .post i send do my php code an object that with var_dump
Using jquery, how can I change the color of these elements to red if
Using jQuery, how can I get the selected item's value in a select when
Using jQuery, how can I get the input element that has the caret's (cursor's)
Using jQuery, one can easily find out whether a particular element is visible using
Using jquery how do i simply check if it is read only? this is
Using jQuery, what's the best way to automatically initialize a plugin on all current
Using jQuery and given this <ul> <li> <a external=http://stackoverflow.com href=home.htm>Link 1</a> </li> <li> <a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.