Skip to content

Commit 073143d

Browse files
committed
update for the last adrotate version
1 parent b97b834 commit 073143d

File tree

8 files changed

+45
-70
lines changed

8 files changed

+45
-70
lines changed

admin/assets/tablesorter/asc.gif

-54 Bytes
Binary file not shown.

admin/assets/tablesorter/bg.gif

-64 Bytes
Binary file not shown.

admin/assets/tablesorter/desc.gif

-54 Bytes
Binary file not shown.

admin/assets/tablesorter/jquery.tablesorter.min.js

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/assets/tablesorter/style.css

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
/* tables */
2-
table.tablesorter thead tr .header {
3-
background-image: url(bg.gif);
4-
background-repeat: no-repeat;
1+
/* header */
2+
.tablesorter-default .header,
3+
.tablesorter-default .tablesorter-header {
4+
background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);
55
background-position: center right;
6+
background-repeat: no-repeat;
67
cursor: pointer;
8+
white-space: normal;
9+
min-width: 25px;
710
}
8-
table.tablesorter thead tr .headerSortUp {
9-
background-image: url(asc.gif);
10-
}
11-
table.tablesorter thead tr .headerSortDown {
12-
background-image: url(desc.gif);
11+
.tablesorter-default thead .headerSortUp,
12+
.tablesorter-default thead .tablesorter-headerSortUp,
13+
.tablesorter-default thead .tablesorter-headerAsc {
14+
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
1315
}
16+
.tablesorter-default thead .headerSortDown,
17+
.tablesorter-default thead .tablesorter-headerSortDown,
18+
.tablesorter-default thead .tablesorter-headerDesc {
19+
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
20+
}

admin/class-adrotate-extra-settings-admin.php

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,12 @@ private function __construct() {
7171
add_action( 'admin_head', array( $this, 'add_sortable' ) );
7272
}
7373
}
74-
} else if ( $_GET[ 'page' ] === 'adrotate-groups' ) {
74+
} else if ( $_GET[ 'page' ] === 'adrotate-groups' || $_GET[ 'page' ] === 'adrotate-schedules') {
7575
$setting = ( array ) get_option( $this->plugin_slug );
7676
if ( isset( $setting[ 'sortable' ] ) ) {
7777
add_action( 'admin_head', array( $this, 'add_sortable' ) );
7878
}
79-
} else if ( $_GET[ 'page' ] === 'adrotate-schedules' ) {
80-
$setting = ( array ) get_option( $this->plugin_slug );
81-
if ( isset( $setting[ 'sortable' ] ) ) {
82-
add_action( 'admin_head', array( $this, 'add_sortable' ) );
83-
}
84-
}
79+
}
8580
}
8681
}
8782

@@ -108,11 +103,6 @@ public static function get_instance() {
108103
* @since 1.0.0
109104
*/
110105
public function add_plugin_admin_menu() {
111-
112-
/*
113-
* Add a settings page for this plugin to the Adrotate menu.
114-
*/
115-
116106
$this->plugin_screen_hook_suffix = add_submenu_page( 'adrotate', __( 'Adrotate Extra Settings', $this->plugin_slug ), __( 'Extra Settings', $this->plugin_slug ), 'manage_options', $this->plugin_slug, array( $this, 'display_plugin_admin_page' ) );
117107
}
118108

@@ -150,10 +140,6 @@ function adrotate_extra_settings_form() {
150140
$this->plugin_slug, __( 'Tweak', $this->plugin_slug ), '__return_false', $this->plugin_slug
151141
);
152142

153-
// add_settings_field(
154-
// $this->plugin_slug . '_free_or_pro', __( 'Check if you use AdRotate Pro, uncheck if you use AdRotate', $this->plugin_slug ), array( $this, 'field_free_or_pro' ), $this->plugin_slug, $this->plugin_slug
155-
// );
156-
157143
add_settings_field(
158144
$this->plugin_slug . '_custom_examples', __( 'This add custom examples in the box for the ads.<br> One rule for line, empty for disable it', $this->plugin_slug ), array( $this, 'field_examples' ), $this->plugin_slug, $this->plugin_slug
159145
);
@@ -167,31 +153,16 @@ function adrotate_extra_settings_form() {
167153
);
168154

169155
add_settings_field(
170-
$this->plugin_slug . 'hide_geolocation', __( 'Hide geolocation section (only pro)', $this->plugin_slug ), array( $this, 'hide_geolocation' ), $this->plugin_slug, $this->plugin_slug
156+
$this->plugin_slug . 'hide_geolocation', __( 'Hide geolocation section', $this->plugin_slug ), array( $this, 'hide_geolocation' ), $this->plugin_slug, $this->plugin_slug
171157
);
172158

173159
add_settings_field(
174-
$this->plugin_slug . 'hide_timeframe', __( 'Hide timeframe section (only pro)', $this->plugin_slug ), array( $this, 'hide_timeframe' ), $this->plugin_slug, $this->plugin_slug
160+
$this->plugin_slug . 'hide_advanced', __( 'Hide advanced section', $this->plugin_slug ), array( $this, 'hide_advanced' ), $this->plugin_slug, $this->plugin_slug
175161
);
176162

177163
register_setting( $this->plugin_slug, $this->plugin_slug );
178164
}
179165

180-
/**
181-
* Check free or pro
182-
*
183-
* @since 1.0.0
184-
*/
185-
function field_free_or_pro() {
186-
$setting = ( array ) get_option( $this->plugin_slug );
187-
188-
if ( !isset( $setting[ 'pro' ] ) ) {
189-
$setting[ 'pro' ] = false;
190-
}
191-
192-
echo '<input type="checkbox" name="' . $this->plugin_slug . '[pro]" ' . checked( $setting[ 'pro' ], 'on', false ) . ' />';
193-
}
194-
195166
/**
196167
* Custom examples
197168
*
@@ -253,18 +224,18 @@ function hide_geolocation() {
253224
}
254225

255226
/**
256-
* Hide usage
227+
* Hide advanced
257228
*
258-
* @since 1.0.0
229+
* @since 1.1.0
259230
*/
260-
function hide_timeframe() {
231+
function hide_advanced() {
261232
$setting = ( array ) get_option( $this->plugin_slug );
262233

263-
if ( !isset( $setting[ 'hide_timeframe' ] ) ) {
264-
$setting[ 'hide_timeframe' ] = false;
234+
if ( !isset( $setting[ 'hide_advanced' ] ) ) {
235+
$setting[ 'hide_advanced' ] = false;
265236
}
266237

267-
echo '<input type="checkbox" name="' . $this->plugin_slug . '[hide_timeframe]" ' . checked( $setting[ 'hide_timeframe' ], 'on', false ) . ' />';
238+
echo '<input type="checkbox" name="' . $this->plugin_slug . '[hide_advanced]" ' . checked( $setting[ 'hide_advanced' ], 'on', false ) . ' />';
268239
}
269240

270241
/**
@@ -277,10 +248,8 @@ public function add_examples() {
277248
echo '<script>' . "\n";
278249
echo 'jQuery(function() {' . "\n";
279250
$setting[ 'examples' ] = explode( '\n', $setting[ 'examples' ] );
280-
$i = 4;
281251
foreach ( $setting[ 'examples' ] as $value ) {
282-
$i++;
283-
echo "jQuery('table.widefat:first a[onclick]:last').parent().parent().after('<p>" . $i . ". <em><a onclick=\"textatcursor(\'adrotate_bannercode\',\'" . htmlspecialchars( $value ) . "\');return false;\" href=\"#\">" . htmlspecialchars( $value ) . "</a></em></p>')\n";
252+
echo "jQuery('table.widefat:first tr:nth-child(2n) a[onclick]:last').parent().parent().after('<p><em><a onclick=\"textatcursor(\'adrotate_bannercode\',\'" . htmlspecialchars( $value ) . "\');return false;\" href=\"#\">" . htmlspecialchars( $value ) . "</a></em></p>')\n";
284253
}
285254
echo '});' . "\n";
286255
echo '</script>' . "\n";
@@ -297,8 +266,7 @@ public function add_sortable() {
297266
echo '<script src="' . plugins_url( 'assets/tablesorter/jquery.tablesorter.min.js', __FILE__ ) . '"></script>' . "\n";
298267
echo '<script>' . "\n";
299268
echo 'jQuery(function() {' . "\n";
300-
//if ( !isset( $setting[ 'pro' ] ) ) {
301-
echo 'jQuery("table.widefat:not(:last)").addClass("tablesorter").tablesorter();';
269+
echo 'jQuery("table.widefat:not(:last)").addClass("tablesorter").tablesorter();' . "\n";
302270
echo '});' . "\n";
303271
echo '</script>' . "\n";
304272
}
@@ -313,13 +281,13 @@ public function hide_section_js() {
313281
echo '<script>' . "\n";
314282
echo 'jQuery(function() {' . "\n";
315283
if ( isset( $setting[ 'hide_usage' ] ) ) {
316-
echo "jQuery('h3:contains(\"Usage\")').hide().next().hide().next().hide().next().hide();\n";
284+
echo "jQuery('h3:contains(\"Usage\")').hide().next().hide().next().hide().next().hide().next().hide().next().hide();\n";
317285
}
318286
if ( isset( $setting[ 'hide_geolocation' ] ) ) {
319-
echo "jQuery('h3:contains(\"Geo Location\")').hide().next().hide().next().hide();\n";
287+
echo "jQuery('h3:contains(\"Geo Targeting in AdRotate Pro\"), h3:contains(\"Geo Targeting\")').hide().next().hide().next().hide();\n";
320288
}
321-
if ( isset( $setting[ 'hide_timeframe' ] ) ) {
322-
echo "jQuery('h3:contains(\"Timeframe\")').hide().next().hide().next().hide().next().hide();\n";
289+
if ( isset( $setting[ 'hide_advanced' ] ) ) {
290+
echo "jQuery('h3:contains(\"Advanced\")').hide().next().hide().next().hide().next().hide();\n";
323291
}
324292
echo '});' . "\n";
325293
echo '</script>' . "\n";

adrotate-extra-settings.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@
88
* @author Daniele 'Mte90' Scasciafratte <[email protected]>
99
* @license GPL-2.0+
1010
* @link http://mte90.net
11-
* @copyright 2014
11+
* @copyright 2014-2016
1212
*
1313
* @wordpress-plugin
1414
* Plugin Name: Adrotate Extra Settings
1515
* Plugin URI: https://github.com/Mte90/AdRotate-Extra-Settings
1616
* Description: Ultra light plugin for Wordpress that add new tinys feature to AdRotate/AdRotate Pro
17-
* Version: 1.1.1
17+
* Version: 1.2.0
1818
* Author: Daniele 'Mte90' Scasciafratte
1919
* Author URI: http://mte90.net
2020
* Text Domain: adrotate-extra-settings
2121
* License: GPL-2.0+
2222
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
2323
* Domain Path: /languages
24-
* WordPress-Plugin-Boilerplate: v2.6.1
2524
*/
2625

2726
// If this file is called directly, abort.

readme.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
=== Adrotate Extra Settings ===
2-
Contributors: Mte90
2+
Contributors: codeat, Mte90
33
Donate link: http://mte90.net
44
Tags: adrotate, ad, banner, ads
5-
Requires at least: 3.8
6-
Tested up to: 4.0
7-
Stable tag: 1.1.1
5+
Requires at least: 4.4
6+
Tested up to: 4.2
7+
Stable tag: 1.2.0
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -18,12 +18,12 @@ For these small features is born this plugin:
1818

1919
* Custom Examples
2020
* Ads/Groups/Schedules Sortable (With jQuery TableSorter)
21-
* Hide section (Usage, Geolocation, Timeframe)
21+
* Hide section (Usage, Geolocation, Advanced)
2222
* Suggestion?
2323

2424
Github Repo: [https://github.com/Mte90/AdRotate-Extra-Settings](https://github.com/Mte90/AdRotate-Extra-Settings)
2525

26-
This plugin is not affiliated with the official AdRotate Free/Pro product
26+
This plugin is not affiliated with the official AdRotate Free/Pro product.
2727

2828
== Installation ==
2929

@@ -62,6 +62,9 @@ Yes
6262

6363
== Changelog ==
6464

65+
= 1.2.0 =
66+
* Update to the new AdRotate version
67+
6568
= 1.1.1 =
6669
* Little fix for older PHP version
6770

0 commit comments

Comments
 (0)