Changeset 172556
- Timestamp:
- 11/12/2009 07:16:57 AM (16 years ago)
- Location:
- eventr/trunk
- Files:
-
- 2 added
- 10 edited
-
attendee_form.php (modified) (3 diffs)
-
attendees.php (modified) (3 diffs)
-
event_form.php (modified) (2 diffs)
-
eventr.php (modified) (5 diffs)
-
events.php (modified) (3 diffs)
-
export_choose.php (modified) (1 diff)
-
includes (added)
-
includes/Image.php (added)
-
options.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
show_registeration_form.php (modified) (3 diffs)
-
wpframe.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
eventr/trunk/attendee_form.php
r134219 r172556 1 1 <?php 2 2 require('wpframe.php'); 3 stopDirectCall(__FILE__);3 wpframe_stop_direct_call(__FILE__); 4 4 5 5 $attendee = array(); … … 8 8 strip_tags($_POST['attendee_name']), $_POST['content'], $_POST['url'], $_POST['email'], $_POST['phone'], 9 9 (isset($_POST['status']) ? 1 : 0), $_POST['attendee'])); 10 showMessage("Attendee details updated");10 wpframe_message("Attendee details updated"); 11 11 } 12 12 $attendee = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}eventr_attendee WHERE ID = $_REQUEST[attendee]"); … … 19 19 20 20 <?php 21 wp_admin_css('thickbox'); 22 wp_print_scripts('jquery-ui-core'); 23 wp_print_scripts('jquery-ui-tabs'); 24 wp_print_scripts('post'); 25 wp_print_scripts('editor'); 26 if(function_exists('add_thickbox')) add_thickbox(); //Make sure it works with WP 2.5 27 wp_print_scripts('media-upload'); 28 if (function_exists('wp_tiny_mce')) wp_tiny_mce(); 21 wpframe_add_editor_js(); 29 22 ?> 30 23 <form name="post" action="" method="post" id="post"> -
eventr/trunk/attendees.php
r134219 r172556 1 1 <?php 2 2 include('wpframe.php'); 3 stopDirectCall(__FILE__);3 wpframe_stop_direct_call(__FILE__); 4 4 5 5 if($_REQUEST['action'] == 'delete' or $_REQUEST['action'] == t('Delete Selected')) { … … 12 12 13 13 <div class="wrap"> 14 <h2><?php echo t("Attendees for ") . $event_name; ?></h2>14 <h2><?php echo t("Attendees for ") . stripslashes($event_name); ?></h2> 15 15 16 16 <?php … … 141 141 ?> 142 142 143 Items Per Page: <select name="items_per_page" id="items_per_page">143 <?php e("Items Per Page"); ?>: <select name="items_per_page" id="items_per_page"> 144 144 <?php 145 145 foreach($items_per_page_choice as $v) { -
eventr/trunk/event_form.php
r134219 r172556 1 1 <?php 2 2 require('wpframe.php'); 3 stopDirectCall(__FILE__);3 wpframe_stop_direct_call(__FILE__); 4 4 5 5 $action = 'new'; … … 23 23 24 24 <?php 25 wp_admin_css('thickbox'); 26 wp_print_scripts('jquery-ui-core'); 27 wp_print_scripts('jquery-ui-tabs'); 28 wp_print_scripts('post'); 29 wp_print_scripts('editor'); 30 if(function_exists('add_thickbox')) add_thickbox(); //Make sure it works with WP 2.5 31 wp_print_scripts('media-upload'); 32 if (function_exists('wp_tiny_mce')) wp_tiny_mce(); 25 wpframe_add_editor_js(); 33 26 ?> 34 27 <script type="text/javascript" src="<?=$wpframe_plugin_folder?>/js/admin/event_form.js"></script> -
eventr/trunk/eventr.php
r134219 r172556 4 4 Plugin URI: http://www.bin-co.com/tools/wordpress/plugins/eventr/ 5 5 Description: Eventr Plugin lets you create events and provides your visitors with a form that lets them register for the event. There is also an option to show the entire attendee list to blog vistors as well. 6 Version: 1.02. 06 Version: 1.02.1 7 7 Author: Binny V A 8 8 Author URI: http://www.binnyva.com/ 9 9 */ 10 require_once('wpframe.php');11 10 12 11 /** … … 20 19 if($wp_version >= '2.7') $page = 'tools.php'; 21 20 22 add_submenu_page($page, t('Manage Events'), t('Manage Events'), $view_level, 'eventr/events.php'); 23 wpf_register_pages(array('attendee_form.php','attendees.php', 'event_form.php', 'export.php', 'export_choose.php', 'event_action.php'), 'eventr'); 21 add_submenu_page($page, __('Manage Events', 'eventr'), __('Manage Events', 'eventr'), $view_level, 'eventr/events.php'); 22 global $_registered_pages; 23 $code_pages = array('attendee_form.php','attendees.php', 'event_form.php', 'export.php', 'export_choose.php', 'event_action.php'); 24 foreach($code_pages as $code_page) { 25 $hookname = get_plugin_page_hookname("eventr/$code_page", '' ); 26 $_registered_pages[$hookname] = true; 27 } 24 28 } 25 29 … … 33 37 add_action('admin_menu', 'eventr_option_page'); 34 38 function eventr_option_page() { 35 add_options_page( t('Eventr Settings'), t('Eventr Settings'), 8, basename(__FILE__), 'eventr_options');39 add_options_page(__('Eventr Settings', 'eventr'), __('Eventr Settings', 'eventr'), 8, basename(__FILE__), 'eventr_options'); 36 40 } 37 41 function eventr_options() { 38 42 if ( function_exists('current_user_can') && !current_user_can('manage_options') ) die(t('Cheatin’ uh?')); 39 if (! user_can_access_admin_page()) wp_die( t('You do not have sufficient permissions to access this page.') );43 if (! user_can_access_admin_page()) wp_die( __('You do not have sufficient permissions to access this page.', 'eventr') ); 40 44 41 45 require(ABSPATH. '/wp-content/plugins/eventr/options.php'); … … 46 50 * This will scan all the content pages that wordpress outputs for our special code. If the code is found, it will replace the requested quiz. 47 51 */ 48 add_filter('the_content', 'eventr_scan_content'); 49 function eventr_scan_content($body) { 50 if(strpos($body, 'EVENTR') !== false) { 51 if(preg_match('/(<!--|\[)\s*EVENTR\s*REGISTRATION\s*(\d+)\s*(\]|-->)/', $body, $matches)) { 52 $event_id = $matches[2]; 53 54 if(is_numeric($event_id)) { // Basic validiation - more on the show_quiz.php file. 55 ob_start(); 56 include(ABSPATH . 'wp-content/plugins/eventr/show_registeration_form.php'); 57 $contents = ob_get_contents(); 58 ob_end_clean(); 52 add_shortcode( 'EVENTR', 'eventr_shortcode' ); 53 function eventr_shortcode( $attr ) { 54 $action = $attr[0]; 55 $event_id = $attr[1]; 56 if(!is_numeric($event_id)) return ''; 57 58 $contents = ''; 59 ob_start(); 60 if($action == 'REGISTRATION') { 61 include(ABSPATH . 'wp-content/plugins/eventr/show_registeration_form.php'); 59 62 60 $body = str_replace($matches[0], $contents, $body); 61 } 62 } 63 // Don't put elseif here - the blog auther might put both tags into the same page. 64 if(preg_match('/(<!--|\[)\s*EVENTR\s*ATTENDEES\s*(\d+)\s*(\]|-->)/', $body, $matches)) { 65 $event_id = $matches[2]; 66 67 if(is_numeric($event_id)) { // Basic validiation - more on the show_quiz.php file. 68 ob_start(); 69 include(ABSPATH . 'wp-content/plugins/eventr/show_attendee_list.php'); 70 $contents = ob_get_contents(); 71 ob_end_clean(); 72 73 $body = str_replace($matches[0], $contents, $body); 74 } 75 } 63 } elseif($action == 'ATTENDEES') { 64 include(ABSPATH . 'wp-content/plugins/eventr/show_attendee_list.php'); 76 65 } 66 $contents = ob_get_contents(); 67 ob_end_clean(); 77 68 78 return $ body;69 return $contents; 79 70 } 80 71 … … 113 104 $old_umask = umask(0); // Or the folder will not get write permission for everybody. 114 105 if ( ! file_exists($upload_path) && ! mkdir($upload_path, 0777) ) { 115 showMessage("Cannot create the uploads folder '$upload_path'. Please create it using FTP and give it 777 permission", 'error'); 106 print '<div id="message" class="updated error"><p>'; 107 printf(__("Cannot create the uploads folder '%s'. Please create it using FTP and give it 777 permission", 'eventr'), $upload_path); 108 print '</p></div>'; 116 109 } 117 110 118 111 $images_folder = $upload_path . '/eventr/'; 119 112 if ( ! file_exists($images_folder) && ! mkdir($images_folder, 0777) ) { 120 showMessage("Cannot create the uploads folder '$images_folder'. Please create it using FTP and give it 777 permission", 'error'); 113 print '<div id="message" class="updated error"><p>'; 114 printf(__("Cannot create the uploads folder '%s'. Please create it using FTP and give it 777 permission", 'eventr'), $images_folder); 115 print '</p></div>'; 121 116 } 122 117 umask($old_umask); -
eventr/trunk/events.php
r83388 r172556 1 1 <?php 2 2 include('wpframe.php'); 3 stopDirectCall(__FILE__);3 wpframe_stop_direct_call(__FILE__); 4 4 5 5 if($_REQUEST['message'] == 'updated') { 6 showMessage('Event Updated', 'updated');6 wpframe_message('Event Updated', 'updated'); 7 7 } elseif($_REQUEST['message'] == 'new_event') { 8 showMessage('Event Added', 'updated');8 wpframe_message('Event Added', 'updated'); 9 9 } 10 10 … … 12 12 $wpdb->get_results("DELETE FROM {$wpdb->prefix}eventr_event WHERE ID='$_REQUEST[event]'"); 13 13 $wpdb->get_results("DELETE FROM {$wpdb->prefix}eventr_event_attendee WHERE event_ID='$_REQUEST[event]'"); 14 showMessage('Event Deleted', 'updated');14 wpframe_message('Event Deleted', 'updated'); 15 15 } 16 16 ?> … … 49 49 ?> 50 50 <th scope="row" style="text-align: center;"><?=$event->ID ?></th> 51 <td><?= $event->name?></td>51 <td><?=stripslashes($event->name)?></td> 52 52 <td><?=$event->attendee_count ?></td> 53 53 <td><?=($event->event_date == '0000-00-00') ? '' : date(get_option('date_format'), strtotime($event->event_date)) ?></td> -
eventr/trunk/export_choose.php
r134219 r172556 3 3 ?> 4 4 <div class="wrap"> 5 <h2> Export Data</h2>5 <h2><?php e("Export Data") ?></h2> 6 6 7 7 <form action="<?php echo $GLOBALS['wpframe_plugin_folder'] ?>/export.php" method="post"> 8 <p> Select the fields you want to export...</p>8 <p><?php e("Select the fields you want to export...") ?></p> 9 9 10 10 <?php -
eventr/trunk/options.php
r134219 r172556 15 15 else update_option('eventr_' . $opt, 0); 16 16 } 17 showMessage("Options updated");17 wpframe_message("Options updated"); 18 18 } 19 19 ?> 20 20 <div class="wrap" id="poststuff"> 21 <h2> Eventr Settings</h2>21 <h2><?php e("Eventr Settings") ?></h2> 22 22 23 23 <form action="" method="post"> -
eventr/trunk/readme.txt
r134219 r172556 5 5 Requires at least: 2.5 6 6 Tested up to: 2.8 7 Stable tag: 1.02. 07 Stable tag: 1.02.1 8 8 9 9 Eventr Plugin lets you create events and provide your visitors with a form that lets them register for the event. It also shows the attendee list. … … 48 48 * Ability to select which all fields should be shown in the listing page. 49 49 * You can edit individual attendees from the admin side. 50 51 = 1.02.1 = 52 * Added Belorussian transilation - thanks to [Marcis Gasuns](http://www.comfi.com/) 53 * Images resizes to smaller version when uploaded automatically. 54 * French transilation added. By Emilie Cadoux 55 * Depreciated the old <!-- EVENTR 1 --> type insertion - it will no longer work. Use [EVENTR 1] in your posts/pages. -
eventr/trunk/show_registeration_form.php
r134219 r172556 199 199 200 200 if(!$image) $errors[] = 'Image upload failed: ' . $result; //Upload Failed 201 else { //Valid image - try to resize it. 202 if(function_exists('imagecreatefrompng')) { 203 require(joinPath(WP_PLUGIN_DIR, 'eventr/includes/Image.php')); 204 $image_file_absolute = joinPath($upload_folder, $image); 205 $img = new Image($image_file_absolute); 206 $img->resize(0, 200, false); 207 $new_file = preg_replace('/\.(\w{2,5})$/', "_small.$1", $image_file_absolute); 208 $img->save($new_file); 209 210 if(file_exists($new_file)) { 211 $image_file = preg_replace('/\.(\w{2,5})$/', "_small.$1", $image_file); 212 } 213 } 214 } 201 215 } elseif($options['image_mandatory']) { 202 216 $errors[] = t('Please upload your image'); … … 239 253 // First, check to see if this guy has already registered. 240 254 if($wpdb->get_row($wpdb->prepare("SELECT added_on FROM {$wpdb->prefix}eventr_event_attendee WHERE event_ID=%d AND attendee_ID=%d", $_POST['event_id'], $attendee_id))) { 241 printf(t("You are already registered for the %s event."), $event->name);255 printf(t("You are already registered for the %s event."), stripslashes($event->name)); 242 256 243 257 } else { … … 251 265 } 252 266 253 printf(t("'%s' has been added to the attendee list for event %s.<br />Thank you."), $_POST['attendee_name'], $event->name);267 printf(t("'%s' has been added to the attendee list for event %s.<br />Thank you."), $_POST['attendee_name'], stripslashes($event->name)); 254 268 } 255 269 -
eventr/trunk/wpframe.php
r134219 r172556 13 13 //* :DEBUG: */ $GLOBALS['wpdb']->show_errors(); 14 14 15 if(!function_exists(' stopDirectCall')) { //Make sure multiple plugins can be created using WPFrame15 if(!function_exists('wpframe_add_editor_js')) { //Make sure multiple plugins can be created using WPFrame 16 16 17 /// Need to register a page to use it in a plugin in WP2.8.1+. THIS IS A HACK. 18 function wpf_register_pages($pages, $folder) { 19 foreach($pages as $p) wpf_register_page($folder . DIRECTORY_SEPARATOR . $p); 20 } 21 function wpf_register_page($file) { 22 global $_registered_pages; 23 $hookname = get_plugin_page_hookname($file, '' ); 24 $_registered_pages[$hookname] = true; 17 /// Adds the JS code needed for the editor. Changes often. So made it centralized 18 function wpframe_add_editor_js() { 19 wp_enqueue_script( 'common' ); 20 wp_enqueue_script( 'jquery-color' ); 21 wp_print_scripts('editor'); 22 if (function_exists('add_thickbox')) add_thickbox(); 23 wp_print_scripts('media-upload'); 24 if (function_exists('wp_tiny_mce')) wp_tiny_mce(); 25 wp_admin_css(); 26 wp_enqueue_script('utils'); 27 do_action("admin_print_styles-post-php"); 28 do_action('admin_print_styles'); 25 29 } 26 30 27 31 /// Make sure that the user don't call this file directly - forces the use of the WP interface 28 function stopDirectCall($file) {32 function wpframe_stop_direct_call($file) { 29 33 if(preg_match('#' . basename($file) . '#', $_SERVER['PHP_SELF'])) die('Don\'t call this page directly.'); // Stop direct call 30 34 } 31 35 32 36 /// Shows a message in the admin interface of Wordpress 33 function showMessage($message, $type='updated') {37 function wpframe_message($message, $type='updated') { 34 38 if($type == 'updated') $class = 'updated fade'; 35 39 elseif($type == 'error') $class = 'updated error';
Note: See TracChangeset
for help on using the changeset viewer.