Plugin Directory

Changeset 2015231


Ignore:
Timestamp:
01/19/2019 08:29:26 AM (7 years ago)
Author:
deller21
Message:

Fixed issue #

Location:
recobox/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • recobox/trunk/README.txt

    r2015214 r2015231  
    55Requires at least: 3.0
    66Tested up to: 4.9.5
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • recobox/trunk/admin/class-rcb-comments-admin.php

    r2015211 r2015231  
    566566    function comments_number_post($comment_text) {
    567567        global $post;
    568         return '<span class="rcb-span-container" id="rcb-counter-' . htmlspecialchars($post->ID) . '">' . $comment_text . '</span>';
     568        $host = $_SERVER['HTTP_HOST'];
     569        $host = str_replace('www.', '', $host);
     570        $hosts = explode('.', $host);
     571        if(count($hosts) > 2) {
     572            $prefix = [];
     573            for($i = 0; $i < (count($hosts) - 2); $i++) {
     574                $prefix[] = $hosts[$i];
     575            }
     576            $postId = implode('_', $prefix) . '_' . $post->ID;
     577        } else {
     578            $postId = $post->ID;
     579        }
     580        return '<span class="rcb-span-container" id="rcb-counter-' . htmlspecialchars($postId) . '">' . $comment_text . '</span>';
    569581    }
    570582}
  • recobox/trunk/public/partials/rcb-comment-template.php

    r2014437 r2015231  
    2121        $sync = $settings['sync'];
    2222    }
     23    do_action('comment_form_before');
     24   
     25    if(comments_open()) {
    2326    ?>
    2427    <div class="entry">
     
    3942    </div>
    4043    </div>
     44    <?php do_action('comment_form_after'); ?>
    4145
    4246    <script type="text/javascript">
     47    <?php
     48    $host = $_SERVER['HTTP_HOST'];
     49    $host = str_replace('www.', '', $host);
     50    $hosts = explode('.', $host);
     51    if(count($hosts) > 2) {
     52        $prefix = [];
     53        for($i = 0; $i < (count($hosts) - 2); $i++) {
     54            $prefix[] = $hosts[$i];
     55        }
     56        $postId = implode('_', $prefix) . '_' . $post->ID;
     57    } else {
     58        $postId = $post->ID;
     59    }
     60    ?>
    4361        (function () {
    4462            RCB = window.RCB || [];
     
    4664                widget: "Comments",
    4765                id: <?php echo $settings['widget_id'] ?>,
    48                 cname: <?php echo $post->ID ?>,
     66                cname: '<?php echo $postId ?>',
    4967                count_container: '#rcb-counter-<?php echo $post->ID ?>'
    5068            };
    51             <?php
    52             if(!comments_open()) {
    53                 echo 'data.channel_close = true;';
    54             }
    55             ?>
    5669            <?php
    5770            if ($sso && strlen($api_key) > 0) {
     
    8699    </script>
    87100    <?php
     101    }
    88102}
    89103
  • recobox/trunk/rcb-comments.php

    r2015214 r2015231  
    33/**
    44 * @link              https://recobox.ru
    5  * @since             1.0.3
     5 * @since             1.0.4
    66 * @package           Rcb_Comments
    77 *
     
    1010 * Plugin URI:        https://recobox.ru
    1111 * Description:       Система комментирования с различными вариантами социальной аутентификации(ВКонтакте, Одноклассники, FaceBook, Google+ и т.д.).
    12  * Version:           1.0.3
     12 * Version:           1.0.4
    1313 * Author:            Recobox
    1414 * Author URI:        https://profiles.wordpress.org/deller21
     
    2929 * Rename this for your plugin and update it as you release new versions.
    3030 */
    31 define( 'RCB_COMMENTS_VERSION', '1.0.3' );
     31define( 'RCB_COMMENTS_VERSION', '1.0.4' );
    3232
    3333/**
     
    6565 * not affect the page life cycle.
    6666 *
    67  * @since    1.0.3
     67 * @since    1.0.4
    6868 */
    6969function rcb_comments_run() {
Note: See TracChangeset for help on using the changeset viewer.