Plugin Directory

Changeset 1031106


Ignore:
Timestamp:
11/23/2014 09:59:04 AM (11 years ago)
Author:
teraom
Message:

White space fix, tag 0.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • super-events/trunk/superevents.php

    r903749 r1031106  
    55Description: A simple events management plugin with RSVP.
    66Author: Bharad
    7 Version: 0.4
     7Version: 0.5
    88Author URI: http://bharad.net/
    99License: GPL2
     
    2828        'search_items'       => __( 'Search Events', 'superevents' ),
    2929        'not_found'          => __( 'No events found', 'superevents' ),
    30         'not_found_in_trash' => __( 'No events found in Trash', 'superevents' ), 
     30        'not_found_in_trash' => __( 'No events found in Trash', 'superevents' ),
    3131        'parent_item_colon'  => '',
    3232        'menu_name'          => __( 'Events', 'superevents' )
    3333
    3434    );
    35    
     35
    3636    //Remember to add to below array
    3737   // /     'menu_icon'           => ''. plugins_url( '/images/events-icon-20x20.png', __FILE__ ),
    38    
     38
    3939    $args = array(
    4040
     
    5555        'can_export'          => true,
    5656        'show_in_nav_menus'   => false
    57    
    58     );
    59        
     57
     58    );
     59
    6060   register_post_type( 'event', $args );
    6161
     
    6363
    6464// Adds the taxonomy for event type
    65 function superevents_register_taxonomy() 
     65function superevents_register_taxonomy()
    6666{
    6767   $labels = array(
    68            
     68
    6969        'name'              => __( 'Types', 'superevents' ),
    7070        'singular_name'     => __( 'Type', 'superevents' ),
     
    7979        'new_item_name'     => __( 'New Type Name', 'superevents' ),
    8080        'menu_name'         => __( 'Types', 'superevents' )
    81            
    82     );
    83    
     81
     82    );
     83
    8484    $args = array(
    8585
     
    9191        'hierarchical'      => true,
    9292        'rewrite'           => array( 'slug' => 'type' )
    93    
     93
    9494    );
    9595
     
    102102    global $post, $post_ID;
    103103
    104     $messages['event'] = array( 
     104    $messages['event'] = array(
    105105
    106106        0  => '',
     
    128128{
    129129   $columns = array(
    130    
     130
    131131        'cb'         => '<input type="checkbox" />',
    132132        'title'      => __( 'Event Name', 'superevents' ),
     
    146146   global $post;
    147147
    148     switch ( $column ) 
     148    switch ( $column )
    149149    {
    150150       case 'type' :
     
    156156         $table = $wpdb->prefix."events_rsvp";
    157157         $rows = $wpdb->get_results($wpdb->prepare("SELECT rsvp, COUNT(*) AS headcount FROM $table WHERE event_id = %d GROUP BY rsvp ORDER BY rsvp DESC", $post->ID));
    158          foreach ($rows as $row) 
     158         foreach ($rows as $row)
    159159            echo ucfirst($row->rsvp) . ' : ' . $row->headcount . '<br/>';
    160160          break;
     
    201201   {
    202202      if (isset($_POST['superevents_'. $field]))
    203          update_post_meta($post->ID, "superevents_". $field, $_POST["superevents_". $field]);         
     203         update_post_meta($post->ID, "superevents_". $field, $_POST["superevents_". $field]);
    204204   }
    205205}
     
    212212{
    213213   global $post_type;
    214            
     214
    215215    if ( ( isset( $_GET['post_type'] ) && $_GET['post_type'] == 'event' ) || ( isset( $post_type ) && $post_type == 'event' ) ) {
    216216
     
    229229   if(is_single() && ('event' === $post_type))
    230230   {
    231       if ( file_exists( get_stylesheet_directory()."/superevents.css" ) ) 
     231      if ( file_exists( get_stylesheet_directory()."/superevents.css" ) )
    232232      {
    233233        wp_enqueue_style( 'superevents', get_stylesheet_directory_uri() . '/superevents.css', array(), '1.0' );
    234234    }
    235     elseif ( file_exists( get_template_directory()."/superevents.css" ) ) 
    236     {                       
     235    elseif ( file_exists( get_template_directory()."/superevents.css" ) )
     236    {
    237237        wp_enqueue_style( 'superevents', get_template_directory_uri() . '/superevents.css', array(), '1.0' );
    238     }else 
     238    }else
    239239    {
    240         wp_enqueue_style( 'superevents', plugins_url('/css/superevents.css', __FILE__), array(), '1.0' );   
     240        wp_enqueue_style( 'superevents', plugins_url('/css/superevents.css', __FILE__), array(), '1.0' );
    241241    }
    242242   }
     
    282282add_action( 'widgets_init', 'superevents_register_widget' );
    283283
    284 function superevents_register_widget() 
     284function superevents_register_widget()
    285285{
    286286    register_widget('superevents_rsvp_widget');
     
    301301        /* Create the widget. */
    302302        $this->WP_Widget( 'superevents_rsvp_widget', 'Events RSVP Widget', $widget_ops, $control_ops );
    303      
     303
    304304   }
    305    
    306    function widget( $args, $instance ) 
     305
     306   function widget( $args, $instance )
    307307   {
    308308      $post_type = get_post_type( $GLOBALS['post']->ID);
     
    358358         }
    359359        /* After widget (defined by themes). */
    360            echo $after_widget;         
     360           echo $after_widget;
    361361      }
    362362
    363363
    364364    }
    365    
     365
    366366    function update($new_instance, $old_instance)
    367367    {
     
    370370      return $instance;
    371371    }
    372    
     372
    373373    function form($instance)
    374374    {
     
    378378         <label for="<?php echo $this->get_field_id( 'title' ); ?>">Title:</label>
    379379         <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:95%;" />
    380       </p>     
     380      </p>
    381381      <?php
    382382    }
     
    408408   get_currentuserinfo();
    409409   $user_id = $current_user->ID;
    410    global $wpdb;   
     410   global $wpdb;
    411411   $table = $wpdb->prefix."events_rsvp";
    412412   // Unique key on user_id, event_id
     
    440440// }
    441441
    442 // if you want better control over the template, 
     442// if you want better control over the template,
    443443// Use a file called single-event.php in your theme folder.
    444444
     
    458458                  $agenda = $event['superevents_agenda'][0];
    459459                  $minutes = $event['superevents_minutes'][0];
    460          
     460
    461461         $content .= "<div id='event_template_wrapper'>
    462462                    <div class='event_label' id='location_label'>Location:</div>
Note: See TracChangeset for help on using the changeset viewer.