Plugin Directory

Changeset 937944


Ignore:
Timestamp:
06/24/2014 05:10:56 PM (12 years ago)
Author:
bholub
Message:

adding optional inline results and comments
updating to 3.2

Location:
wodtogether-whiteboards/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wodtogether-whiteboards/trunk/readme.txt

    r732238 r937944  
    44Requires at least: 3.0
    55Tested up to: 3.5.1
    6 Stable tag: 3.1.0
     6Stable tag: 3.2.0
    77License: GPLv2
    88
     
    2222
    2323== Changelog ==
     24= 3.2.0 =
     25* adding option for inline results and comments
     26* removing old unused option to display wods
    2427= 3.1.0 =
    2528* adding program id option to show whiteboards from only 1 program
  • wodtogether-whiteboards/trunk/wodtogether-whiteboards.php

    r732238 r937944  
    44 * Plugin URI: http://wodtogether.com
    55 * Description: Automatic embedding of WODTogether whiteboards into blog posts. Other widgets too
    6  * Version: 3.1.0
     6 * Version: 3.2.0
    77 * Author: WODTogether, Inc.
    88 * Author URI: http://wodtogether.com
     
    4545    add_settings_field('wodtogether_required_category', 'Required Category', 'wodtogether_setting_required_category', 'wodtogether', 'wodtogether_main');
    4646    add_settings_field('wodtogether_static_page', 'Static Page (Today\'s WOD)', 'wodtogether_setting_static_page', 'wodtogether', 'wodtogether_main');
    47     add_settings_field('wodtogether_show_wods', 'Show WOD Details by Default', 'wodtogether_setting_show_wods', 'wodtogether', 'wodtogether_main');
     47    add_settings_field('wodtogether_inline_results', 'Allow Inline Results and Comments', 'wodtogether_setting_inline_results', 'wodtogether', 'wodtogether_main');
    4848}
    4949
     
    9696    <p><strong>Note:</strong> If you want to show Today's WOD on a static Page (instead of/in addition to on each blog post), select a page in the dropdown.</p>";
    9797}
    98 function wodtogether_setting_show_wods() {
    99     $options = get_option('wodtogether_options');
    100    
    101     $checked = (isset($options['show_wods']) && $options['show_wods']) ? ' checked' : '';
    102     echo "<input id='wodtogether_show_wods' name='wodtogether_options[show_wods]' {$checked} type='checkbox' value='1' />";
     98function wodtogether_setting_inline_results() {
     99    $options = get_option('wodtogether_options');
     100   
     101    $checked = (isset($options['inline_results']) && $options['inline_results']) ? ' checked' : '';
     102    echo "<input id='wodtogether_inline_results' name='wodtogether_options[inline_results]' {$checked} type='checkbox' value='1' />";
    103103}
    104104
     
    117117    }
    118118   
    119     if (!is_numeric($input['show_wods'])) {
    120         $input['show_wods'] = 0; // default to off
     119    if (!is_numeric($input['inline_results'])) {
     120        $input['inline_results'] = 0; // default to off
    121121    }
    122122   
     
    193193    $gym_id =(!isset($wodtogetherSettings['gym_id']) || !$wodtogetherSettings['gym_id'] || !is_numeric($wodtogetherSettings['gym_id'])) ? 2958 : $wodtogetherSettings['gym_id'];
    194194    $program_id = (!isset($wodtogetherSettings['program_id']) || !$wodtogetherSettings['program_id'] || !is_numeric($wodtogetherSettings['program_id'])) ? '' : $wodtogetherSettings['program_id'];
    195     $show_wods = (isset($wodtogetherSettings['show_wods']) && $wodtogetherSettings['show_wods']) ? '/show-wods/1' : '';
     195    $inline_results = (isset($wodtogetherSettings['inline_results']) && $wodtogetherSettings['inline_results']) ? 'true' : 'false';
    196196   
    197197    $date_offset = (isset($wodtogetherSettings['date_offset']) && $wodtogetherSettings['date_offset']) ? 86400 : 0;
     
    200200    $date = date('Y-m-d', strtotime($datestr) + $date_offset);
    201201   
    202     $whiteboardsHtml = "<div id=\"wb_{$whiteboarded}\" class=\"wodtogether_whiteboard_wods wodtogether_wb\" data-gid=\"{$gym_id}\" data-pids=\"{$program_id}\" data-date=\"{$date}\"></div>";
     202    $whiteboardsHtml = "<div id=\"wb_{$whiteboarded}\" class=\"wodtogether_whiteboard_wods wodtogether_wb\" data-gid=\"{$gym_id}\" data-pids=\"{$program_id}\" data-date=\"{$date}\" data-inline_results=\"{$inline_results}\"></div>";
    203203   
    204204    $whiteboarded++;
Note: See TracChangeset for help on using the changeset viewer.