Plugin Directory

Changeset 767483


Ignore:
Timestamp:
09/05/2013 05:40:41 PM (13 years ago)
Author:
dpereyra
Message:
  • Added Most Popular Comments widget
  • Improved Recent Comments Widget
Location:
realtidbits-comments/trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • realtidbits-comments/trunk/readme.txt

    r766571 r767483  
    44Requires at least: 2.5
    55Tested up to: 3.5
    6 Stable tag: 1.1.3.5
     6Stable tag: 1.1.3.6
    77
    88The RealTidbits comment system replaces your WordPress comment system with comments powered by RealTidbits.
     
    1919
    2020== Changelog ==
     21
     22= 1.1.3.6 =
     23* Added Most Popular Comments widget
     24* Improved Recent Comments Widget
    2125
    2226= 1.1.3.5 =
  • realtidbits-comments/trunk/realtidbits-comments.php

    r766571 r767483  
    55Description: The RealTidbits comment system replaces your WordPress comment system with comments powered by RealTidbits.
    66Author: RealTidbits <support@realtidbits.com>
    7 Version: 1.1.3.5
     7Version: 1.1.3.6
    88Author URI: http://realtidbits.com/
    99*/
    1010
    11 define('RTB_COMMENTS_VERSION', '1.1.3.5');
     11define('RTB_COMMENTS_VERSION', '1.1.3.6');
    1212
    1313
     
    3535
    3636require_once("widgets/rtb-audiorecorder.php");
     37require_once("widgets/rtb-recentcomments.php");
     38require_once("widgets/rtb-popularcomments.php");
    3739
    3840function rtb_load_widgets() {
    3941    register_widget( 'rtb_audiorecorder_widget' );
     42    register_widget( 'rtb_recentcomments_widget' );
     43    register_widget( 'rtb_popularcomments_widget' );
    4044}
    4145add_action( 'widgets_init', 'rtb_load_widgets' );
     
    445449add_filter('plugin_action_links', 'rtb_plugin_action_links', 10, 2);
    446450
    447 
    448 //error_reporting(E_ALL);
    449 add_action("widgets_init", array('RTB_Comments_widget', 'register'));
    450 register_activation_hook( __FILE__, array('RTB_Comments_widget', 'activate'));
    451 register_deactivation_hook( __FILE__, array('RTB_Comments_widget', 'deactivate'));
    452 class RTB_Comments_widget {
    453   function activate(){
    454     $data = array( 'option1' => 'Default value' ,'option2' => 55);
    455     if ( ! get_option('widget_name')){
    456       add_option('widget_name' , $data);
    457     } else {
    458       update_option('widget_name' , $data);
    459     }
    460   }
    461   function deactivate(){
    462     delete_option('widget_name');
    463   }
    464     function control(){
    465       $data = get_option('widget_name');
    466       ?>
    467       <p><label>Number of Comments<input name="widget_name_option1"
    468     type="text" value="<?php echo $data['option1']; ?>" /></label></p>
    469       <!--<p><label>Option 2<input name="widget_name_option2"
    470     type="text" value="<?php echo $data['option2']; ?>" /></label></p>-->
    471       <?php
    472        if (isset($_POST['widget_name_option1'])){
    473         $data['option1'] = attribute_escape($_POST['widget_name_option1']);
    474         $data['option2'] = attribute_escape($_POST['widget_name_option2']);
    475         update_option('widget_name', $data);
    476       }
    477     }
    478   function widget($args, $instance=null){
    479       extract($args, EXTR_SKIP);
    480     $title = apply_filters('widget_title', $instance['title'] ); // Title
    481     echo $args['before_widget'];
    482     if ( $title ) {
    483         echo $before_title . $title . $after_title;
    484     } else {
    485         echo $before_title . 'Recent Comments' . $after_title;
    486     }
    487     //include dirname(__FILE__) . '/widget.php';
    488     $x = get_option('widget_name');
    489     if(is_numeric($x['option1'])) { $itemsPerPage = $x['option1']; } else { $itemsPerPage = '10'; };
    490     ?>
    491 <!-- RealTidbits.Comments -->
    492 <div id="rtb-latest-comments">Loading comments...</div>
    493 <script type="text/javascript">
    494 Backplane.init({
    495     "serverBaseURL" : "http://api.echoenabled.com/v1",
    496     "busName": "<?php echo get_option('rtb_comments_backplane_busname'); ?>"
    497 });
    498 </script>
    499 <style type="text/css">
    500 #rtb-latest-comments .echo-streamserver-controls-stream-item-markers,
    501 #rtb-latest-comments .echo-streamserver-controls-stream-item-tags,
    502 #rtb-latest-comments .echo-streamserver-controls-stream-item-buttons,
    503 #rtb-latest-comments .echo-streamserver-controls-stream-item-modeSwitch {
    504     display:none !important;
    505 }
    506 </style>
    507 <script type="text/javascript">
    508 jQuery(document).ready(function() {
    509     Echo.Loader.initApplication({
    510         "script": "http://cdn.echoenabled.com/sdk/v3/streamserver.pack.js",
    511         "component": "Echo.StreamServer.Controls.Stream",
    512         "backplane": {
    513             "busName": "<?php echo get_option('rtb_comments_backplane_busname'); ?>",
    514             "serverBaseURL": "https://api.echoenabled.com/v1"
    515         },
    516         "config": {
    517             "target": document.getElementById('rtb-latest-comments'),
    518             "appkey": "<?php echo get_option('rtb_comments_appkey'); ?>",
    519             "query": "childrenof:" + document.location.protocol + "//" + document.location.hostname + "/* type:'http://activitystrea.ms/schema/1.0/comment' -markers:page sortOrder:reverseChronological children state:Untouched,ModeratorApproved user.state:Untouched,ModeratorApproved itemsPerPage:<?php echo $itemsPerPage?> -source:Twitter,Facebook",
    520             "stream": {
    521                 "queryParams": {
    522                     "main": {"source": "-source:Twitter,Facebook -provider:'Idea Melt'", "bozo": true, "premod": true, "type": "type:'http://activitystrea.ms/schema/1.0/comment'"}
    523                 }
    524             },
    525             "item": {
    526                 "reTag": false,
    527                 "limits": {
    528                     "maxBodyCharacters": 300   
    529                 }
    530             },
    531             "liveUpdates": {
    532                 "enabled" : false
    533             },
    534             "itemsPerPage": <?php echo $itemsPerPage?>,
    535             "children": {
    536                    "sortOrder": "chronological"
    537             },
    538             "plugins": [
    539                 {
    540                     "name": "Whirlpools",
    541                     "after" : 2,
    542                     "clickable": true
    543                 },
    544                 {"name": "CommunityFlag"},
    545                 {"name": "Curation"},
    546                 {"name": "UserBan"},
    547                 {"name": "UserPrivileges"},
    548                 {
    549                     "name": "Reply",
    550                     "actionString": "Write reply here...",
    551                     "nestedPlugins": [{
    552                         "name": "FormAuth",
    553                         "submitPermissions": "forceLogin"
    554                     }]
    555                 }
    556             ]
    557         }
    558     });
    559 });
    560 </script>
    561 
    562 <!-- End of RealTidbits.Comments -->
    563  
    564     <?php
    565    
    566     echo $args['after_widget'];
    567   }
    568   function register(){
    569     register_sidebar_widget('RealTidbits Recent Comments', array('RTB_Comments_widget', 'widget'));
    570     register_widget_control('RealTidbits Recent Comments', array('RTB_Comments_widget', 'control'));
    571   }
    572 }
    573 
    574451// Javascript Files
    575452
Note: See TracChangeset for help on using the changeset viewer.