Version Description
FREE = * [new] Basic advert code generator * [fix] Unable to edit adverts with empty titles
Download this release
Release Info
Developer | adegans |
Plugin | AdRotate Banner Manager |
Version | 4.5 |
Comparing to | |
See all releases |
Code changes from version 4.4 to 4.5
- adrotate-functions.php +18 -21
- adrotate-manage-publisher.php +133 -2
- adrotate-output.php +6 -6
- adrotate-setup.php +16 -2
- adrotate.php +18 -13
- dashboard/info.php +2 -16
- dashboard/publisher/adverts-edit.php +11 -11
- dashboard/publisher/adverts-generator.php +133 -0
- dashboard/publisher/groups-edit.php +1 -1
- readme.txt +13 -34
adrotate-functions.php
CHANGED
@@ -369,7 +369,7 @@ function adrotate_prepare_evaluate_ads($return = true) {
|
|
369 |
global $wpdb;
|
370 |
|
371 |
// Fetch ads
|
372 |
-
$ads = $wpdb->get_results("SELECT `id` FROM `{$wpdb->prefix}adrotate` WHERE `type` != 'disabled' AND `type` != 'empty' ORDER BY `id` ASC;");
|
373 |
|
374 |
// Determine error states
|
375 |
$error = $expired = $expiressoon = $normal = $unknown = 0;
|
@@ -673,13 +673,10 @@ function adrotate_dashboard_styles() {
|
|
673 |
|
674 |
/*-------------------------------------------------------------
|
675 |
Name: adrotate_folder_contents
|
676 |
-
|
677 |
-
Purpose: List folder contents of /wp-content/banners and /wp-content/uploads
|
678 |
-
Receive: $current
|
679 |
-
Return: $output
|
680 |
Since: 0.4
|
681 |
-------------------------------------------------------------*/
|
682 |
-
function adrotate_folder_contents($current) {
|
683 |
global $wpdb, $adrotate_config;
|
684 |
|
685 |
$output = '';
|
@@ -696,23 +693,20 @@ function adrotate_folder_contents($current) {
|
|
696 |
}
|
697 |
}
|
698 |
closedir($handle);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
699 |
|
700 |
if($i > 0) {
|
701 |
sort($files);
|
702 |
foreach($files as $file) {
|
703 |
$fileinfo = pathinfo($file);
|
704 |
|
705 |
-
if(
|
706 |
-
(
|
707 |
-
strtolower($fileinfo['extension']) == "jpg"
|
708 |
-
OR strtolower($fileinfo['extension']) == "gif"
|
709 |
-
OR strtolower($fileinfo['extension']) == "png"
|
710 |
-
OR strtolower($fileinfo['extension']) == "jpeg"
|
711 |
-
OR strtolower($fileinfo['extension']) == "swf"
|
712 |
-
OR strtolower($fileinfo['extension']) == "flv"
|
713 |
-
OR strtolower($fileinfo['extension']) == "html"
|
714 |
-
)
|
715 |
-
) {
|
716 |
$output .= "<option value='".$file."'";
|
717 |
if(($current == WP_CONTENT_URL.'/banners/'.$file) OR ($current == WP_CONTENT_URL."/%folder%/".$file)) { $output .= "selected"; }
|
718 |
$output .= ">".$file."</option>";
|
@@ -741,11 +735,10 @@ function adrotate_return($page, $status, $args = null) {
|
|
741 |
$arguments = wp_parse_args($args, $defaults);
|
742 |
$redirect = 'admin.php?page=' . $page . '&'.http_build_query($arguments);
|
743 |
} else {
|
744 |
-
$redirect = 'admin.php?page=adrotate';
|
745 |
}
|
746 |
|
747 |
wp_redirect($redirect);
|
748 |
-
exit;
|
749 |
}
|
750 |
|
751 |
/*-------------------------------------------------------------
|
@@ -801,7 +794,11 @@ function adrotate_status($status, $args = null) {
|
|
801 |
break;
|
802 |
|
803 |
case '215' :
|
804 |
-
echo '<div id="message" class="updated"><p>'. __('Export created', 'adrotate
|
|
|
|
|
|
|
|
|
805 |
break;
|
806 |
|
807 |
// Settings
|
@@ -822,7 +819,7 @@ function adrotate_status($status, $args = null) {
|
|
822 |
break;
|
823 |
|
824 |
case '406' :
|
825 |
-
echo '<div id="message" class="updated"><p>'. __('Cleanup complete', 'adrotate
|
826 |
break;
|
827 |
|
828 |
// (all) Error messages
|
369 |
global $wpdb;
|
370 |
|
371 |
// Fetch ads
|
372 |
+
$ads = $wpdb->get_results("SELECT `id` FROM `{$wpdb->prefix}adrotate` WHERE `type` != 'disabled' AND `type` != 'generator' AND `type` != 'empty' ORDER BY `id` ASC;");
|
373 |
|
374 |
// Determine error states
|
375 |
$error = $expired = $expiressoon = $normal = $unknown = 0;
|
673 |
|
674 |
/*-------------------------------------------------------------
|
675 |
Name: adrotate_folder_contents
|
676 |
+
Purpose: List folder contents of /wp-content/banners
|
|
|
|
|
|
|
677 |
Since: 0.4
|
678 |
-------------------------------------------------------------*/
|
679 |
+
function adrotate_folder_contents($current, $kind = 'all') {
|
680 |
global $wpdb, $adrotate_config;
|
681 |
|
682 |
$output = '';
|
693 |
}
|
694 |
}
|
695 |
closedir($handle);
|
696 |
+
if($kind == "image") {
|
697 |
+
$extensions = array('jpg', 'jpeg', 'gif', 'png');
|
698 |
+
} else if($kind == "html5") {
|
699 |
+
$extensions = array('swf', 'flv', 'html', 'htm');
|
700 |
+
} else {
|
701 |
+
$extensions = array('jpg', 'jpeg', 'gif', 'png', 'swf', 'flv', 'html', 'htm');
|
702 |
+
}
|
703 |
|
704 |
if($i > 0) {
|
705 |
sort($files);
|
706 |
foreach($files as $file) {
|
707 |
$fileinfo = pathinfo($file);
|
708 |
|
709 |
+
if(in_array($fileinfo['extension'], $extensions)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
710 |
$output .= "<option value='".$file."'";
|
711 |
if(($current == WP_CONTENT_URL.'/banners/'.$file) OR ($current == WP_CONTENT_URL."/%folder%/".$file)) { $output .= "selected"; }
|
712 |
$output .= ">".$file."</option>";
|
735 |
$arguments = wp_parse_args($args, $defaults);
|
736 |
$redirect = 'admin.php?page=' . $page . '&'.http_build_query($arguments);
|
737 |
} else {
|
738 |
+
$redirect = 'admin.php?page=adrotate&status=1'; // Unexpected error
|
739 |
}
|
740 |
|
741 |
wp_redirect($redirect);
|
|
|
742 |
}
|
743 |
|
744 |
/*-------------------------------------------------------------
|
794 |
break;
|
795 |
|
796 |
case '215' :
|
797 |
+
echo '<div id="message" class="updated"><p>'. __('Export created', 'adrotate') .'. <a href="' . WP_CONTENT_URL . '/reports/'.$arguments['file'].'">Download</a>.</p></div>';
|
798 |
+
break;
|
799 |
+
|
800 |
+
case '226' :
|
801 |
+
echo '<div id="message" class="updated"><p>'. __('Advert HTML generated and placed in the AdCode field. Configure your advert below.', 'adrotate') .'</div>';
|
802 |
break;
|
803 |
|
804 |
// Settings
|
819 |
break;
|
820 |
|
821 |
case '406' :
|
822 |
+
echo '<div id="message" class="updated"><p>'. __('Cleanup complete', 'adrotate') .'</p></div>';
|
823 |
break;
|
824 |
|
825 |
// (all) Error messages
|
adrotate-manage-publisher.php
CHANGED
@@ -9,6 +9,138 @@
|
|
9 |
* liability that might arise from it's use.
|
10 |
------------------------------------------------------------------------------------ */
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
/*-------------------------------------------------------------
|
13 |
Name: adrotate_insert_input
|
14 |
Purpose: Prepare input form on saving new or updated banners
|
@@ -48,7 +180,7 @@ function adrotate_insert_input() {
|
|
48 |
if(isset($_POST['adrotate_maxshown'])) $maxshown = strip_tags(trim($_POST['adrotate_maxshown'], "\t\n "));
|
49 |
|
50 |
// Advanced options
|
51 |
-
$advertiser = $image_field = $image_dropdown = $tracker = '';
|
52 |
if(isset($_POST['adrotate_advertiser'])) $advertiser = 0;
|
53 |
if(isset($_POST['adrotate_image'])) $image_field = strip_tags(trim($_POST['adrotate_image'], "\t\n "));
|
54 |
if(isset($_POST['adrotate_image_dropdown'])) $image_dropdown = strip_tags(trim($_POST['adrotate_image_dropdown'], "\t\n "));
|
@@ -109,7 +241,6 @@ function adrotate_insert_input() {
|
|
109 |
if(strlen($maxclicks) < 1 OR !is_numeric($maxclicks)) $maxclicks = 0;
|
110 |
if(strlen($maxshown) < 1 OR !is_numeric($maxshown)) $maxshown = 0;
|
111 |
|
112 |
-
// Set tracker value
|
113 |
if(isset($tracker) AND strlen($tracker) != 0) $tracker = 'Y';
|
114 |
else $tracker = 'N';
|
115 |
|
9 |
* liability that might arise from it's use.
|
10 |
------------------------------------------------------------------------------------ */
|
11 |
|
12 |
+
/*-------------------------------------------------------------
|
13 |
+
Name: adrotate_generate_input
|
14 |
+
Purpose: GEnerate advert code based on user input
|
15 |
+
Since: 4.5
|
16 |
+
-------------------------------------------------------------*/
|
17 |
+
function adrotate_generate_input() {
|
18 |
+
global $wpdb, $adrotate_config;
|
19 |
+
|
20 |
+
if(wp_verify_nonce($_POST['adrotate_nonce'], 'adrotate_generate_ad')) {
|
21 |
+
// Mandatory
|
22 |
+
$id = '';
|
23 |
+
if(isset($_POST['adrotate_id'])) $id = $_POST['adrotate_id'];
|
24 |
+
|
25 |
+
// Basic advert
|
26 |
+
$advert_text = $targeturl = $new_window = $nofollow = $basic_field = $basic_dropdown = $adwidth = $adheight = '';
|
27 |
+
if(isset($_POST['adrotate_text'])) $advert_text = strip_tags(trim($_POST['adrotate_text'], "\t\n "));
|
28 |
+
if(isset($_POST['adrotate_targeturl'])) $targeturl = strip_tags(trim($_POST['adrotate_targeturl'], "\t\n "));
|
29 |
+
if(isset($_POST['adrotate_newwindow'])) $new_window = strip_tags(trim($_POST['adrotate_newwindow'], "\t\n "));
|
30 |
+
if(isset($_POST['adrotate_nofollow'])) $nofollow = strip_tags(trim($_POST['adrotate_nofollow'], "\t\n "));
|
31 |
+
if(isset($_POST['adrotate_image'])) $basic_field = strip_tags(trim($_POST['adrotate_image'], "\t\n "));
|
32 |
+
if(isset($_POST['adrotate_basic_dropdown'])) $basic_dropdown = strip_tags(trim($_POST['adrotate_basic_dropdown'], "\t\n "));
|
33 |
+
if(isset($_POST['adrotate_width'])) $adwidth = strip_tags(trim($_POST['adrotate_width'], "\t\n "));
|
34 |
+
if(isset($_POST['adrotate_height'])) $adheight = strip_tags(trim($_POST['adrotate_height'], "\t\n "));
|
35 |
+
|
36 |
+
// HTML5/Flash advert
|
37 |
+
$html5_dropdown = $$html5_adwidth = $html5_adheight = $html5_clicktag = $html5_targeturl = '';
|
38 |
+
if(isset($_POST['adrotate_html5_dropdown'])) $html5_dropdown = strip_tags(trim($_POST['adrotate_html5_dropdown'], "\t\n "));
|
39 |
+
if(isset($_POST['adrotate_html5_width'])) $html5_adwidth = strip_tags(trim($_POST['adrotate_html5_width'], "\t\n "));
|
40 |
+
if(isset($_POST['adrotate_html5_height'])) $html5_adheight = strip_tags(trim($_POST['adrotate_html5_height'], "\t\n "));
|
41 |
+
if(isset($_POST['adrotate_html5_clicktag'])) $html5_clicktag = strip_tags(trim($_POST['adrotate_html5_clicktag'], "\t\n "));
|
42 |
+
if(isset($_POST['adrotate_html5_targeturl'])) $html5_targeturl = strip_tags(trim(strtolower($_POST['adrotate_html5_targeturl']), "\t\n "));
|
43 |
+
|
44 |
+
if(current_user_can('adrotate_ad_manage')) {
|
45 |
+
// Basic Advert
|
46 |
+
if(strlen($targeturl) > 0) {
|
47 |
+
// Sort out adwidth and adheight
|
48 |
+
if((is_numeric($adwidth) AND $adwidth < 1 OR $adwidth > 9999) OR $adwidth == '' OR !is_numeric($adwidth)) {
|
49 |
+
$adwidth = '';
|
50 |
+
} else {
|
51 |
+
$adwidth = ' width="'.$adwidth.'"';
|
52 |
+
}
|
53 |
+
if((is_numeric($adheight) AND $adheight < 1 OR $adheight > 9999) OR $adheight == '' OR !is_numeric($adheight)) {
|
54 |
+
$adheight = '';
|
55 |
+
} else {
|
56 |
+
$adheight = ' height="'.$adheight.'"';
|
57 |
+
}
|
58 |
+
|
59 |
+
// Determine image settings ($basic_field has priority!)
|
60 |
+
if(strlen($basic_field) > 1) {
|
61 |
+
$imagetype = "field";
|
62 |
+
$image = $basic_field;
|
63 |
+
$asset = "<img src=\"%asset%\"".$adwidth.$adheight." />";
|
64 |
+
} else if(strlen($basic_dropdown) > 1) {
|
65 |
+
$imagetype = "dropdown";
|
66 |
+
$image = WP_CONTENT_URL."/%folder%/".$basic_dropdown;
|
67 |
+
$asset = "<img src=\"%asset%\"".$adwidth.$adheight." />";
|
68 |
+
} else {
|
69 |
+
$imagetype = $image = "";
|
70 |
+
$asset = $advert_text; // Text advert
|
71 |
+
}
|
72 |
+
|
73 |
+
// Open in a new window?
|
74 |
+
if(isset($new_window) AND strlen($new_window) != 0) {
|
75 |
+
$new_window = ' target="_blank"';
|
76 |
+
} else {
|
77 |
+
$new_window = '';
|
78 |
+
}
|
79 |
+
|
80 |
+
// Set nofollow?
|
81 |
+
if(isset($nofollow) AND strlen($nofollow) != 0) {
|
82 |
+
$nofollow = ' rel="nofollow"';
|
83 |
+
} else {
|
84 |
+
$nofollow = '';
|
85 |
+
}
|
86 |
+
|
87 |
+
// Generate code
|
88 |
+
$bannercode = "<a href=\"".$targeturl."\"".$new_window.$nofollow.">".$asset."</a>";
|
89 |
+
}
|
90 |
+
|
91 |
+
// HTML5/FLASH advert
|
92 |
+
if(strlen($html5_dropdown) > 0) {
|
93 |
+
$imagetype = "dropdown";
|
94 |
+
$image = WP_CONTENT_URL."/%folder%/".$html5_dropdown;
|
95 |
+
|
96 |
+
// Sort out adwidth and adheight
|
97 |
+
if((is_numeric($html5_adwidth) AND $html5_adwidth < 1 OR $html5_adwidth > 9999) OR $html5_adwidth == '' OR !is_numeric($html5_adwidth)) {
|
98 |
+
$adwidth = '728';
|
99 |
+
} else {
|
100 |
+
$adwidth = $html5_adwidth;
|
101 |
+
}
|
102 |
+
if((is_numeric($html5_adheight) AND $html5_adheight < 1 OR $html5_adheight > 9999) OR $html5_adheight == '' OR !is_numeric($html5_adheight)) {
|
103 |
+
$adheight = '90';
|
104 |
+
} else {
|
105 |
+
$adheight = $html5_adheight;
|
106 |
+
}
|
107 |
+
|
108 |
+
// Set clickTAG?
|
109 |
+
if(isset($html5_clicktag) AND strlen($html5_targeturl) > 10) {
|
110 |
+
$clicktag = '?'.$html5_clicktag.'='.$html5_targeturl;
|
111 |
+
} else {
|
112 |
+
$clicktag = '';
|
113 |
+
}
|
114 |
+
|
115 |
+
// Determine advert type
|
116 |
+
$extension = explode(".", $html5_dropdown);
|
117 |
+
$extension = end($extension);
|
118 |
+
|
119 |
+
// Generate HTML5 code
|
120 |
+
if($extension == "html" OR $extension == "htm") {
|
121 |
+
$bannercode = "<iframe src=\"%asset%\" width=\"".$html5_adwidth."\" height=\"".$html5_adheight."\" frameborder=\"0\" style=\"border:none;\"></iframe>";
|
122 |
+
}
|
123 |
+
|
124 |
+
// Generate Flash advert
|
125 |
+
if($extension == "flv" OR $extension == "swf") {
|
126 |
+
$bannercode = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\" width=\"".$adwidth."\" height=\"".$adheight."\" id=\"ajdg-flash-".$id."\"><param name=\"movie\" value=\"%asset%\"><param name=\"quality\" value=\"high\"><embed src=\"%asset%".$clicktag."\" quality=\"high\" width=\"".$adwidth."\" height=\"".$adheight."\" name=\"ajdg-flash-".$id."\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object>";
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
// Save the ad to the DB
|
131 |
+
$wpdb->update($wpdb->prefix.'adrotate', array('bannercode' => $bannercode, 'imagetype' => $imagetype, 'image' => $image), array('id' => $id));
|
132 |
+
|
133 |
+
adrotate_return('adrotate-ads', 226, array('view' => 'edit', 'ad'=> $id));
|
134 |
+
exit;
|
135 |
+
} else {
|
136 |
+
adrotate_return('adrotate-ads', 500);
|
137 |
+
}
|
138 |
+
} else {
|
139 |
+
adrotate_nonce_error();
|
140 |
+
exit;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
/*-------------------------------------------------------------
|
145 |
Name: adrotate_insert_input
|
146 |
Purpose: Prepare input form on saving new or updated banners
|
180 |
if(isset($_POST['adrotate_maxshown'])) $maxshown = strip_tags(trim($_POST['adrotate_maxshown'], "\t\n "));
|
181 |
|
182 |
// Advanced options
|
183 |
+
$advertiser = $image_field = $image_dropdown = $tracker = $show_everyone = '';
|
184 |
if(isset($_POST['adrotate_advertiser'])) $advertiser = 0;
|
185 |
if(isset($_POST['adrotate_image'])) $image_field = strip_tags(trim($_POST['adrotate_image'], "\t\n "));
|
186 |
if(isset($_POST['adrotate_image_dropdown'])) $image_dropdown = strip_tags(trim($_POST['adrotate_image_dropdown'], "\t\n "));
|
241 |
if(strlen($maxclicks) < 1 OR !is_numeric($maxclicks)) $maxclicks = 0;
|
242 |
if(strlen($maxshown) < 1 OR !is_numeric($maxshown)) $maxshown = 0;
|
243 |
|
|
|
244 |
if(isset($tracker) AND strlen($tracker) != 0) $tracker = 'Y';
|
245 |
else $tracker = 'N';
|
246 |
|
adrotate-output.php
CHANGED
@@ -625,27 +625,27 @@ function adrotate_dashboard_error() {
|
|
625 |
$adrotate_notifications = get_option("adrotate_notifications");
|
626 |
if($adrotate_notifications['notification_dash'] == "Y") {
|
627 |
if($status['expired'] > 0 AND $adrotate_notifications['notification_dash_expired'] == "Y") {
|
628 |
-
$error['advert_expired'] = sprintf(_n('One advert is expired.', '%1$s adverts expired!', $status['expired'], 'adrotate-pro'), $status['expired']).' <a href="'.admin_url('admin.php?page=adrotate-ads').'">'.__('Check adverts', 'adrotate
|
629 |
}
|
630 |
if($status['expiressoon'] > 0 AND $adrotate_notifications['notification_dash_soon'] == "Y") {
|
631 |
-
$error['advert_soon'] = sprintf(_n('One advert expires soon.', '%1$s adverts are almost expiring!', $status['expiressoon'], 'adrotate-pro'), $status['expiressoon']).' <a href="'.admin_url('admin.php?page=adrotate-ads').'">'.__('Check adverts', 'adrotate
|
632 |
}
|
633 |
}
|
634 |
if($status['error'] > 0) {
|
635 |
-
$error['advert_config'] = sprintf(_n('One advert with configuration errors.', '%1$s adverts have configuration errors!', $status['error'], 'adrotate-pro'), $status['error']).' <a href="'.admin_url('admin.php?page=adrotate-ads').'">'.__('Check adverts', 'adrotate
|
636 |
}
|
637 |
|
638 |
// Caching
|
639 |
if($adrotate_config['w3caching'] == "Y" AND !is_plugin_active('w3-total-cache/w3-total-cache.php')) {
|
640 |
-
$error['w3tc_not_active'] = __('You have enable caching support but W3 Total Cache is not active on your site!', 'adrotate
|
641 |
}
|
642 |
if($adrotate_config['w3caching'] == "Y" AND !defined('W3TC_DYNAMIC_SECURITY')) {
|
643 |
-
$error['w3tc_no_hash'] = __('You have enable caching support but the W3TC_DYNAMIC_SECURITY definition is not set.', 'adrotate
|
644 |
}
|
645 |
|
646 |
// Misc
|
647 |
if(!is_writable(WP_CONTENT_DIR."/".$adrotate_config['banner_folder'])) {
|
648 |
-
$error['banners_folder'] = __('Your AdRotate Banner folder is not writable or does not exist.', 'adrotate
|
649 |
}
|
650 |
|
651 |
$error = (isset($error) AND is_array($error)) ? $error : false;
|
625 |
$adrotate_notifications = get_option("adrotate_notifications");
|
626 |
if($adrotate_notifications['notification_dash'] == "Y") {
|
627 |
if($status['expired'] > 0 AND $adrotate_notifications['notification_dash_expired'] == "Y") {
|
628 |
+
$error['advert_expired'] = sprintf(_n('One advert is expired.', '%1$s adverts expired!', $status['expired'], 'adrotate-pro'), $status['expired']).' <a href="'.admin_url('admin.php?page=adrotate-ads').'">'.__('Check adverts', 'adrotate').'</a>!';
|
629 |
}
|
630 |
if($status['expiressoon'] > 0 AND $adrotate_notifications['notification_dash_soon'] == "Y") {
|
631 |
+
$error['advert_soon'] = sprintf(_n('One advert expires soon.', '%1$s adverts are almost expiring!', $status['expiressoon'], 'adrotate-pro'), $status['expiressoon']).' <a href="'.admin_url('admin.php?page=adrotate-ads').'">'.__('Check adverts', 'adrotate').'</a>!';
|
632 |
}
|
633 |
}
|
634 |
if($status['error'] > 0) {
|
635 |
+
$error['advert_config'] = sprintf(_n('One advert with configuration errors.', '%1$s adverts have configuration errors!', $status['error'], 'adrotate-pro'), $status['error']).' <a href="'.admin_url('admin.php?page=adrotate-ads').'">'.__('Check adverts', 'adrotate').'</a>!';
|
636 |
}
|
637 |
|
638 |
// Caching
|
639 |
if($adrotate_config['w3caching'] == "Y" AND !is_plugin_active('w3-total-cache/w3-total-cache.php')) {
|
640 |
+
$error['w3tc_not_active'] = __('You have enable caching support but W3 Total Cache is not active on your site!', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">Disable Caching Support</a> or <a href="'.admin_url('/plugins.php').'">Enable W3 Total Cache</a>.';
|
641 |
}
|
642 |
if($adrotate_config['w3caching'] == "Y" AND !defined('W3TC_DYNAMIC_SECURITY')) {
|
643 |
+
$error['w3tc_no_hash'] = __('You have enable caching support but the W3TC_DYNAMIC_SECURITY definition is not set.', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">How to configure W3 Total Cache</a>.';
|
644 |
}
|
645 |
|
646 |
// Misc
|
647 |
if(!is_writable(WP_CONTENT_DIR."/".$adrotate_config['banner_folder'])) {
|
648 |
+
$error['banners_folder'] = __('Your AdRotate Banner folder is not writable or does not exist.', 'adrotate').' <a href="https://ajdg.solutions/manuals/adrotate-manuals/manage-banner-images/?utm_campaign=adrotate-manual&utm_medium=dashboard-notification&utm_source=adrotate-free" target="_blank">Set up your banner folder</a>.';
|
649 |
}
|
650 |
|
651 |
$error = (isset($error) AND is_array($error)) ? $error : false;
|
adrotate-setup.php
CHANGED
@@ -346,7 +346,7 @@ function adrotate_dummy_data() {
|
|
346 |
|
347 |
if(is_null($no_ads) AND is_null($no_schedules) AND is_null($no_linkmeta)) {
|
348 |
// Demo ad 1
|
349 |
-
$wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo ad 468x60', 'bannercode' => '<a href=\"http:\/\/www.adrotateforwordpress.com\"><img src=\"http://ajdg.solutions/assets/dummy-banners/adrotate-468x60.jpg\" /></a>', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'paid' => 'U', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
|
350 |
$ad_id = $wpdb->insert_id;
|
351 |
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
|
352 |
$schedule_id = $wpdb->insert_id;
|
@@ -354,7 +354,7 @@ function adrotate_dummy_data() {
|
|
354 |
unset($ad_id, $schedule_id);
|
355 |
|
356 |
// Demo ad 2
|
357 |
-
$wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo ad 200x200', 'bannercode' => '<a href=\"http:\/\/www.adrotateforwordpress.com\"><img src=\"http://ajdg.solutions/assets/dummy-banners/adrotate-200x200.jpg\" /></a>', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'paid' => 'U', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
|
358 |
$ad_id = $wpdb->insert_id;
|
359 |
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
|
360 |
$schedule_id = $wpdb->insert_id;
|
@@ -407,6 +407,7 @@ function adrotate_database_install() {
|
|
407 |
`image` varchar(255) NOT NULL,
|
408 |
`paid` char(1) NOT NULL default 'U',
|
409 |
`tracker` char(1) NOT NULL default 'N',
|
|
|
410 |
`desktop` char(1) NOT NULL default 'Y',
|
411 |
`mobile` char(1) NOT NULL default 'Y',
|
412 |
`tablet` char(1) NOT NULL default 'Y',
|
@@ -452,6 +453,7 @@ function adrotate_database_install() {
|
|
452 |
`adwidth` varchar(6) NOT NULL DEFAULT '125',
|
453 |
`adheight` varchar(6) NOT NULL DEFAULT '125',
|
454 |
`adspeed` int(5) NOT NULL DEFAULT '6000',
|
|
|
455 |
PRIMARY KEY (`id`)
|
456 |
) ".$charset_collate.$engine.";");
|
457 |
}
|
@@ -952,6 +954,13 @@ function adrotate_database_upgrade() {
|
|
952 |
adrotate_add_column("{$wpdb->prefix}adrotate_schedule", 'autodelete', 'char(1) NOT NULL default \'N\' AFTER `day_sun`');
|
953 |
}
|
954 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
955 |
update_option("adrotate_db_version", array('current' => ADROTATE_DB_VERSION, 'previous' => $adrotate_db_version['current']));
|
956 |
}
|
957 |
|
@@ -1150,6 +1159,11 @@ function adrotate_core_upgrade() {
|
|
1150 |
update_option('adrotate_config', $config390);
|
1151 |
}
|
1152 |
|
|
|
|
|
|
|
|
|
|
|
1153 |
update_option("adrotate_version", array('current' => ADROTATE_VERSION, 'previous' => $adrotate_version['current']));
|
1154 |
}
|
1155 |
|
346 |
|
347 |
if(is_null($no_ads) AND is_null($no_schedules) AND is_null($no_linkmeta)) {
|
348 |
// Demo ad 1
|
349 |
+
$wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo ad 468x60', 'bannercode' => '<a href=\"http:\/\/www.adrotateforwordpress.com\"><img src=\"http://ajdg.solutions/assets/dummy-banners/adrotate-468x60.jpg\" /></a>', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'paid' => 'U', 'tracker' => 'N', 'show_everyone' => 'Y', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
|
350 |
$ad_id = $wpdb->insert_id;
|
351 |
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
|
352 |
$schedule_id = $wpdb->insert_id;
|
354 |
unset($ad_id, $schedule_id);
|
355 |
|
356 |
// Demo ad 2
|
357 |
+
$wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo ad 200x200', 'bannercode' => '<a href=\"http:\/\/www.adrotateforwordpress.com\"><img src=\"http://ajdg.solutions/assets/dummy-banners/adrotate-200x200.jpg\" /></a>', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'paid' => 'U', 'tracker' => 'N', 'show_everyone' => 'Y', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
|
358 |
$ad_id = $wpdb->insert_id;
|
359 |
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
|
360 |
$schedule_id = $wpdb->insert_id;
|
407 |
`image` varchar(255) NOT NULL,
|
408 |
`paid` char(1) NOT NULL default 'U',
|
409 |
`tracker` char(1) NOT NULL default 'N',
|
410 |
+
`show_everyone` char(1) NOT NULL default 'Y',
|
411 |
`desktop` char(1) NOT NULL default 'Y',
|
412 |
`mobile` char(1) NOT NULL default 'Y',
|
413 |
`tablet` char(1) NOT NULL default 'Y',
|
453 |
`adwidth` varchar(6) NOT NULL DEFAULT '125',
|
454 |
`adheight` varchar(6) NOT NULL DEFAULT '125',
|
455 |
`adspeed` int(5) NOT NULL DEFAULT '6000',
|
456 |
+
`repeat_impressions` char(1) NOT NULL default 'Y',
|
457 |
PRIMARY KEY (`id`)
|
458 |
) ".$charset_collate.$engine.";");
|
459 |
}
|
954 |
adrotate_add_column("{$wpdb->prefix}adrotate_schedule", 'autodelete', 'char(1) NOT NULL default \'N\' AFTER `day_sun`');
|
955 |
}
|
956 |
|
957 |
+
// Database: 64
|
958 |
+
// AdRotate: 4.5
|
959 |
+
if($adrotate_db_version['current'] < 64) {
|
960 |
+
adrotate_add_column("{$wpdb->prefix}adrotate", 'show_everyone', 'char(1) NOT NULL default \'Y\' AFTER `tracker`');
|
961 |
+
adrotate_add_column("{$wpdb->prefix}adrotate_groups", 'repeat_impressions', 'char(1) NOT NULL default \'Y\' AFTER `adspeed`');
|
962 |
+
}
|
963 |
+
|
964 |
update_option("adrotate_db_version", array('current' => ADROTATE_DB_VERSION, 'previous' => $adrotate_db_version['current']));
|
965 |
}
|
966 |
|
1159 |
update_option('adrotate_config', $config390);
|
1160 |
}
|
1161 |
|
1162 |
+
// 4.5
|
1163 |
+
if($adrotate_version['current'] < 391) {
|
1164 |
+
if(get_option('adrotate_hide_banner') == 1) update_option('adrotate_hide_banner', adrotate_now());
|
1165 |
+
}
|
1166 |
+
|
1167 |
update_option("adrotate_version", array('current' => ADROTATE_VERSION, 'previous' => $adrotate_version['current']));
|
1168 |
}
|
1169 |
|
adrotate.php
CHANGED
@@ -4,10 +4,10 @@ Plugin Name: AdRotate
|
|
4 |
Plugin URI: https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=plugin-info&utm_source=adrotate-free
|
5 |
Author: Arnan de Gans
|
6 |
Author URI: http://ajdg.solutions/?utm_campaign=homepage&utm_medium=plugin-info&utm_source=adrotate-free
|
7 |
-
Description:
|
8 |
Text Domain: adrotate
|
9 |
Domain Path: /languages/
|
10 |
-
Version: 4.
|
11 |
License: GPLv3
|
12 |
*/
|
13 |
|
@@ -22,9 +22,9 @@ License: GPLv3
|
|
22 |
------------------------------------------------------------------------------------ */
|
23 |
|
24 |
/*--- AdRotate values ---------------------------------------*/
|
25 |
-
define("ADROTATE_DISPLAY", '4.
|
26 |
-
define("ADROTATE_VERSION",
|
27 |
-
define("ADROTATE_DB_VERSION",
|
28 |
$plugin_folder = plugin_dir_path(__FILE__);
|
29 |
/*-----------------------------------------------------------*/
|
30 |
|
@@ -79,6 +79,7 @@ if(is_admin()) {
|
|
79 |
add_action("admin_print_styles", 'adrotate_dashboard_styles');
|
80 |
add_action('admin_notices','adrotate_notifications_dashboard');
|
81 |
/*--- Internal redirects ------------------------------------*/
|
|
|
82 |
if(isset($_POST['adrotate_ad_submit'])) add_action('init', 'adrotate_insert_input');
|
83 |
if(isset($_POST['adrotate_group_submit'])) add_action('init', 'adrotate_insert_group');
|
84 |
if(isset($_POST['adrotate_action_submit'])) add_action('init', 'adrotate_request_action');
|
@@ -96,10 +97,9 @@ if(is_admin()) {
|
|
96 |
Purpose: Add pages to admin menus
|
97 |
-------------------------------------------------------------*/
|
98 |
function adrotate_dashboard() {
|
99 |
-
|
100 |
|
101 |
-
|
102 |
-
$adrotate_page = add_menu_page('AdRotate', 'AdRotate', 'adrotate_ad_manage', 'adrotate', 'adrotate_info', plugins_url('/images/icon-menu.png', __FILE__), '25.8');
|
103 |
$adrotate_page = add_submenu_page('adrotate', 'AdRotate · '.__('General Info', 'adrotate'), __('General Info', 'adrotate'), 'adrotate_ad_manage', 'adrotate', 'adrotate_info');
|
104 |
$adrotate_pro = add_submenu_page('adrotate', 'AdRotate · '.__('AdRotate Pro', 'adrotate'), __('AdRotate Pro', 'adrotate'), 'adrotate_ad_manage', 'adrotate-pro', 'adrotate_pro');
|
105 |
$adrotate_adverts = add_submenu_page('adrotate', 'AdRotate · '.__('Adverts', 'adrotate'), __('Adverts', 'adrotate'), 'adrotate_ad_manage', 'adrotate-ads', 'adrotate_manage');
|
@@ -197,11 +197,13 @@ function adrotate_manage() {
|
|
197 |
if($type == 'active' AND $stoptime <= $in7days) $type = '7days';
|
198 |
if($type == 'active' AND $stoptime <= $in2days) $type = '2days';
|
199 |
if($type == 'active' AND $stoptime <= $now) $type = 'expired';
|
|
|
|
|
200 |
|
201 |
if($type == 'active' OR $type == '7days') {
|
202 |
$active[$singlebanner->id] = array(
|
203 |
'id' => $singlebanner->id,
|
204 |
-
'title' => $
|
205 |
'type' => $type,
|
206 |
'tracker' => $singlebanner->tracker,
|
207 |
'weight' => $singlebanner->weight,
|
@@ -213,7 +215,7 @@ function adrotate_manage() {
|
|
213 |
if($type == 'error' OR $type == 'expired' OR $type == '2days') {
|
214 |
$error[$singlebanner->id] = array(
|
215 |
'id' => $singlebanner->id,
|
216 |
-
'title' => $
|
217 |
'type' => $type,
|
218 |
'tracker' => $singlebanner->tracker,
|
219 |
'weight' => $singlebanner->weight,
|
@@ -225,7 +227,7 @@ function adrotate_manage() {
|
|
225 |
if($type == 'disabled') {
|
226 |
$disabled[$singlebanner->id] = array(
|
227 |
'id' => $singlebanner->id,
|
228 |
-
'title' => $
|
229 |
'type' => $type,
|
230 |
'tracker' => $singlebanner->tracker,
|
231 |
'weight' => $singlebanner->weight,
|
@@ -238,8 +240,9 @@ function adrotate_manage() {
|
|
238 |
|
239 |
<div class="tablenav">
|
240 |
<div class="alignleft actions">
|
241 |
-
<a class="row-title" href="<?php echo admin_url('/admin.php?page=adrotate-ads
|
242 |
-
|
|
|
243 |
</div>
|
244 |
</div>
|
245 |
|
@@ -258,6 +261,8 @@ function adrotate_manage() {
|
|
258 |
}
|
259 |
} else if($view == "addnew" OR $view == "edit") {
|
260 |
include("dashboard/publisher/adverts-edit.php");
|
|
|
|
|
261 |
} else if($view == "report") {
|
262 |
include("dashboard/publisher/adverts-report.php");
|
263 |
}
|
4 |
Plugin URI: https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=plugin-info&utm_source=adrotate-free
|
5 |
Author: Arnan de Gans
|
6 |
Author URI: http://ajdg.solutions/?utm_campaign=homepage&utm_medium=plugin-info&utm_source=adrotate-free
|
7 |
+
Description: Monetise your website with adverts while keeping things simple. Start making money today!
|
8 |
Text Domain: adrotate
|
9 |
Domain Path: /languages/
|
10 |
+
Version: 4.5
|
11 |
License: GPLv3
|
12 |
*/
|
13 |
|
22 |
------------------------------------------------------------------------------------ */
|
23 |
|
24 |
/*--- AdRotate values ---------------------------------------*/
|
25 |
+
define("ADROTATE_DISPLAY", '4.5');
|
26 |
+
define("ADROTATE_VERSION", 391);
|
27 |
+
define("ADROTATE_DB_VERSION", 64);
|
28 |
$plugin_folder = plugin_dir_path(__FILE__);
|
29 |
/*-----------------------------------------------------------*/
|
30 |
|
79 |
add_action("admin_print_styles", 'adrotate_dashboard_styles');
|
80 |
add_action('admin_notices','adrotate_notifications_dashboard');
|
81 |
/*--- Internal redirects ------------------------------------*/
|
82 |
+
if(isset($_POST['adrotate_generate_submit'])) add_action('init', 'adrotate_generate_input');
|
83 |
if(isset($_POST['adrotate_ad_submit'])) add_action('init', 'adrotate_insert_input');
|
84 |
if(isset($_POST['adrotate_group_submit'])) add_action('init', 'adrotate_insert_group');
|
85 |
if(isset($_POST['adrotate_action_submit'])) add_action('init', 'adrotate_request_action');
|
97 |
Purpose: Add pages to admin menus
|
98 |
-------------------------------------------------------------*/
|
99 |
function adrotate_dashboard() {
|
100 |
+
$adrotate_page = $adrotate_pro = $adrotate_adverts = $adrotate_groups = $adrotate_settings = '';
|
101 |
|
102 |
+
add_menu_page('AdRotate', 'AdRotate', 'adrotate_ad_manage', 'adrotate', 'adrotate_info', plugins_url('/images/icon-menu.png', __FILE__), '25.8');
|
|
|
103 |
$adrotate_page = add_submenu_page('adrotate', 'AdRotate · '.__('General Info', 'adrotate'), __('General Info', 'adrotate'), 'adrotate_ad_manage', 'adrotate', 'adrotate_info');
|
104 |
$adrotate_pro = add_submenu_page('adrotate', 'AdRotate · '.__('AdRotate Pro', 'adrotate'), __('AdRotate Pro', 'adrotate'), 'adrotate_ad_manage', 'adrotate-pro', 'adrotate_pro');
|
105 |
$adrotate_adverts = add_submenu_page('adrotate', 'AdRotate · '.__('Adverts', 'adrotate'), __('Adverts', 'adrotate'), 'adrotate_ad_manage', 'adrotate-ads', 'adrotate_manage');
|
197 |
if($type == 'active' AND $stoptime <= $in7days) $type = '7days';
|
198 |
if($type == 'active' AND $stoptime <= $in2days) $type = '2days';
|
199 |
if($type == 'active' AND $stoptime <= $now) $type = 'expired';
|
200 |
+
|
201 |
+
$title = (strlen($singlebanner->title) == 0) ? 'Advert '.$singlebanner->id.' [temp]' : $singlebanner->title;
|
202 |
|
203 |
if($type == 'active' OR $type == '7days') {
|
204 |
$active[$singlebanner->id] = array(
|
205 |
'id' => $singlebanner->id,
|
206 |
+
'title' => $title,
|
207 |
'type' => $type,
|
208 |
'tracker' => $singlebanner->tracker,
|
209 |
'weight' => $singlebanner->weight,
|
215 |
if($type == 'error' OR $type == 'expired' OR $type == '2days') {
|
216 |
$error[$singlebanner->id] = array(
|
217 |
'id' => $singlebanner->id,
|
218 |
+
'title' => $title,
|
219 |
'type' => $type,
|
220 |
'tracker' => $singlebanner->tracker,
|
221 |
'weight' => $singlebanner->weight,
|
227 |
if($type == 'disabled') {
|
228 |
$disabled[$singlebanner->id] = array(
|
229 |
'id' => $singlebanner->id,
|
230 |
+
'title' => $title,
|
231 |
'type' => $type,
|
232 |
'tracker' => $singlebanner->tracker,
|
233 |
'weight' => $singlebanner->weight,
|
240 |
|
241 |
<div class="tablenav">
|
242 |
<div class="alignleft actions">
|
243 |
+
<a class="row-title" href="<?php echo admin_url('/admin.php?page=adrotate-ads');?>"><?php _e('Manage', 'adrotate'); ?></a>
|
244 |
+
| <a class="row-title" href="<?php echo admin_url('/admin.php?page=adrotate-ads&view=generator');?>"><?php _e('Generator', 'adrotate-pro'); ?></a>
|
245 |
+
| <a class="row-title" href="<?php echo admin_url('/admin.php?page=adrotate-ads&view=addnew');?>"><?php _e('Add New', 'adrotate'); ?></a>
|
246 |
</div>
|
247 |
</div>
|
248 |
|
261 |
}
|
262 |
} else if($view == "addnew" OR $view == "edit") {
|
263 |
include("dashboard/publisher/adverts-edit.php");
|
264 |
+
} else if($view == "generator") {
|
265 |
+
include("dashboard/publisher/adverts-generator.php");
|
266 |
} else if($view == "report") {
|
267 |
include("dashboard/publisher/adverts-report.php");
|
268 |
}
|
dashboard/info.php
CHANGED
@@ -48,22 +48,7 @@ $partner = mt_rand(1,3);
|
|
48 |
<td colspan="2">
|
49 |
<p><strong><?php _e('Support AdRotate', 'adrotate'); ?></strong></p>
|
50 |
<p><?php _e('Consider writing a review if you like AdRotate. Also follow my Facebook page for updates about me and my plugins. Thank you!', 'adrotate'); ?><br />
|
51 |
-
<center><a class="button-primary" href="https://paypal.me/arnandegans/10usd" target="_blank">Donate $10 via Paypal</a> <a class="button" target="_blank" href="https://wordpress.org/support/plugin/adrotate/reviews/?rate=5#new-post">Write review on WordPress.org</a></center
|
52 |
-
<a href="http://www.arnan.me/?pk_campaign=adrotate-free&pk_kwd=infopage" title="arnan.me - Nomadic in the Philippines"><img src="<?php echo plugins_url('/images/arnan-credits.jpg', dirname(__FILE__)); ?>" alt="Arnan de Gans" align="center" class="ajdg-photo" width="100%" /></a><br />
|
53 |
-
<script>(function(d, s, id) {
|
54 |
-
var js, fjs = d.getElementsByTagName(s)[0];
|
55 |
-
if (d.getElementById(id)) return;
|
56 |
-
js = d.createElement(s); js.id = id;
|
57 |
-
js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
|
58 |
-
fjs.parentNode.insertBefore(js, fjs);
|
59 |
-
}(document, 'script', 'facebook-jssdk'));</script>
|
60 |
-
<p><center><div class="fb-page"
|
61 |
-
data-href="https://www.facebook.com/Arnandegans"
|
62 |
-
data-width="490"
|
63 |
-
data-adapt-container-width="true"
|
64 |
-
data-hide-cover="false"
|
65 |
-
data-show-facepile="false">
|
66 |
-
</div></center></p>
|
67 |
</td>
|
68 |
</tr>
|
69 |
</tbody>
|
@@ -74,6 +59,7 @@ $partner = mt_rand(1,3);
|
|
74 |
<h3><?php _e('Arnan de Gans News & Updates', 'adrotate'); ?></h3>
|
75 |
<div class="postbox-ajdg">
|
76 |
<div class="inside">
|
|
|
77 |
<?php wp_widget_rss_output(array(
|
78 |
'url' => array('http://www.arnan.me/feed/', 'http://ajdg.solutions/feed/'),
|
79 |
'items' => 4,
|
48 |
<td colspan="2">
|
49 |
<p><strong><?php _e('Support AdRotate', 'adrotate'); ?></strong></p>
|
50 |
<p><?php _e('Consider writing a review if you like AdRotate. Also follow my Facebook page for updates about me and my plugins. Thank you!', 'adrotate'); ?><br />
|
51 |
+
<center><a class="button-primary" href="https://paypal.me/arnandegans/10usd" target="_blank">Donate $10 via Paypal</a> <a class="button" target="_blank" href="https://wordpress.org/support/plugin/adrotate/reviews/?rate=5#new-post">Write review on WordPress.org</a></center></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
</td>
|
53 |
</tr>
|
54 |
</tbody>
|
59 |
<h3><?php _e('Arnan de Gans News & Updates', 'adrotate'); ?></h3>
|
60 |
<div class="postbox-ajdg">
|
61 |
<div class="inside">
|
62 |
+
<p><center><a href="http://www.arnan.me/" title="arnan.me - Living in the Philippines"><img src="<?php echo plugins_url('/images/arnan-credits.jpg', dirname(__FILE__)); ?>" alt="Arnan de Gans" align="center" class="ajdg-photo" width="100%" /></a></center></p>
|
63 |
<?php wp_widget_rss_output(array(
|
64 |
'url' => array('http://www.arnan.me/feed/', 'http://ajdg.solutions/feed/'),
|
65 |
'items' => 4,
|
dashboard/publisher/adverts-edit.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
if(!$ad_edit_id) {
|
13 |
$edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' ORDER BY `id` DESC LIMIT 1;");
|
14 |
if($edit_id == 0) {
|
15 |
-
$wpdb->insert($wpdb->prefix."adrotate", array('title' => '', 'bannercode' => '', 'thetime' => $now, 'updated' => $now, 'author' => $userdata->user_login, 'imagetype' => 'dropdown', 'image' => '', 'paid' => 'U', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'empty', 'weight' => 6, 'autodelete' => 'N', 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
|
16 |
$edit_id = $wpdb->insert_id;
|
17 |
|
18 |
$wpdb->insert($wpdb->prefix.'adrotate_schedule', array('name' => 'Schedule for ad '.$edit_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y', 'autodelete' => 'N'));
|
@@ -118,10 +118,10 @@ if($edit_banner->imagetype == "field") {
|
|
118 |
</tr>
|
119 |
<tr>
|
120 |
<th valign="top"><?php _e('AdCode', 'adrotate'); ?></th>
|
121 |
-
<td>
|
122 |
<label for="adrotate_bannercode"><textarea tabindex="2" id="adrotate_bannercode" name="adrotate_bannercode" cols="70" rows="15"><?php echo stripslashes($edit_banner->bannercode); ?></textarea></label>
|
123 |
</td>
|
124 |
-
<td width="
|
125 |
<p><strong><?php _e('Basic Examples:', 'adrotate'); ?></strong></p>
|
126 |
<p><em><a href="#" onclick="textatcursor('adrotate_bannercode','<a href="https://ajdg.solutions/"><img src="%asset%" /></a>');return false;"><a href="https://ajdg.solutions/"><img src="%asset%" /></a></a></em></p>
|
127 |
<p><em><a href="#" onclick="textatcursor('adrotate_bannercode','<iframe src="%asset%" height="250" frameborder="0" style="border:none;"></iframe>');return false;"><iframe src="%asset%" height="250" frameborder="0" style="border:none;"></iframe></a></em></p>
|
@@ -132,14 +132,14 @@ if($edit_banner->imagetype == "field") {
|
|
132 |
</tr>
|
133 |
<tr>
|
134 |
<th valign="top"><?php _e('Useful tags', 'adrotate'); ?></th>
|
135 |
-
<td>
|
136 |
<p><em><a href="#" title="<?php _e('Insert the advert ID Number.', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','%id%');return false;">%id%</a>, <a href="#" title="<?php _e('Required when selecting a asset below.', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','%asset%');return false;">%asset%</a>, <a href="#" title="<?php _e('Insert the advert name.', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','%title%');return false;">%title%</a>, <a href="#" title="<?php _e('Insert a random seed. Useful for DFP/DoubleClick type adverts.', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','%random%');return false;">%random%</a>, <a href="#" title="<?php _e('Add inside the <a> tag to open advert in a new window.', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','target="_blank"');return false;">target="_blank"</a>, <a href="#" title="<?php _e('Add inside the <a> tag to tell crawlers to ignore this link', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','rel="nofollow"');return false;">rel="nofollow"</a></em><br /><?php _e('Place the cursor in your AdCode where you want to add any of these tags and click to add it.', 'adrotate'); ?></p>
|
137 |
</td>
|
138 |
</tr>
|
139 |
<?php if($edit_banner->type != 'empty') { ?>
|
140 |
<tr>
|
141 |
<th valign="top"><?php _e('Preview', 'adrotate'); ?></th>
|
142 |
-
<td colspan="
|
143 |
<div><?php echo adrotate_preview($edit_banner->id); ?></div>
|
144 |
<br /><em><?php _e('Note: While this preview is an accurate one, it might look different then it does on the website.', 'adrotate'); ?>
|
145 |
<br /><?php _e('This is because of CSS differences. Your themes CSS file is not active here!', 'adrotate'); ?></em>
|
@@ -148,7 +148,7 @@ if($edit_banner->imagetype == "field") {
|
|
148 |
<?php } ?>
|
149 |
<tr>
|
150 |
<th valign="top"><?php _e('Banner asset', 'adrotate'); ?></th>
|
151 |
-
<td colspan="
|
152 |
<label for="adrotate_image">
|
153 |
<?php _e('WordPress media:', 'adrotate'); ?> <input tabindex="3" id="adrotate_image" type="text" size="50" name="adrotate_image" value="<?php echo $image_field; ?>" /> <input tabindex="4" id="adrotate_image_button" class="button" type="button" value="<?php _e('Select Banner', 'adrotate'); ?>" />
|
154 |
</label><br />
|
@@ -165,7 +165,7 @@ if($edit_banner->imagetype == "field") {
|
|
165 |
<?php if($adrotate_config['stats'] > 0) { ?>
|
166 |
<tr>
|
167 |
<th width="15%" valign="top"><?php _e('Statistics', 'adrotate'); ?></th>
|
168 |
-
<td colspan="
|
169 |
<label for="adrotate_tracker"><input tabindex="6" type="checkbox" name="adrotate_tracker" <?php if($edit_banner->tracker == 'Y') { ?>checked="checked" <?php } ?> /> <?php _e('Enable click and impression tracking for this advert.', 'adrotate'); ?> <br />
|
170 |
<em><?php _e('Note: Clicktracking does not work for Javascript adverts such as those provided by Google AdSense/DFP/DoubleClick. HTML5/Flash adverts are not always supported.', 'adrotate'); ?></em>
|
171 |
</label>
|
@@ -174,7 +174,7 @@ if($edit_banner->imagetype == "field") {
|
|
174 |
<?php } ?>
|
175 |
<tr>
|
176 |
<th><?php _e('Activate', 'adrotate'); ?></th>
|
177 |
-
<td colspan="
|
178 |
<label for="adrotate_active">
|
179 |
<select tabindex="7" name="adrotate_active">
|
180 |
<option value="active" <?php if($edit_banner->type == "active") { echo 'selected'; } ?>><?php _e('Yes, this ad will be used', 'adrotate'); ?></option>
|
@@ -201,9 +201,9 @@ if($edit_banner->imagetype == "field") {
|
|
201 |
</tr>
|
202 |
<tr>
|
203 |
<th width="15%"><?php _e('In a post or page', 'adrotate'); ?></th>
|
204 |
-
<td>[adrotate banner="<?php echo $edit_banner->id; ?>"]</td>
|
205 |
<th width="15%"><?php _e('Directly in a theme', 'adrotate'); ?></th>
|
206 |
-
<td><?php echo adrotate_ad(<?php echo $edit_banner->id; ?>); ?></td>
|
207 |
</tr>
|
208 |
</tbody>
|
209 |
</table>
|
@@ -213,7 +213,7 @@ if($edit_banner->imagetype == "field") {
|
|
213 |
<tbody>
|
214 |
<tr>
|
215 |
<th width="15%"><?php _e('Start date (day/month/year)', 'adrotate'); ?></th>
|
216 |
-
<td>
|
217 |
<label for="adrotate_sday">
|
218 |
<input tabindex="9" name="adrotate_sday" class="search-input" type="text" size="4" maxlength="2" value="<?php echo $sday;?>" /> /
|
219 |
<select tabindex="10" name="adrotate_smonth">
|
12 |
if(!$ad_edit_id) {
|
13 |
$edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' ORDER BY `id` DESC LIMIT 1;");
|
14 |
if($edit_id == 0) {
|
15 |
+
$wpdb->insert($wpdb->prefix."adrotate", array('title' => '', 'bannercode' => '', 'thetime' => $now, 'updated' => $now, 'author' => $userdata->user_login, 'imagetype' => 'dropdown', 'image' => '', 'paid' => 'U', 'tracker' => 'N', 'show_everyone' => 'Y', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'empty', 'weight' => 6, 'autodelete' => 'N', 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
|
16 |
$edit_id = $wpdb->insert_id;
|
17 |
|
18 |
$wpdb->insert($wpdb->prefix.'adrotate_schedule', array('name' => 'Schedule for ad '.$edit_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y', 'autodelete' => 'N'));
|
118 |
</tr>
|
119 |
<tr>
|
120 |
<th valign="top"><?php _e('AdCode', 'adrotate'); ?></th>
|
121 |
+
<td colspan="2">
|
122 |
<label for="adrotate_bannercode"><textarea tabindex="2" id="adrotate_bannercode" name="adrotate_bannercode" cols="70" rows="15"><?php echo stripslashes($edit_banner->bannercode); ?></textarea></label>
|
123 |
</td>
|
124 |
+
<td width="35%" rowspan="2">
|
125 |
<p><strong><?php _e('Basic Examples:', 'adrotate'); ?></strong></p>
|
126 |
<p><em><a href="#" onclick="textatcursor('adrotate_bannercode','<a href="https://ajdg.solutions/"><img src="%asset%" /></a>');return false;"><a href="https://ajdg.solutions/"><img src="%asset%" /></a></a></em></p>
|
127 |
<p><em><a href="#" onclick="textatcursor('adrotate_bannercode','<iframe src="%asset%" height="250" frameborder="0" style="border:none;"></iframe>');return false;"><iframe src="%asset%" height="250" frameborder="0" style="border:none;"></iframe></a></em></p>
|
132 |
</tr>
|
133 |
<tr>
|
134 |
<th valign="top"><?php _e('Useful tags', 'adrotate'); ?></th>
|
135 |
+
<td colspan="2">
|
136 |
<p><em><a href="#" title="<?php _e('Insert the advert ID Number.', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','%id%');return false;">%id%</a>, <a href="#" title="<?php _e('Required when selecting a asset below.', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','%asset%');return false;">%asset%</a>, <a href="#" title="<?php _e('Insert the advert name.', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','%title%');return false;">%title%</a>, <a href="#" title="<?php _e('Insert a random seed. Useful for DFP/DoubleClick type adverts.', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','%random%');return false;">%random%</a>, <a href="#" title="<?php _e('Add inside the <a> tag to open advert in a new window.', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','target="_blank"');return false;">target="_blank"</a>, <a href="#" title="<?php _e('Add inside the <a> tag to tell crawlers to ignore this link', 'adrotate'); ?>" onclick="textatcursor('adrotate_bannercode','rel="nofollow"');return false;">rel="nofollow"</a></em><br /><?php _e('Place the cursor in your AdCode where you want to add any of these tags and click to add it.', 'adrotate'); ?></p>
|
137 |
</td>
|
138 |
</tr>
|
139 |
<?php if($edit_banner->type != 'empty') { ?>
|
140 |
<tr>
|
141 |
<th valign="top"><?php _e('Preview', 'adrotate'); ?></th>
|
142 |
+
<td colspan="3">
|
143 |
<div><?php echo adrotate_preview($edit_banner->id); ?></div>
|
144 |
<br /><em><?php _e('Note: While this preview is an accurate one, it might look different then it does on the website.', 'adrotate'); ?>
|
145 |
<br /><?php _e('This is because of CSS differences. Your themes CSS file is not active here!', 'adrotate'); ?></em>
|
148 |
<?php } ?>
|
149 |
<tr>
|
150 |
<th valign="top"><?php _e('Banner asset', 'adrotate'); ?></th>
|
151 |
+
<td colspan="3">
|
152 |
<label for="adrotate_image">
|
153 |
<?php _e('WordPress media:', 'adrotate'); ?> <input tabindex="3" id="adrotate_image" type="text" size="50" name="adrotate_image" value="<?php echo $image_field; ?>" /> <input tabindex="4" id="adrotate_image_button" class="button" type="button" value="<?php _e('Select Banner', 'adrotate'); ?>" />
|
154 |
</label><br />
|
165 |
<?php if($adrotate_config['stats'] > 0) { ?>
|
166 |
<tr>
|
167 |
<th width="15%" valign="top"><?php _e('Statistics', 'adrotate'); ?></th>
|
168 |
+
<td colspan="3">
|
169 |
<label for="adrotate_tracker"><input tabindex="6" type="checkbox" name="adrotate_tracker" <?php if($edit_banner->tracker == 'Y') { ?>checked="checked" <?php } ?> /> <?php _e('Enable click and impression tracking for this advert.', 'adrotate'); ?> <br />
|
170 |
<em><?php _e('Note: Clicktracking does not work for Javascript adverts such as those provided by Google AdSense/DFP/DoubleClick. HTML5/Flash adverts are not always supported.', 'adrotate'); ?></em>
|
171 |
</label>
|
174 |
<?php } ?>
|
175 |
<tr>
|
176 |
<th><?php _e('Activate', 'adrotate'); ?></th>
|
177 |
+
<td colspan="3">
|
178 |
<label for="adrotate_active">
|
179 |
<select tabindex="7" name="adrotate_active">
|
180 |
<option value="active" <?php if($edit_banner->type == "active") { echo 'selected'; } ?>><?php _e('Yes, this ad will be used', 'adrotate'); ?></option>
|
201 |
</tr>
|
202 |
<tr>
|
203 |
<th width="15%"><?php _e('In a post or page', 'adrotate'); ?></th>
|
204 |
+
<td width="35%">[adrotate banner="<?php echo $edit_banner->id; ?>"]</td>
|
205 |
<th width="15%"><?php _e('Directly in a theme', 'adrotate'); ?></th>
|
206 |
+
<td width="35%"><?php echo adrotate_ad(<?php echo $edit_banner->id; ?>); ?></td>
|
207 |
</tr>
|
208 |
</tbody>
|
209 |
</table>
|
213 |
<tbody>
|
214 |
<tr>
|
215 |
<th width="15%"><?php _e('Start date (day/month/year)', 'adrotate'); ?></th>
|
216 |
+
<td width="35%">
|
217 |
<label for="adrotate_sday">
|
218 |
<input tabindex="9" name="adrotate_sday" class="search-input" type="text" size="4" maxlength="2" value="<?php echo $sday;?>" /> /
|
219 |
<select tabindex="10" name="adrotate_smonth">
|
dashboard/publisher/adverts-generator.php
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* ------------------------------------------------------------------------------------
|
3 |
+
* COPYRIGHT AND TRADEMARK NOTICE
|
4 |
+
* Copyright 2008-2017 Arnan de Gans. All Rights Reserved.
|
5 |
+
* ADROTATE is a registered trademark of Arnan de Gans.
|
6 |
+
|
7 |
+
* COPYRIGHT NOTICES AND ALL THE COMMENTS SHOULD REMAIN INTACT.
|
8 |
+
* By using this code you agree to indemnify Arnan de Gans from any
|
9 |
+
* liability that might arise from it's use.
|
10 |
+
------------------------------------------------------------------------------------ */
|
11 |
+
|
12 |
+
if(!$ad_edit_id) {
|
13 |
+
$edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'generator' ORDER BY `id` DESC LIMIT 1;");
|
14 |
+
if($edit_id == 0) {
|
15 |
+
$wpdb->insert($wpdb->prefix."adrotate", array('title' => '', 'bannercode' => '', 'thetime' => $now, 'updated' => $now, 'author' => $userdata->user_login, 'imagetype' => 'dropdown', 'image' => '', 'paid' => 'U', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'generator', 'weight' => 6, 'autodelete' => 'N', 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
|
16 |
+
$edit_id = $wpdb->insert_id;
|
17 |
+
|
18 |
+
$wpdb->insert($wpdb->prefix.'adrotate_schedule', array('name' => 'Schedule for ad '.$edit_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y', 'autodelete' => 'N'));
|
19 |
+
$schedule_id = $wpdb->insert_id;
|
20 |
+
$wpdb->insert($wpdb->prefix.'adrotate_linkmeta', array('ad' => $edit_id, 'group' => 0, 'user' => 0, 'schedule' => $schedule_id));
|
21 |
+
}
|
22 |
+
$ad_edit_id = $edit_id;
|
23 |
+
}
|
24 |
+
|
25 |
+
$edit_banner = $wpdb->get_row("SELECT * FROM `{$wpdb->prefix}adrotate` WHERE `id` = '$ad_edit_id';");
|
26 |
+
|
27 |
+
wp_enqueue_media();
|
28 |
+
wp_enqueue_script('uploader-hook', plugins_url().'/adrotate-pro/library/uploader-hook.js', array('jquery'));
|
29 |
+
?>
|
30 |
+
|
31 |
+
<form method="post" action="admin.php?page=adrotate-ads">
|
32 |
+
<?php wp_nonce_field('adrotate_generate_ad','adrotate_nonce'); ?>
|
33 |
+
<input type="hidden" name="adrotate_id" value="<?php echo $edit_banner->id;?>" />
|
34 |
+
|
35 |
+
<h2><?php _e('Generate Advert Code', 'adrotate'); ?></h2>
|
36 |
+
<p><?php _e('Use the Generator if you have received a target url, banner image and/or some separate files with a description on how to use those. The AdRotate Generator will take your bits and pieces and try to generate a working adcode from it.', 'adrotate'); ?></p>
|
37 |
+
|
38 |
+
<p><?php _e('If you have a complete and working ad code / ad tag you do not use the Generator. You can simply paste that code in the AdCode field when creating your advert. For example as provided by Media.net or Google AdSense among others.', 'adrotate'); ?></p>
|
39 |
+
|
40 |
+
<h2><?php _e('Basic advert', 'adrotate'); ?></h2>
|
41 |
+
<em><?php _e('This is a regular advert consisting of an image and a link, made up from HTML code.', 'adrotate'); ?></em>
|
42 |
+
<table class="widefat" style="margin-top: .5em">
|
43 |
+
|
44 |
+
<tbody>
|
45 |
+
<tr>
|
46 |
+
<th valign="top"><?php _e('Banner asset', 'adrotate'); ?></th>
|
47 |
+
<td>
|
48 |
+
<label for="adrotate_basic_dropdown">
|
49 |
+
<select tabindex="1" id="adrotate_basic_dropdown" name="adrotate_basic_dropdown" style="min-width: 300px;">
|
50 |
+
<option value=""><?php _e('No file selected', 'adrotate'); ?></option>
|
51 |
+
<?php echo adrotate_folder_contents('', 'image'); ?>
|
52 |
+
</select> <?php _e('Is your file not listed? Upload it via the AdRotate Media Manager.', 'adrotate'); ?></label><br />
|
53 |
+
<?php _e('- OR -', 'adrotate'); ?><br />
|
54 |
+
<label for="adrotate_text"><input tabindex="2" id="adrotate_text" name="adrotate_text" type="text" size="60" class="search-input" value="" autocomplete="off" /> <?php _e('Visible text if this is a text link banner.', 'adrotate'); ?><br /><em><?php _e('Use either the dropdown or the text field. If the dropdown is used, that field has priority.', 'adrotate'); ?></em></label>
|
55 |
+
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
+
<tr>
|
59 |
+
<th width="15%" valign="top"><?php _e('Target website', 'adrotate'); ?></th>
|
60 |
+
<td>
|
61 |
+
<label for="adrotate_targeturl"><input tabindex="3" id="adrotate_targeturl" name="adrotate_targeturl" type="text" size="60" class="search-input" value="" autocomplete="off" /> <?php _e('Where does the person clicking the advert go?', 'adrotate'); ?></label>
|
62 |
+
</td>
|
63 |
+
</tr>
|
64 |
+
<tr>
|
65 |
+
<th valign="top"><?php _e('Target window', 'adrotate'); ?></th>
|
66 |
+
<td>
|
67 |
+
<label for="adrotate_newwindow_disabled"><input tabindex="4" type="checkbox" name="adrotate_newwindow_disabled" disabled="1" /></label> <?php _e('Available in AdRotate Pro.', 'adrotate'); ?> <?php _e('Open the target website in a new window?', 'adrotate'); ?>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
<tr>
|
71 |
+
<th valign="top"><?php _e('NoFollow', 'adrotate'); ?></th>
|
72 |
+
<td>
|
73 |
+
<label for="adrotate_nofollow_disabled"><input tabindex="5" type="checkbox" name="adrotate_nofollow_disabled" disabled="1"/></label> <?php _e('Available in AdRotate Pro.', 'adrotate'); ?> <?php _e('Tell crawlers and search engines not to follow the target website url?', 'adrotate'); ?>
|
74 |
+
</td>
|
75 |
+
</tr>
|
76 |
+
<tr>
|
77 |
+
<th valign="top"><?php _e('Advert size', 'adrotate'); ?></strong></th>
|
78 |
+
<td>
|
79 |
+
<label for="adrotate_width"><input tabindex="6" name="adrotate_width" type="text" class="search-input" size="5" value="" autocomplete="off" /> <?php _e('px wide', 'adrotate'); ?>,</label>
|
80 |
+
<label for="adrotate_height"><input tabindex="7" name="adrotate_height" type="text" class="search-input" size="5" value="" autocomplete="off" /> <?php _e('px high.', 'adrotate'); ?></label>
|
81 |
+
<?php _e('Define the maximum size of the adverts in pixels.', 'adrotate'); ?> <?php _e('(Optional)', 'adrotate'); ?>
|
82 |
+
</td>
|
83 |
+
</tr>
|
84 |
+
</tbody>
|
85 |
+
|
86 |
+
</table>
|
87 |
+
|
88 |
+
<h2><?php _e('HTML5 or Flash Advert', 'adrotate'); ?></h2>
|
89 |
+
<em><?php _e('These are more advanced adverts, using a Flash file or HTML5 files. Try to avoid Flash. HTML5 is the new and better standard.', 'adrotate'); ?><br />
|
90 |
+
<?php _e('If your HTML5 advert consists of multiple files, upload all files using the AdRotate Media Manager and select the HTML file here.', 'adrotate'); ?></em>
|
91 |
+
<table class="widefat" style="margin-top: .5em">
|
92 |
+
|
93 |
+
<tbody>
|
94 |
+
<tr>
|
95 |
+
<th valign="top" width="15%"><?php _e('HTML/Flash file', 'adrotate'); ?></th>
|
96 |
+
<td>
|
97 |
+
<label for="adrotate_html5_dropdown">
|
98 |
+
<select tabindex="8" id="adrotate_html5_dropdown" name="adrotate_html5_dropdown" style="min-width: 300px;">
|
99 |
+
<option value=""><?php _e('No file selected', 'adrotate'); ?></option>
|
100 |
+
<?php echo adrotate_folder_contents('', 'html5'); ?>
|
101 |
+
</select> <?php _e('Is your file not listed? Upload it via the AdRotate Media Manager.', 'adrotate'); ?>
|
102 |
+
</label>
|
103 |
+
</td>
|
104 |
+
</tr>
|
105 |
+
<tr>
|
106 |
+
<th valign="top"><?php _e('Advert size', 'adrotate'); ?></strong></th>
|
107 |
+
<td>
|
108 |
+
<label for="adrotate_html5_width"><input tabindex="9" name="adrotate_html5_width" type="text" class="search-input" size="5" value="" autocomplete="off" /> <?php _e('px wide', 'adrotate'); ?>,</label>
|
109 |
+
<label for="adrotate_html5_height"><input tabindex="10" name="adrotate_html5_height" type="text" class="search-input" size="5" value="" autocomplete="off" /> <?php _e('px high.', 'adrotate'); ?></label>
|
110 |
+
<?php _e('Define the maximum size of the adverts in pixels.', 'adrotate'); ?>
|
111 |
+
</td>
|
112 |
+
</tr>
|
113 |
+
<tr>
|
114 |
+
<th valign="top" width="15%"><?php _e('Flash clickTAG', 'adrotate'); ?></th>
|
115 |
+
<td>
|
116 |
+
<label for="adrotate_html5_clicktag">
|
117 |
+
<?php _e('Parameter', 'adrotate'); ?> <select tabindex="11" id="adrotate_html5_clicktag_disabled" name="adrotate_html5_clicktag_disabled" style="min-width: 200px;" disabled="1">
|
118 |
+
<option value=""><?php _e('No clickTAG', 'adrotate'); ?></option>
|
119 |
+
</select> <?php _e('URL', 'adrotate'); ?> <input tabindex="12" id="adrotate_html5_clicktag_disabled" name="adrotate_html5_clicktag_disabled" type="text" size="50" class="search-input" value="" autocomplete="off" disabled="1" /> <?php _e('(Optional)', 'adrotate'); ?><br /><em><?php _e('Available in AdRotate Pro.', 'adrotate'); ?> <?php _e('This option is ignored for HTML5 adverts. All choices do the exact same, but some developers write the parameter differently.', 'adrotate'); ?></em>
|
120 |
+
</label>
|
121 |
+
</td>
|
122 |
+
</tr>
|
123 |
+
</tbody>
|
124 |
+
|
125 |
+
</table>
|
126 |
+
|
127 |
+
<p class="submit">
|
128 |
+
<input tabindex="13" type="submit" name="adrotate_generate_submit" class="button-primary" value="<?php _e('Generate and Configure Advert', 'adrotate'); ?>" />
|
129 |
+
<a href="admin.php?page=adrotate-ads&view=manage" class="button"><?php _e('Cancel', 'adrotate'); ?></a> <?php _e('Always test your adverts before activating them.', 'adrotate'); ?>
|
130 |
+
</p>
|
131 |
+
|
132 |
+
<p><em><strong><?php _e('NOTE:', 'adrotate'); ?></strong> <?php _e('While the Code Generator has been tested and works, code generation, as always, is a interpretation of user input. If you provide the correct bits and pieces, a working advert may be generated. If you leave fields empty or insert the wrong info you probably end up with a broken advert.', 'adrotate'); ?><br /><?php _e('Based on your input and experiences later iterations of the Code Generator will be better and more feature rich.', 'adrotate'); ?></em></p>
|
133 |
+
</form>
|
dashboard/publisher/groups-edit.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
$action = "group_new";
|
14 |
$edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` = '' ORDER BY `id` DESC LIMIT 1;");
|
15 |
if($edit_id == 0) {
|
16 |
-
$wpdb->insert($wpdb->prefix.'adrotate_groups', array('name' => '', 'modus' => 0, 'fallback' => '0', 'cat' => '', 'cat_loc' => 0, 'cat_par' => 0, 'page' => '', 'page_loc' => 0, 'page_par' => 0, 'mobile' => 0, 'geo' => 0, 'wrapper_before' => '', 'wrapper_after' => '', 'gridrows' => 2, 'gridcolumns' => 2, 'admargin' => 0, 'admargin_bottom' => 0, 'admargin_left' => 0, 'admargin_right' => 0, 'adwidth' => '125', 'adheight' => '125', 'adspeed' => 6000));
|
17 |
$edit_id = $wpdb->insert_id;
|
18 |
}
|
19 |
$group_edit_id = $edit_id;
|
13 |
$action = "group_new";
|
14 |
$edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` = '' ORDER BY `id` DESC LIMIT 1;");
|
15 |
if($edit_id == 0) {
|
16 |
+
$wpdb->insert($wpdb->prefix.'adrotate_groups', array('name' => '', 'modus' => 0, 'fallback' => '0', 'cat' => '', 'cat_loc' => 0, 'cat_par' => 0, 'page' => '', 'page_loc' => 0, 'page_par' => 0, 'mobile' => 0, 'geo' => 0, 'wrapper_before' => '', 'wrapper_after' => '', 'gridrows' => 2, 'gridcolumns' => 2, 'admargin' => 0, 'admargin_bottom' => 0, 'admargin_left' => 0, 'admargin_right' => 0, 'adwidth' => '125', 'adheight' => '125', 'adspeed' => 6000, 'repeat_impressions' => 'Y'));
|
17 |
$edit_id = $wpdb->insert_id;
|
18 |
}
|
19 |
$group_edit_id = $edit_id;
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== AdRotate Banner Manager ===
|
2 |
Contributors: adegans
|
3 |
Donate link: http://www.arnan.me/donate/?utm_campaign=donations&utm_medium=readme&utm_source=adrotate-free
|
4 |
-
Tags: ad,
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.8
|
7 |
-
Stable tag: 4.
|
8 |
License: GPLv3
|
9 |
|
10 |
Monetise your website with adverts while keeping things simple. Start making money today!
|
@@ -98,43 +98,22 @@ You can also post your questions on the [forum](https://ajdg.solutions/forums/?u
|
|
98 |
|
99 |
Be a Professional and go Pro. With [AdRotate Professional](https://ajdg.solutions/plugins/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=readme&utm_source=adrotate-free)!
|
100 |
|
101 |
-
= 4.
|
102 |
-
* [new]
|
103 |
-
* [
|
104 |
-
|
105 |
-
|
106 |
-
* [
|
107 |
-
* [
|
108 |
-
* [
|
109 |
-
* [
|
110 |
-
* [i18n] Updated all po files with new strings
|
111 |
-
|
112 |
-
= 4.7 PRO =
|
113 |
-
* [new] Advert exports to CSV
|
114 |
-
* [new] Advert importing from CSV
|
115 |
-
* [new] Option to delete old export files in Settings > Maintenance
|
116 |
-
* [change] Banner folder must be in wp-content (or it's equivalent)
|
117 |
-
* [change] Dashboard tweaks
|
118 |
-
* [change] XML importing and exporting no longer supported
|
119 |
-
* [change] Advert exporting now requires 'ad_manage' permission
|
120 |
-
* [fix] Improved PHP7 compatibility
|
121 |
-
* [fix] Sortable columns now properly assigned
|
122 |
-
* [fix] Exporting of adverts
|
123 |
-
* [i18n] Updated all po files with new strings
|
124 |
|
125 |
All recent changes are available on the [AdRotate website](https://ajdg.solutions/plugins/adrotate-for-wordpress/development/?utm_campaign=development&utm_medium=readme&utm_source=adrotate-free).
|
126 |
|
127 |
== Upgrade Notice ==
|
128 |
|
129 |
-
* [new]
|
130 |
-
* [
|
131 |
-
* [change] Banner folder must be in wp-content (or it's equivalent)
|
132 |
-
* [change] Dashboard tweaks
|
133 |
-
* [change] XML exporting no longer supported
|
134 |
-
* [change] Advert exporting now requires 'ad_manage' permission
|
135 |
-
* [i18n] Settings tabs added
|
136 |
-
* [i18n] Updated Spanish by Juanjo Navarra
|
137 |
-
* [i18n] Updated all po files with new strings
|
138 |
|
139 |
== Screenshots ==
|
140 |
|
1 |
=== AdRotate Banner Manager ===
|
2 |
Contributors: adegans
|
3 |
Donate link: http://www.arnan.me/donate/?utm_campaign=donations&utm_medium=readme&utm_source=adrotate-free
|
4 |
+
Tags: ad, advert, adsense, advertising, doubleclick, responsive, ad rotator, ad manager, banner manager, advert manager, analytics, advertisement,
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.8
|
7 |
+
Stable tag: 4.5
|
8 |
License: GPLv3
|
9 |
|
10 |
Monetise your website with adverts while keeping things simple. Start making money today!
|
98 |
|
99 |
Be a Professional and go Pro. With [AdRotate Professional](https://ajdg.solutions/plugins/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=readme&utm_source=adrotate-free)!
|
100 |
|
101 |
+
= 4.5 FREE =
|
102 |
+
* [new] Basic advert code generator
|
103 |
+
* [fix] Unable to edit adverts with empty titles
|
104 |
+
|
105 |
+
= 4.8 PRO =
|
106 |
+
* [new] Advert code generator
|
107 |
+
* [new] Hide selected adverts from logged in users
|
108 |
+
* [new] Count impressions for the first cycle in dynamic groups
|
109 |
+
* [fix] Unable to edit adverts with empty titles
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
All recent changes are available on the [AdRotate website](https://ajdg.solutions/plugins/adrotate-for-wordpress/development/?utm_campaign=development&utm_medium=readme&utm_source=adrotate-free).
|
112 |
|
113 |
== Upgrade Notice ==
|
114 |
|
115 |
+
* [new] Basic advert code generator
|
116 |
+
* [fix] Unable to edit adverts with empty titles
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
== Screenshots ==
|
119 |
|