Changeset 1911694
- Timestamp:
- 07/19/2018 02:10:53 PM (8 years ago)
- Location:
- davsy/trunk
- Files:
-
- 4 edited
-
assets/js/wp_davsy_front.js (modified) (1 diff)
-
davsy.php (modified) (2 diffs)
-
includes/class-davsy-widget.php (modified) (4 diffs)
-
includes/class-wp-davsy-api.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
davsy/trunk/assets/js/wp_davsy_front.js
r1911588 r1911694 1 1 jQuery(document).ready(function(e){ 2 jQuery('.wp_davsy_link').click(function(){ 3 var href =jQuery(this).attr('data-href'); 4 window.open(href,'_blank'); 5 }); 2 6 3 jQuery('.wp_davsy_link').click(function(){4 5 var href =jQuery(this).attr('data-href');6 window.open(href,'_blank');7 8 });9 10 7 }); -
davsy/trunk/davsy.php
r1911485 r1911694 238 238 //print_r($app_data); 239 239 if(!empty($app_data['result']) && is_array($app_data['result'])){ 240 241 $davsy_obj .="<div class='davsy-main-widget '>";240 $coloClass='davsy-col-'.$no_post; 241 $davsy_obj .="<div class='davsy-main-widget $coloClass'>"; 242 242 $davsy_obj .= "<h2>".$davsy_header_title."</h2>"; 243 243 $davsy_obj .="<ul class='davsy-widget'>"; 244 244 $i=1; 245 245 foreach($app_data['result'] as $key=>$widget_value){ 246 $pids[]=$widget_value->id; 246 247 $widget_img=$widget_value->blog_post_image; 247 248 $widget_link=$widget_value->blog_post_url; … … 254 255 $i++; 255 256 } 257 Wp_Davsy_API::updateDavsyPostsviewCount(json_encode($pids)); 256 258 $davsy_obj .= "</ul>"; 257 259 $davsy_obj .= "</div>"; -
davsy/trunk/includes/class-davsy-widget.php
r1911485 r1911694 37 37 $davsy_header_title=$instance['header']; 38 38 $davsy_api_key=trim( get_option('davsy_api_key') ); 39 39 40 40 41 41 $no_post=isset($no_post)?$no_post:'1'; … … 51 51 echo "<ul class='davsy-widget'>"; 52 52 $i=1; 53 53 54 foreach($app_data['result'] as $key=>$widget_value){ 55 $pids[]=$widget_value->id; 54 56 $widget_img=$widget_value->blog_post_image; 55 57 $widget_link=$widget_value->blog_post_url; … … 62 64 $i++; 63 65 } 66 67 Wp_Davsy_API::updateDavsyPostsviewCount(json_encode($pids)); 64 68 echo "</ul>"; 65 69 echo "</div>"; … … 118 122 return $instance; 119 123 } 120 121 122 124 123 125 } -
davsy/trunk/includes/class-wp-davsy-api.php
r1911485 r1911694 38 38 39 39 } 40 41 public static function updateDavsyPostsviewCount($requestJson) { 42 $postUrl = 'http://app.davsy.com/views_update'; 43 $ch = curl_init(); 44 curl_setopt($ch, CURLOPT_URL,$postUrl); 45 curl_setopt($ch, CURLOPT_POST, 1); 46 curl_setopt($ch, CURLOPT_POSTFIELDS, 47 "pids=".$requestJson); 48 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 49 $response = curl_exec ($ch); 50 curl_close ($ch); 51 return $response; 52 } 40 53 41 54 }
Note: See TracChangeset
for help on using the changeset viewer.