Changeset 633231
- Timestamp:
- 12/02/2012 11:15:28 PM (13 years ago)
- Location:
- facebook-awd-seo-comments/trunk/inc/classes
- Files:
-
- 3 edited
-
class.AWD_facebook_comments_base.php (modified) (1 diff)
-
class.AWD_facebook_seo_comments.php (modified) (4 diffs)
-
class.table_comments.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
facebook-awd-seo-comments/trunk/inc/classes/class.AWD_facebook_comments_base.php
r633229 r633231 77 77 if($this->comments_url == '') 78 78 return false; 79 80 79 81 $fql = "SELECT comments_fbid,commentsbox_count,comment_count FROM link_stat WHERE url='".$this->comments_url."'"; 80 82 try { -
facebook-awd-seo-comments/trunk/inc/classes/class.AWD_facebook_seo_comments.php
r633227 r633231 49 49 add_action('AWD_facebook_save_custom_settings',array(&$this,'hook_post_from_custom_options')); 50 50 add_action('AWD_facebook_seo_comments_clear_cache',array(&$this,'clear_comments_cache')); 51 add_action('wp_ajax_table_comments_list',array(&$this,'ajax_table_comments_list')); 51 52 52 53 if($this->AWD_facebook->options['comments_merge'] == 1) … … 295 296 <input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" /> 296 297 <?php $AWD_facebook_table_comments->search_box(__('Search URL',$this->plugin_text_domain), $this->plugin_slug.'_search' ); ?> 297 < ?php $AWD_facebook_table_comments->display(); ?>298 <div class="<?php echo $this->plugin_slug; ?>comments-filter-table"><?php $AWD_facebook_table_comments->display(); ?></div> 298 299 </form> 299 300 <br /> … … 324 325 $("#search_submit").click(function(e){ 325 326 e.preventDefault(); 326 $("#'.$this->plugin_slug.'comments-filter").submit(); 327 $("body").css("cursor", "progress"); 327 //$("#'.$this->plugin_slug.'comments-filter").submit(); 328 //$(".'.$this->plugin_slug.'comments-filter-table").slideUp().html(""); 329 $.post(ajaxurl+"?action=table_comments_list",$("#'.$this->plugin_slug.'comments-filter").serialize().replace("action","action_modified_for_ajax")+"&"+$.param(list_args), function(data){ 330 $(".'.$this->plugin_slug.'comments-filter-table").html(data.table).slideDown(); 331 console.log(data); 332 },"json"); 328 333 }); 334 jQuery(".next-page, .prev-page, th.sortable a").live("click",function(e){ 335 e.preventDefault(); 336 $this = $(this); 337 $("#'.$this->plugin_slug.'comments-filter input[name=\'paged\']").remove(); 338 $.post($this.attr("href"),$("#'.$this->plugin_slug.'comments-filter").serialize().replace("action","action_modified_for_ajax")+"&"+$.param(list_args), function(data){ 339 $(".'.$this->plugin_slug.'comments-filter-table").html(data.table).slideDown(); 340 },"json"); 341 }) 329 342 jQuery("#comment_submit").click(function(e){ 330 343 e.preventDefault(); 331 344 $("#'.$this->plugin_slug.'comments-post").submit(); 332 $("body").css("cursor", "progress");333 345 }); 334 346 }); … … 337 349 echo $style_js; 338 350 } 351 352 public function ajax_table_comments_list(){ 353 $wp_list_table = new AWD_facebook_table_comments($this); 354 $this->AWD_facebook_comments->comments_url = $_REQUEST['s']; 355 $this->AWD_facebook_comments->get_comments_id_by_url(); 356 $wp_list_table->ajax_response(); 357 die('0'); 358 } 339 359 } -
facebook-awd-seo-comments/trunk/inc/classes/class.table_comments.php
r633227 r633231 23 23 'singular' => 'comment', 24 24 'plural' => 'comments', 25 'ajax' => false25 'ajax' => true 26 26 )); 27 27 } 28 28 function ajax_user_can() 29 { 30 return true; 31 } 29 32 function no_items() 30 33 { … … 49 52 </p> 50 53 <?php 54 wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 51 55 } 52 56 function column_default($item, $column_name) … … 209 213 return $good_comment_format; 210 214 } 215 216 217 function ajax_response() { 218 $this->prepare_items(); 219 extract( $this->_args ); 220 extract( $this->_pagination_args ); 221 222 ob_start(); 223 $this->display(); 224 $table = ob_get_clean(); 225 $response = array( 'table' => $table); 226 227 if ( isset( $total_items ) ) 228 $response['total_items_i18n'] = sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ); 229 230 if ( isset( $total_pages ) ) { 231 $response['total_pages'] = $total_pages; 232 $response['total_pages_i18n'] = number_format_i18n( $total_pages ); 233 } 234 235 die( json_encode( $response ) ); 236 } 237 238 211 239 } 212 240 ?>
Note: See TracChangeset
for help on using the changeset viewer.