Changeset 190543
- Timestamp:
- 01/06/2010 12:03:35 PM (16 years ago)
- File:
-
- 1 edited
-
booking-event/trunk/bookable_events.php (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
booking-event/trunk/bookable_events.php
r136242 r190543 6 6 The registered users can add/remove their participation to an event (represented by a post) by links at the bottom of the post. 7 7 This plugin provides also a widget displaying the list of the last 'bookable events' added. Edited by Giovanni Caputo 8 Version: 0.28 Version: 1.0.5 9 9 Author: Francesca 'sefran' Secondo and edited by Giovani Caputo 10 10 Author URI: http://giovannicaputo.netsons.org … … 96 96 97 97 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' >"; 99 99 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' />"; 103 103 104 104 $vis.=" <input type='hidden' name='postID' value='".get_the_ID()."'>"; … … 118 118 119 119 if ($num_partecipanti) { 120 $content=__("Registrered users for this event:", 'book able-events');120 $content=__("Registrered users for this event:", 'booking-event'); 121 121 122 122 $content=$content."<div class='listUt'>"; … … 136 136 $content = "$content ".$utdaStampare; 137 137 } 138 $content=$content."</div><br />(".__("in total", 'book able-events')." ".$num_partecipanti.").";138 $content=$content."</div><br />(".__("in total", 'booking-event')." ".$num_partecipanti.")."; 139 139 } else { 140 $content="$content<br/>".__("No registered users for this event.", 'book able-events');140 $content="$content<br/>".__("No registered users for this event.", 'booking-event'); 141 141 } 142 142 return $content; … … 148 148 Internationalization 149 149 */ 150 load_plugin_textdomain( 'bookable-events', 'wp-content/plugins/bookable-events/lang' ); 150 151 $plugin_dir = basename(dirname(__FILE__)); 152 load_plugin_textdomain( 'booking-event', 'wp-content/plugins/' . $plugin_dir, $plugin_dir ); 153 154 //load_plugin_textdomain( 'bookable-events', 'wp-content/plugins/bookable-events/lang' ); 151 155 152 156 … … 192 196 */ 193 197 function add_link_registration() { 194 return __("If you want to register for this event, click on the following link after login.", 'book able-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>"; 195 199 } 196 200 … … 199 203 */ 200 204 function add_link_unregistration() { 201 return __("If you want to unregister from this event, click on the following link after login.", 'book able-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>"; 202 206 } 203 207 … … 256 260 { 257 261 if (!isset($_GET['click_register']) && !isset($_GET['click_unregister'])){ 258 $content = "<div class='redtext'>".__("bookable event", 'book able-events')."</div>$content<br/><div class='event'>";262 $content = "<div class='redtext'>".__("bookable event", 'booking-event')."</div>$content<br/><div class='event'>"; 259 263 260 264 if ( !untenteGiaPrenotato() && !is_passed() ){ … … 296 300 297 301 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!", 'book able-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/>"; 299 303 300 304 … … 305 309 $num_partecipanti = count($mykey_values); 306 310 $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", 'book able-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'>"; 311 315 312 316 if ( !untenteGiaPrenotato() ){ … … 323 327 324 328 } 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!", 'book able-events')."</div><br/>";329 $content = "$content<br/><div class='mgs_t1'>$fs_current_user->user_login, ".__("you are already registered!", 'booking-event')."</div><br/>"; 326 330 } 327 331 328 332 } 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!", 'book able-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/>"; 330 334 } 331 335 return $content; … … 348 352 $user_in_array = in_array( $meta_value, (array)$mykey_values ); 349 353 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!", 'book able-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/>"; 351 355 } elseif ( $user_in_array && ( get_the_ID() == $postid_clicked ) ) { 352 356 delete_post_meta($postid_clicked, $participant_key, $meta_value); … … 355 359 $num_partecipanti = count($mykey_values); 356 360 $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", 'book able-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'>"; 361 365 362 366 if ( !untenteGiaPrenotato() ){ … … 373 377 374 378 } 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!", 'book able-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/>"; 376 380 } 377 381 return $content; … … 390 394 function bookable_events_widget_init() { 391 395 $widget_options = array( 'classname' => 'widget_recent_bookable_events' ); 392 register_sidebar_widget(__("Last bookable events", 'book able-events'), 'bookable_events_widget', $widget_options);393 register_widget_control(__("Last bookable events", 'book able-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); 394 398 } 395 399 … … 410 414 $options = get_option('widget_recent_bookable_events'); 411 415 412 $title = empty($options['title']) ? __("Last bookable events", 'book able-events') : apply_filters('widget_title', $options['title']);416 $title = empty($options['title']) ? __("Last bookable events", 'booking-event') : apply_filters('widget_title', $options['title']); 413 417 if ( !$number = (int) $options['number'] ) 414 418 $number = 5; … … 438 442 for ($i=1; $i<$num_partecipanti; $i++) $participants = $participants.", ".$participants_values[$i]; 439 443 $participants = $participants."."; 440 } else $participants = __("No registered users", 'book able-events');441 } else $participants = __("Protected post", 'book able-events');444 } else $participants = __("No registered users", 'booking-event'); 445 } else $participants = __("Protected post", 'booking-event'); 442 446 443 447 echo "<li><a href=".get_permalink($postinfo->ID)." title=\"$participants\">".$postinfo->post_title."</a></li>"; … … 476 480 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> 477 481 <p> 478 <label for='recent-bookable-events-number'>".__("Number of posts to show", 'book able-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> 479 483 <br /> 480 <small>".__("(at most 10)", 'book able-events')."</small>484 <small>".__("(at most 10)", 'booking-event')."</small> 481 485 </p> 482 486 <input type='hidden' id='recent-bookable-events-submit' name='recent-bookable-events-submit' value='1' />"; … … 543 547 $nome=$mykey_values[$i]; 544 548 $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) 546 550 $mail=$u->user_email; 547 551 if ($mail!=null)
Note: See TracChangeset
for help on using the changeset viewer.