Changeset 1911882
- Timestamp:
- 07/19/2018 09:19:40 PM (7 years ago)
- Location:
- ad-buttons/tags/3.0
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ad-buttons/tags/3.0/adbuttons.php
r1900232 r1911882 36 36 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 37 37 dbDelta($structure); 38 39 $ab_plugindir = get_option('siteurl').'/'.PLUGINDIR.'/'.dirname(plugin_basename(__FILE__)); 40 38 41 39 $wpdb->query("INSERT INTO $table 42 40 (id, ad_picture, ad_link, ad_text, ad_views, ad_clicks, ad_active) 43 VALUES (1, '". $ab_plugindir."/ab125.jpg', 'http://wordpress.org/plugins/ad-buttons/', 'ads powered by Ad Buttons', 0, 0, 0),44 (2, '". $ab_plugindir."/wordpress_logo.png', 'http://wordpress.org/', 'WordPress.org', 0, 0, 1)");41 VALUES (1, '".plugins_url( 'ab125.jpg', __FILE__ )."', 'http://wordpress.org/plugins/ad-buttons/', 'ads powered by Ad Buttons', 0, 0, 0), 42 (2, '".plugins_url( 'ab125.jpg', __FILE__ )."', 'http://wordpress.org/', 'WordPress.org', 0, 0, 1)"); 45 43 46 44 $table = "{$wpdb->prefix}ad_buttons_stats"; … … 265 263 266 264 if($widget_adbuttons_cfg['ab_yah']){ 267 $ab_plugindir = get_option('siteurl').'/'.PLUGINDIR.'/'.dirname(plugin_basename(__FILE__));268 265 if($widget_adbuttons_cfg['ab_yaht'] == 'url'){ 269 echo'<a href="'.$widget_adbuttons_cfg['ab_yahurl'].'" title="Advertise here"><img src="'. $ab_plugindir.'/your_ad_here.jpg" alt="Advertise here"></a>';266 echo'<a href="'.$widget_adbuttons_cfg['ab_yahurl'].'" title="Advertise here"><img src="'.plugins_url( 'your_ad_here.jpg', __FILE__ ).'" alt="Advertise here"></a>'; 270 267 } else { 271 echo'<a href="'.$wp_root.'/?page_id='.$widget_adbuttons_cfg['ab_yourad'].'" title="Advertise here"><img src="'. $ab_plugindir.'/your_ad_here.jpg" alt="Advertise here"></a>';268 echo'<a href="'.$wp_root.'/?page_id='.$widget_adbuttons_cfg['ab_yourad'].'" title="Advertise here"><img src="'.plugins_url( 'your_ad_here.jpg', __FILE__ ).'" alt="Advertise here"></a>'; 272 269 } 273 270 } … … 407 404 add_action("init", "adbuttons_getclick"); 408 405 406 add_filter('query_vars','plugin_add_trigger'); 407 function plugin_add_trigger($vars) { 408 $vars[] = 'ab_graph'; 409 return $vars; 410 } 411 412 add_action('template_redirect', 'ab_gen_graph'); 413 function ab_gen_graph() { 414 if(intval(get_query_var('ab_graph')) == 1) { 415 // png image generation code 416 include('adbuttonsstatsimg.php'); 417 exit; 418 } 419 } 409 420 ?> -
ad-buttons/tags/3.0/adbuttonsact.php
r1901350 r1911882 2 2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 3 3 global $wpdb; 4 $ab_plugindir = get_option('siteurl').'/'.PLUGINDIR.'/'.dirname(plugin_basename(__FILE__)); 4 5 5 $ol_flash = ''; 6 6 $htp = "http://"; … … 80 80 if (!empty($_POST['ab_link'])) { 81 81 if(substr($_POST['ab_link'], 0, 7) == $htp){ 82 $ab_link = $_POST['ab_link'];82 $ab_link = esc_url($_POST['ab_link']); 83 83 }elseif(substr($_POST['ab_link'], 0, 8) == $htps){ 84 $ab_link = $_POST['ab_link'];84 $ab_link = esc_url($_POST['ab_link']); 85 85 }else{ 86 $ab_link = $htp.$_POST['ab_link'];86 $ab_link = esc_url($htp.$_POST['ab_link']); 87 87 } 88 88 } -
ad-buttons/tags/3.0/adbuttonsadmin.php
r1901350 r1911882 54 54 $widget_adbuttons_cfg['ab_adsense_pubid'] = sanitize_text_field($_POST['ab_adsense_pubid']); 55 55 $widget_adbuttons_cfg['ab_adsense_channel'] = (int)$_POST['ab_adsense_channel']; 56 if (preg_match('/rc:\d{1,2}/', $_POST['ab_adsense_corners']) == 1) $widget_adbuttons_cfg['ab_adsense_corners'] = $_POST['ab_adsense_corners'];56 if (preg_match('/rc:\d{1,2}/', $_POST['ab_adsense_corners']) == 1) $widget_adbuttons_cfg['ab_adsense_corners'] = sanitize_text_field($_POST['ab_adsense_corners']); 57 57 $widget_adbuttons_cfg['ab_adsense_col_border'] = (int)hexdec(trim($_POST['ab_adsense_col_border'], "#")); 58 58 $widget_adbuttons_cfg['ab_adsense_col_title'] = (int)hexdec(trim($_POST['ab_adsense_col_title'], "#")); … … 67 67 $widget_adbuttons_cfg['ab_yah'] = (bool)$_POST['ab_yah']; 68 68 $widget_adbuttons_cfg['ab_yourad'] = (bool)$_POST['ab_yourad']; 69 $widget_adbuttons_cfg['ab_yaht'] = $_POST['ab_yaht'];70 $widget_adbuttons_cfg['ab_yahurl'] = $_POST['ab_yahurl'];69 $widget_adbuttons_cfg['ab_yaht'] = sanitize_text_field($_POST['ab_yaht']); 70 $widget_adbuttons_cfg['ab_yahurl'] = sanitize_text_field($_POST['ab_yahurl']); 71 71 $widget_adbuttons_cfg['ab_fix'] = (bool)$_POST['ab_fix']; 72 72 $widget_adbuttons_cfg['ab_count'] = (int)$_POST['ab_count']; … … 86 86 <?php 87 87 $widget_adbuttons_cfg = get_option('widget_adbuttons_cfg'); 88 $ab_plugindir = get_option('siteurl').'/'.PLUGINDIR.'/'.dirname(plugin_basename(__FILE__));88 $ab_plugindir = plugins_url( '', __FILE__ ); 89 89 90 90 echo'<script src="'.esc_html($ab_plugindir).'/color_functions.js"></script>'; ?> -
ad-buttons/tags/3.0/adbuttonsstats.php
r1901350 r1911882 3 3 4 4 global $wpdb; 5 $ab_plugindir = get_option('siteurl').'/'.PLUGINDIR.'/'.dirname(plugin_basename(__FILE__));6 5 7 6 if(isset($_GET['month'])){ … … 47 46 <a href="<?php echo esc_url( $nplink.'&month='.$prevdate ); ?>">previous month</a> 48 47 <a href="<?php echo esc_url( $nplink.'&month='.$nextdate ); ?>">next month</a> <br/> 49 <img src="<?php echo $ab_plugindir; ?>/adbuttonsstatsimg.php?graphdate=<?php echo $graphdate;?>">48 <img src="<?php echo site_url(); ?>/?ab_graph=1&graphdate=<?php echo $graphdate;?>"> 50 49 <br/> 51 50 <p>Bars represent ad views. The scale is shown on the left side. (Each ad is counted individually, so if you are -
ad-buttons/tags/3.0/adbuttonsstatsimg.php
r1901350 r1911882 1 1 <?php 2 3 require_once('../../../wp-blog-header.php'); 4 5 $ab_plugindir = get_option('siteurl').'/'.PLUGINDIR.'/'.dirname(plugin_basename(__FILE__)); 2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 3 4 global $wpdb; 6 5 7 6 if(isset($_GET['graphdate'])){ … … 232 231 $r_height = round($stat_values[$statdays[$count]]['views'] / $view_scale); 233 232 } 234 $r_y = 2 39- $r_height;233 $r_y = 241 - $r_height; 235 234 imagefilledrectangle($im, $r_x, $r_y, $r_x+$r_width, $r_y+$r_height, $lightblue); 236 235 }
Note: See TracChangeset
for help on using the changeset viewer.