/    Sign up×
Community /Pin to ProfileBookmark

opencart calendar help

Hi

I found the following extension for opencart, it looks perfect for what I need but am trying to do it myself to understand the coding better but got stuck
[url]https://www.opencart.com/index.php?route=extension/extension/info&extension_id=16530&token=9f7ebe35ce7a380fde936f97007cc60b[/url]

I managed to get the calendar displaying all ok on the front end and it calls the events from a php file by looks of the coding

[code]
<div id=”eventCalendarHumanDate”></div>

<script>
$(document).ready(function() {
$(“#eventCalendarHumanDate”).eventCalendar({
eventsjson: ‘http://upyerpole.co.uk/bookingoc/catalog/view/theme/default/js/event.humanDate.json.php’,
jsonDateFormat: ‘human’ // ‘YYYY-MM-DD HH:MM:SS’
});
});
</script>
<script>
$(id).eventCalendar({
eventsjson: ‘file.json’,
jsonDateFormat: ‘human’
});
</script>
[/code]

Looking at the extension he has managed to add it into the admin side so events can be created by the admin side but I am not sure how to get that done

Looks like the person who made the extension is using the following jquery calendar
[url]http://www.vissit.com/jquery-event-calendar-plugin-english-version[/url]

The php file coding that has the events is below

[code]
<?php
header(‘Content-type: text/json’);
echo ‘[‘;
$separator = “”;
$days = 16;
// echo ‘ { “date”: “2013-03-19 17:30:00”, “type”: “meeting”, “title”: “Test Last Year”, “description”: “Lorem Ipsum dolor set”, “url”: “” },’;
// echo ‘ { “date”: “2013-03-23 17:30:00”, “type”: “meeting”, “title”: “Test Next Year”, “description”: “Lorem Ipsum dolor set”, “url”: “http://www.event3.com/” },’;

$i = 1;
echo $separator;
$initTime = date(“Y”).”-“.date(“m”).”-“.date(“d”).” “.date(“H”).”:00:00″;
//$initTime = date(“Y-m-d H:i:00”);
echo ‘ { “date”: “2013-04-01 17:30:00”, “type”: “meeting”, “title”: “Test Last Year”, “description”: “Lorem Ipsum dolor set”, “url”: “” },’;
echo ‘ { “date”: “2013-04-02 17:30:00”, “type”: “meeting”, “title”: “Test Last Year”, “description”: “Lorem Ipsum dolor set”, “url”: “” },’;
echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 1 days’)); echo ‘”, “type”: “meeting”, “title”: “Project ‘; echo $i; echo ‘ meeting”, “description”: “Lorem Ipsum dolor set”, “url”: “” },’;
echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 1 days + 4 hours’)); echo ‘”, “type”: “demo”, “title”: “Project ‘; echo $i; echo ‘ demo”, “description”: “Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.”, “url”: “http://www.event2.com/” },’;

echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 1 days 8 hours’)); echo ‘”, “type”: “meeting”, “title”: “Test Project ‘; echo $i; echo ‘ Brainstorming”, “description”: “Lorem Ipsum dolor set”, “url”: “http://www.event3.com/” },’;

echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 2 days 3 hours’)); echo ‘”, “type”: “test”, “title”: “A very very long name for a f*cking project ‘; echo $i; echo ‘ events”, “description”: “Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam.”, “url”: “http://www.event4.com/” },’;

echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 2 days 3 hours’)); echo ‘”, “type”: “meeting”, “title”: “Project ‘; echo $i; echo ‘ meeting”, “description”: “Lorem Ipsum dolor set”, “url”: “http://www.event5.com/” },’;

echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 4 days 3 hours’)); echo ‘”, “type”: “demo”, “title”: “Project ‘; echo $i; echo ‘ demo”, “description”: “Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.”, “url”: “http://www.event6.com/” },’;

echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 7 days 1 hours’)); echo ‘”, “type”: “meeting”, “title”: “Test Project ‘; echo $i; echo ‘ Brainstorming”, “description”: “Lorem Ipsum dolor set”, “url”: “http://www.event7.com/” },’;

echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 12 days 3 hours’)); echo ‘”, “type”: “test”, “title”: “A very very long name for a f*cking project ‘; echo $i; echo ‘ events”, “description”: “Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam.”, “url”: “http://www.event8.com/” },’;

echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 20 days 10 hours’)); echo ‘”, “type”: “demo”, “title”: “Project ‘; echo $i; echo ‘ demo”, “description”: “Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.”, “url”: “http://www.event9.com/” },’;

echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 22 days 3 hours’)); echo ‘”, “type”: “meeting”, “title”: “Test Project ‘; echo $i; echo ‘ Brainstorming”, “description”: “Lorem Ipsum dolor set”, “url”: “http://www.event10.com/” },’;

echo ‘ { “date”: “‘; echo date(“Y-m-d H:i:00″,strtotime($initTime. ‘ + 28 days 1 hours’)); echo ‘”, “type”: “test”, “title”: “A very very long name for a f*cking project ‘; echo $i; echo ‘ events”, “description”: “Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam.”, “url”: “http://www.event11.com/” }’;
$separator = “,”;

echo ‘]’;
?>
[/code]

I don’t understand the coding dates wise to be honest but not too worried about that at the mo, is more trying to get the events being added from the admin side, looks like he has made it into a module looking at the demo admin side?

Any help would really be appreciated

Thank you in advance

Ian

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @ianhaney spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...