Jump to content
JcMagpie

Support thread for JcM Events Calender V1.0 Phoenix 1.0.4.0

Recommended Posts

JcM Events Calender V1.0 Phoenix 1.0.4.0

This is a simple add-on that lets you add a store events calender to your site.

It make use of fullcalender.js to render the calender. All the required css and scripts a loaded using a hook so don’t for get to load that.

A simple button in a card is used to access the calender. You can change this if you wish to make it just a test link or something else, but as stock it’s a button. The button class can be changed in admin.

The calender itself is shown on a new page. FullCalender.js can be as simple or as complex as you like. This is a simple implementation, the styling is basic and so is the complexity.

To add new events or edit existing ones all that is required is to edit the language file calender.php. The install is provided with a number of test evens showing how they can be setup.

You can get more information form the official site https://fullcalendar.io/

That’s it enjoy.

It has only been tested on Phoenix 1.0.4.3 only.

Can be seen working on this custom test site

image.thumb.png.0d00c58f5462dbf6ee614d02676d32ba.png

 


 

Share this post


Link to post
Share on other sites
Just now, JcMagpie said:

The script will not care where the events come from as long as they are provided in the format required.

Would that be in the language file or in the calendar file?

Share this post


Link to post
Share on other sites

I have made the below changes to the language file and it will only show one of the events I have in my database, not all of them (I currently have 2)

define('NAVBAR_TITLE', 'Events Calender');
  define('HEADING_TITLE', 'Events Calender');

$db_query = tep_db_query("select * from stores");
 while ($events = tep_db_fetch_array($db_query)) {


$title = $events['stores_title'];
$url = $events['event_url'];
$start = $events['event_date'];
	 
	 
	 $event = array(
    "'{title" => $title,
    "url" => $url,
    "start" => $start . "},'"
);
 
// Loop through superhero array
foreach($event as $key => $value){
    echo $key . ": " . $value . "<br>";
}
	 

  define('JCM_EVENTS_FULLCALENDER_BUTTON_EVENTS', '{
        title: "'.$title.'",
        url: "'.$url.'",
        start: "'.$start.'"
      },');
 }

 

Share this post


Link to post
Share on other sites

You need to edit the language file

public_html/includes/languages/english/calender.php

As you can see as long as the data follows ths format it should work.

define('JCM_EVENTS_FULLCALENDER_BUTTON_EVENTS', '{
        title: "All Day Event",
        url: "https://kuuza.co.uk/",
        start: "2020-01-31",
        description: "This is a test event"
      },

 


 

Share this post


Link to post
Share on other sites
1 hour ago, LeeFoster said:

I have made the below changes to the language file and it will only show one of the events I have in my database, not all of them (I currently have 2)

So it's geting the data just not reading more that one! Check the HTML beeing generated and make sure the output is correct format? must be an issue with your loop.


 

Share this post


Link to post
Share on other sites
3 hours ago, LeeFoster said:

have you considered doing this using database driven events?

@LeeFoster   there is Events Calendar (28d07) made by @burt .. 


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites
15 minutes ago, Omar_one said:

@LeeFoster   there is Events Calendar (28d07) made by @burt .. 

Yes I know but I don't have access to it and there's been no information on if it is going to be released for Phoenix and if so when.

Share this post


Link to post
Share on other sites
1 hour ago, JcMagpie said:

So it's geting the data just not reading more that one! Check the HTML beeing generated and make sure the output is correct format? must be an issue with your loop.

This is what is being generated -

<script>

      document.addEventListener('DOMContentLoaded', function() {
  var calendarEl = document.getElementById('calendar');

  var calendar = new FullCalendar.Calendar(calendarEl, {
    plugins: [ 'interaction', 'dayGrid', 'timeGrid', 'dayGridDay', 'dayGridWeek', 'timeGridDay', 'dayGridMonth' ],
    defaultView: 'dayGridMonth',
    
    defaultDate: '2020-02-04',
    //defaultDate: '2020-01-31',
    
    header: {
      left: 'today prev,next',
      center: 'title',
      right: 'dayGridMonth,timeGridWeek,timeGridDay'
    },
    events: [
      {
        title: "Chillcon - Sheffield",
        url: "http://www.chillcon.co.uk/sheffield-venue",
        start: "2020-03-28"
      },		]
    
  });

  calendar.render();
});

    </script>

 

Share this post


Link to post
Share on other sites

So the calender is working fine, looks like your loop for the events is not working... check you error logs? also make sure the loop is in corect position. is the event shown the first or the second? at which point is the loop stuck?

I don't have any db events so am not able to check.

 

 

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites
3 minutes ago, JcMagpie said:

So the calender is working fine, looks like your loop for the events is not working... check you error logs? also make sure the loop is in corect position. is the event shown the first or the second? at which point is the loop stuck?

I don't have any db events so am not able to check.

It's the first event that is shown.

Share this post


Link to post
Share on other sites

Then the loop is simply not doing it's job, check it's actualy looping by adding a simple echo statment  or count in the loop?

I would say pm a link but not sure that's much use in this case....

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites
21 minutes ago, JcMagpie said:

Then the loop is simply not doing it's job, check it's actualy looping by adding a simple echo statment  or count in the loop?

When I echo the loop it's fine so it has to be the way the data is being pushed into the define.

Share this post


Link to post
Share on other sites

Yeah the add-on is writen to keep it simple for most people to use by simply editing a language file to add events! Stock osC/Phoenix has no events in db. If you wish to pull from db you can....  just dont do it using the define as I'm not sure but I don't think you can have a loop in a define.

Just move the script to the public_html/calender.php  and replace <?php echo JCM_EVENTS_FULLCALENDER_BUTTON_EVENTS ?>  with the actual script pulled from your db.

 events: [
      <?php echo JCM_EVENTS_FULLCALENDER_BUTTON_EVENTS ?>
      ]

That should allow you to use the loop as required. Your basicly making a new add-on.............

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites
16 minutes ago, JcMagpie said:

Yeah the add-on is writen to keep it simple for most people to use by simply editing a language file to add events! Stock osC/Phoenix has no events in db. If you wish to pull from db you can....  just dont do it using the define as I'm not sure but I don't think you can have a loop in a define.

Just move the script to the public_html/calender.php  and replace <?php echo JCM_EVENTS_FULLCALENDER_BUTTON_EVENTS ?>  with the actual script pulled from your db.


 events: [
      <?php echo JCM_EVENTS_FULLCALENDER_BUTTON_EVENTS ?>
      ]

That should allow you to use the loop as required. Your basicly making a new add-on.............

Got it sorted, thank you for your help.

Share this post


Link to post
Share on other sites
14 hours ago, Omar_one said:

@LeeFoster   there is Events Calendar (28d07) made by @burt .. 

This is a support thread for this free add-on, it helps no one to post about other add-on.... especially if they are not free to download in the app's store


 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×