Plugin Directory

Changeset 135014


Ignore:
Timestamp:
07/14/2009 12:37:58 PM (17 years ago)
Author:
giocaputo
Message:
 
Location:
booking-event
Files:
10 added
3 edited

Legend:

Unmodified
Added
Removed
  • booking-event/trunk/README.txt

    r131774 r135014  
    55Require: avatars plugin. you cand download from http://www.sterling-adventures.co.uk/blog/2008/03/01/avatars-plugin/
    66Tested up to: 2.7.1
    7 Stable tag: 0.1
     7Stable tag: 0.2
    88
    99Plugin that makes a post 'bookable', using the custom fields.
  • booking-event/trunk/bookable_events.php

    r131774 r135014  
    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: 1.0.4
     8    Version: 0.2
    99    Author: Francesca 'sefran' Secondo and edited by Giovani Caputo
    1010    Author URI: http://giovannicaputo.netsons.org
     
    215215}
    216216
     217
     218
     219
     220/*check if date on bookable_event is passed from today */
     221
     222function is_passed(){
     223
     224   global $bookable_key;
     225    global $bookable;
     226    $meta = get_post_custom();
     227    $date = $meta[$bookable_key][0];
     228   
     229    if ( strtotime($date)==FALSE )  return false;
     230
     231   $todays_date =  time();
     232   
     233   
     234    $dateArr = explode("-",$date);
     235
     236    $date1Int = mktime(0,0,0,$dateArr[1],$dateArr[2],$dateArr[0]) ;
     237     
     238   
     239   
     240   if (  $todays_date > $date1Int ) { return true; } else { return false; }
     241   
     242   
     243   
     244}
     245
     246
     247
     248
     249
    217250/*
    218251    Adds the registration/unregistration links at the bottom of the 'bookable' post. Moreover, it adds the 'bookable event' label at the post beginning.
    219252*/
    220253function add_links_to_post( $content = '' ) {
    221    
    222       if ( is_bookable() && !post_password_required() && utentePuoRegistrarsi() )
     254     
     255      if ( is_bookable() && !post_password_required() && utentePuoRegistrarsi()  )
    223256       {
    224257         if (!isset($_GET['click_register']) && !isset($_GET['click_unregister'])){
    225258            $content = "<div class='redtext'>".__("bookable event", 'bookable-events')."</div>$content<br/><div class='event'>";
    226259           
    227             if ( !untenteGiaPrenotato() ){
     260            if ( !untenteGiaPrenotato()  && !is_passed()  ){
    228261                $content.=add_link_registration()."<br/>";
    229262       
    230263            }
    231             if ( untenteGiaPrenotato() ){
     264            if ( untenteGiaPrenotato() && !is_passed() ){
    232265                $content.=add_link_unregistration()."<br/>";
    233266             }
     
    361394}
    362395
     396
     397
     398
     399
     400
     401
    363402/*
    364403    Outputs the content of the "Last bookable events" widget, that is the titles of 'bookable post'.
Note: See TracChangeset for help on using the changeset viewer.