Plugin Directory

Changeset 1506796


Ignore:
Timestamp:
10/02/2016 01:41:03 PM (10 years ago)
Author:
123teru321
Message:

1.1.2

Location:
ucb-recommend
Files:
268 added
9 edited

Legend:

Unmodified
Added
Removed
  • ucb-recommend/trunk/controllers/010-widget.php

    r1506564 r1506796  
    7171        $ucbr_api->register_use_function( 'get-bandits' );
    7272        $ucbr_api->register_use_function( 'get-preview' );
     73        $ucbr_api->register_use_function( 'get-histories' );
    7374
    7475        $ucbr_api->register_use_function( 'save-join-table' );
  • ucb-recommend/trunk/languages/UCBRecommend-ja.po

    r1506564 r1506796  
    33"Project-Id-Version: ucb-recommend0.0.0.0.1\n"
    44"POT-Creation-Date: 2016-07-19 20:40+0900\n"
    5 "PO-Revision-Date: 2016-10-02 01:41+0900\n"
     5"PO-Revision-Date: 2016-10-02 21:38+0900\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    432432msgstr "nonceチェックをせずにAjaxアクセスする場合にリファラをチェックするかどうか"
    433433
    434 msgid "Please update your PHP. <strong>%s</strong> requires PHP version 5.4 or above"
    435 msgstr "PHPをアップデートして下さい。 <strong>%s</strong>の動作にはPHP5.4以上が必要です。"
     434msgid "Your PHP version is %s."
     435msgstr "あなたのPHPのバージョンは%sです。"
     436
     437msgid "Please update your PHP."
     438msgstr "PHPをアップデートして下さい。"
     439
     440msgid "<strong>%s</strong> requires PHP version %s or above."
     441msgstr "<strong>%s</strong>の動作にはPHP%s以上が必要です。"
    436442
    437443msgid "Standard Deviation to use calculate score from ucb score"
     
    461467msgid "Ajax test"
    462468msgstr "Ajaxテスト"
     469
     470msgid "Context"
     471msgstr "Context"
     472
     473msgid "Histories"
     474msgstr "履歴"
     475
     476msgid "Clicked histories"
     477msgstr "クリック履歴"
     478
     479msgid "Data for about %s"
     480msgstr "%s前以降データ"
     481
     482msgid "Total shown item number"
     483msgstr "表示された総回数"
  • ucb-recommend/trunk/readme.txt

    r1506572 r1506796  
    44Requires at least: 3.9.14
    55Tested up to: 4.6.1
    6 Stable tag: 1.1.1
     6Stable tag: 1.1.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3434
    3535== Changelog ==
     36
     37= 1.1.2 =
     38* 2016-10-02
     39* Add history tab
     40* Show php version when PHP version < 5.4
    3641
    3742= 1.1.1 =
  • ucb-recommend/trunk/ucb-recommend.php

    r1506572 r1506796  
    55  Description: Recommendation and AB test plugin using ucb algorithm
    66  Author: 123teru321
    7   Version: 1.1.1
     7  Version: 1.1.2
    88  Author URI: http://technote.space/
    99  Text Domain: UCBRecommend
     
    2727
    2828//plugin version
    29 define( 'UCB_RECOMMEND_PLUGIN_VERSION', '1.1.1' );
     29define( 'UCB_RECOMMEND_PLUGIN_VERSION', '1.1.2' );
    3030
    3131//required php version
  • ucb-recommend/trunk/unsupported.php

    r1506564 r1506796  
    77function ucbr_old_php_message()
    88{
    9     return sprintf( __( 'Please update your PHP. <strong>%s</strong> requires PHP version %s or above', UCB_RECOMMEND_TEXT_DOMAIN ), UCB_RECOMMEND_PLUGIN_NAME, UCB_RECOMMEND_REQUIRED_PHP_VERSION );
     9    $ret = sprintf( __( 'Your PHP version is %s.', UCB_RECOMMEND_TEXT_DOMAIN ), phpversion() ) . '<br>';
     10    $ret .= __( 'Please update your PHP.', UCB_RECOMMEND_TEXT_DOMAIN ) . '<br>';
     11    $ret .= sprintf( __( '<strong>%s</strong> requires PHP version %s or above.', UCB_RECOMMEND_TEXT_DOMAIN ), UCB_RECOMMEND_PLUGIN_NAME, UCB_RECOMMEND_REQUIRED_PHP_VERSION );
     12    return $ret;
    1013}
    1114
  • ucb-recommend/trunk/update.json

    r1506572 r1506796  
    33  "slug": "ucb-recommend",
    44  "download_url": "https://github.com/123teru321/UCB-Recommend/archive/master.zip",
    5   "version": "1.1.1",
     5  "version": "1.1.2",
    66  "tested": "4.6.1",
    77  "homepage": "https://technote.space/",
  • ucb-recommend/trunk/views/widget-settings-script.php

    r1506564 r1506796  
    164164            html += '<div class="nav-tab" data-id="4"><?php _e( "Search conditions", UCB_RECOMMEND_TEXT_DOMAIN ); ?></div>';
    165165            html += '<div class="nav-tab" data-id="5"><?php _e( "Join conditions", UCB_RECOMMEND_TEXT_DOMAIN ); ?></div>';
    166             html += '<div class="nav-tab" data-id="6"><?php _e( "Help", UCB_RECOMMEND_TEXT_DOMAIN ); ?></div>';
     166            html += '<div class="nav-tab" data-id="6"><?php _e( "Histories", UCB_RECOMMEND_TEXT_DOMAIN ); ?></div>';
     167            html += '<div class="nav-tab" data-id="7"><?php _e( "Help", UCB_RECOMMEND_TEXT_DOMAIN ); ?></div>';
    167168            html += '</h2>';
    168169            html += '<div id="ucbr-board"></div>';
     
    206207                    break;
    207208                case 6:
     209                    set_histories(id);
     210                    break;
     211                case 7:
    208212                    set_help(id);
    209213                    break;
     
    465469                    var li = $('#ucbr-board').find('li');
    466470                    var values = {};
    467                     $(li).each(function(){
     471                    $(li).each(function () {
    468472                        var name = $(this).data('name');
    469473                        var value = $(this).find('.ucbr-template-value').val();
    470474                        values[name] = value;
    471475                    });
    472                     save_design_templates(get_widget_id(), values, function(){
     476                    save_design_templates(get_widget_id(), values, function () {
    473477                        set_updated('<?php _e( "Saved.", UCB_RECOMMEND_TEXT_DOMAIN ); ?>');
    474478                        ucbr_obj.enable_controls();
     
    860864                });
    861865                $('.ucbr-select-table').trigger('change');
     866            });
     867        }
     868
     869        function set_histories(tab_id) {
     870            if (tab_id !== ucbr_obj.tab_id) {
     871                return;
     872            }
     873            $('#ucbr-board').html(ucbr_obj.now_loading);
     874            ucbr_obj.disable_controls();
     875            var id = get_widget_id();
     876            get_histories(id, function (data) {
     877                if (id !== get_widget_id()) {
     878                    return;
     879                }
     880                ucbr_obj.enable_controls();
     881                var html = '';
     882                html += '<h3>' + data.result.diff + '</h3>';
     883                html += '<div id="ucbr-histories-total">' + data.result.total + '</div>';
     884                html += '<h3><?php echo __( 'Clicked histories', UCB_RECOMMEND_TEXT_DOMAIN );?></h3>';
     885                html += '<table class="widefat striped"><tr>';
     886                html += '<th><?php echo __( 'Date', UCB_RECOMMEND_TEXT_DOMAIN );?></th>';
     887                html += '<th><?php echo __( 'Post ID', UCB_RECOMMEND_TEXT_DOMAIN );?></th>';
     888                if (!data.result.no_context) {
     889                    html += '<th><?php echo __( 'Context', UCB_RECOMMEND_TEXT_DOMAIN );?></th>';
     890                }
     891                html += '</tr>';
     892                if (data.result.data.length > 0) {
     893                    for (var key in data.result.data) {
     894                        html += '<tr>'
     895                        html += '<td>' + data.result.data[key].updated_at + '</td>';
     896                        html += '<td>' + data.result.data[key].post_id + '</td>';
     897                        if (!data.result.no_context) {
     898                            html += '<td>' + data.result.data[key].context + '</td>';
     899                        }
     900                        html += '</tr>';
     901                    }
     902                } else {
     903                    html += '<tr><td><?php echo __( 'Item not found.', UCB_RECOMMEND_TEXT_DOMAIN );?></td></tr>';
     904                }
     905
     906                html += '<tr></table>';
     907                $('#ucbr-board').html(html);
    862908            });
    863909        }
     
    16291675        }
    16301676
     1677        function get_histories(id, func) {
     1678            ucbr_obj.get_histories({id: id}, function (data) {
     1679                if (!data.result) {
     1680                    set_error(data.message);
     1681                    return;
     1682                }
     1683                if (func)func(data);
     1684            }, function (error) {
     1685                set_error(error);
     1686            });
     1687        }
     1688
    16311689        $(function () {
    16321690            ucbr_obj.disable_controls();
  • ucb-recommend/trunk/views/widget-settings.php

    r1499492 r1506796  
    126126    width: 100%;
    127127}
     128#ucbr-histories-total {
     129    padding: 10px;
     130    margin: 5px;
     131}
    128132EOS
    129133);
Note: See TracChangeset for help on using the changeset viewer.