Changeset 2019500
- Timestamp:
- 01/26/2019 11:01:19 AM (7 years ago)
- Location:
- recobox/trunk
- Files:
-
- 6 edited
-
README.txt (modified) (1 diff)
-
admin/class-rcb-comments-admin.php (modified) (1 diff)
-
includes/class-rcb-comments-activator.php (modified) (1 diff)
-
public/class-rcb-comments-public.php (modified) (3 diffs)
-
public/partials/rcb-comment-template.php (modified) (2 diffs)
-
rcb-comments.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
recobox/trunk/README.txt
r2015231 r2019500 5 5 Requires at least: 3.0 6 6 Tested up to: 4.9.5 7 Stable tag: 1.0. 47 Stable tag: 1.0.5 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
recobox/trunk/admin/class-rcb-comments-admin.php
r2015231 r2019500 209 209 [ 210 210 'post_id' => $channel->name, 211 'recobox_id' => $channel->id 211 'recobox_id' => $channel->id, 212 'rating' => json_encode($channel->rating) 212 213 ], 213 214 ['%s', '%s'] -
recobox/trunk/includes/class-rcb-comments-activator.php
r2014437 r2019500 52 52 post_id text NOT NULL default '', 53 53 recobox_id text NOT NULL default '', 54 rating text NOT NULL default '', 54 55 PRIMARY KEY (id) 55 56 ) {$charset_collate};"; -
recobox/trunk/public/class-rcb-comments-public.php
r2014437 r2019500 93 93 public function get_data_from_recobox_func($request) 94 94 { 95 $test_wr = fopen('testlog.txt', 'a+');96 fwrite($test_wr, print_r($request, true));97 fclose($test_wr);95 //$test_wr = fopen('testlog.txt', 'a+'); 96 //fwrite($test_wr, print_r($request, true)); 97 //fclose($test_wr); 98 98 99 99 $type = $request->get_param('type'); … … 262 262 FROM $channesTableName 263 263 WHERE recobox_id = %d 264 ", $comment['channel'][' name']));264 ", $comment['channel']['id'])); 265 265 266 266 if (empty($recoboxChannel)) { … … 270 270 [ 271 271 'post_id' => $comment['channel']['name'], 272 'recobox_id' => $comment['channel']['id'] 272 'recobox_id' => $comment['channel']['id'], 273 'rating' => json_encode($comment['channel']['rating']) 273 274 ], 275 ['%s', '%s', '%s'] 276 ); 277 278 } else { 279 280 $wpdb->update( 281 $wpdb->get_blog_prefix() . 'recobox_channels', 282 [ 283 'rating' => json_encode($comment['channel']['rating']) 284 ], 285 [ 286 'post_id' => $comment['channel']['name'], 287 'recobox_id' => $comment['channel']['id'], 288 ], 289 ['%s'], 274 290 ['%s', '%s'] 275 291 ); -
recobox/trunk/public/partials/rcb-comment-template.php
r2015231 r2019500 21 21 $sync = $settings['sync']; 22 22 } 23 24 $host = $_SERVER['HTTP_HOST']; 25 $host = str_replace('www.', '', $host); 26 $hosts = explode('.', $host); 27 if(count($hosts) > 2) { 28 $prefix = []; 29 for($i = 0; $i < (count($hosts) - 2); $i++) { 30 $prefix[] = $hosts[$i]; 31 } 32 $postId = implode('_', $prefix) . '_' . $post->ID; 33 } else { 34 $postId = $post->ID; 35 } 36 37 $channesTableName = $wpdb->get_blog_prefix() . 'recobox_channels'; 38 $recoboxChannel = $wpdb->get_row($wpdb->prepare( 39 " 40 SELECT * 41 FROM $channesTableName 42 WHERE post_id = %d 43 ", $postId)); 44 $htmlRating = ''; 45 if (!empty($recoboxChannel)) { 46 47 if(!empty($recoboxChannel->rating)) { 48 $rating = (array)json_decode($recoboxChannel->rating); 49 switch ($rating['type']) { 50 case 'stars': 51 $ratingValue = $rating['rating_avg']; 52 $ratingCount = $rating['rating_count']; 53 break; 54 case 'like_dislike': 55 $ratingValue = $rating['likes'] - $rating['dislikes']; 56 if($ratingValue < 0) 57 $ratingValue = 0; 58 else 59 $ratingValue = 5; 60 $ratingCount = $rating['likes'] + $rating['dislikes']; 61 break; 62 } 63 64 $htmlRating = '<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> 65 Рейтинг <span itemprop="ratingValue">' . $ratingValue . '</span> из <span itemprop="bestRating">5</span>. 66 Проголосовало: <span itemprop="ratingCount">' . $ratingCount . '</span></div>'; 67 } 68 69 } 70 71 23 72 do_action('comment_form_before'); 24 73 25 74 if(comments_open()) { 26 75 ?> 27 <div class="entry">28 <div class="entry-footer">29 76 <div id="rcb-comments-area"> 30 77 <div id="rcb-comments"> 31 78 <?php 79 echo $htmlRating; 32 80 if ($sync) { ?> 33 81 <ul id="recobox-comments"> … … 40 88 </div> 41 89 </div> 42 </div>43 </div>44 90 <?php do_action('comment_form_after'); ?> 45 91 46 92 <script type="text/javascript"> 47 <?php48 $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 ?>61 93 (function () { 62 94 RCB = window.RCB || []; -
recobox/trunk/rcb-comments.php
r2015231 r2019500 3 3 /** 4 4 * @link https://recobox.ru 5 * @since 1.0. 45 * @since 1.0.5 6 6 * @package Rcb_Comments 7 7 * … … 10 10 * Plugin URI: https://recobox.ru 11 11 * Description: Система комментирования с различными вариантами социальной аутентификации(ВКонтакте, Одноклассники, FaceBook, Google+ и т.д.). 12 * Version: 1.0. 412 * Version: 1.0.5 13 13 * Author: Recobox 14 14 * Author URI: https://profiles.wordpress.org/deller21 … … 65 65 * not affect the page life cycle. 66 66 * 67 * @since 1.0. 467 * @since 1.0.5 68 68 */ 69 69 function rcb_comments_run() {
Note: See TracChangeset
for help on using the changeset viewer.