Plugin Directory

Changeset 190543


Ignore:
Timestamp:
01/06/2010 12:03:35 PM (16 years ago)
Author:
giocaputo
Message:

internalizaion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • booking-event/trunk/bookable_events.php

    r136242 r190543  
    66    The registered users can add/remove their participation to an event (represented by a post) by links at the bottom of the post.
    77    This plugin provides also a widget displaying the list of the last 'bookable events' added. Edited by Giovanni Caputo
    8     Version: 0.2
     8    Version: 1.0.5
    99    Author: Francesca 'sefran' Secondo and edited by Giovani Caputo
    1010    Author URI: http://giovannicaputo.netsons.org
     
    9696 
    9797 if ($user->user_level == 10){
    98      $vis.="<div class=''><b>Invia una mail ai partecipanti</b> <br /><form action='' method='post' >";
     98     $vis.="<div class=''><b>".__("Invia una mail ai partecipanti", "booking-event")."</b> <br /><form action='' method='post' >";
    9999     
    100      $vis.="Oggetto: <br /><input name='oggetto' type='text' value='oggetto' size='50' maxlength='50' />  <br />";
    101      $vis.="Messaggio:<BR /> <TEXTAREA NAME='msg' COLS=40 ROWS=6>Messaggio</TEXTAREA><br />";
    102      $vis.="<input type='submit' value='Invia' name='mailPartepitants' />";
     100     $vis.=__("Object", "booking-event"). ": <br /><input name='oggetto' type='text' value='".__("Object", "booking-event"). "' size='50' maxlength='50' />  <br />";
     101     $vis.=__("Message", "booking-event" ).":<BR /> <TEXTAREA NAME='msg' COLS=40 ROWS=6>".__("Message", "booking-event")."</TEXTAREA><br />";
     102     $vis.="<input type='submit' value='". __("Send", "booking-event"). "' name='mailPartepitants' />";
    103103     
    104104     $vis.=" <input type='hidden' name='postID' value='".get_the_ID()."'>";
     
    118118       
    119119    if ($num_partecipanti) {
    120         $content=__("Registrered users for this event:", 'bookable-events');
     120        $content=__("Registrered users for this event:", 'booking-event');
    121121       
    122122        $content=$content."<div class='listUt'>";
     
    136136            $content = "$content ".$utdaStampare;
    137137        }
    138         $content=$content."</div><br />(".__("in total", 'bookable-events')." ".$num_partecipanti.").";
     138        $content=$content."</div><br />(".__("in total", 'booking-event')." ".$num_partecipanti.").";
    139139    } else {
    140             $content="$content<br/>".__("No registered users for this event.", 'bookable-events');
     140            $content="$content<br/>".__("No registered users for this event.", 'booking-event');
    141141     }
    142142     return $content;
     
    148148    Internationalization
    149149*/
    150 load_plugin_textdomain( 'bookable-events', 'wp-content/plugins/bookable-events/lang' );
     150
     151$plugin_dir = basename(dirname(__FILE__));
     152load_plugin_textdomain( 'booking-event', 'wp-content/plugins/' . $plugin_dir, $plugin_dir );
     153
     154//load_plugin_textdomain( 'bookable-events', 'wp-content/plugins/bookable-events/lang' );
    151155
    152156
     
    192196*/
    193197function add_link_registration() {
    194     return __("If you want to register for this event, click on the following link after login.", 'bookable-events')."<br/><b><a href='$PHP_SELF?click_register=true&post=".get_the_ID()."'>".__("Register!", 'bookable-events')."</a></b>";
     198    return __("If you want to register for this event, click on the following link after login.", 'booking-event')."<br/><b><a href='$PHP_SELF?click_register=true&post=".get_the_ID()."'>".__("Register!", 'booking-event')."</a></b>";
    195199}
    196200
     
    199203*/
    200204function add_link_unregistration() {
    201     return __("If you want to unregister from this event, click on the following link after login.", 'bookable-events')."<br/><b><a href='$PHP_SELF?click_unregister=true&post=".get_the_ID()."'>".__("Unregister!", 'bookable-events')."</a></b>";
     205    return __("If you want to unregister from this event, click on the following link after login.", 'booking-event')."<br/><b><a href='$PHP_SELF?click_unregister=true&post=".get_the_ID()."'>".__("Unregister!", 'booking-event')."</a></b>";
    202206}
    203207
     
    256260       {
    257261         if (!isset($_GET['click_register']) && !isset($_GET['click_unregister'])){
    258             $content = "<div class='redtext'>".__("bookable event", 'bookable-events')."</div>$content<br/><div class='event'>";
     262            $content = "<div class='redtext'>".__("bookable event", 'booking-event')."</div>$content<br/><div class='event'>";
    259263           
    260264            if ( !untenteGiaPrenotato()  && !is_passed()  ){
     
    296300       
    297301        if ( !$user_in_array && ( get_the_ID() == $postid_clicked ) ) {
    298             $content = "$content<br/><div class='mgs_t1'>$fs_current_user->user_login, ".__("thank you for the registration!", 'bookable-events')."</div><br/>";
     302            $content = "$content<br/><div class='mgs_t1'>$fs_current_user->user_login, ".__("thank you for the registration!", 'booking-event')."</div><br/>";
    299303           
    300304                           
     
    305309            $num_partecipanti = count($mykey_values);
    306310             $num_partecipanti++;
    307             @wp_mail( get_option('admin_email'), "Prenotazione evento ". html_entity_decode(get_the_title(get_the_ID())). " Tot: ". $num_partecipanti."utenti", "Utente ".$meta_value."  si è prenotato all'evento ".html_entity_decode(get_the_title(get_the_ID())), $headers);
    308 
    309            
    310             $content = "<div class='redtext'>".__("bookable event", 'bookable-events')."</div>$content<br/><div class='event'>";
     311            @wp_mail( get_option('admin_email'), __("Booking Event", "booking-event").  html_entity_decode(get_the_title(get_the_ID())). " Tot: ". $num_partecipanti." ".__("User", "booking-event"). __("User", "booking-event") . $meta_value. __("is booking at event", "booking-event"). html_entity_decodeml_entity_decode(get_the_title(get_the_ID())), $headers);
     312
     313           
     314            $content = "<div class='redtext'>".__("bookable event", 'booking-event')."</div>$content<br/><div class='event'>";
    311315           
    312316            if ( !untenteGiaPrenotato() ){
     
    323327
    324328        } elseif ( $user_in_array && ( get_the_ID() == $postid_clicked ) ) {
    325             $content = "$content<br/><div class='mgs_t1'>$fs_current_user->user_login, ".__("you are already registered!", 'bookable-events')."</div><br/>";
     329            $content = "$content<br/><div class='mgs_t1'>$fs_current_user->user_login, ".__("you are already registered!", 'booking-event')."</div><br/>";
    326330        }
    327331
    328332    } elseif ( ( $bookable && !is_user_logged_in() ) && ( get_the_ID() == $postid_clicked ) ) {
    329         $content = "$content<br/><div class='mgs_t1'>".__("You must be logged in to register for this event!", 'bookable-events')."</div><br/>";
     333        $content = "$content<br/><div class='mgs_t1'>".__("You must be logged in to register for this event!", 'booking-event')."</div><br/>";
    330334    }
    331335    return $content;
     
    348352        $user_in_array = in_array( $meta_value, (array)$mykey_values );
    349353        if ( !$user_in_array && ( get_the_ID() == $postid_clicked ) ) {
    350             $content = "$content<br/><div class='mgs_t1'>$fs_current_user->user_login, ".__("you have never been registered for this event!", 'bookable-events')."</div><br/>";
     354            $content = "$content<br/><div class='mgs_t1'>$fs_current_user->user_login, ".__("you have never been registered for this event!", 'booking-event')."</div><br/>";
    351355        } elseif ( $user_in_array && ( get_the_ID() == $postid_clicked ) ) {
    352356            delete_post_meta($postid_clicked, $participant_key, $meta_value);
     
    355359            $num_partecipanti = count($mykey_values);
    356360             $num_partecipanti--;
    357             @wp_mail( get_option('admin_email'), "Disdetta prenotazione ". html_entity_decode(get_the_title(get_the_ID())). " Tot: ". $num_partecipanti."utenti", "Utente ".$meta_value."  ha disdetto prenotazione all'evento ".html_entity_decode(get_the_title(get_the_ID())), $headers);
    358            
    359            
    360             $content = "<div class='redtext'>".__("bookable event", 'bookable-events')."</div>$content<br/><div class='event'>";
     361            @wp_mail( get_option('admin_email'), __("Cancel Booking", "booking-event"). html_entity_decode(get_the_title(get_the_ID())). __("Tot", "booking-event").  ": ". $num_partecipanti.   __("Users", "booking-event"), __("User", "booking-event"). $meta_value. __(" have cancelled booking for event ", "booking-event").html_entity_decode(get_the_title(get_the_ID())), $headers);
     362           
     363           
     364            $content = "<div class='redtext'>".__("bookable event", 'booking-event')."</div>$content<br/><div class='event'>";
    361365           
    362366            if ( !untenteGiaPrenotato() ){
     
    373377   
    374378    } elseif ( ( $bookable && !is_user_logged_in() ) && ( get_the_ID() == $postid_clicked ) ) {
    375         $content = "$content<br/><div class='mgs_t1'>".__("You must be logged in to unregister from this event!", 'bookable-events')."</div><br/>";
     379        $content = "$content<br/><div class='mgs_t1'>".__("You must be logged in to unregister from this event!", 'booking-event')."</div><br/>";
    376380    }
    377381    return $content;
     
    390394function bookable_events_widget_init() {
    391395    $widget_options = array( 'classname' => 'widget_recent_bookable_events' );
    392     register_sidebar_widget(__("Last bookable events", 'bookable-events'), 'bookable_events_widget', $widget_options);   
    393     register_widget_control(__("Last bookable events", 'bookable-events'),'bookable_events_widget_control', 250,350);   
     396    register_sidebar_widget(__("Last bookable events", 'booking-event'), 'bookable_events_widget', $widget_options);   
     397    register_widget_control(__("Last bookable events", 'booking-event'),'bookable_events_widget_control', 250,350);   
    394398}
    395399
     
    410414    $options = get_option('widget_recent_bookable_events');
    411415
    412     $title = empty($options['title']) ? __("Last bookable events", 'bookable-events') : apply_filters('widget_title', $options['title']);
     416    $title = empty($options['title']) ? __("Last bookable events", 'booking-event') : apply_filters('widget_title', $options['title']);
    413417    if ( !$number = (int) $options['number'] )
    414418        $number = 5;
     
    438442                        for ($i=1; $i<$num_partecipanti; $i++) $participants = $participants.", ".$participants_values[$i];
    439443                        $participants = $participants.".";
    440                     } else $participants = __("No registered users", 'bookable-events');
    441                 } else $participants = __("Protected post", 'bookable-events');
     444                    } else $participants = __("No registered users", 'booking-event');
     445                } else $participants = __("Protected post", 'booking-event');
    442446
    443447                echo "<li><a href=".get_permalink($postinfo->ID)." title=\"$participants\">".$postinfo->post_title."</a></li>";
     
    476480    echo "<p><label for='recent-bookable-events-title'>".__("Title", 'bookable-events')."<input class='widefat' id='recent-bookable-events-title' name='recent-bookable-events-title' type='text' value=\"$title\" /></label></p>
    477481            <p>
    478                 <label for='recent-bookable-events-number'>".__("Number of posts to show", 'bookable-events')."<input style='width: 25px; text-align: center;' id='recent-bookable-events-number' name='recent-bookable-events-number' type='text' value=\"$number\" /></label>
     482                <label for='recent-bookable-events-number'>".__("Number of posts to show", 'booking-event')."<input style='width: 25px; text-align: center;' id='recent-bookable-events-number' name='recent-bookable-events-number' type='text' value=\"$number\" /></label>
    479483                <br />
    480                 <small>".__("(at most 10)", 'bookable-events')."</small>
     484                <small>".__("(at most 10)", 'booking-event')."</small>
    481485            </p>
    482486            <input type='hidden' id='recent-bookable-events-submit' name='recent-bookable-events-submit' value='1' />";
     
    543547     $nome=$mykey_values[$i];
    544548     $u=get_userdatabylogin($nome);
    545      if ($u!=null){  // se l 'utente non registrato (xkè aggiunto custum filed manualemente)
     549     if ($u!=null){  // se l 'utente non registrato (xk aggiunto custum filed manualemente)
    546550         $mail=$u->user_email;
    547551        if ($mail!=null)
Note: See TracChangeset for help on using the changeset viewer.