'theme' => '13',
'default' => 'month',
'select' => 'month,list,day,week,',
), $atts));
if (!isset($atts['select'])) {
$atts['select'] = 'month,list,day,week,';
}
return spider_calendar_big_front_end($id, $theme, $default, $select);
}
add_shortcode('Spider_Calendar', 'spider_calendar_big');
function spider_calendar_big_front_end($id, $theme, $default, $select, $widget = 0) {
require_once(«front_end/frontend_functions.php»);
ob_start();
global $many_sp_calendar;
global $wpdb;
if ($widget === 1) {
$themes = $wpdb->get_row($wpdb->prepare(‘SELECT * FROM ‘ . $wpdb->prefix . ‘spidercalendar_widget_theme WHERE id=%d’, $theme));
}
else{
$themes = $wpdb->get_row($wpdb->prepare(‘SELECT * FROM ‘ . $wpdb->prefix . ‘spidercalendar_theme WHERE id=%d’, $theme));
}
$cal_width = $themes->width; ?>
echo ‘You have no permission.’;
die();
}
global $wpdb;
if (isset($_POST[‘calendar_id’]) && isset($_POST[‘calendar_title’]) && isset($_POST[‘us_12_format_sp_calendar’]) && isset($_POST[‘default_year’]) && isset($_POST[‘default_month’])) {
$wpdb->update($wpdb->prefix . ‘spidercalendar_calendar’, array(
‘title’ => esc_sql(esc_html(stripslashes($_POST[‘calendar_title’]))),
‘time_format’ => esc_sql(esc_html(stripslashes($_POST[‘us_12_format_sp_calendar’]))),
‘def_year’ => esc_sql(esc_html(stripslashes($_POST[‘default_year’]))),
‘def_month’ => esc_sql(esc_html(stripslashes($_POST[‘default_month’]))),
), array(‘id’ => esc_sql(esc_html(stripslashes($_POST[‘calendar_id’])))), array(
‘%s’,
‘%d’,
‘%s’,
‘%s’,
), array(‘%d’));
$row = $wpdb->get_row($wpdb->prepare(«SELECT * FROM » . $wpdb->prefix . «spidercalendar_calendar WHERE id=’%d'», (int) $_POST[‘calendar_id’]));
?>
Manage eventspublished)
echo ‘style=»color:#C00″‘; ?>
href=»admin.php?page=SpiderCalendar&task=published&id=«> echo «Yes»;
else echo «No»; ?>
echo ‘You have no permission.’;
die();
}
global $wpdb;
if (isset($_POST[‘calendar_id’])) {
$row = $wpdb->get_row($wpdb->prepare(«SELECT * FROM » . $wpdb->prefix . «spidercalendar_calendar WHERE id=’%d'», $_POST[‘calendar_id’]));
?>
Cancel
id . «‘» ?>)» class=»button-primary save alignright»>Update
This plugin is the non-commercial version of the Spider Event Calendar. Use of the calendar is free.
The only limitation is the use of the themes. If you want to use one of the 11 standard themes or create a new one that
satisfies the needs of your web site, you are required to purchase a license.
Purchasing a license will add 11 standard themes and give possibility to edit the themes of the Spider Event Calendar.
After the purchasing the commercial version follow this steps:
- Deactivate Spider Event Calendar Plugin
- Delete Spider Event Calendar Plugin
- Install the downloaded commercial version of the plugin
}
function spider_calendar_themes_admin_styles_scripts() {
global $wd_spider_calendar_version;
wp_enqueue_script(«jquery»);
wp_enqueue_script(«standart_themes», plugins_url(‘elements/theme_reset.js’, __FILE__), array(), $wd_spider_calendar_version);
wp_enqueue_script(‘wp-color-picker’);
wp_enqueue_style( ‘wp-color-picker’ );
if (isset($_GET[‘task’])) {
if ($_GET[‘task’] == ‘edit_theme’ || $_GET[‘task’] == ‘add_theme’ || $_GET[‘task’] == ‘Apply’) {
wp_enqueue_style(«parsetheme_css», plugins_url(‘style_for_cal/style_for_tables_cal.css’, __FILE__), array(), $wd_spider_calendar_version);
}
}
}
function spider_widget_calendar_themes_admin_styles_scripts() {
global $wd_spider_calendar_version;
wp_enqueue_script(«jquery»);
wp_enqueue_script(«standart_themes», plugins_url(‘elements/theme_reset_widget.js’, __FILE__), array(), $wd_spider_calendar_version);
wp_enqueue_script(‘wp-color-picker’);
wp_enqueue_style( ‘wp-color-picker’ );
if (isset($_GET[‘task’])) {
if ($_GET[‘task’] == ‘edit_theme’ || $_GET[‘task’] == ‘add_theme’ || $_GET[‘task’] == ‘Apply’) {
wp_enqueue_style(«parsetheme_css», plugins_url(‘style_for_cal/style_for_tables_cal.css’, __FILE__), array(), $wd_spider_calendar_version);
}
}
}
function spider_calendar_admin_styles_scripts() {
global $wd_spider_calendar_version;
wp_enqueue_script(«Calendar», plugins_url(«elements/calendar.js», __FILE__), array(), $wd_spider_calendar_version, FALSE);
wp_enqueue_script(«calendar-setup», plugins_url(«elements/calendar-setup.js», __FILE__), array(), $wd_spider_calendar_version, FALSE);
wp_enqueue_script(«calendar_function», plugins_url(«elements/calendar_function.js», __FILE__), array(), $wd_spider_calendar_version, FALSE);
wp_enqueue_style(«Css», plugins_url(«elements/calendar-jos.css», __FILE__), array(), $wd_spider_calendar_version, FALSE);
}
function spider_calendar_event_category_admin_styles_scripts(){
global $wd_spider_calendar_version;
wp_enqueue_script(«Calendar», plugins_url(«elements/calendar.js», __FILE__), array(), $wd_spider_calendar_version, FALSE);
wp_enqueue_script(«calendar-setup», plugins_url(«elements/calendar-setup.js», __FILE__), array(), $wd_spider_calendar_version, FALSE);
wp_enqueue_script(‘wp-color-picker’);
wp_enqueue_style( ‘wp-color-picker’ );
wp_enqueue_style(«Css», plugins_url(«elements/calendar-jos.css», __FILE__), array(), $wd_spider_calendar_version, FALSE);
}
add_filter(‘admin_head’, ‘spide_ShowTinyMCE’);
function spide_ShowTinyMCE() {
// conditions here
wp_enqueue_script(‘common’);
wp_enqueue_script(‘jquery-color’);
wp_print_scripts(‘editor’);
if (function_exists(‘add_thickbox’)) {
add_thickbox();
}
wp_print_scripts(‘media-upload’);
if(version_compare(get_bloginfo(‘version’),3.3)<0){
if (function_exists(‘wp_tiny_mce’)) {
wp_tiny_mce();
}
}
wp_admin_css();
wp_enqueue_script(‘utils’);
do_action(«admin_print_styles-post-php»);
do_action(‘admin_print_styles’);
}
// Add menu.
add_action(‘admin_menu’, ‘sp_calendar_options_panel’);
require_once(«functions_for_xml_and_ajax.php»);
require_once(«front_end/bigcalendarday.php»);
require_once(«front_end/bigcalendarlist.php»);
require_once(«front_end/bigcalendarweek.php»);
require_once(«front_end/bigcalendarmonth.php»);
require_once(«front_end/bigcalendarmonth_widget.php»);
require_once(«front_end/bigcalendarweek_widget.php»);
require_once(«front_end/bigcalendarlist_widget.php»);
require_once(«front_end/bigcalendarday_widget.php»);
// Actions for popup and xmls.
add_action(‘wp_ajax_spiderbigcalendar_day’, ‘big_calendar_day’);
add_action(‘wp_ajax_spiderbigcalendar_list’, ‘big_calendar_list’);
add_action(‘wp_ajax_spiderbigcalendar_week’, ‘big_calendar_week’);
add_action(‘wp_ajax_spiderbigcalendar_month’, ‘big_calendar_month’);
add_action(‘wp_ajax_spiderbigcalendar_month_widget’, ‘big_calendar_month_widget’);
add_action(‘wp_ajax_spiderbigcalendar_list_widget’, ‘big_calendar_list_widget’);
add_action(‘wp_ajax_spiderbigcalendar_week_widget’, ‘big_calendar_week_widget’);
add_action(‘wp_ajax_spiderbigcalendar_day_widget’, ‘big_calendar_day_widget’);
add_action(‘wp_ajax_spidercalendarbig’, ‘spiderbigcalendar’);
add_action(‘wp_ajax_spiderseemore’, ‘seemore’);
add_action(‘wp_ajax_window’, ‘php_window’);
// Ajax for users.
add_action(‘wp_ajax_nopriv_spiderbigcalendar_day’, ‘big_calendar_day’);
add_action(‘wp_ajax_nopriv_spiderbigcalendar_list’, ‘big_calendar_list’);
add_action(‘wp_ajax_nopriv_spiderbigcalendar_week’, ‘big_calendar_week’);
add_action(‘wp_ajax_nopriv_spiderbigcalendar_month’, ‘big_calendar_month’);
add_action(‘wp_ajax_nopriv_spiderbigcalendar_month_widget’, ‘big_calendar_month_widget’);
add_action(‘wp_ajax_nopriv_spiderbigcalendar_list_widget’, ‘big_calendar_list_widget’);
add_action(‘wp_ajax_nopriv_spiderbigcalendar_week_widget’, ‘big_calendar_week_widget’);
add_action(‘wp_ajax_nopriv_spiderbigcalendar_day_widget’, ‘big_calendar_day_widget’);
add_action(‘wp_ajax_nopriv_spidercalendarbig’, ‘spiderbigcalendar’);
add_action(‘wp_ajax_nopriv_spiderseemore’, ‘seemore’);
add_action(‘wp_ajax_nopriv_window’, ‘php_window’);
//notices
if ( is_admin() && ( ! defined( ‘DOING_AJAX’ ) || ! DOING_AJAX ) ) {
require_once( ‘spider_calendar_admin_class.php’ );
include_once(‘spider_calendar_notices_class.php’);
require_once(‘notices.php’);
add_action( ‘plugins_loaded’, array( ‘SC_Admin’, ‘get_instance’ ) );
}
// Add style head.
function add_button_style_calendar() {
echo ‘‘;
}
add_action(‘admin_head’, ‘add_button_style_calendar’);
function Manage_Spider_Calendar() {
global $wpdb;
if (!function_exists(‘print_html_nav’)) {
require_once(«nav_function/nav_html_func.php»);
}
require_once(«calendar_functions.php»); // add functions for Spider_Video_Player
require_once(«calendar_functions.html.php»); // add functions for vive Spider_Video_Player
if (isset($_GET[«task»])) {
$task = esc_html($_GET[«task»]);
}
else {
$task = «»;
}
if (isset($_GET[«id»])) {
$id = (int) $_GET[«id»];
}
else {
$id = 0;
}
if (isset($_GET[«calendar_id»])) {
$calendar_id = (int) $_GET[«calendar_id»];
}
else {
$calendar_id = 0;
}
switch ($task) {
case ‘calendar’:
show_spider_calendar();
break;
case ‘add_calendar’:
add_spider_calendar();
break;
case ‘published’;
$nonce_sp_cal = $_REQUEST[‘_wpnonce’];
if (! wp_verify_nonce($nonce_sp_cal, ‘nonce_sp_cal’) )
die(«Are you sure you want to do this?»);
spider_calendar_published($id);
show_spider_calendar();
break;
case ‘Save’:
if (!$id) {
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
apply_spider_calendar(-1);
}
else {
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
apply_spider_calendar($id);
}
show_spider_calendar();
break;
case ‘Apply’:
if (!$id) {
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
apply_spider_calendar(-1);
$id = $wpdb->get_var(«SELECT MAX(id) FROM » . $wpdb->prefix . «spidercalendar_calendar»);
}
else {
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
apply_spider_calendar($id);
}
edit_spider_calendar($id);
break;
case ‘edit_calendar’:
edit_spider_calendar($id);
break;
case ‘remove_calendar’:
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
remove_spider_calendar($id);
show_spider_calendar();
break;
// Events.
case ‘show_manage_event’:
show_spider_event($calendar_id);
break;
case ‘add_event’:
add_spider_event($calendar_id);
break;
case ‘save_event’:
if ($id) {
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
apply_spider_event($calendar_id, $id);
}
else {
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
apply_spider_event($calendar_id, -1);
}
show_spider_event($calendar_id);
break;
case ‘apply_event’:
if ($id) {
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
apply_spider_event($calendar_id, $id);
}
else {
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
apply_spider_event($calendar_id, -1);
$id = $wpdb->get_var(«SELECT MAX(id) FROM » . $wpdb->prefix . «spidercalendar_event»);
}
edit_spider_event($calendar_id, $id);
break;
case ‘edit_event’:
edit_spider_event($calendar_id, $id);
break;
case ‘remove_event’:
$nonce_sp_cal = $_REQUEST[‘_wpnonce’];
if (! wp_verify_nonce($nonce_sp_cal, ‘nonce_sp_cal’) )
die(«Are you sure you want to do this?»);
remove_spider_event($calendar_id, $id);
show_spider_event($calendar_id);
break;
case ‘published_event’;
$nonce_sp_cal = $_REQUEST[‘_wpnonce’];
if (! wp_verify_nonce($nonce_sp_cal, ‘nonce_sp_cal’) )
die(«Are you sure you want to do this?»);
published_spider_event($calendar_id, $id);
show_spider_event($calendar_id);
break;
default:
show_spider_calendar();
break;
}
}
function Manage_Spider_Category_Calendar(){
require_once(«calendar_functions.html.php»);
require_once(«calendar_functions.php»);
if (!function_exists(‘print_html_nav’)) {
require_once(«nav_function/nav_html_func.php»);
}
global $wpdb;
if (isset($_GET[«task»])) {
$task = esc_html($_GET[«task»]);
}
else {
$task = «»;
show_event_cat();
return;
}
if (isset($_GET[«id»])) {
$id = (int) $_GET[«id»];
}
else {
$id = 0;
}
switch($task){
case ‘add_category’:
edit_event_category($id);
break;
case ‘save_category_event’:
if(!$id){
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
save_spider_category_event();
$id = $wpdb->get_var(«SELECT MAX(id) FROM » . $wpdb->prefix . «spidercalendar_event_category»);
}
else
{
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
apply_spider_category_event($id);
}
show_event_cat();
break;
case ‘apply_event_category’:
if (!$id) {
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
save_spider_category_event();
$id = $wpdb->get_var(«SELECT MAX(id) FROM » . $wpdb->prefix . «spidercalendar_event_category»);
}
else {
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
apply_spider_category_event($id);
}
edit_event_category($id);
break;
case ‘edit_event_category’:
//apply_spider_category_event();
edit_event_category($id);
break;
case ‘remove_event_category’:
check_admin_referer(‘nonce_sp_cal’, ‘nonce_sp_cal’);
remove_category_event($id);
show_event_cat();
break;
case ‘published’:
$nonce_sp_cal = $_REQUEST[‘_wpnonce’];
if (! wp_verify_nonce($nonce_sp_cal, ‘nonce_sp_cal’) )
die(«Are you sure you want to do this?»);
spider_category_published($id);
show_event_cat();
break;
}
}
function upcoming_widget(){
require_once(«calendar_functions.html.php»);
require_once(«spidercalendar_upcoming_events_widget.php»);
require_once(«calendar_functions.php»);
if (!function_exists(‘print_html_nav’)) {
require_once(«nav_function/nav_html_func.php»);
}
global $wpdb;
spider_upcoming();
}
function spider_widget_calendar_params() {
wp_enqueue_script(‘media-upload’);
wp_admin_css(‘thickbox’);
if (!function_exists(‘print_html_nav’)) {
require_once(«nav_function/nav_html_func.php»);
}
require_once(«widget_Themes_function.html.php»);
global $wpdb;
if (isset($_GET[«task»])) {
$task = esc_html($_GET[«task»]);
}
else {
$task = «»;
}
switch ($task) {
case ‘theme’:
html_show_theme_calendar_widget();
break;
default:
html_show_theme_calendar_widget();
}
}
// Themes.
function spider_calendar_params() {
wp_enqueue_script(‘media-upload’);
wp_admin_css(‘thickbox’);
if (!function_exists(‘print_html_nav’)) {
require_once(«nav_function/nav_html_func.php»);
}
require_once(«Themes_function.html.php»); // add functions for vive Spider_Video_Player
global $wpdb;
if (isset($_GET[«task»])) {
$task = esc_html($_GET[«task»]);
}
else {
$task = «»;
}
switch ($task) {
case ‘theme’:
html_show_theme_calendar();
break;
default:
html_show_theme_calendar();
}
}
function Uninstall_sp_calendar() {
global $wpdb;
$base_name = plugin_basename(‘Spider_Calendar’);
$base_page = ‘admin.php?page=’ . $base_name;
$mode = (isset($_GET[‘mode’]) ? trim($_GET[‘mode’]) : »);
if (!empty($_POST[‘do’])) {
if ($_POST[‘do’] == «UNINSTALL Spider Event Calendar») {
check_admin_referer(‘Spider_Calendar uninstall’);
echo ‘
‘;
$mode = ‘end-UNINSTALL’;
}
}
switch ($mode) {
case ‘end-UNINSTALL’:
$deactivate_url = wp_nonce_url(‘plugins.php?action=deactivate&plugin=’ . plugin_basename(__FILE__), ‘deactivate-plugin_’ . plugin_basename(__FILE__));
echo ‘
echo ‘
Uninstall Spider Event Calendar
‘;
echo ‘
‘ . sprintf(‘Click Here To Finish The Uninstallation And Spider Event Calendar Will Be Deactivated Automatically.’, $deactivate_url) . ‘
‘;
echo ‘
‘;
break;
// Main Page
default:
?>
‘ . «\n»;
‘ . «\n»;
‘ . «\n»;
‘ . «\n»;
‘ . «\n»; |
»
class=»button-primary»
onclick=»uninstall()»/>
Featured Themes |
Featured Plugins |
$spider_cats = $wpdb->get_results($select_spider_categories);
$cat_columns = array(
array(‘id’, ‘title’, ‘published’, ‘color’, ‘description’)
);
if ($spider_cats) {
foreach ($spider_cats as $cat) {
$cat_columns[] = array(
$cat->id,
$cat->title,
$cat->published,
$cat->color,
$cat->description
);
}
}
$cat_handle = fopen($tmp_folder . ‘/sc_categories.csv’, ‘w+’);
foreach ($cat_columns as $ar) {
if (fputcsv($cat_handle, $ar, ‘,’) === FALSE) {
break;
}
}
@fclose($cat_handle);
$select_spider_calendars = «SELECT * from » . $wpdb->prefix . «spidercalendar_calendar»;
$spider_calendars = $wpdb->get_results($select_spider_calendars);
$cal_columns = array(
array(‘id’, ‘title’, ‘published’)
);
if ($spider_calendars) {
foreach ($spider_calendars as $cal) {
$cal_columns[] = array(
$cal->id,
$cal->title,
$cal->published
);
}
}
$cal_handle = fopen($tmp_folder . ‘/sc_calendars.csv’, ‘w+’);
foreach ($cal_columns as $ar) {
if (fputcsv($cal_handle, $ar, ‘,’) === FALSE) {
break;
}
}
@fclose($cal_handle);
$select_spider_events = «SELECT * from » . $wpdb->prefix . «spidercalendar_event»;
$spider_events = $wpdb->get_results($select_spider_events);
$events_columns = array(
array(‘id’, ‘cal_id’, ‘start_date’, ‘end_date’, ‘title’, ‘cat_id’,
‘time’, ‘text_for_date’, ‘userID’, ‘repeat_method’, ‘repeat’, ‘week’,
‘month’, ‘month_type’, ‘monthly_list’, ‘month_week’, ‘year_month’, ‘published’)
);
if ($spider_events) {
foreach ($spider_events as $ev) {
$events_columns[] = array(
$ev->id,
$ev->calendar,
$ev->date,
$ev->date_end,
$ev->title,
$ev->category,
$ev->time,
$ev->text_for_date,
$ev->userID,
$ev->repeat_method,
$ev->repeat,
$ev->week,
$ev->month,
$ev->month_type,
$ev->monthly_list,
$ev->month_week,
$ev->year_month,
$ev->published
);
}
}
$ev_handle = fopen($tmp_folder . ‘/sc_events.csv’, ‘w+’);
foreach ($events_columns as $ar) {
if (fputcsv($ev_handle, $ar, ‘,’) === FALSE) {
break;
}
}
@fclose($ev_handle);
$files = array(
‘sc_categories.csv’,
‘sc_calendars.csv’,
‘sc_events.csv’
);
$zip = new ZipArchive();
$tmp_file = tempnam(‘.’, »);
if ($zip->open($tmp_file, ZIPARCHIVE::CREATE) === TRUE) {
foreach ($files as $file) {
if (file_exists($tmp_folder . $file)) {
$zip->addFile($tmp_folder . $file, $file);
}
}
$zip->close();
header(«Content-type: application/zip; charset=utf-8»);
header(«Content-Disposition: attachment; filename=spider-event-calendar-export.zip»);
header(«Content-length: » . filesize($tmp_file));
header(«Pragma: no-cache»);
header(«Expires: 0»);
readfile($tmp_file);
}
foreach ($files as $file) {
@unlink($tmp_folder . $file);
}
}
}
function calendar_export() {
?>
`id` int(11) NOT NULL AUTO_INCREMENT,
`calendar` int(11) NOT NULL,
`date` date NOT NULL,
`date_end` date NOT NULL,
`title` text NOT NULL,
`time` varchar(20) NOT NULL,
`text_for_date` longtext NOT NULL,
`userID` varchar(255) NOT NULL,
`repeat_method` varchar(255) NOT NULL,
`repeat` varchar(255) NOT NULL,
`week` varchar(255) NOT NULL,
`month` varchar(255) NOT NULL,
`month_type` varchar(255) NOT NULL,
`monthly_list` varchar(255) NOT NULL,
`month_week` varchar(255) NOT NULL,
`year_month` varchar(255) NOT NULL,
`published` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;»;
$spider_calendar_table = «CREATE TABLE IF NOT EXISTS `» . $wpdb->prefix . «spidercalendar_calendar` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`gid` varchar(255) NOT NULL,
`def_zone` varchar(255) NOT NULL,
`time_format` tinyint(1) NOT NULL,
`allow_publish` varchar(255) NOT NULL,
`start_month` varchar(255) NOT NULL,
`published` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;»;
$spider_category_event_table = «CREATE TABLE IF NOT EXISTS `» . $wpdb->prefix . «spidercalendar_event_category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`published` tinyint(1) NOT NULL,
`color` varchar(255) NOT NULL,
`description` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;»;
$wpdb->query($spider_event_table);
$wpdb->query($spider_calendar_table);
$wpdb->query($spider_category_event_table);
require_once «spider_calendar_update.php»;
spider_calendar_chech_update();
}
register_activation_hook(__FILE__, ‘SpiderCalendar_activate’);
function spider_calendar_ajax_func() {
?>