Plugin Directory

Changeset 172556


Ignore:
Timestamp:
11/12/2009 07:16:57 AM (16 years ago)
Author:
binnyva
Message:

Publishing new version of Eventr

Location:
eventr/trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • eventr/trunk/attendee_form.php

    r134219 r172556  
    11<?php
    22require('wpframe.php');
    3 stopDirectCall(__FILE__);
     3wpframe_stop_direct_call(__FILE__);
    44
    55$attendee = array();
     
    88                                strip_tags($_POST['attendee_name']), $_POST['content'], $_POST['url'], $_POST['email'], $_POST['phone'],
    99                                (isset($_POST['status']) ? 1 : 0), $_POST['attendee']));
    10     showMessage("Attendee details updated");
     10    wpframe_message("Attendee details updated");
    1111}
    1212$attendee = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}eventr_attendee WHERE ID = $_REQUEST[attendee]");
     
    1919
    2020<?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();
     21wpframe_add_editor_js();
    2922?>
    3023<form name="post" action="" method="post" id="post">
  • eventr/trunk/attendees.php

    r134219 r172556  
    11<?php
    22include('wpframe.php');
    3 stopDirectCall(__FILE__);
     3wpframe_stop_direct_call(__FILE__);
    44
    55if($_REQUEST['action'] == 'delete' or $_REQUEST['action'] == t('Delete Selected')) {
     
    1212
    1313<div class="wrap">
    14 <h2><?php echo t("Attendees for ") . $event_name; ?></h2>
     14<h2><?php echo t("Attendees for ") . stripslashes($event_name); ?></h2>
    1515
    1616<?php
     
    141141?>
    142142
    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">
    144144<?php
    145145foreach($items_per_page_choice as $v) {
  • eventr/trunk/event_form.php

    r134219 r172556  
    11<?php
    22require('wpframe.php');
    3 stopDirectCall(__FILE__);
     3wpframe_stop_direct_call(__FILE__);
    44
    55$action = 'new';
     
    2323
    2424<?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();
     25wpframe_add_editor_js();
    3326?>
    3427<script type="text/javascript" src="<?=$wpframe_plugin_folder?>/js/admin/event_form.js"></script>
  • eventr/trunk/eventr.php

    r134219 r172556  
    44Plugin URI: http://www.bin-co.com/tools/wordpress/plugins/eventr/
    55Description: 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.0
     6Version: 1.02.1
    77Author: Binny V A
    88Author URI: http://www.binnyva.com/
    99*/
    10 require_once('wpframe.php');
    1110
    1211/**
     
    2019    if($wp_version >= '2.7') $page = 'tools.php';
    2120   
    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    }
    2428}
    2529
     
    3337add_action('admin_menu', 'eventr_option_page');
    3438function 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');
    3640}
    3741function eventr_options() {
    3842    if ( function_exists('current_user_can') && !current_user_can('manage_options') ) die(t('Cheatin&#8217; 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') );
    4044
    4145    require(ABSPATH. '/wp-content/plugins/eventr/options.php');
     
    4650 * 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.
    4751 */
    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();
     52add_shortcode( 'EVENTR', 'eventr_shortcode' );
     53function 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');
    5962       
    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');
    7665    }
     66    $contents = ob_get_contents();
     67    ob_end_clean();
    7768   
    78     return $body;
     69    return $contents;
    7970}
    8071
     
    113104    $old_umask = umask(0); // Or the folder will not get write permission for everybody.
    114105    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>';
    116109    }
    117110
    118111    $images_folder = $upload_path . '/eventr/';
    119112    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>';
    121116    }
    122117    umask($old_umask);
  • eventr/trunk/events.php

    r83388 r172556  
    11<?php
    22include('wpframe.php');
    3 stopDirectCall(__FILE__);
     3wpframe_stop_direct_call(__FILE__);
    44
    55if($_REQUEST['message'] == 'updated') {
    6     showMessage('Event Updated', 'updated');
     6    wpframe_message('Event Updated', 'updated');
    77} elseif($_REQUEST['message'] == 'new_event') {
    8     showMessage('Event Added', 'updated');
     8    wpframe_message('Event Added', 'updated');
    99}
    1010
     
    1212    $wpdb->get_results("DELETE FROM {$wpdb->prefix}eventr_event WHERE ID='$_REQUEST[event]'");
    1313    $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');
    1515}
    1616?>
     
    4949        ?>
    5050        <th scope="row" style="text-align: center;"><?=$event->ID ?></th>
    51         <td><?=$event->name ?></td>
     51        <td><?=stripslashes($event->name)?></td>
    5252        <td><?=$event->attendee_count ?></td>
    5353        <td><?=($event->event_date == '0000-00-00') ? '' : date(get_option('date_format'), strtotime($event->event_date)) ?></td>
  • eventr/trunk/export_choose.php

    r134219 r172556  
    33?>
    44<div class="wrap">
    5 <h2>Export Data</h2>
     5<h2><?php e("Export Data") ?></h2>
    66
    77<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>
    99
    1010<?php
  • eventr/trunk/options.php

    r134219 r172556  
    1515        else update_option('eventr_' . $opt, 0);
    1616    }
    17     showMessage("Options updated");
     17    wpframe_message("Options updated");
    1818}
    1919?>
    2020<div class="wrap" id="poststuff">
    21 <h2>Eventr Settings</h2>
     21<h2><?php e("Eventr Settings") ?></h2>
    2222
    2323<form action="" method="post">
  • eventr/trunk/readme.txt

    r134219 r172556  
    55Requires at least: 2.5
    66Tested up to: 2.8
    7 Stable tag: 1.02.0
     7Stable tag: 1.02.1
    88
    99Eventr 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.
     
    4848* Ability to select which all fields should be shown in the listing page.
    4949* 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  
    199199               
    200200                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                }
    201215            } elseif($options['image_mandatory']) {
    202216                $errors[] = t('Please upload your image');
     
    239253        // First, check to see if this guy has already registered.
    240254        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));
    242256           
    243257        } else {
     
    251265            }
    252266           
    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));
    254268        }
    255269   
  • eventr/trunk/wpframe.php

    r134219 r172556  
    1313//* :DEBUG: */ $GLOBALS['wpdb']->show_errors();
    1414
    15 if(!function_exists('stopDirectCall')) { //Make sure multiple plugins can be created using WPFrame
     15if(!function_exists('wpframe_add_editor_js')) { //Make sure multiple plugins can be created using WPFrame
    1616
    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
     18function 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');
    2529}
    2630
    2731/// Make sure that the user don't call this file directly - forces the use of the WP interface
    28 function stopDirectCall($file) {
     32function wpframe_stop_direct_call($file) {
    2933    if(preg_match('#' . basename($file) . '#', $_SERVER['PHP_SELF'])) die('Don\'t call this page directly.'); // Stop direct call
    3034}
    3135
    3236/// Shows a message in the admin interface of Wordpress
    33 function showMessage($message, $type='updated') {
     37function wpframe_message($message, $type='updated') {
    3438    if($type == 'updated') $class = 'updated fade';
    3539    elseif($type == 'error') $class = 'updated error';
Note: See TracChangeset for help on using the changeset viewer.