Plugin Directory

Changeset 2625605


Ignore:
Timestamp:
11/07/2021 12:07:50 PM (4 years ago)
Author:
devlloplugins
Message:

v-0.2

Location:
devllo-events-bookings/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • devllo-events-bookings/trunk/devllo-events-bookings.php

    r2512686 r2625605  
    55    Description: This plugin adds a ticketing function to the Devllo Events plugin
    66    Author: Devllo Plugins
    7     Version: 0.1
     7    Version: 0.2
    88    Author URI: https://devllo.com/
    99    Text Domain: devllo-events-bookings
     
    2121 * Current plugin version.
    2222 */
    23 define( 'DEVLLO_EVENTS_BOOKINGS_VERSION', '0.1' );
     23define( 'DEVLLO_EVENTS_BOOKINGS_VERSION', '0.2' );
    2424define( 'DEVLLO_EVENTS_BOOKINGS_URI', plugin_dir_url( __FILE__ ) );
    2525define( 'DEVLLO_EVENTS_BOOKINGS_DIR', dirname(__FILE__) );
  • devllo-events-bookings/trunk/inc/devllo-events-bookings-activator.php

    r2512686 r2625605  
    1414        add_option( 'Activated_Plugin', 'devllo-event-bookings' );
    1515
    16         $devllo_events_bookings_current_version = 0.1;
     16        $devllo_events_bookings_current_version = 0.2;
    1717
    1818    }
  • devllo-events-bookings/trunk/inc/devllo-events-bookings-email-function.php

    r2512686 r2625605  
    99        add_action('devllo_events_bookings_after_add_attendee', array($this, 'devllo_send_organiser_email_after_checkout'));
    1010        add_action('devllo_events_bookings_after_add_attendee', array($this, 'devllo_send_email_after_checkout'));
     11        add_filter('wp_mail_content_type', array($this, 'devllo_events_format_email'));       
    1112    }
    1213
     
    3435
    3536        wp_mail( $to, $subject, $message );
    36 
     37       
    3738    }
    3839
     
    113114        }
    114115
    115      //   $message .= '<br/><br/>Your details: ';
    116 
    117116        $message .= '<br/><br/>Please submit any questions to ' .$organiser_email;
    118117
     
    120119
    121120    }
     121
     122    // Format Emails
     123    function devllo_events_format_email(){
     124        return 'text/html';
     125    }
    122126}
    123127
  • devllo-events-bookings/trunk/inc/devllo-events-bookings-form.php

    r2512686 r2625605  
    44
    55        public function __construct(){
    6             add_shortcode( 'devllo_register', array($this, 'devllo_events_bookings_form'));
     6            add_shortcode( 'devllo-register', array($this, 'devllo_events_bookings_form'));
    77            add_action( 'init', array( $this, 'devllo_events_add_new_user' ) );
    88        }
     
    1717           // $bookings_enabled = get_option('users_can_register');
    1818
    19             if ( ! get_option( 'users_can_register' ) ) {
    20             update_option( 'users_can_register', true );
    21             }
    2219
    23                 $output = $this->devllo_events_bookings_fields();
     20            $output = $this->devllo_events_bookings_fields();
    2421   
    2522            return $output;
     
    152149                    wp_set_auth_cookie($user_login, $user_pass, true);
    153150                    wp_set_current_user($new_user_id, $user_login);
    154                     do_action('wp_login', $user_login);
    155 
     151                   // do_action('wp_login', $user_login);
    156152
    157153                    $creds = array();
     
    163159                   
    164160                    // send the newly created user to the home page after logging them in
    165                     update_option( 'users_can_register', false );
    166161
    167162                    wp_redirect(home_url('/events')); exit;
  • devllo-events-bookings/trunk/inc/devllo-events-bookings-functions.php

    r2512686 r2625605  
    1313      add_action ('devllo_events_after_side_single_event', array($this, 'devllo_events_reg_login_func'));
    1414
    15       add_action ('wp_head', array($this, 'checkoutstartSession'), 1);
     15      add_action ('wp_head', array($this, 'devllo_events_reg_checkoutstartSession'), 1);
    1616   
    1717     // add_action ('devllo_events_after_side_single_event', array($this, 'devllo_events_reg_login_button'));
     
    2424
    2525    // Start Checkout Session
    26     function checkoutstartSession() {
     26    function devllo_events_reg_checkoutstartSession() {
    2727
    2828            global $post;
     29            if( !is_object($post) )
     30            return;
    2931            if ( 'devllo_event' === $post->post_type ) {
    3032
     
    9799    }
    98100
    99     // Check if USer is Registered, if not let them Register
     101    // Check if User is Registered, if not let them Register
    100102    function devllo_events_reg_user(){
    101103        global $post;
     
    105107       
    106108            echo do_shortcode( '[reg_login]' );
    107             _e('You need to Log in/Register as an attendee to attend this event', '');
     109            _e('You need to Log in/Register as an attendee to attend this event', 'devllo-events-bookings');
    108110           
    109111            }
     
    175177       if ($payment_gateway == "pbc"){
    176178           $url = get_permalink(get_option('devllo-event-checkout-page'));   
    177         //   $url = get_site_url() . "/1526-2/";
    178 
    179179           wp_redirect( $url );
    180180        }
     
    216216        );
    217217
    218         $table_name = $wpdb->prefix . 'devllo_events_participants';
    219    
    220         $wpdb->insert(
    221         $table_name,
    222         array(
    223             'time' => current_time( 'mysql' ),
    224             'name' => $user->user_login,
    225             'user_email' => $user->user_email,
    226             'user_id' => $user->ID,
    227             'event_id' => $postID,
    228                 //'text' => $welcome_text,
    229             )
    230         );
     218        // Check if user is already registered
     219        if ( $id > 0 )
     220        {
     221            echo 'You are already registered for this event';
     222        }   else
     223        {
     224            $table_name = $wpdb->prefix . 'devllo_events_participants';
     225       
     226            $wpdb->insert(
     227            $table_name,
     228            array(
     229                'time' => current_time( 'mysql' ),
     230                'name' => $user->user_login,
     231                'user_email' => $user->user_email,
     232                'user_id' => $user->ID,
     233                'event_id' => $postID,
     234                    //'text' => $welcome_text,
     235                )
     236            );
    231237       
    232238        echo '<br/>You are Registered, you will be attending this event';
    233239
    234240        do_action('devllo_events_bookings_after_add_attendee');
     241        }
    235242   
    236243    }
     
    261268        );
    262269
    263         $table_name = $wpdb->prefix . 'devllo_events_participants';
    264    
    265         $wpdb->insert(
    266         $table_name,
    267         array(
    268             'time' => current_time( 'mysql' ),
    269             'name' => $user->user_login,
    270             'user_email' => $user->user_email,
    271             'user_id' => $user->ID,
    272             'event_id' => $postID,
    273                 //'text' => $welcome_text,
    274             )
    275         );
    276        
    277         echo '<br/>You are Registered, you will be attending this event';
    278 
    279         do_action('devllo_events_bookings_after_add_attendee');
    280    
     270        // Check if user is already registered
     271        if ( $id > 0 )
     272        {
     273            echo 'You are already registered for this event';
     274        }   else
     275        {
     276
     277            $table_name = $wpdb->prefix . 'devllo_events_participants';
     278       
     279            $wpdb->insert(
     280            $table_name,
     281            array(
     282                'time' => current_time( 'mysql' ),
     283                'name' => $user->user_login,
     284                'user_email' => $user->user_email,
     285                'user_id' => $user->ID,
     286                'event_id' => $postID,
     287                    //'text' => $welcome_text,
     288                )
     289            );
     290       
     291            echo '<br/>You are Registered, you will be attending this event';
     292
     293            do_action('devllo_events_bookings_after_add_attendee');
     294        }
    281295    }
    282296
  • devllo-events-bookings/trunk/payments/payments.php

    r2512686 r2625605  
    11<?php
    2 function devllo_events_stripe_payment_form() {
     2function devllo_events_payment_form() {
    33
    44    ob_start();
     
    2222                }   
    2323                   
    24             ?></div><br/><button class="btn btn-primary" type="submit" id="submit"><?php  _e('Accept', 'devllo-events-registration'); ?></button>
     24            ?></div>
     25            <br/>
     26            <button class="btn btn-primary" type="submit" id="submit"><?php  _e('Accept', 'devllo-events-registration'); ?></button>
    2527            </form>
    2628            <?php
    2729            if($_SERVER['REQUEST_METHOD']=='POST'){
    2830
    29         echo "You will be redirected to the event page.<br/>";
    30    
    31         $Devllo_Events_Bookings_Functions = new Devllo_Events_Bookings_Functions;
    32    
    33         $Devllo_Events_Bookings_Functions->devllo_events_add_attendee();
     31                _e('You will be redirected to the event page.', 'devllo-events-bookings'); ?>
     32                <br/>
     33                <?php
     34           
     35                $Devllo_Events_Bookings_Functions = new Devllo_Events_Bookings_Functions;
     36           
     37                $Devllo_Events_Bookings_Functions->devllo_events_add_attendee();
     38   
     39                echo '<script type="text/javascript">
     40                        setTimeout(function(){
     41                            window.location.href = "'. get_permalink( $value ) .'"
     42                        }, 5000);
     43                        console.log('.$value.')
     44                    </script>';
     45            }
    3446
    35         ?>
    36             <script>
    37                 setTimeout(function(){
    38                     window.location.href = '<?php get_permalink( $value ); ?>';
    39                 }, 5000);
    40             </script>
    41         <?php
    42     }
    43 
    44 }else{
    45     do_action('devllo_events_bookings_payment_checkout');
    46 }
    47 
     47        }
     48        else{
     49            do_action('devllo_events_bookings_payment_checkout');
     50        }
    4851
    4952    }
     
    5255   
    5356    {
    54         echo 'Please select an event to check out';
     57         _e('Please select an event to check out', 'devllo-events-bookings');
    5558    }
    5659    return ob_get_clean();
    5760
    5861}
    59 add_shortcode('devllo-checkout', 'devllo_events_stripe_payment_form');
     62add_shortcode('devllo-checkout', 'devllo_events_payment_form');
  • devllo-events-bookings/trunk/readme.txt

    r2512687 r2625605  
    55Tested up to: 5.7
    66Requires PHP: 5.5
    7 Stable tag: 0.1
     7Stable tag: 0.2
    88License: GPLv2 or later
    99
     
    1111
    1212== Description ==
    13 Allow attendees to register to events. Sell tickets with integrated payment gateway or redirect to an offsite ticket page.
     13Allow attendees to register to events. Sell tickets with integrated payment gateway or redirect to an offsite ticket pahe.
    1414
    1515
     
    3737= 0.1 =
    3838Initial release.
     39
     40= 0.2 =
     41Fixed Redirect after checkout.
     42Fixed HTML tags in emails
     43Fixed duplicate event bookings
     44Fixed bug on register page
     45Fixed devllo-register shortcode error
Note: See TracChangeset for help on using the changeset viewer.