Plugin Directory

Changeset 1351608


Ignore:
Timestamp:
02/16/2016 09:41:11 AM (10 years ago)
Author:
ty_pwd
Message:

additional templates

Location:
weekly-class-schedule/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • weekly-class-schedule/trunk/includes/wcs3_output.php

    r1193555 r1351608  
    194194    $template = str_replace( '[end hour]', $class->end_hour, $template );
    195195    $template = str_replace( '[notes]', $class->notes, $template );
     196
     197    // TODO: replace [class_link], etc.
    196198   
    197199    return $template;
  • weekly-class-schedule/trunk/includes/wcs3_schedule.php

    r1170953 r1351608  
    122122    $meta_table = $wpdb->prefix . 'postmeta';
    123123   
    124     $query = "SELECT 
     124    $query = "SELECT
    125125                c.post_title AS class_title, c.post_content AS class_desc,
    126126                i.post_title AS instructor_title, i.post_content AS instructor_desc,
     
    140140            $meta_table );
    141141
     142    // Add IDs by default (post filter)
     143    $pattern = '/^\s?SELECT/';
     144    $replacement = "SELECT c.ID AS class_id, i.ID as instructor_id, l.ID as location_id,";
     145    $query = preg_replace($pattern, $replacement, $query);
     146
    142147    // Filter by location
    143148    if ( $location != 'all' ) {
     
    167172            // Prep CSS class name
    168173            wcs3_format_class_object( $class, $format );
    169            
     174
     175            $class->class_link = get_permalink($class->class_id);
     176            $class->instructor_link = get_permalink($class->instructor_id);
     177            $class->location_link = get_permalink($class->location_id);
     178
    170179            if ( $layout == 'list' ) {
    171180                $grouped[$class->weekday][] = $class;
  • weekly-class-schedule/trunk/js/wcs3_common.js

    r853343 r1351608  
    3030        template = template.replace('[end hour]', data.end_hour);
    3131        template = template.replace('[notes]', data.notes);
    32        
     32
     33        template = template.replace('[class_link]', "<a href='" + data.class_link + "' target=_blank>" + data.class_title + "</a>");
     34        template = template.replace('[instructor_link]', "<a href='" + data.instructor_link + "' target=_blank>" + data.instructor_title + "</a>");
     35        template = template.replace('[location_link]', "<a href='" + data.location_link + "' target=_blank>" + data.location_title + "</a>");
     36
    3337        return template;
    3438    },
Note: See TracChangeset for help on using the changeset viewer.