Version Description
- Improved UI for vi stories customization
- Bug fixes
- Improved compatibility with other wp plugins
Download this release
Release Info
Developer | insertpostads |
Plugin | Insert Post Ads |
Version | 1.3 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.3
- adstxt.php +73 -0
- controls/assets/css/controls.css +8 -0
- css/admin.css +256 -1
- css/controls.css +12 -0
- css/insert-post.css +12 -8
- images/ic_remove.svg +18 -0
- images/logo-svg.svg +23 -0
- includes/adstxt.php +42 -0
- common.php → includes/common.php +0 -0
- geotargeting.php → includes/geotargeting.php +0 -0
- inpostads.php → includes/inpostads.php +35 -26
- rules.php → includes/rules.php +0 -0
- vi-integration.php → includes/vi-integration.php +21 -13
- insert-post-ads.php +176 -18
- js/admin.js +201 -5
- readme.txt +7 -2
- uninstall.php +2 -2
- views/add-vi.php +59 -0
- views/settings.php +2 -2
adstxt.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* Begin Add Card in Admin Panel */
|
3 |
+
add_action('insert_ads_plugin_card', 'insert_ads_adstxt_plugin_card', 70);
|
4 |
+
function insert_ads_adstxt_plugin_card() {
|
5 |
+
echo '<div class="plugin-card adstxt-card">';
|
6 |
+
echo '<div class="plugin-card-top">';
|
7 |
+
echo '<h4>Authorized Digital Sellers / ads.txt</h4>';
|
8 |
+
echo '<p>Authorized Digital Sellers, or ads.txt, is an <a href="https://iabtechlab.com/">IAB</a> initiative to improve transparency in programmatic advertising.</p>';
|
9 |
+
echo '<p>You can easily manage your ads.txt from within Wp-Insert, providing confidence to brands they are buying authentic publisher inventory, protect you from counterfiet inventory and might even lead to higher monetization for your ad invertory.</p>';
|
10 |
+
echo '</div>';
|
11 |
+
echo '<div class="plugin-card-bottom">';
|
12 |
+
if(insert_ads_adstxt_file_exists()) {
|
13 |
+
echo '<a id="insert_ads_adstxt_generate" href="javascript:;" class="button button-primary">Modify ads.txt</a>';
|
14 |
+
} else {
|
15 |
+
echo '<a id="insert_ads_adstxt_generate" href="javascript:;" class="button button-primary">Generate ads.txt</a>';
|
16 |
+
}
|
17 |
+
echo '</div>';
|
18 |
+
echo '</div>';
|
19 |
+
}
|
20 |
+
/* End Add Card in Admin Panel */
|
21 |
+
|
22 |
+
/* Begin Create Ads.txt */
|
23 |
+
add_action('wp_ajax_insert_ads_adstxt_generate_form_get_content', 'insert_ads_adstxt_generate_form_get_content');
|
24 |
+
function insert_ads_adstxt_generate_form_get_content() {
|
25 |
+
check_ajax_referer('wp-insert', 'insert_ads_nonce');
|
26 |
+
echo '<div class="insert_ads_popup_content_wrapper">';
|
27 |
+
echo '<div id="insert_ads_adstxt_accordion">';
|
28 |
+
$control = new smartlogixControls();
|
29 |
+
echo '<h3>ads.txt Content</h3>';
|
30 |
+
echo '<div>';
|
31 |
+
$control->add_control(array('type' => 'textarea', 'id' => 'insert_ads_adstxt_content', 'name' => 'insert_ads_adstxt_content', 'style' => 'height: 220px;', 'value' => insert_ads_adstxt_get_content(), 'helpText' => 'You can directly edit the entries here or you can use the entry generator below to quickly create new entries'));
|
32 |
+
$control->create_section('ads.txt Content');
|
33 |
+
echo $control->HTML;
|
34 |
+
$control->clear_controls();
|
35 |
+
echo '</div>';
|
36 |
+
echo '<h3>Entry Generator</h3>';
|
37 |
+
echo '<div>';
|
38 |
+
$control->add_control(array('type' => 'text', 'id' => 'insert_ads_adstxt_new_entry_domain', 'name' => 'insert_ads_adstxt_new_entry_domain', 'label' => 'Domain name of the advertising system <small style="font-size: 10px;">(Required)</small>', 'value' => '', 'helpText' => 'For Google Adsense Use "google.com"; for other networks, contact your service provider for values.'));
|
39 |
+
$control->add_control(array('type' => 'text', 'id' => 'insert_ads_adstxt_new_entry_pid', 'name' => 'insert_ads_adstxt_new_entry_pid', 'label' => 'Publisher’s Account ID <small style="font-size: 10px;">(Required)</small>', 'value' => '', 'helpText' => 'For Google Adsense Use your Publisher ID "pub-xxxxxxxxxxxxxxxx"; for other networks, contact your service provider for values.'));
|
40 |
+
$control->add_control(array('type' => 'select', 'id' => 'insert_ads_adstxt_new_entry_type', 'name' => 'insert_ads_adstxt_new_entry_type', 'label' => 'Type of Account / Relationship <small style="font-size: 10px;">(Required)</small>', 'value' => '', 'options' => array(array('text' => 'Direct', 'value' => 'DIRECT'), array('text' => 'Reseller', 'value' => 'RESELLER')), 'helpText' => 'For Google Adsense select "Reseller"; for other networks, contact your service provider for values.'));
|
41 |
+
$control->add_control(array('type' => 'text', 'id' => 'insert_ads_adstxt_new_entry_certauthority', 'name' => 'insert_ads_adstxt_new_entry_certauthority', 'label' => 'Certification Authority ID', 'value' => '', 'helpText' => 'Contact your service provider for values.'));
|
42 |
+
$control->HTML .= '<p><input id="insert_ads_adstxt_add_entry" onclick="insert_ads_adstxt_add_entry()" type="button" value="Add Entry" class="button button-primary" /></p>';
|
43 |
+
$control->create_section('Entry Generator');
|
44 |
+
echo $control->HTML;
|
45 |
+
echo '</div>';
|
46 |
+
echo '</div>';
|
47 |
+
echo '<script type="text/javascript">';
|
48 |
+
echo $control->JS;
|
49 |
+
echo 'jQuery("#insert_ads_adstxt_accordion").accordion({ icons: { header: "ui-icon-circle-arrow-e", activeHeader: "ui-icon-circle-arrow-s" }, heightStyle: "fill" });';
|
50 |
+
//echo 'jQuery(".ui-dialog-buttonset").find("button").first().remove();';
|
51 |
+
echo '</script>';
|
52 |
+
echo '</div>';
|
53 |
+
die();
|
54 |
+
}
|
55 |
+
|
56 |
+
add_action('wp_ajax_insert_ads_adstxt_generate_form_save_action', 'insert_ads_adstxt_generate_form_save_action');
|
57 |
+
function insert_ads_adstxt_generate_form_save_action() {
|
58 |
+
check_ajax_referer('wp-insert', 'insert_ads_nonce');
|
59 |
+
$content = ((isset($_POST['insert_ads_adstxt_content']))?$_POST['insert_ads_adstxt_content']:'');
|
60 |
+
$output = insert_ads_adstxt_updation_failed_message($content);
|
61 |
+
$output .= '<script type="text/javascript">';
|
62 |
+
$output .= 'jQuery(".ui-dialog-buttonset").find("button").first().hide();';
|
63 |
+
$output .= '</script>';
|
64 |
+
|
65 |
+
if(insert_ads_adstxt_update_content($content)) {
|
66 |
+
echo '###SUCCESS###';
|
67 |
+
} else {
|
68 |
+
echo $output;
|
69 |
+
}
|
70 |
+
die();
|
71 |
+
}
|
72 |
+
/* End Create Ads.txt */
|
73 |
+
?>
|
controls/assets/css/controls.css
CHANGED
@@ -1408,4 +1408,12 @@ only screen and (min-resolution: 1.5dppx) {
|
|
1408 |
}
|
1409 |
.minicolors-theme-semanticui input {
|
1410 |
text-indent: 30px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1411 |
}
|
1408 |
}
|
1409 |
.minicolors-theme-semanticui input {
|
1410 |
text-indent: 30px;
|
1411 |
+
}
|
1412 |
+
.ipcheckbox {
|
1413 |
+
background-color: rgba(216, 216, 216, 1);
|
1414 |
+
width: 70px;
|
1415 |
+
}
|
1416 |
+
.ipcheckbox.checked{
|
1417 |
+
-webkit-box-shadow: inset 0 0 0 36px rgba(0, 115, 164, 1);
|
1418 |
+
box-shadow: inset 0 0 0 36px rgba(0, 115, 164, 1);
|
1419 |
}
|
css/admin.css
CHANGED
@@ -71,4 +71,259 @@ div[aria-describedby="insert_ads_vi_signup_dialog"] .ui-dialog-titlebar button{
|
|
71 |
margin: auto;
|
72 |
top: 40%;
|
73 |
z-index: 99999;
|
74 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
margin: auto;
|
72 |
top: 40%;
|
73 |
z-index: 99999;
|
74 |
+
}
|
75 |
+
.insert_ads_vi_popup_right_column p, .insert_ads_vi_popup_right_column{
|
76 |
+
text-align:center;
|
77 |
+
}
|
78 |
+
.insert_ads_vi_popup_right_column p{
|
79 |
+
margin-top: 50px !important;
|
80 |
+
}
|
81 |
+
.postbox .smartlogixSectionWrapper{
|
82 |
+
border:0;
|
83 |
+
}
|
84 |
+
#set-update{
|
85 |
+
height: 32px;
|
86 |
+
padding: 0px 55px;
|
87 |
+
font-size: 13px;
|
88 |
+
position: absolute;
|
89 |
+
bottom: -65px;
|
90 |
+
line-height: 32px;
|
91 |
+
font-weight: bold;
|
92 |
+
left: -30px;
|
93 |
+
}
|
94 |
+
.vi-choose{
|
95 |
+
float:left !important;
|
96 |
+
border: 0;
|
97 |
+
margin: 0;
|
98 |
+
box-shadow:none;
|
99 |
+
}
|
100 |
+
.vi-choose .hndle{
|
101 |
+
display:none;
|
102 |
+
}
|
103 |
+
.insert_ads_rule_block {
|
104 |
+
width: calc(100% - 40px) !important;
|
105 |
+
}
|
106 |
+
.postbox.vi-choose .insert_ads_popup_content_wrapper div p:nth-child(3), .postbox.vi-choose .insert_ads_popup_content_wrapper h3, .postbox.vi-choose .insert_ads_popup_content_wrapper{
|
107 |
+
display:none;
|
108 |
+
}
|
109 |
+
.postbox.vi-choose .plugin-card-bottom{
|
110 |
+
|
111 |
+
}
|
112 |
+
a[href="edit.php?post_type=insertpostads&page=insert-post-ads"]{
|
113 |
+
display:none !important;
|
114 |
+
}
|
115 |
+
.ins-notice{
|
116 |
+
border: 0;
|
117 |
+
padding: 0;
|
118 |
+
background: transparent;
|
119 |
+
box-shadow: none;
|
120 |
+
}
|
121 |
+
.insert_ads_vi_popup_left_column > p:nth-child(7){
|
122 |
+
height:30px;
|
123 |
+
}
|
124 |
+
.monetize-btn{
|
125 |
+
background-color: rgba(255, 242, 0, 1);
|
126 |
+
border: 1px solid rgba(240, 228, 0, 1);
|
127 |
+
border-radius: 3px;
|
128 |
+
box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.11);
|
129 |
+
padding: 10px 20px;
|
130 |
+
font-family: 'Arial';
|
131 |
+
font-size: 16px;
|
132 |
+
font-weight: bold;
|
133 |
+
color: rgba(0, 0, 0, 1) !important;
|
134 |
+
text-decoration:none;
|
135 |
+
position: relative;
|
136 |
+
top: -5px;
|
137 |
+
}
|
138 |
+
#ipa_meta p label, #ipa_meta #titlewrap label{
|
139 |
+
width: 14%;
|
140 |
+
float: left;
|
141 |
+
font-size: 14px;
|
142 |
+
font-weight: bold;
|
143 |
+
padding-top: 4px;
|
144 |
+
}
|
145 |
+
#ipa_meta #title-prompt-text{
|
146 |
+
|
147 |
+
}
|
148 |
+
|
149 |
+
#paragraph_number{
|
150 |
+
vertical-align: middle;
|
151 |
+
}
|
152 |
+
input#ad_unit{
|
153 |
+
display:none;
|
154 |
+
}
|
155 |
+
.aslabel{
|
156 |
+
float: left;
|
157 |
+
width: 190px;
|
158 |
+
font-size: 14px;
|
159 |
+
font-weight:bold;
|
160 |
+
}
|
161 |
+
#cur-pos-sel{
|
162 |
+
float: left;
|
163 |
+
}
|
164 |
+
.insert_ads_popup_content_wrapper p .ipcheckbox + .ipcheckbox{
|
165 |
+
display:none;
|
166 |
+
}
|
167 |
+
.insert_ads_popup_content_wrapper{
|
168 |
+
margin-top:15px;
|
169 |
+
}
|
170 |
+
.smartlogixSectionWrapper .smartlogixSectionInner, .insert_ads_vi_popup_left_column p:last-child{
|
171 |
+
margin-bottom:0 !important;
|
172 |
+
}
|
173 |
+
.insert_ads_vi_popup_left_column textarea{
|
174 |
+
overflow-x:hidden;
|
175 |
+
}
|
176 |
+
#field-more{
|
177 |
+
position: absolute;
|
178 |
+
top: 12px;
|
179 |
+
right: -70px;
|
180 |
+
font-family: 'Open Sans';
|
181 |
+
font-size: 14px;
|
182 |
+
font-style: italic;
|
183 |
+
color: rgba(102, 102, 102, 1);
|
184 |
+
text-decoration: none;
|
185 |
+
}
|
186 |
+
#field-more span{
|
187 |
+
background-color: rgba(186, 186, 186, 1);
|
188 |
+
color: white;
|
189 |
+
display: inline-block;
|
190 |
+
width: 13px;
|
191 |
+
text-align: center;
|
192 |
+
border-radius: 50%;
|
193 |
+
margin-right: 5px;
|
194 |
+
height: 13px;
|
195 |
+
line-height: 14px;
|
196 |
+
vertical-align: middle;
|
197 |
+
}
|
198 |
+
#field-more text{
|
199 |
+
display: inline-block;
|
200 |
+
vertical-align: middle;
|
201 |
+
line-height: 14px;
|
202 |
+
}
|
203 |
+
.keys-desc{
|
204 |
+
float: right;
|
205 |
+
width: calc(100% - 210px);
|
206 |
+
display: inline-block;
|
207 |
+
clear: none;
|
208 |
+
margin-right: 20px;
|
209 |
+
font-family: 'Arial';
|
210 |
+
font-size: 14px;
|
211 |
+
font-style: italic;
|
212 |
+
color: rgba(102, 102, 102, 1);
|
213 |
+
}
|
214 |
+
.postbox .smartlogixSectionWrapper{
|
215 |
+
padding: 0;
|
216 |
+
margin-top: 0;
|
217 |
+
}
|
218 |
+
#normal-sortables .smartlogixSectionWrapper .smartlogixSectionTitle{
|
219 |
+
border-bottom: 1px solid #eee;
|
220 |
+
padding: 15px 30px;
|
221 |
+
position: static;
|
222 |
+
width: 95%;
|
223 |
+
display: block;
|
224 |
+
font-size: 14px;
|
225 |
+
}
|
226 |
+
body.insertpostads_page_vi_integration p{
|
227 |
+
font-size: 14px;
|
228 |
+
}
|
229 |
+
.insert_ads_vi_popup_left_column input[type="text"]:not(.minicolors-input), .insert_ads_vi_popup_left_column textarea{
|
230 |
+
padding: 10px;
|
231 |
+
color: rgba(102, 102, 102, 1);
|
232 |
+
}
|
233 |
+
.insert_ads_vi_popup_left_column select, .insert_ads_vi_popup_left_column select option, .insert_ads_vi_popup_left_column .minicolors-input{
|
234 |
+
color: rgba(102, 102, 102, 1);
|
235 |
+
background:white;
|
236 |
+
}
|
237 |
+
body.post-new-php.post-type-insertpostads #postbox-container-1{
|
238 |
+
display:none;
|
239 |
+
}
|
240 |
+
body.post-new-php.post-type-insertpostads #poststuff #post-body{
|
241 |
+
margin-right:0;
|
242 |
+
}
|
243 |
+
.post-type-insertpostads th#title{
|
244 |
+
width: 25%;
|
245 |
+
}
|
246 |
+
.post-type-insertpostads th#ad_unit{
|
247 |
+
width: 20%;
|
248 |
+
}
|
249 |
+
.post-type-insertpostads th#date{
|
250 |
+
width: 60%;
|
251 |
+
}
|
252 |
+
.post-type-insertpostads #the-list + tfoot{
|
253 |
+
display:none;
|
254 |
+
}
|
255 |
+
.post-type-insertpostads .tablenav-pages{
|
256 |
+
display:none;
|
257 |
+
}
|
258 |
+
.post-type-insertpostads .search-box{
|
259 |
+
position: relative;
|
260 |
+
right: 0;
|
261 |
+
top: 47px;
|
262 |
+
}
|
263 |
+
.post-type-insertpostads td.date abbr{
|
264 |
+
text-decoration: none;
|
265 |
+
font-weight: bold;
|
266 |
+
}
|
267 |
+
.post-type-insertpostads .tablenav{
|
268 |
+
margin-bottom:20px;
|
269 |
+
}
|
270 |
+
.post-type-insertpostads .subsubsub{
|
271 |
+
margin-bottom: 12px;
|
272 |
+
}
|
273 |
+
.bulk{
|
274 |
+
float: left;
|
275 |
+
margin-top: 5px;
|
276 |
+
font-family: 'Arial';
|
277 |
+
font-size: 14px;
|
278 |
+
color: rgba(0, 0, 0, 1);
|
279 |
+
text-align: left;
|
280 |
+
margin-right: 15px;
|
281 |
+
}
|
282 |
+
.post-type-insertpostads .striped>tbody>:nth-child(odd) {
|
283 |
+
background-color: rgba(241, 241, 241, 1);
|
284 |
+
}
|
285 |
+
.post-type-insertpostads .striped>tbody>tr>*{
|
286 |
+
border-bottom: 1px solid rgba(229, 229, 229, 1);
|
287 |
+
}
|
288 |
+
body.post-new-php.post-type-insertpostads #titlewrap{
|
289 |
+
display:none;
|
290 |
+
}
|
291 |
+
body.post-new-php.post-type-insertpostads #title{
|
292 |
+
width: 86%;
|
293 |
+
margin: 0;
|
294 |
+
}
|
295 |
+
#ipa_meta{
|
296 |
+
width:80%;
|
297 |
+
}
|
298 |
+
#ipa_meta + #publish{
|
299 |
+
padding: 0 20px;
|
300 |
+
}
|
301 |
+
#field-more i{
|
302 |
+
color: rgba(186, 186, 186, 1);
|
303 |
+
vertical-align: middle;
|
304 |
+
margin-right: 5px;
|
305 |
+
font-size: 14px;
|
306 |
+
}
|
307 |
+
.plugin-card-top-content .viError{
|
308 |
+
font-weight:normal;
|
309 |
+
}
|
310 |
+
@media(max-width:1500px){
|
311 |
+
.blurb-info{
|
312 |
+
max-width: 864px;
|
313 |
+
}
|
314 |
+
}
|
315 |
+
@media(max-width:1200px){
|
316 |
+
.blurb-info{
|
317 |
+
max-width: 750px;
|
318 |
+
}
|
319 |
+
}
|
320 |
+
@media(max-width:1200px){
|
321 |
+
.blurb-info{
|
322 |
+
max-width: 650px;
|
323 |
+
}
|
324 |
+
}
|
325 |
+
@media(max-width:1100px){
|
326 |
+
.blurb-info{
|
327 |
+
max-width: 550px;
|
328 |
+
}
|
329 |
+
}
|
css/controls.css
CHANGED
@@ -21,6 +21,7 @@
|
|
21 |
margin: 10px 0 10px;
|
22 |
padding: 0 10px;
|
23 |
position: relative;
|
|
|
24 |
}
|
25 |
|
26 |
@media screen and (min-width: 768px) and (max-width: 1200px) {
|
@@ -1408,4 +1409,15 @@ only screen and (min-resolution: 1.5dppx) {
|
|
1408 |
}
|
1409 |
.minicolors-theme-semanticui input {
|
1410 |
text-indent: 30px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1411 |
}
|
21 |
margin: 10px 0 10px;
|
22 |
padding: 0 10px;
|
23 |
position: relative;
|
24 |
+
padding: 0px 30px;
|
25 |
}
|
26 |
|
27 |
@media screen and (min-width: 768px) and (max-width: 1200px) {
|
1409 |
}
|
1410 |
.minicolors-theme-semanticui input {
|
1411 |
text-indent: 30px;
|
1412 |
+
}
|
1413 |
+
.ipcheckbox {
|
1414 |
+
background-color: rgba(216, 216, 216, 1);
|
1415 |
+
width: 70px;
|
1416 |
+
}
|
1417 |
+
.ipcheckbox.checked{
|
1418 |
+
-webkit-box-shadow: inset 0 0 0 36px rgba(0, 115, 164, 1);
|
1419 |
+
box-shadow: inset 0 0 0 36px rgba(0, 115, 164, 1);
|
1420 |
+
}
|
1421 |
+
.ipcheckbox.checked .handle {
|
1422 |
+
left: 37px;
|
1423 |
}
|
css/insert-post.css
CHANGED
@@ -346,17 +346,18 @@ p.viError {
|
|
346 |
position: relative;
|
347 |
}
|
348 |
|
349 |
-
.insert_ads_popup_content_wrapper .insert_ads_vi_popup_left_column p label {
|
350 |
float: left;
|
351 |
display: inline-block;
|
352 |
width: 180px;
|
|
|
353 |
}
|
354 |
|
355 |
.insert_ads_popup_content_wrapper .insert_ads_vi_popup_left_column p br {
|
356 |
display: none;
|
357 |
}
|
358 |
|
359 |
-
.insert_ads_popup_content_wrapper .insert_ads_vi_popup_left_column p input,
|
360 |
.insert_ads_popup_content_wrapper .insert_ads_vi_popup_left_column p select,
|
361 |
.insert_ads_popup_content_wrapper .insert_ads_vi_popup_left_column p textarea {
|
362 |
float: right;
|
@@ -526,12 +527,15 @@ form > .postbox .inside, form > .postbox .inside > p:first-child{
|
|
526 |
margin-top:0;
|
527 |
}
|
528 |
.ins-settings{
|
529 |
-
float:
|
530 |
-
width:
|
|
|
|
|
|
|
531 |
}
|
532 |
.vi-choose{
|
533 |
float:right;
|
534 |
-
|
535 |
}
|
536 |
.vi-choose .plugin-card{
|
537 |
width:100%;
|
@@ -543,7 +547,7 @@ form > .postbox .inside, form > .postbox .inside > p:first-child{
|
|
543 |
border:0;
|
544 |
}
|
545 |
.vi-choose .plugin-card-bottom{
|
546 |
-
padding: 5px
|
547 |
padding-bottom: 14px;
|
548 |
}
|
549 |
.vi-ct{
|
@@ -551,8 +555,8 @@ form > .postbox .inside, form > .postbox .inside > p:first-child{
|
|
551 |
width: 49%;
|
552 |
}
|
553 |
.ins-settings input[type="submit"]{
|
554 |
-
|
555 |
-
bottom: -50px
|
556 |
}
|
557 |
.plugin-card.vi-card .plugin-card-bottom > span{
|
558 |
margin-top: 12px;
|
346 |
position: relative;
|
347 |
}
|
348 |
|
349 |
+
.insert_ads_popup_content_wrapper .insert_ads_vi_popup_left_column p:not(#cur-pos-sel) label {
|
350 |
float: left;
|
351 |
display: inline-block;
|
352 |
width: 180px;
|
353 |
+
font-weight: bold;
|
354 |
}
|
355 |
|
356 |
.insert_ads_popup_content_wrapper .insert_ads_vi_popup_left_column p br {
|
357 |
display: none;
|
358 |
}
|
359 |
|
360 |
+
.insert_ads_popup_content_wrapper .insert_ads_vi_popup_left_column p input:not([type="radio"]):not(.minicolors-input),
|
361 |
.insert_ads_popup_content_wrapper .insert_ads_vi_popup_left_column p select,
|
362 |
.insert_ads_popup_content_wrapper .insert_ads_vi_popup_left_column p textarea {
|
363 |
float: right;
|
527 |
margin-top:0;
|
528 |
}
|
529 |
.ins-settings{
|
530 |
+
float:none;
|
531 |
+
width:100%;
|
532 |
+
}
|
533 |
+
.edit-php.post-type-insertpostads .tablenav.bottom{
|
534 |
+
display:none;
|
535 |
}
|
536 |
.vi-choose{
|
537 |
float:right;
|
538 |
+
width: 100%;
|
539 |
}
|
540 |
.vi-choose .plugin-card{
|
541 |
width:100%;
|
547 |
border:0;
|
548 |
}
|
549 |
.vi-choose .plugin-card-bottom{
|
550 |
+
padding: 5px 0px;
|
551 |
padding-bottom: 14px;
|
552 |
}
|
553 |
.vi-ct{
|
555 |
width: 49%;
|
556 |
}
|
557 |
.ins-settings input[type="submit"]{
|
558 |
+
/* position: absolute;
|
559 |
+
bottom: -50px;*/
|
560 |
}
|
561 |
.plugin-card.vi-card .plugin-card-bottom > span{
|
562 |
margin-top: 12px;
|
images/ic_remove.svg
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3 |
+
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
|
4 |
+
<title>ic_remove</title>
|
5 |
+
<desc>Created with Sketch.</desc>
|
6 |
+
<defs></defs>
|
7 |
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
8 |
+
<g id="1.3_insert_post_ads" transform="translate(-1376.000000, -116.000000)">
|
9 |
+
<g id="1.3_blurb_monetize-copy" transform="translate(183.000000, 100.000000)">
|
10 |
+
<g id="ic_remove" transform="translate(1193.000000, 16.000000)">
|
11 |
+
<circle id="Combined-Shape-Copy" fill="#E2E2E2" cx="7" cy="7" r="7"></circle>
|
12 |
+
<rect id="Rectangle-Copy" fill="#5F5F5F" x="6.46966991" y="3.2876894" width="1.06066017" height="7.4246212"></rect>
|
13 |
+
<rect id="Rectangle-3-Copy" fill="#5F5F5F" x="3.2876894" y="6.46966991" width="7.4246212" height="1.06066017"></rect>
|
14 |
+
</g>
|
15 |
+
</g>
|
16 |
+
</g>
|
17 |
+
</g>
|
18 |
+
</svg>
|
images/logo-svg.svg
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<svg width="123px" height="48px" viewBox="0 0 123 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3 |
+
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
|
4 |
+
<title>vi_logo_on_white copy 5</title>
|
5 |
+
<desc>Created with Sketch.</desc>
|
6 |
+
<defs></defs>
|
7 |
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
8 |
+
<g id="1.3_insert_post_ads" transform="translate(-1244.000000, -131.000000)">
|
9 |
+
<g id="1.3_blurb_monetize-copy" transform="translate(183.000000, 100.000000)">
|
10 |
+
<g id="vi_logo_on_white-copy-5" transform="translate(1063.000000, 33.000000)">
|
11 |
+
<path d="M21.8603175,43.5809524 C33.8730159,43.5809524 43.5809524,33.8730159 43.5809524,21.7904762 C43.5809524,9.77777778 33.8730159,0 21.8603175,0 C9.84761905,0.0698412698 0.13968254,9.77777778 0.13968254,21.7904762 C0.13968254,33.8031746 9.84761905,43.5809524 21.8603175,43.5809524" id="Fill-1" fill="#FEF200" fill-rule="nonzero"></path>
|
12 |
+
<path d="M21.6507937,44 C33.5936508,44 43.3015873,34.152381 43.3015873,22 C43.3015873,9.84761905 33.5936508,0 21.6507937,0 C9.70793651,0 0,9.84761905 0,22 C0,34.152381 9.70793651,44 21.6507937,44 L21.6507937,44 L21.6507937,44 L21.6507937,44 L21.6507937,44 Z" id="Stroke-2" stroke="#000000" stroke-width="3"></path>
|
13 |
+
<path d="M15.3650794,31.4285714 L19.5555556,31.4285714 L25.352381,17.1111111 L21.0222222,17.1111111 L19.2063492,21.6507937 C18.647619,23.1174603 18.0190476,24.7936508 17.4603175,26.1904762 L17.4603175,26.1904762 C16.9714286,24.7238095 16.4126984,23.1873016 15.8539683,21.6507937 L14.1777778,17.0412698 L9.4984127,17.0412698 L15.3650794,31.4285714 L15.3650794,31.4285714 L15.3650794,31.4285714 L15.3650794,31.4285714 L15.3650794,31.4285714 Z M26.8190476,31.4285714 L31.2190476,31.4285714 L31.2190476,17.1111111 L26.8190476,17.1111111 L26.8190476,31.4285714 L26.8190476,31.4285714 L26.8190476,31.4285714 L26.8190476,31.4285714 Z" id="Fill-4" fill="#000000" fill-rule="nonzero"></path>
|
14 |
+
<polygon id="Fill-5" fill="#000000" fill-rule="nonzero" points="26.8190476 14.7365079 31.2190476 14.7365079 31.2190476 10.3365079 26.8190476 10.3365079"></polygon>
|
15 |
+
<path d="M50.984127,31.4285714 L52.9396825,31.4285714 L52.9396825,25.1428571 L50.984127,25.1428571 L50.984127,31.4285714 L50.984127,31.4285714 L50.984127,31.4285714 L50.984127,31.4285714 Z M54.5460317,31.4285714 L56.5015873,31.4285714 L56.5015873,27.168254 C56.8507937,26.8888889 57.3396825,26.6095238 57.8285714,26.6095238 C58.1079365,26.6095238 58.3174603,26.6793651 58.5269841,26.8888889 C58.6666667,27.0984127 58.7365079,27.3079365 58.7365079,27.7968254 L58.7365079,31.4285714 L60.6920635,31.4285714 L60.6920635,27.5174603 C60.6920635,26.6095238 60.552381,26.0507937 60.1333333,25.631746 C59.7142857,25.2126984 59.1555556,25.0031746 58.4571429,25.0031746 C57.6888889,25.0031746 56.9904762,25.352381 56.5015873,25.7015873 L56.5015873,25.7015873 L56.5015873,25.1428571 L54.5460317,25.1428571 L54.5460317,31.4285714 L54.5460317,31.4285714 L54.5460317,31.4285714 L54.5460317,31.4285714 L54.5460317,31.4285714 Z M63.2761905,30.9396825 C63.6952381,31.3587302 64.2539683,31.568254 64.8825397,31.568254 C65.4412698,31.568254 66,31.4285714 66.2793651,31.2190476 L66.2793651,29.6825397 C66,29.8222222 65.6507937,29.9619048 65.3714286,29.9619048 C64.8126984,29.9619048 64.6730159,29.4730159 64.6730159,28.9142857 L64.6730159,26.8190476 L66.3492063,26.8190476 L66.3492063,25.1428571 L64.6730159,25.1428571 L64.6730159,23.1873016 L62.7174603,23.5365079 L62.7174603,25.1428571 L61.6698413,25.1428571 L61.6698413,26.7492063 L62.7174603,26.7492063 L62.7174603,29.0539683 C62.7174603,30.1015873 62.9269841,30.5904762 63.2761905,30.9396825 L63.2761905,30.9396825 L63.2761905,30.9396825 L63.2761905,30.9396825 L63.2761905,30.9396825 Z M73.3333333,28.7746032 C73.3333333,28.6349206 73.4031746,28.3555556 73.4031746,28.0761905 C73.4031746,25.9809524 71.9365079,24.9333333 70.4,24.9333333 C68.6539683,24.9333333 67.1174603,26.2603175 67.1174603,28.2857143 C67.1174603,30.2412698 68.584127,31.568254 70.6793651,31.568254 C71.5174603,31.568254 72.4952381,31.3587302 73.0539683,31.0095238 L73.0539683,29.4031746 C72.3555556,29.8222222 71.5873016,30.1015873 70.8888889,30.1015873 C69.9809524,30.1015873 69.2825397,29.6825397 69.0730159,28.8444444 L73.3333333,28.8444444 L73.3333333,28.7746032 L73.3333333,28.7746032 L73.3333333,28.7746032 L73.3333333,28.7746032 Z M70.3301587,26.4698413 C70.9587302,26.4698413 71.447619,26.8888889 71.5873016,27.5873016 L69.0730159,27.5873016 C69.1428571,26.8888889 69.7015873,26.4698413 70.3301587,26.4698413 L70.3301587,26.4698413 L70.3301587,26.4698413 L70.3301587,26.4698413 L70.3301587,26.4698413 Z M74.5904762,31.4285714 L76.5460317,31.4285714 L76.5460317,21.6507937 L74.5904762,21.6507937 L74.5904762,31.4285714 L74.5904762,31.4285714 L74.5904762,31.4285714 L74.5904762,31.4285714 Z M78.152381,31.4285714 L80.1079365,31.4285714 L80.1079365,21.6507937 L78.152381,21.6507937 L78.152381,31.4285714 L78.152381,31.4285714 L78.152381,31.4285714 L78.152381,31.4285714 Z M81.7142857,31.4285714 L83.6698413,31.4285714 L83.6698413,25.1428571 L81.7142857,25.1428571 L81.7142857,31.4285714 L81.7142857,31.4285714 L81.7142857,31.4285714 L81.7142857,31.4285714 Z M85.8349206,33.9428571 C86.3936508,34.2222222 87.1619048,34.431746 88,34.431746 C90.0253968,34.431746 91.352381,33.3142857 91.352381,31.3587302 L91.352381,25.1428571 L89.815873,25.4222222 C89.3968254,25.2126984 88.8380952,25.0730159 88.2095238,25.0730159 C86.2539683,25.0730159 84.9269841,26.5396825 84.9269841,28.3555556 C84.9269841,30.2412698 86.3238095,31.4285714 87.8603175,31.4285714 C88.4190476,31.4285714 88.9777778,31.2888889 89.3269841,31.0095238 L89.3269841,31.0095238 L89.3269841,31.3587302 C89.3269841,32.2666667 88.768254,32.7555556 87.7904762,32.7555556 C87.0920635,32.7555556 86.3936508,32.5460317 85.7650794,32.1269841 L85.7650794,33.9428571 L85.8349206,33.9428571 L85.8349206,33.9428571 L85.8349206,33.9428571 L85.8349206,33.9428571 Z M86.952381,28.215873 C86.952381,27.3777778 87.4412698,26.6793651 88.4190476,26.6793651 C88.768254,26.6793651 89.1174603,26.7492063 89.3968254,26.8888889 L89.3968254,29.5428571 C89.1174603,29.6825397 88.768254,29.8222222 88.4190476,29.8222222 C87.5111111,29.8222222 86.952381,29.1238095 86.952381,28.215873 L86.952381,28.215873 L86.952381,28.215873 L86.952381,28.215873 L86.952381,28.215873 Z M98.8253968,28.7746032 C98.8253968,28.6349206 98.8952381,28.3555556 98.8952381,28.0761905 C98.8952381,25.9809524 97.4285714,24.9333333 95.8920635,24.9333333 C94.1460317,24.9333333 92.6095238,26.2603175 92.6095238,28.2857143 C92.6095238,30.2412698 94.0761905,31.568254 96.1714286,31.568254 C97.0095238,31.568254 97.9174603,31.3587302 98.5460317,31.0095238 L98.5460317,29.4031746 C97.847619,29.8222222 97.0793651,30.1015873 96.3809524,30.1015873 C95.4730159,30.1015873 94.7746032,29.6825397 94.5650794,28.8444444 L98.8253968,28.8444444 L98.8253968,28.7746032 L98.8253968,28.7746032 L98.8253968,28.7746032 L98.8253968,28.7746032 Z M95.8222222,26.4698413 C96.4507937,26.4698413 96.9396825,26.8888889 97.0793651,27.5873016 L94.5650794,27.5873016 C94.7047619,26.8888889 95.2634921,26.4698413 95.8222222,26.4698413 L95.8222222,26.4698413 L95.8222222,26.4698413 L95.8222222,26.4698413 L95.8222222,26.4698413 Z M100.152381,31.4285714 L102.107937,31.4285714 L102.107937,27.168254 C102.457143,26.8888889 102.946032,26.6095238 103.434921,26.6095238 C103.714286,26.6095238 103.92381,26.6793651 104.133333,26.8888889 C104.273016,27.0984127 104.342857,27.3079365 104.342857,27.7968254 L104.342857,31.4285714 L106.298413,31.4285714 L106.298413,27.5174603 C106.298413,26.6095238 106.15873,26.0507937 105.739683,25.631746 C105.320635,25.2126984 104.761905,25.0031746 104.063492,25.0031746 C103.295238,25.0031746 102.596825,25.352381 102.107937,25.7015873 L102.107937,25.7015873 L102.107937,25.1428571 L100.152381,25.1428571 L100.152381,31.4285714 L100.152381,31.4285714 L100.152381,31.4285714 L100.152381,31.4285714 L100.152381,31.4285714 Z M107.485714,28.2857143 C107.485714,30.1714286 108.952381,31.568254 110.977778,31.568254 C111.67619,31.568254 112.444444,31.4285714 113.073016,31.0793651 L113.073016,29.3333333 C112.514286,29.752381 111.815873,29.9619048 111.257143,29.9619048 C110.209524,29.9619048 109.511111,29.2634921 109.511111,28.3555556 C109.511111,27.3777778 110.209524,26.6793651 111.257143,26.6793651 C111.885714,26.6793651 112.444444,26.8888889 113.003175,27.2380952 L113.003175,25.4222222 C112.514286,25.1428571 111.815873,25.0031746 111.11746,25.0031746 C109.092063,25.0031746 107.485714,26.3301587 107.485714,28.2857143 L107.485714,28.2857143 L107.485714,28.2857143 L107.485714,28.2857143 L107.485714,28.2857143 Z M120.266667,28.7746032 C120.266667,28.6349206 120.336508,28.3555556 120.336508,28.0761905 C120.336508,25.9809524 118.869841,24.9333333 117.333333,24.9333333 C115.587302,24.9333333 114.050794,26.2603175 114.050794,28.2857143 C114.050794,30.2412698 115.51746,31.568254 117.612698,31.568254 C118.450794,31.568254 119.428571,31.3587302 119.987302,31.0095238 L119.987302,29.4031746 C119.288889,29.8222222 118.520635,30.1015873 117.822222,30.1015873 C116.914286,30.1015873 116.215873,29.6825397 116.006349,28.8444444 L120.266667,28.8444444 L120.266667,28.7746032 L120.266667,28.7746032 L120.266667,28.7746032 L120.266667,28.7746032 Z M117.263492,26.4698413 C117.892063,26.4698413 118.380952,26.8888889 118.520635,27.5873016 L115.936508,27.5873016 C116.146032,26.8888889 116.634921,26.4698413 117.263492,26.4698413 L117.263492,26.4698413 L117.263492,26.4698413 L117.263492,26.4698413 L117.263492,26.4698413 Z" id="Fill-6" fill="#000000" fill-rule="nonzero"></path>
|
16 |
+
<path d="M50.984127,24.0952381 L52.9396825,24.0952381 L52.9396825,22.1396825 L50.984127,22.1396825 L50.984127,24.0952381 L50.984127,24.0952381 L50.984127,24.0952381 L50.984127,24.0952381 Z M81.7142857,24.0952381 L83.6698413,24.0952381 L83.6698413,22.1396825 L81.7142857,22.1396825 L81.7142857,24.0952381 L81.7142857,24.0952381 L81.7142857,24.0952381 L81.7142857,24.0952381 Z" id="Fill-7" fill="#000000" fill-rule="nonzero"></path>
|
17 |
+
<path d="M53.568254,20.2539683 L55.4539683,20.2539683 L58.0380952,13.968254 L56.0825397,13.968254 L55.3142857,15.9936508 C55.0349206,16.6222222 54.7555556,17.3904762 54.5460317,18.0190476 L54.5460317,18.0190476 C54.3365079,17.3904762 54.0571429,16.6920635 53.847619,15.9936508 L53.0095238,13.968254 L50.984127,13.968254 L53.568254,20.2539683 L53.568254,20.2539683 L53.568254,20.2539683 L53.568254,20.2539683 L53.568254,20.2539683 Z M58.8761905,20.2539683 L60.831746,20.2539683 L60.831746,13.968254 L58.8761905,13.968254 L58.8761905,20.2539683 L58.8761905,20.2539683 L58.8761905,20.2539683 L58.8761905,20.2539683 Z M62.0888889,17.2507937 C62.0888889,19.2063492 63.4857143,20.3936508 65.0222222,20.3936508 C65.6507937,20.3936508 66.2095238,20.184127 66.6285714,19.9047619 L66.6285714,19.9047619 L66.6285714,20.2539683 L68.5142857,20.2539683 L68.5142857,10.4761905 L66.5587302,10.4761905 L66.5587302,14.0380952 L66.5587302,14.0380952 C66.2095238,13.8984127 65.8603175,13.8285714 65.3714286,13.8285714 C63.4857143,13.8285714 62.0888889,15.2253968 62.0888889,17.2507937 L62.0888889,17.2507937 L62.0888889,17.2507937 L62.0888889,17.2507937 L62.0888889,17.2507937 Z M64.0444444,17.1809524 C64.0444444,16.2031746 64.6031746,15.4349206 65.6507937,15.4349206 C66.0698413,15.4349206 66.3492063,15.5047619 66.6285714,15.6444444 L66.6285714,18.4380952 C66.3492063,18.647619 65.9301587,18.7873016 65.5111111,18.7873016 C64.5333333,18.7873016 64.0444444,18.0888889 64.0444444,17.1809524 L64.0444444,17.1809524 L64.0444444,17.1809524 L64.0444444,17.1809524 L64.0444444,17.1809524 Z M76.0571429,17.6 C76.0571429,17.4603175 76.1269841,17.1809524 76.1269841,16.9015873 C76.1269841,14.8063492 74.6603175,13.7587302 73.1238095,13.7587302 C71.3777778,13.7587302 69.8412698,15.0857143 69.8412698,17.1111111 C69.8412698,19.0666667 71.3079365,20.3936508 73.4031746,20.3936508 C74.2412698,20.3936508 75.2190476,20.184127 75.7777778,19.8349206 L75.7777778,18.2285714 C75.0793651,18.647619 74.3111111,18.9269841 73.6126984,18.9269841 C72.7047619,18.9269841 72.0063492,18.5079365 71.7968254,17.6698413 L76.0571429,17.6698413 L76.0571429,17.6 L76.0571429,17.6 L76.0571429,17.6 L76.0571429,17.6 Z M73.0539683,15.2952381 C73.6825397,15.2952381 74.1714286,15.7142857 74.3111111,16.4126984 L71.7968254,16.4126984 C71.9365079,15.7142857 72.4253968,15.2952381 73.0539683,15.2952381 L73.0539683,15.2952381 L73.0539683,15.2952381 L73.0539683,15.2952381 L73.0539683,15.2952381 Z M78.9206349,17.1111111 C78.9206349,16.2031746 79.6190476,15.5047619 80.4571429,15.5047619 C81.2952381,15.5047619 81.9936508,16.2031746 81.9936508,17.1111111 C81.9936508,18.0190476 81.2952381,18.7174603 80.4571429,18.7174603 C79.6190476,18.7174603 78.9206349,18.0190476 78.9206349,17.1111111 L78.9206349,17.1111111 L78.9206349,17.1111111 L78.9206349,17.1111111 L78.9206349,17.1111111 Z M76.9650794,17.1111111 C76.9650794,18.9968254 78.431746,20.3936508 80.4571429,20.3936508 C82.4825397,20.3936508 83.9492063,18.9269841 83.9492063,17.1111111 C83.9492063,15.2952381 82.4825397,13.8285714 80.4571429,13.8285714 C78.431746,13.8285714 76.9650794,15.2253968 76.9650794,17.1111111 L76.9650794,17.1111111 L76.9650794,17.1111111 L76.9650794,17.1111111 L76.9650794,17.1111111 Z" id="Fill-8" fill="#000000" fill-rule="nonzero"></path>
|
18 |
+
<polygon id="Fill-9" fill="#000000" fill-rule="nonzero" points="58.6666667 12.7809524 60.6222222 12.7809524 60.6222222 10.8253968 58.6666667 10.8253968"></polygon>
|
19 |
+
</g>
|
20 |
+
</g>
|
21 |
+
</g>
|
22 |
+
</g>
|
23 |
+
</svg>
|
includes/adstxt.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function insert_ads_adstxt_file_exists() {
|
3 |
+
if(file_exists(trailingslashit(get_home_path()).'ads.txt')) {
|
4 |
+
return true;
|
5 |
+
}
|
6 |
+
return false;
|
7 |
+
}
|
8 |
+
|
9 |
+
function insert_ads_adstxt_get_content() {
|
10 |
+
if(insert_ads_adstxt_file_exists()) {
|
11 |
+
return @file_get_contents(trailingslashit(get_home_path()).'ads.txt');
|
12 |
+
}
|
13 |
+
return '';
|
14 |
+
}
|
15 |
+
|
16 |
+
function insert_ads_adstxt_update_content($content) {
|
17 |
+
if(get_filesystem_method() === 'direct') {
|
18 |
+
$creds = request_filesystem_credentials(site_url().'/wp-admin/', '', false, false, array());
|
19 |
+
if(!WP_Filesystem($creds)) {
|
20 |
+
return false;
|
21 |
+
}
|
22 |
+
global $wp_filesystem;
|
23 |
+
if(!$wp_filesystem->put_contents(trailingslashit(get_home_path()).'ads.txt', $content, FS_CHMOD_FILE)) {
|
24 |
+
return false;
|
25 |
+
}
|
26 |
+
} else {
|
27 |
+
return false;
|
28 |
+
}
|
29 |
+
return true;
|
30 |
+
}
|
31 |
+
|
32 |
+
function insert_ads_adstxt_updation_failed_message($content) {
|
33 |
+
$output = '<div class="insert_ads_popup_content_wrapper">';
|
34 |
+
$output .= '<p>Auto Creation / Updation of ads.txt failed due to access permission restrictions on the server.</p>';
|
35 |
+
$output .= '<p>You have to manually upload the file using your Host\'s File manager or your favourite FTP program</p>';
|
36 |
+
$output .= '<p>ads.txt should be located in the root of your server. After manually uploading the file click <a href="'.site_url().'/ads.txt">here</a> to check if its accessible from the correct location</p>';
|
37 |
+
$output .= '<textarea style="display: none;" id="insert_ads_adstxt_content">'.$content.'</textarea>';
|
38 |
+
$output .= '<p><a onclick="insert_ads_adstxt_content_download()" class="button button-primary" href="javascript:;">Download ads.txt</a></p>';
|
39 |
+
$output .= '</div>';
|
40 |
+
return $output;
|
41 |
+
}
|
42 |
+
?>
|
common.php → includes/common.php
RENAMED
File without changes
|
geotargeting.php → includes/geotargeting.php
RENAMED
File without changes
|
inpostads.php → includes/inpostads.php
RENAMED
@@ -5,12 +5,19 @@ function insert_ads_inpostads_plugin_card() {
|
|
5 |
echo '<div class="plugin-card">';
|
6 |
echo '<h3 class="hndle">In-Post Ads</h3>';
|
7 |
echo '<div class="plugin-card-bottom">';
|
8 |
-
echo '<p
|
9 |
-
echo '<div class="vi-ct"><p><a id="insert_ads_inpostads_above" href="javascript:;">Ad - Above Post Content</a></p>';
|
10 |
-
echo '<p><a id="insert_ads_inpostads_middle" href="javascript:;">Ad - Middle of Post Content</a></p>';
|
11 |
-
echo '<p><a id="insert_ads_inpostads_below" href="javascript:;">Ad - Below Post Content</a></p></div>';
|
12 |
-
echo '<div class="vi-ct"><p><a id="insert_ads_inpostads_left" href="javascript:;">Ad - Left of Post Content</a></p>';
|
13 |
-
echo '<p><a id="insert_ads_inpostads_right" href="javascript:;">Ad - Right of Post Content</a></p></div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
echo '</div>';
|
15 |
echo '</div>';
|
16 |
echo '<input type="hidden" id="insert_ads_admin_ajax" name="insert_ads_admin_ajax" value="' . admin_url('admin-ajax.php') . '" /><input type="hidden" id="insert_ads_nonce" name="insert_ads_nonce" value="' . wp_create_nonce('insert-ads') . '" />';
|
@@ -122,17 +129,19 @@ function insert_ads_inpostads_form_get_content($position) {
|
|
122 |
array('text' => 'Use Generic / Custom Ad Code', 'value' => 'generic'),
|
123 |
array('text' => 'vi stories', 'value' => 'vicode'),
|
124 |
);
|
|
|
125 |
$control->add_control(array('type' => 'select', 'label' => 'Ad Type', 'optionName' => 'primary_ad_code_type', 'options' => $adTypes));
|
126 |
echo $control->HTML;
|
127 |
$control->clear_controls();
|
|
|
128 |
|
129 |
-
|
130 |
$control->create_section('<span id="primary_ad_code_type_generic" class="isSelectedIndicator"></span>Generic / Custom Ad Code (Primary Network)');
|
131 |
$control->set_HTML('<div class="insert_ads_rule_block">'.$control->HTML.'</div>');
|
132 |
echo $control->HTML;
|
133 |
-
$control->clear_controls()
|
134 |
|
135 |
-
|
136 |
$isJSTagGenerated = ((insert_ads_vi_api_get_vi_code() === false)?false:true);
|
137 |
$isVIDisabled = false;
|
138 |
$viMessage = '';
|
@@ -144,7 +153,7 @@ function insert_ads_inpostads_form_get_content($position) {
|
|
144 |
$isVIDisabled = true;
|
145 |
$viMessage .= '<p>Before you can use <b>vi stories</b>, you must configure it. In the <i>video intelligence</i> panel, click <i>Configure</i></p>';
|
146 |
//$viMessage .= '<p><a id="insert_ads_inpostads_vi_customize_adcode" href="javascript:;" class="button button-primary aligncenter">Configure vi Code</a></p>'; /*Button being temporarily removed to avoid confusion for users*/
|
147 |
-
} else if(!$IsVILoggedin && $isJSTagGenerated) {
|
148 |
$isVIDisabled = false;
|
149 |
$viMessage = '<p>Before you can use <b>vi stories</b>, you must configure it. Once you’ve signed up, in the <i>video intelligence</i> panel, click <i>Sign in</i> then click <i>Configure</i></p>';
|
150 |
} else {
|
@@ -152,21 +161,21 @@ function insert_ads_inpostads_form_get_content($position) {
|
|
152 |
$viMessage = insert_ads_vi_customize_adcode_get_settings();
|
153 |
$viMessage .= '<p>To configure <b>vi stories</b>, go to the <i>video intelligence</i> panel, click <i>Configure</i></p>';
|
154 |
//$viMessage .= '<p><a id="insert_ads_inpostads_vi_customize_adcode" href="javascript:;" class="button button-primary aligncenter">Configure vi Code</a></p>'; /*Button being temporarily removed to avoid confusion for users*/
|
155 |
-
}
|
156 |
|
157 |
-
|
158 |
$control->create_section('<span id="primary_ad_code_type_vicode" class="isSelectedIndicator '.(($isVIDisabled)?'disabled':'').'"></span>vi stories (Primary Network)');
|
159 |
$control->set_HTML('<div class="insert_ads_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
|
160 |
echo $control->HTML;
|
161 |
-
$control->clear_controls()
|
162 |
} else {
|
163 |
-
|
164 |
$control->create_section('Ad Code (Primary Network)');
|
165 |
echo $control->HTML;
|
166 |
-
$control->clear_controls()
|
167 |
}
|
168 |
|
169 |
-
|
170 |
$control->create_section('Ad Code (Secondary Network)');
|
171 |
if($abtestingMode != '2' && $abtestingMode != '3') {
|
172 |
$control->set_HTML('<div style="display: none;">'.$control->HTML.'</div>');
|
@@ -180,9 +189,9 @@ function insert_ads_inpostads_form_get_content($position) {
|
|
180 |
$control->set_HTML('<div style="display: none;">'.$control->HTML.'</div>');
|
181 |
}
|
182 |
echo $control->HTML;
|
183 |
-
$control->clear_controls()
|
184 |
echo '</div>';
|
185 |
-
echo '<h3>Rules</h3>';
|
186 |
echo '<div>';
|
187 |
$control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_loggedin'));
|
188 |
$control->create_section('Logged in Users');
|
@@ -283,8 +292,8 @@ function insert_ads_inpostads_form_get_content($position) {
|
|
283 |
$control->create_section('Notes');
|
284 |
echo $control->HTML;
|
285 |
$control->clear_controls();
|
286 |
-
echo '</div>'
|
287 |
-
if($position == 'middle') {
|
288 |
echo '<h3>Positioning</h3>';
|
289 |
echo '<div>';
|
290 |
$control->add_control(array('type' => 'text', 'label' => 'Minimum Character Count', 'optionName' => 'minimum_character_count', 'helpText' => 'Show the ad only if the Content meets the minimum character count. If this parameter is set to 0 (or empty) minimum character count check will be deactivated.'));
|
@@ -293,15 +302,15 @@ function insert_ads_inpostads_form_get_content($position) {
|
|
293 |
echo $control->HTML;
|
294 |
$control->clear_controls();
|
295 |
echo '</div>';
|
296 |
-
}
|
297 |
-
echo '</div>';
|
298 |
echo '<script type="text/javascript">';
|
299 |
echo $control->JS;
|
300 |
-
echo 'jQuery("#insert_ads_inpostads_'.$position.'_accordion").accordion({ icons: { header: "ui-icon-circle-arrow-e", activeHeader: "ui-icon-circle-arrow-s" }, heightStyle: "auto" });';
|
301 |
-
echo 'primary_ad_code_type_change();';
|
302 |
-
echo 'insert_ads_inpostads_vi_customize_adcode();';
|
303 |
echo '</script>';
|
304 |
-
echo '</div>';
|
305 |
}
|
306 |
|
307 |
function insert_ads_inpostads_form_save_action($position) {
|
5 |
echo '<div class="plugin-card">';
|
6 |
echo '<h3 class="hndle">In-Post Ads</h3>';
|
7 |
echo '<div class="plugin-card-bottom">';
|
8 |
+
echo '<p class="aslabel">Ads shown</p>';
|
9 |
+
//echo '<div class="vi-ct"><p><a id="insert_ads_inpostads_above" href="javascript:;">Ad - Above Post Content</a></p>';
|
10 |
+
//echo '<p><a id="insert_ads_inpostads_middle" href="javascript:;">Ad - Middle of Post Content</a></p>';
|
11 |
+
//echo '<p><a id="insert_ads_inpostads_below" href="javascript:;">Ad - Below Post Content</a></p></div>';
|
12 |
+
//echo '<div class="vi-ct"><p><a id="insert_ads_inpostads_left" href="javascript:;">Ad - Left of Post Content</a></p>';
|
13 |
+
//echo '<p><a id="insert_ads_inpostads_right" href="javascript:;">Ad - Right of Post Content</a></p></div>';
|
14 |
+
echo '<p id="cur-pos-sel">';
|
15 |
+
echo '<input type="radio" checked name="cur-pos-rad" value="above" id="cur-pos-above"><label for="cur-pos-above" style="margin-right: 15px;">Ad - Above Post Content</label>';
|
16 |
+
echo '<input type="radio" name="cur-pos-rad" value="middle" id="cur-pos-middle"><label for="cur-pos-middle">Ad - Middle of Post Content</label>';
|
17 |
+
echo '</p>';
|
18 |
+
echo '<div style="clear:both;"></div>';
|
19 |
+
insert_ads_inpostads_form_get_content('above');
|
20 |
+
insert_ads_inpostads_form_get_content('middle');
|
21 |
echo '</div>';
|
22 |
echo '</div>';
|
23 |
echo '<input type="hidden" id="insert_ads_admin_ajax" name="insert_ads_admin_ajax" value="' . admin_url('admin-ajax.php') . '" /><input type="hidden" id="insert_ads_nonce" name="insert_ads_nonce" value="' . wp_create_nonce('insert-ads') . '" />';
|
129 |
array('text' => 'Use Generic / Custom Ad Code', 'value' => 'generic'),
|
130 |
array('text' => 'vi stories', 'value' => 'vicode'),
|
131 |
);
|
132 |
+
echo '<span class="aslabel" style="padding: 11px 0;">Activate vi stories</span>';
|
133 |
$control->add_control(array('type' => 'select', 'label' => 'Ad Type', 'optionName' => 'primary_ad_code_type', 'options' => $adTypes));
|
134 |
echo $control->HTML;
|
135 |
$control->clear_controls();
|
136 |
+
//echo '<p data-pos="'.$position.'" class="notify-'.$position.' funcnot"></p>';
|
137 |
|
138 |
+
/*$control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'primary_ad_code'));
|
139 |
$control->create_section('<span id="primary_ad_code_type_generic" class="isSelectedIndicator"></span>Generic / Custom Ad Code (Primary Network)');
|
140 |
$control->set_HTML('<div class="insert_ads_rule_block">'.$control->HTML.'</div>');
|
141 |
echo $control->HTML;
|
142 |
+
$control->clear_controls();*/
|
143 |
|
144 |
+
/*$IsVILoggedin = insert_ads_vi_api_is_loggedin();
|
145 |
$isJSTagGenerated = ((insert_ads_vi_api_get_vi_code() === false)?false:true);
|
146 |
$isVIDisabled = false;
|
147 |
$viMessage = '';
|
153 |
$isVIDisabled = true;
|
154 |
$viMessage .= '<p>Before you can use <b>vi stories</b>, you must configure it. In the <i>video intelligence</i> panel, click <i>Configure</i></p>';
|
155 |
//$viMessage .= '<p><a id="insert_ads_inpostads_vi_customize_adcode" href="javascript:;" class="button button-primary aligncenter">Configure vi Code</a></p>'; /*Button being temporarily removed to avoid confusion for users*/
|
156 |
+
/*} else if(!$IsVILoggedin && $isJSTagGenerated) {
|
157 |
$isVIDisabled = false;
|
158 |
$viMessage = '<p>Before you can use <b>vi stories</b>, you must configure it. Once you’ve signed up, in the <i>video intelligence</i> panel, click <i>Sign in</i> then click <i>Configure</i></p>';
|
159 |
} else {
|
161 |
$viMessage = insert_ads_vi_customize_adcode_get_settings();
|
162 |
$viMessage .= '<p>To configure <b>vi stories</b>, go to the <i>video intelligence</i> panel, click <i>Configure</i></p>';
|
163 |
//$viMessage .= '<p><a id="insert_ads_inpostads_vi_customize_adcode" href="javascript:;" class="button button-primary aligncenter">Configure vi Code</a></p>'; /*Button being temporarily removed to avoid confusion for users*/
|
164 |
+
//}
|
165 |
|
166 |
+
/*$control->HTML .= $viMessage;
|
167 |
$control->create_section('<span id="primary_ad_code_type_vicode" class="isSelectedIndicator '.(($isVIDisabled)?'disabled':'').'"></span>vi stories (Primary Network)');
|
168 |
$control->set_HTML('<div class="insert_ads_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
|
169 |
echo $control->HTML;
|
170 |
+
$control->clear_controls();*/
|
171 |
} else {
|
172 |
+
/*$control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'primary_ad_code'));
|
173 |
$control->create_section('Ad Code (Primary Network)');
|
174 |
echo $control->HTML;
|
175 |
+
$control->clear_controls();*/
|
176 |
}
|
177 |
|
178 |
+
/*$control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'secondary_ad_code'));
|
179 |
$control->create_section('Ad Code (Secondary Network)');
|
180 |
if($abtestingMode != '2' && $abtestingMode != '3') {
|
181 |
$control->set_HTML('<div style="display: none;">'.$control->HTML.'</div>');
|
189 |
$control->set_HTML('<div style="display: none;">'.$control->HTML.'</div>');
|
190 |
}
|
191 |
echo $control->HTML;
|
192 |
+
$control->clear_controls();*/
|
193 |
echo '</div>';
|
194 |
+
/*echo '<h3>Rules</h3>';
|
195 |
echo '<div>';
|
196 |
$control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_loggedin'));
|
197 |
$control->create_section('Logged in Users');
|
292 |
$control->create_section('Notes');
|
293 |
echo $control->HTML;
|
294 |
$control->clear_controls();
|
295 |
+
echo '</div>';*/
|
296 |
+
/*if($position == 'middle') {
|
297 |
echo '<h3>Positioning</h3>';
|
298 |
echo '<div>';
|
299 |
$control->add_control(array('type' => 'text', 'label' => 'Minimum Character Count', 'optionName' => 'minimum_character_count', 'helpText' => 'Show the ad only if the Content meets the minimum character count. If this parameter is set to 0 (or empty) minimum character count check will be deactivated.'));
|
302 |
echo $control->HTML;
|
303 |
$control->clear_controls();
|
304 |
echo '</div>';
|
305 |
+
}*/
|
306 |
+
//echo '</div>';
|
307 |
echo '<script type="text/javascript">';
|
308 |
echo $control->JS;
|
309 |
+
//echo 'jQuery("#insert_ads_inpostads_'.$position.'_accordion").accordion({ icons: { header: "ui-icon-circle-arrow-e", activeHeader: "ui-icon-circle-arrow-s" }, heightStyle: "auto" });';
|
310 |
+
//echo 'primary_ad_code_type_change();';
|
311 |
+
//echo 'insert_ads_inpostads_vi_customize_adcode();';
|
312 |
echo '</script>';
|
313 |
+
echo '</div></div>';
|
314 |
}
|
315 |
|
316 |
function insert_ads_inpostads_form_save_action($position) {
|
rules.php → includes/rules.php
RENAMED
File without changes
|
vi-integration.php → includes/vi-integration.php
RENAMED
@@ -50,7 +50,7 @@ function insert_ads_vi_plugin_card_content($isLoggedin = false, $isAjaxRequest =
|
|
50 |
echo '<div class="plugin-card-bottom" '.(($isAjaxRequest)?'style="opacity: 0;"':'').'>';
|
51 |
echo '<input type="hidden" id="insert_ads_admin_ajax" name="insert_ads_admin_ajax" value="' . admin_url('admin-ajax.php') . '" /><input type="hidden" id="insert_ads_nonce" name="insert_ads_nonce" value="' . wp_create_nonce('insert-ads') . '" />';
|
52 |
echo '<a id="insert_ads_vi_dashboard" href="'.$dashboardURL.'" target="_blank" class="button button-primary alignleft">Publisher Dashboard</a>';
|
53 |
-
echo '<a id="insert_ads_vi_customize_adcode" href="javascript:;" class="button button-primary alignleft">Configure vi code</a>';
|
54 |
echo '<a id="insert_ads_vi_logout" href="javascript:;" class="button button-secondary">Log Out</a>';
|
55 |
echo '</div>';
|
56 |
}
|
@@ -197,12 +197,12 @@ function insert_ads_vi_update_adstxt() {
|
|
197 |
|
198 |
if(insert_ads_adstxt_update_content($updatedAdstxtContent)) {
|
199 |
echo '###SUCCESS###';
|
200 |
-
echo '<div class="notice notice-
|
201 |
echo '<div style="float: left; max-width: 875px; font-size: 14px; font-family: Arial; line-height: 18px; color: #232323;">';
|
202 |
echo '<p><b>ADS.TXT has been added</b></p>';
|
203 |
-
echo '<p>
|
204 |
echo '</div>';
|
205 |
-
echo '<img style="float: right; margin-right: 20px; margin-top: 13px;" src="'.WP_INSADS_URL.'images/
|
206 |
echo '<div class="clear"></div>';
|
207 |
echo '<button type="button" class="notice-dismiss" onclick="javascript:jQuery(this).parent().remove()"><span class="screen-reader-text">Dismiss this notice.</span></button>';
|
208 |
echo '</div>';
|
@@ -210,8 +210,10 @@ function insert_ads_vi_update_adstxt() {
|
|
210 |
echo '###FAIL###';
|
211 |
echo '<div class="notice notice-error insert_ads_adsstxt_notice is-dismissible" style="padding: 5px 15px;">';
|
212 |
echo '<div style="float: left; max-width: 875px; font-size: 14px; font-family: Arial; line-height: 18px; color: #232323;">';
|
213 |
-
echo '<p><b>
|
214 |
-
echo '<p>
|
|
|
|
|
215 |
echo '<p><code style="display: block;">'.trim(str_replace(array("\r\n", "\r", "\n"), "<br />", $viEntry)).'</code><br />Only by doing so, you\'ll be able to make more money through video intelligence (vi.ai).</p>';
|
216 |
echo '</div>';
|
217 |
echo '<img style="float: right; margin-right: 20px; margin-top: 13px;" src="'.WP_INSADS_URL.'images/vi-big-logo.png?'.WP_INSADS_VERSION.'" />';
|
@@ -238,13 +240,15 @@ function insert_ads_vi_logout_action() {
|
|
238 |
/* Begin Configure vi Code */
|
239 |
add_action('wp_ajax_insert_ads_vi_customize_adcode_form_get_content', 'insert_ads_vi_customize_adcode_form_get_content');
|
240 |
function insert_ads_vi_customize_adcode_form_get_content() {
|
241 |
-
check_ajax_referer('insert-ads', 'insert_ads_nonce');
|
242 |
$vicodeSettings = get_option('insert_ads_vi_code_settings');
|
243 |
$control = new smartlogix(array('optionIdentifier' => 'insert_ads_vi_code_settings', 'values' => $vicodeSettings));
|
244 |
$control->HTML = '<div class="insert_ads_popup_content_wrapper">';
|
245 |
-
$control->HTML .= '<p>Use this form to customize the look of the video unit. Use the same parameters as your WordPress theme for a natural look on your site
|
246 |
$control->HTML .= '<div class="insert_ads_vi_popup_right_column">';
|
247 |
-
$control->HTML .= '<img style="margin: 0 auto; display: block;" src="'.WP_INSADS_URL.'images/advertisement-preview.png?'.WP_INSADS_VERSION.'" />';
|
|
|
|
|
248 |
$control->HTML .= '</div>';
|
249 |
$control->HTML .= '<div class="insert_ads_vi_popup_left_column">';
|
250 |
$control->HTML .= '<p id="insert_ads_vi_customize_adcode_keywords_required_error" style="display: none;" class="viError">Keywords contains invalid characters, Some required fields are missing</p>';
|
@@ -257,6 +261,7 @@ function insert_ads_vi_customize_adcode_form_get_content() {
|
|
257 |
);
|
258 |
$control->add_control(array('type' => 'select', 'label' => ' Ad Unit*', 'optionName' => 'ad_unit_type', 'helpText' => '</small><span class="tooltipWrapper"><span class="tooltip">- vi stories (video advertising + video content)</span></span><small>', 'options' => $adUnitOptions));/*<br />- out-stream (video advertising)*/
|
259 |
$control->add_control(array('type' => 'textarea', 'label' => 'Keywords', 'optionName' => 'keywords', 'helpText' => '</small><span class="tooltipWrapper"><span class="tooltip">Comma separated values describing the content of the page e.g. \'cooking, grilling, pulled pork\'</span></span><small>'));
|
|
|
260 |
$IABParentCategories = array(
|
261 |
array('text' => 'Select tier 1 category', 'value' => 'select'),
|
262 |
array('text' => 'Arts & Entertainment', 'value' => 'IAB1'),
|
@@ -286,7 +291,7 @@ function insert_ads_vi_customize_adcode_form_get_content() {
|
|
286 |
array('text' => 'Non-Standard Content', 'value' => 'IAB25'),
|
287 |
array('text' => 'Illegal Content', 'value' => 'IAB26')
|
288 |
);
|
289 |
-
$control->add_control(array('type' => 'select', 'label' => 'IAB Category*', 'optionName' => 'iab_category_parent', '
|
290 |
$IABChildCategories = array(
|
291 |
array('text' => 'Select tier 2 category', 'value' => 'select'),
|
292 |
array('text' => 'Books & Literature', 'value' => 'IAB1-1', 'metadata' => array('parent' => 'IAB1')),
|
@@ -707,17 +712,20 @@ function insert_ads_vi_customize_adcode_form_get_content() {
|
|
707 |
$control->add_control(array('type' => 'textarea', 'label' => 'Optional 1', 'optionName' => 'optional_1', 'helpText' => ' '));
|
708 |
$control->add_control(array('type' => 'textarea', 'label' => 'Optional 2', 'optionName' => 'optional_2', 'helpText' => ' '));
|
709 |
$control->add_control(array('type' => 'textarea', 'label' => 'Optional 3', 'optionName' => 'optional_3', 'helpText' => ' '));
|
710 |
-
|
|
|
|
|
|
|
711 |
$control->HTML .= '</div>';
|
712 |
$control->HTML .= '<div class="clear"></div>';
|
713 |
$control->HTML .= '</div>';
|
714 |
-
$control->create_section(' vi
|
715 |
echo $control->HTML;
|
716 |
echo '<script type="text/javascript">';
|
717 |
echo $control->JS;
|
718 |
echo 'insert_ads_vi_code_iab_category_parent_change();';
|
719 |
echo '</script>';
|
720 |
-
die();
|
721 |
}
|
722 |
|
723 |
add_action('wp_ajax_insert_ads_vi_customize_adcode_form_save_action', 'insert_ads_vi_customize_adcode_form_save_action');
|
50 |
echo '<div class="plugin-card-bottom" '.(($isAjaxRequest)?'style="opacity: 0;"':'').'>';
|
51 |
echo '<input type="hidden" id="insert_ads_admin_ajax" name="insert_ads_admin_ajax" value="' . admin_url('admin-ajax.php') . '" /><input type="hidden" id="insert_ads_nonce" name="insert_ads_nonce" value="' . wp_create_nonce('insert-ads') . '" />';
|
52 |
echo '<a id="insert_ads_vi_dashboard" href="'.$dashboardURL.'" target="_blank" class="button button-primary alignleft">Publisher Dashboard</a>';
|
53 |
+
//echo '<a id="insert_ads_vi_customize_adcode" href="javascript:;" class="button button-primary alignleft">Configure vi code</a>';
|
54 |
echo '<a id="insert_ads_vi_logout" href="javascript:;" class="button button-secondary">Log Out</a>';
|
55 |
echo '</div>';
|
56 |
}
|
197 |
|
198 |
if(insert_ads_adstxt_update_content($updatedAdstxtContent)) {
|
199 |
echo '###SUCCESS###';
|
200 |
+
echo '<div class="notice notice-success insert_ads_adsstxt_notice is-dismissible" style="padding: 5px 15px;">';
|
201 |
echo '<div style="float: left; max-width: 875px; font-size: 14px; font-family: Arial; line-height: 18px; color: #232323;">';
|
202 |
echo '<p><b>ADS.TXT has been added</b></p>';
|
203 |
+
echo '<p>Insert Post ads has updated your ads.txt file with lines that declare video intelligence as a legitimate seller of your inventory and enables you to make more money through video intelligence. Read the <a target="_blank" href="https://www.vi.ai/frequently-asked-questions-vi-stories-for-wordpress/?utm_source=WordPress&utm_medium=Plugin%20FAQ&utm_campaign=WP%20Insert">FAQ</a>.</p>';
|
204 |
echo '</div>';
|
205 |
+
echo '<img style="float: right; margin-right: 20px; margin-top: 13px;" src="'.WP_INSADS_URL.'images/logo-svg.svg?'.WP_INSADS_VERSION.'" />';
|
206 |
echo '<div class="clear"></div>';
|
207 |
echo '<button type="button" class="notice-dismiss" onclick="javascript:jQuery(this).parent().remove()"><span class="screen-reader-text">Dismiss this notice.</span></button>';
|
208 |
echo '</div>';
|
210 |
echo '###FAIL###';
|
211 |
echo '<div class="notice notice-error insert_ads_adsstxt_notice is-dismissible" style="padding: 5px 15px;">';
|
212 |
echo '<div style="float: left; max-width: 875px; font-size: 14px; font-family: Arial; line-height: 18px; color: #232323;">';
|
213 |
+
echo '<p><b>WARNING!</b></p>';
|
214 |
+
echo '<p><b>ads.txt couldn’t be added</b></p>';
|
215 |
+
echo '<p>Insert Post Ads hasn\'t been able to update your ads.txt file.</p>';
|
216 |
+
echo '<p>Please, make sure that you enter the following lines manually:</p>';
|
217 |
echo '<p><code style="display: block;">'.trim(str_replace(array("\r\n", "\r", "\n"), "<br />", $viEntry)).'</code><br />Only by doing so, you\'ll be able to make more money through video intelligence (vi.ai).</p>';
|
218 |
echo '</div>';
|
219 |
echo '<img style="float: right; margin-right: 20px; margin-top: 13px;" src="'.WP_INSADS_URL.'images/vi-big-logo.png?'.WP_INSADS_VERSION.'" />';
|
240 |
/* Begin Configure vi Code */
|
241 |
add_action('wp_ajax_insert_ads_vi_customize_adcode_form_get_content', 'insert_ads_vi_customize_adcode_form_get_content');
|
242 |
function insert_ads_vi_customize_adcode_form_get_content() {
|
243 |
+
//check_ajax_referer('insert-ads', 'insert_ads_nonce');
|
244 |
$vicodeSettings = get_option('insert_ads_vi_code_settings');
|
245 |
$control = new smartlogix(array('optionIdentifier' => 'insert_ads_vi_code_settings', 'values' => $vicodeSettings));
|
246 |
$control->HTML = '<div class="insert_ads_popup_content_wrapper">';
|
247 |
+
$control->HTML .= '<p>Use this form to customize the look of the video unit. Use the same parameters as your WordPress theme for a natural look on your site</p>';
|
248 |
$control->HTML .= '<div class="insert_ads_vi_popup_right_column">';
|
249 |
+
$control->HTML .= '<img style="width: 60%;max-width:587px;margin: 0 auto; display: block;" src="'.WP_INSADS_URL.'images/advertisement-preview.png?'.WP_INSADS_VERSION.'" />';
|
250 |
+
|
251 |
+
|
252 |
$control->HTML .= '</div>';
|
253 |
$control->HTML .= '<div class="insert_ads_vi_popup_left_column">';
|
254 |
$control->HTML .= '<p id="insert_ads_vi_customize_adcode_keywords_required_error" style="display: none;" class="viError">Keywords contains invalid characters, Some required fields are missing</p>';
|
261 |
);
|
262 |
$control->add_control(array('type' => 'select', 'label' => ' Ad Unit*', 'optionName' => 'ad_unit_type', 'helpText' => '</small><span class="tooltipWrapper"><span class="tooltip">- vi stories (video advertising + video content)</span></span><small>', 'options' => $adUnitOptions));/*<br />- out-stream (video advertising)*/
|
263 |
$control->add_control(array('type' => 'textarea', 'label' => 'Keywords', 'optionName' => 'keywords', 'helpText' => '</small><span class="tooltipWrapper"><span class="tooltip">Comma separated values describing the content of the page e.g. \'cooking, grilling, pulled pork\'</span></span><small>'));
|
264 |
+
$control->HTML .= '<p><span class="keys-desc">Comma separated values describing the content of the page e.g. \'cooking, grilling, pulled pork\'</span><small></small></p>';
|
265 |
$IABParentCategories = array(
|
266 |
array('text' => 'Select tier 1 category', 'value' => 'select'),
|
267 |
array('text' => 'Arts & Entertainment', 'value' => 'IAB1'),
|
291 |
array('text' => 'Non-Standard Content', 'value' => 'IAB25'),
|
292 |
array('text' => 'Illegal Content', 'value' => 'IAB26')
|
293 |
);
|
294 |
+
$control->add_control(array('type' => 'select', 'label' => 'IAB Category*', 'optionName' => 'iab_category_parent', 'options' => $IABParentCategories));
|
295 |
$IABChildCategories = array(
|
296 |
array('text' => 'Select tier 2 category', 'value' => 'select'),
|
297 |
array('text' => 'Books & Literature', 'value' => 'IAB1-1', 'metadata' => array('parent' => 'IAB1')),
|
712 |
$control->add_control(array('type' => 'textarea', 'label' => 'Optional 1', 'optionName' => 'optional_1', 'helpText' => ' '));
|
713 |
$control->add_control(array('type' => 'textarea', 'label' => 'Optional 2', 'optionName' => 'optional_2', 'helpText' => ' '));
|
714 |
$control->add_control(array('type' => 'textarea', 'label' => 'Optional 3', 'optionName' => 'optional_3', 'helpText' => ' '));
|
715 |
+
//$control->HTML .= '<p class="insert_ads_vi_delay_notice">vi Ad Changes might take some time to take into effect</p>';
|
716 |
+
$control->HTML .= '<div class="clear"></div>';
|
717 |
+
$control->HTML .= '<p><span class="keys-desc">vi Ad Changes might take some time to take into effect</span><small></small></p>';
|
718 |
+
$control->HTML .= '<p><button class="button button-primary" id="set-update">Update</button></p>';
|
719 |
$control->HTML .= '</div>';
|
720 |
$control->HTML .= '<div class="clear"></div>';
|
721 |
$control->HTML .= '</div>';
|
722 |
+
$control->create_section(' vi Stories Settings ');
|
723 |
echo $control->HTML;
|
724 |
echo '<script type="text/javascript">';
|
725 |
echo $control->JS;
|
726 |
echo 'insert_ads_vi_code_iab_category_parent_change();';
|
727 |
echo '</script>';
|
728 |
+
//die();
|
729 |
}
|
730 |
|
731 |
add_action('wp_ajax_insert_ads_vi_customize_adcode_form_save_action', 'insert_ads_vi_customize_adcode_form_save_action');
|
insert-post-ads.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Insert Post Ads
|
4 |
* Plugin URI: http://www.insertpostads.com/
|
5 |
-
* Version: 1.
|
6 |
* Author: InsertPostAds
|
7 |
* Author URI: http://www.insertpostads.com/
|
8 |
* Description: Allows you to insert ads after paragraphs of your post content
|
@@ -39,7 +39,7 @@ class InsertPostAds {
|
|
39 |
$this->plugin->name = 'insert-post-ads'; // Plugin Folder
|
40 |
$this->plugin->displayName = 'Post Adverts'; // Plugin Name
|
41 |
$this->plugin->posttype = 'insertpostads';
|
42 |
-
$this->plugin->version = '1.
|
43 |
$this->plugin->folder = plugin_dir_path( __FILE__ );
|
44 |
$this->plugin->url = plugin_dir_url( __FILE__ );
|
45 |
$this->plugin->ads_screen_key = $this->plugin->name . '-ads-display-chosen-once';
|
@@ -60,6 +60,7 @@ class InsertPostAds {
|
|
60 |
add_action( 'admin_notices', array( &$this, 'dashboardNotices' ) );
|
61 |
add_action( 'wp_ajax_' . $this->plugin->name . '_dismiss_dashboard_notices', array( &$this, 'dismissDashboardNotices' ) );
|
62 |
|
|
|
63 |
// Filters
|
64 |
add_filter( 'enter_title_here', array( &$this, 'changeTitlePlaceholder' ) ); // Change title placeholder
|
65 |
add_filter( 'post_updated_messages', array( &$this, 'changeUpdatedMessages' ) ); // Appropriate messages for the post type
|
@@ -71,12 +72,13 @@ class InsertPostAds {
|
|
71 |
/**
|
72 |
* Register Custom Post Type
|
73 |
*/
|
|
|
74 |
function registerPostTypes() {
|
75 |
register_post_type( $this->plugin->posttype, array(
|
76 |
'labels' => array(
|
77 |
'name' => _x( 'Post Adverts', 'post type general name' ),
|
78 |
'singular_name' => _x( 'Post Advert', 'post type singular name' ),
|
79 |
-
'add_new' => _x( 'Add New', 'insertpostads' ),
|
80 |
'add_new_item' => __( 'Add New Post Advert' ),
|
81 |
'edit_item' => __( 'Edit Post Advert' ),
|
82 |
'new_item' => __( 'New Post Advert' ),
|
@@ -134,14 +136,17 @@ class InsertPostAds {
|
|
134 |
wp_enqueue_style( $this->plugin->name.'ads-admin', $this->plugin->url.'css/insert-post.css', array(), $this->plugin->version );
|
135 |
wp_enqueue_style( $this->plugin->name.'colors', $this->plugin->url.'css/controls.css', array(), $this->plugin->version );
|
136 |
wp_enqueue_style( 'jquery-ui-admin', 'https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css', array(), $this->plugin->version );
|
|
|
137 |
}
|
138 |
|
139 |
/**
|
140 |
* Register the plugin settings panel
|
141 |
*/
|
142 |
function adminPanelsAndMetaBoxes() {
|
|
|
143 |
add_submenu_page( 'edit.php?post_type='.$this->plugin->posttype, __( 'Settings', $this->plugin->name ), __( 'Settings', $this->plugin->name ), 'manage_options', $this->plugin->name, array( &$this, 'adminPanel' ) );
|
144 |
-
add_meta_box( 'ipa_meta', __( 'Advert
|
|
|
145 |
$postTypes = get_post_types( array(
|
146 |
'public' => true,
|
147 |
), 'objects' );
|
@@ -204,6 +209,44 @@ class InsertPostAds {
|
|
204 |
// Load Settings Form
|
205 |
include_once( $this->plugin->folder . '/views/settings.php' );
|
206 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
|
208 |
/**
|
209 |
* Loads plugin textdomain
|
@@ -220,6 +263,7 @@ class InsertPostAds {
|
|
220 |
function displayMetaBox( $post ) {
|
221 |
// Get meta
|
222 |
$adCode = get_post_meta( $post->ID, '_ad_code', true );
|
|
|
223 |
$adPosition = get_post_meta( $post->ID, '_ad_position', true );
|
224 |
$paragraphNumber = get_post_meta( $post->ID, '_paragraph_number', true );
|
225 |
|
@@ -227,8 +271,10 @@ class InsertPostAds {
|
|
227 |
wp_nonce_field( $this->plugin->name, $this->plugin->name . '_nonce' );
|
228 |
?>
|
229 |
<p>
|
230 |
-
<
|
|
|
231 |
</p>
|
|
|
232 |
<p>
|
233 |
<label for="ad_position"><?php _e( 'Display the advert:', $this->plugin->name ); ?></label>
|
234 |
<select onChange="javascript:handleIpaAdOptionChange( this.value )" name="ad_position" size="1">
|
@@ -248,6 +294,7 @@ class InsertPostAds {
|
|
248 |
}
|
249 |
</script>
|
250 |
</p>
|
|
|
251 |
<?php
|
252 |
}
|
253 |
|
@@ -306,6 +353,11 @@ class InsertPostAds {
|
|
306 |
// so do nothing before saving
|
307 |
update_post_meta( $post_id, '_ad_code', $_REQUEST['ad_code'] );
|
308 |
}
|
|
|
|
|
|
|
|
|
|
|
309 |
if ( isset( $_REQUEST['ad_position'] ) ) {
|
310 |
update_post_meta( $post_id, '_ad_position', sanitize_text_field( $_REQUEST['ad_position'] ) );
|
311 |
}
|
@@ -554,13 +606,15 @@ if(!defined('WP_INSADS_URL'))
|
|
554 |
if(!defined('WP_INSADS_DIR'))
|
555 |
define('WP_INSADS_DIR', plugin_dir_path(__FILE__));
|
556 |
if(!defined('WP_INSADS_VERSION'))
|
557 |
-
define('WP_INSADS_VERSION', '1.
|
558 |
-
require_once(dirname(__FILE__).'/vi-integration.php');
|
559 |
require_once(dirname(__FILE__).'/apis/vi/api.php');
|
560 |
-
require_once(dirname(__FILE__).'/inpostads.php');
|
561 |
-
require_once(dirname(__FILE__).'/rules.php');
|
562 |
-
require_once(dirname(__FILE__).'/common.php');
|
563 |
-
require_once(dirname(__FILE__).'/geotargeting.php');
|
|
|
|
|
564 |
require_once(dirname(__FILE__).'/controls/controls.php');
|
565 |
|
566 |
/* Begin Admin Notice */
|
@@ -570,14 +624,15 @@ function insert_ads_admin_notices() {
|
|
570 |
$userId = get_current_user_id();
|
571 |
if(!get_user_meta($userId, 'insert_ads_'.WP_INSADS_VERSION.'_admin_notice_dismissed', true)) {
|
572 |
echo '<div class="notice notice-success insert_ads_notice is-dismissible" style="padding: 15px;">';
|
573 |
-
echo '<div style="float: left;
|
574 |
echo '<p>Thank you for updating <b>Insert Post ADS</b>!</p>';
|
575 |
-
echo '<p>This update features <strong>vi stories</strong> from video intelligence - a video player that supplies both content and video advertising. Watch a <a href="http://demo.vi.ai/ViewsterBlog_Nintendo.html">demo</a
|
576 |
-
echo '<
|
577 |
-
echo '
|
578 |
-
echo '<p style="
|
|
|
579 |
echo '</div>';
|
580 |
-
echo '<img style="float: right; margin-right: 20px; margin-top: 13px;" src="'.WP_INSADS_URL.'images/
|
581 |
echo '<div class="clear"></div>';
|
582 |
echo '<input type="hidden" id="insert_ads_admin_notice_nonce" name="insert_ads_admin_notice_nonce" value="'.wp_create_nonce('insert-ads-admin-notice').'" />';
|
583 |
echo '<input type="hidden" id="insert_ads_admin_notice_ajax" name="insert_ads_admin_notice_ajax" value="'.admin_url('admin-ajax.php').'" />';
|
@@ -586,6 +641,60 @@ function insert_ads_admin_notices() {
|
|
586 |
|
587 |
}
|
588 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
add_action('wp_ajax_insert_ads_admin_notice_dismiss', 'insert_ads_admin_notice_dismiss');
|
590 |
function insert_ads_admin_notice_dismiss() {
|
591 |
check_ajax_referer('insert-ads-admin-notice', 'insert_ads_admin_notice_nonce');
|
@@ -593,4 +702,53 @@ function insert_ads_admin_notice_dismiss() {
|
|
593 |
update_user_meta($userId, 'insert_ads_'.WP_INSADS_VERSION.'_admin_notice_dismissed', 'true');
|
594 |
die();
|
595 |
}
|
596 |
-
/* End Admin Notice */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Plugin Name: Insert Post Ads
|
4 |
* Plugin URI: http://www.insertpostads.com/
|
5 |
+
* Version: 1.3
|
6 |
* Author: InsertPostAds
|
7 |
* Author URI: http://www.insertpostads.com/
|
8 |
* Description: Allows you to insert ads after paragraphs of your post content
|
39 |
$this->plugin->name = 'insert-post-ads'; // Plugin Folder
|
40 |
$this->plugin->displayName = 'Post Adverts'; // Plugin Name
|
41 |
$this->plugin->posttype = 'insertpostads';
|
42 |
+
$this->plugin->version = '1.3';
|
43 |
$this->plugin->folder = plugin_dir_path( __FILE__ );
|
44 |
$this->plugin->url = plugin_dir_url( __FILE__ );
|
45 |
$this->plugin->ads_screen_key = $this->plugin->name . '-ads-display-chosen-once';
|
60 |
add_action( 'admin_notices', array( &$this, 'dashboardNotices' ) );
|
61 |
add_action( 'wp_ajax_' . $this->plugin->name . '_dismiss_dashboard_notices', array( &$this, 'dismissDashboardNotices' ) );
|
62 |
|
63 |
+
|
64 |
// Filters
|
65 |
add_filter( 'enter_title_here', array( &$this, 'changeTitlePlaceholder' ) ); // Change title placeholder
|
66 |
add_filter( 'post_updated_messages', array( &$this, 'changeUpdatedMessages' ) ); // Appropriate messages for the post type
|
72 |
/**
|
73 |
* Register Custom Post Type
|
74 |
*/
|
75 |
+
|
76 |
function registerPostTypes() {
|
77 |
register_post_type( $this->plugin->posttype, array(
|
78 |
'labels' => array(
|
79 |
'name' => _x( 'Post Adverts', 'post type general name' ),
|
80 |
'singular_name' => _x( 'Post Advert', 'post type singular name' ),
|
81 |
+
'add_new' => _x( 'Add New Post', 'insertpostads' ),
|
82 |
'add_new_item' => __( 'Add New Post Advert' ),
|
83 |
'edit_item' => __( 'Edit Post Advert' ),
|
84 |
'new_item' => __( 'New Post Advert' ),
|
136 |
wp_enqueue_style( $this->plugin->name.'ads-admin', $this->plugin->url.'css/insert-post.css', array(), $this->plugin->version );
|
137 |
wp_enqueue_style( $this->plugin->name.'colors', $this->plugin->url.'css/controls.css', array(), $this->plugin->version );
|
138 |
wp_enqueue_style( 'jquery-ui-admin', 'https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css', array(), $this->plugin->version );
|
139 |
+
wp_enqueue_style( 'fawesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', array(), $this->plugin->version );
|
140 |
}
|
141 |
|
142 |
/**
|
143 |
* Register the plugin settings panel
|
144 |
*/
|
145 |
function adminPanelsAndMetaBoxes() {
|
146 |
+
add_submenu_page( 'edit.php?post_type='.$this->plugin->posttype,'Add vi stories', 'Add vi stories', 'manage_options', 'vi_integration', array( &$this, 'addVi' ) );
|
147 |
add_submenu_page( 'edit.php?post_type='.$this->plugin->posttype, __( 'Settings', $this->plugin->name ), __( 'Settings', $this->plugin->name ), 'manage_options', $this->plugin->name, array( &$this, 'adminPanel' ) );
|
148 |
+
add_meta_box( 'ipa_meta', __( 'New Advert', $this->plugin->name ), array( &$this, 'displayMetaBox' ), $this->plugin->posttype, 'normal', 'high' );
|
149 |
+
|
150 |
$postTypes = get_post_types( array(
|
151 |
'public' => true,
|
152 |
), 'objects' );
|
209 |
// Load Settings Form
|
210 |
include_once( $this->plugin->folder . '/views/settings.php' );
|
211 |
}
|
212 |
+
function addVi() {
|
213 |
+
// only admin user can access this page
|
214 |
+
if ( !current_user_can( 'administrator' ) ) {
|
215 |
+
echo '<p>' . __( 'Sorry, you are not allowed to access this page.', $this->plugin->name ) . '</p>';
|
216 |
+
return;
|
217 |
+
}
|
218 |
+
// Save Settings
|
219 |
+
if ( isset( $_REQUEST['submit'] ) ) {
|
220 |
+
if ( ! wp_verify_nonce( $_REQUEST['_nonce'], $this->plugin->name . '-nonce' ) ) {
|
221 |
+
$this->errorMessage = __( 'Something went wrong. Please try to save again.', $this->plugin->name );
|
222 |
+
} else {
|
223 |
+
delete_option( $this->plugin->name );
|
224 |
+
if ( isset( $_REQUEST[$this->plugin->name] ) ) {
|
225 |
+
// if user save setting contains post or page or anyother cpt, then set an option
|
226 |
+
// that can be used later to let user know about choosing where to
|
227 |
+
// display post ads after first ad is created
|
228 |
+
if( ( count( $_REQUEST[$this->plugin->name] ) == 1 && !isset( $_REQUEST[$this->plugin->name]['css'] ) ) || count( $_REQUEST[$this->plugin->name] ) > 1 ) {
|
229 |
+
update_option( $this->plugin->ads_screen_key, 1 );
|
230 |
+
}
|
231 |
+
// sanitise the array
|
232 |
+
$tempArr = $_REQUEST[$this->plugin->name];
|
233 |
+
unset( $_REQUEST[$this->plugin->name] );
|
234 |
+
foreach( $tempArr as $key => $value ) {
|
235 |
+
$_REQUEST[$this->plugin->name][sanitize_text_field( $key )] = sanitize_text_field( $value );
|
236 |
+
}
|
237 |
+
unset( $tempArr );
|
238 |
+
update_option( $this->plugin->name, $_REQUEST[$this->plugin->name] );
|
239 |
+
}
|
240 |
+
$this->message = __( 'Post Advert Settings Saved.', $this->plugin->name );
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
// Get latest settings
|
245 |
+
$this->settings = get_option( $this->plugin->name );
|
246 |
+
|
247 |
+
// Load Settings Form
|
248 |
+
include_once( $this->plugin->folder . '/views/add-vi.php' );
|
249 |
+
}
|
250 |
|
251 |
/**
|
252 |
* Loads plugin textdomain
|
263 |
function displayMetaBox( $post ) {
|
264 |
// Get meta
|
265 |
$adCode = get_post_meta( $post->ID, '_ad_code', true );
|
266 |
+
$adUnit = get_post_meta( $post->ID, '_ad_unit', true );
|
267 |
$adPosition = get_post_meta( $post->ID, '_ad_position', true );
|
268 |
$paragraphNumber = get_post_meta( $post->ID, '_paragraph_number', true );
|
269 |
|
271 |
wp_nonce_field( $this->plugin->name, $this->plugin->name . '_nonce' );
|
272 |
?>
|
273 |
<p>
|
274 |
+
<label for="ad_code">Advert code:</label>
|
275 |
+
<textarea name="ad_code" id="ad_code" style="width: 86%; height: 100px; font-size: 14px; float:left;overflow:hidden;"><?php echo esc_html( wp_unslash( $adCode ) ); ?></textarea>
|
276 |
</p>
|
277 |
+
<div style="clear:both"></div>
|
278 |
<p>
|
279 |
<label for="ad_position"><?php _e( 'Display the advert:', $this->plugin->name ); ?></label>
|
280 |
<select onChange="javascript:handleIpaAdOptionChange( this.value )" name="ad_position" size="1">
|
294 |
}
|
295 |
</script>
|
296 |
</p>
|
297 |
+
<p><input readonly name="ad_unit" id="ad_unit" type="text" value="<?php echo $adUnit ? $adUnit : 'Advert post'; ?>"></p>
|
298 |
<?php
|
299 |
}
|
300 |
|
353 |
// so do nothing before saving
|
354 |
update_post_meta( $post_id, '_ad_code', $_REQUEST['ad_code'] );
|
355 |
}
|
356 |
+
if ( isset( $_REQUEST['ad_unit'] ) ) {
|
357 |
+
// $_REQUEST has already been slashed by wp_magic_quotes in wp-settings
|
358 |
+
// so do nothing before saving
|
359 |
+
update_post_meta( $post_id, '_ad_unit', $_REQUEST['ad_unit'] );
|
360 |
+
}
|
361 |
if ( isset( $_REQUEST['ad_position'] ) ) {
|
362 |
update_post_meta( $post_id, '_ad_position', sanitize_text_field( $_REQUEST['ad_position'] ) );
|
363 |
}
|
606 |
if(!defined('WP_INSADS_DIR'))
|
607 |
define('WP_INSADS_DIR', plugin_dir_path(__FILE__));
|
608 |
if(!defined('WP_INSADS_VERSION'))
|
609 |
+
define('WP_INSADS_VERSION', '1.3');
|
610 |
+
require_once(dirname(__FILE__).'/includes/vi-integration.php');
|
611 |
require_once(dirname(__FILE__).'/apis/vi/api.php');
|
612 |
+
require_once(dirname(__FILE__).'/includes/inpostads.php');
|
613 |
+
require_once(dirname(__FILE__).'/includes/rules.php');
|
614 |
+
require_once(dirname(__FILE__).'/includes/common.php');
|
615 |
+
require_once(dirname(__FILE__).'/includes/geotargeting.php');
|
616 |
+
require_once(dirname(__FILE__).'/adstxt.php');
|
617 |
+
require_once(dirname(__FILE__).'/includes/adstxt.php');
|
618 |
require_once(dirname(__FILE__).'/controls/controls.php');
|
619 |
|
620 |
/* Begin Admin Notice */
|
624 |
$userId = get_current_user_id();
|
625 |
if(!get_user_meta($userId, 'insert_ads_'.WP_INSADS_VERSION.'_admin_notice_dismissed', true)) {
|
626 |
echo '<div class="notice notice-success insert_ads_notice is-dismissible" style="padding: 15px;">';
|
627 |
+
echo '<div class="blurb-info" style="float: left; font-size: 14px; font-family: Arial; line-height: 18px; color: #232323;">';
|
628 |
echo '<p>Thank you for updating <b>Insert Post ADS</b>!</p>';
|
629 |
+
echo '<p>This update features <strong>vi stories</strong> from video intelligence - a video player that supplies both content and video advertising. Watch a <a href="http://demo.vi.ai/ViewsterBlog_Nintendo.html">demo</a>.';
|
630 |
+
echo '<br>To begin earning sign up to vi stories and place the ad live now! ';
|
631 |
+
echo 'Read the <a href="https://www.vi.ai/frequently-asked-questions-vi-stories-for-wordpress/?utm_source=WordPress&utm_medium=Plugin%20FAQ&utm_campaign=WP%20insertpostads">FAQ</a>.</p>';
|
632 |
+
echo '<p style="display:inline-block;width:60%;font-size: 12px; font-style:italic;">Click the ‘Monetize Now’ button to activate vi stories. You’ll agree to share your domain, affiliate ID and email with video intelligence, and begin your journey to video publisher.</p>';
|
633 |
+
echo '<p style="display:inline-block;width:30%;text-align:right;"><a target="_blank" class="monetize-btn" href="https://www.vi.ai/publisher-registration/?email='.get_bloginfo('admin_email').'&domain='.get_bloginfo('url').'&aid=WP_insertpostads&utm_source=Wordpress&utm_medium=wp_insertpostads&utm_campaign=white&utm_content=Wp_insertpostads">Monetize Now</a></p>';
|
634 |
echo '</div>';
|
635 |
+
echo '<img style="float: right; margin-right: 20px; margin-top: 13px;width: 12%;" src="'.WP_INSADS_URL.'images/logo-svg.svg?'.WP_INSADS_VERSION.'" />';
|
636 |
echo '<div class="clear"></div>';
|
637 |
echo '<input type="hidden" id="insert_ads_admin_notice_nonce" name="insert_ads_admin_notice_nonce" value="'.wp_create_nonce('insert-ads-admin-notice').'" />';
|
638 |
echo '<input type="hidden" id="insert_ads_admin_notice_ajax" name="insert_ads_admin_notice_ajax" value="'.admin_url('admin-ajax.php').'" />';
|
641 |
|
642 |
}
|
643 |
|
644 |
+
add_action('admin_notices', 'insert_ads_admin_notices_settings');
|
645 |
+
function insert_ads_admin_notices_settings() {
|
646 |
+
$getUrl = $_SERVER['REQUEST_URI'];
|
647 |
+
if ($getUrl == '/wp-admin/edit.php?post_type=insertpostads'){
|
648 |
+
?>
|
649 |
+
<div class="notice ins-notice">
|
650 |
+
<div id="poststuff">
|
651 |
+
<form action="edit.php?post_type=insertpostads&page=insert-post-ads" method="post" class="ins-settings">
|
652 |
+
<div class="postbox">
|
653 |
+
<h3 class="hndle"><?php _e( 'Display Settings', 'insert-post-ads'); ?></h3>
|
654 |
+
|
655 |
+
<div class="inside">
|
656 |
+
<p>
|
657 |
+
<?php
|
658 |
+
$postTypes = get_post_types( array(
|
659 |
+
'public' => true,
|
660 |
+
), 'objects');
|
661 |
+
if ( $postTypes ) {
|
662 |
+
foreach ( $postTypes as $postType ) {
|
663 |
+
// Skip attachments
|
664 |
+
if ( $postType->name == 'attachment' ) {
|
665 |
+
continue;
|
666 |
+
}
|
667 |
+
?>
|
668 |
+
<label for="<?php echo $postType->name; ?>"><?php echo $postType->labels->name; ?></label>
|
669 |
+
<input type="checkbox" name="insert-post-ads[<?php echo $postType->name; ?>]" value="1" id="<?php echo $postType->name; ?>" <?php echo ( isset( get_option( 'insert-post-ads' )[$postType->name] ) ? ' checked' : '' ); ?>/>
|
670 |
+
<?php
|
671 |
+
}
|
672 |
+
}
|
673 |
+
?>
|
674 |
+
<label for="css"><?php _e( 'Exclude CSS', 'insert-post-ads' ) ;?></label>
|
675 |
+
<input type="checkbox" name="insert-post-ads[css]" value="1" id="css"/>
|
676 |
+
</p>
|
677 |
+
|
678 |
+
<p class="description">
|
679 |
+
<?php _e( 'By default, Post Ads are wrapped in a container that has some CSS to aid layout. Developers may wish to use their own CSS, and should check this Exclude CSS option.', 'insert-post-ads' ); ?>
|
680 |
+
</p>
|
681 |
+
<p>
|
682 |
+
<input id="set-submit" name="submit" type="submit" name="Submit" class="button button-primary" value="<?php _e( 'Save Settings', 'insert-post-ads' ); ?>" />
|
683 |
+
</p>
|
684 |
+
</div>
|
685 |
+
</div>
|
686 |
+
<!-- /postbox -->
|
687 |
+
|
688 |
+
|
689 |
+
<!-- /postbox -->
|
690 |
+
<input type="hidden" name="_nonce" value= "<?php echo wp_create_nonce( 'insert-post-ads' . '-nonce' ); ?>" />
|
691 |
+
</form>
|
692 |
+
</div>
|
693 |
+
</div>
|
694 |
+
<?php
|
695 |
+
}
|
696 |
+
}
|
697 |
+
|
698 |
add_action('wp_ajax_insert_ads_admin_notice_dismiss', 'insert_ads_admin_notice_dismiss');
|
699 |
function insert_ads_admin_notice_dismiss() {
|
700 |
check_ajax_referer('insert-ads-admin-notice', 'insert_ads_admin_notice_nonce');
|
702 |
update_user_meta($userId, 'insert_ads_'.WP_INSADS_VERSION.'_admin_notice_dismissed', 'true');
|
703 |
die();
|
704 |
}
|
705 |
+
/* End Admin Notice */
|
706 |
+
|
707 |
+
|
708 |
+
function single_post_insert() {
|
709 |
+
if(get_post_status(10000)){
|
710 |
+
$new_post = array(
|
711 |
+
'post_title' => $_POST['title'],
|
712 |
+
'post_content' => 'dsds',
|
713 |
+
'post_status' => 'publish',
|
714 |
+
'post_type' => 'insertpostads',
|
715 |
+
'meta_input' => array( '_ad_unit'=>'vi stories' ),
|
716 |
+
'ID' => '10000'
|
717 |
+
);
|
718 |
+
//insert the the post into database by passing $new_post to wp_insert_post
|
719 |
+
//store our post ID in a variable $pid
|
720 |
+
$pid = wp_insert_post($new_post);
|
721 |
+
echo json_encode(array('flag'=>'1'));
|
722 |
+
die;
|
723 |
+
} else {
|
724 |
+
$new_post = array(
|
725 |
+
'post_title' => $_POST['title'],
|
726 |
+
'post_content' => 'dsds',
|
727 |
+
'post_status' => 'publish',
|
728 |
+
'post_type' => 'insertpostads',
|
729 |
+
'meta_input' => array( '_ad_unit'=>'vi stories' ),
|
730 |
+
'import_id' => '10000'
|
731 |
+
);
|
732 |
+
$pid = wp_insert_post($new_post);
|
733 |
+
echo json_encode(array('flag'=>'1'));
|
734 |
+
die;
|
735 |
+
}
|
736 |
+
}
|
737 |
+
add_action( 'wp_ajax_single_post', 'single_post_insert' ); // If called from admin panel
|
738 |
+
add_action( 'wp_ajax_nopriv_single_post', 'single_post_insert' );
|
739 |
+
|
740 |
+
add_filter('manage_insertpostads_posts_columns', 'new_ad_cols');
|
741 |
+
function new_ad_cols( $columns )
|
742 |
+
{
|
743 |
+
if( is_array( $columns ) && ! isset( $columns['ad_unit'] ) )
|
744 |
+
unset( $columns['date'] );
|
745 |
+
$columns['title'] = __( 'Title' );
|
746 |
+
$columns['ad_unit'] = __( 'Unit type' );
|
747 |
+
$columns['date'] = __( 'Date' );
|
748 |
+
return $columns;
|
749 |
+
}
|
750 |
+
add_action( 'manage_insertpostads_posts_custom_column', 'get_ad_unit', 10, 2 );
|
751 |
+
function get_ad_unit( $column_name, $post_id ) {
|
752 |
+
if ( $column_name == 'ad_unit')
|
753 |
+
echo get_post_meta( get_the_ID(), '_ad_unit', true );
|
754 |
+
}
|
js/admin.js
CHANGED
@@ -348,7 +348,7 @@ function insert_ads_inpostads_click_handler(location) {
|
|
348 |
jQuery('#toggletext').text(toggleText);
|
349 |
}
|
350 |
})
|
351 |
-
jQuery('#insert_ads_inpostads_'+location+'_status').parent().addClass('pwithcheck').css({'display': 'block', 'margin': '10px 0'}).append('<span id="toggletext" style="padding-left:20px; position: relative; top: -10px;">' + toggleText + '</span>').appendTo('.ui-accordion-content:eq(0) .insert_ads_rule_block
|
352 |
},
|
353 |
function() {
|
354 |
args = {};
|
@@ -397,8 +397,12 @@ function insert_ads_inpostads_click_handler(location) {
|
|
397 |
jQuery.post(
|
398 |
jQuery('#insert_ads_admin_ajax').val(), args, function(response) {
|
399 |
var sucdial = jQuery('<div id="sucdial">Succesfully updated!</div>').hide().fadeIn('1000');
|
400 |
-
jQuery('
|
401 |
-
|
|
|
|
|
|
|
|
|
402 |
}
|
403 |
);
|
404 |
},
|
@@ -825,18 +829,25 @@ function insert_ads_vi_login_handler() {
|
|
825 |
'insert_ads_vi_login_username': insert_ads_vi_login_username,
|
826 |
'insert_ads_vi_login_password': insert_ads_vi_login_password,
|
827 |
}, function(response) {
|
|
|
828 |
if(response.indexOf('###SUCCESS###') !== -1) {
|
|
|
829 |
jQuery.post(
|
830 |
jQuery('#insert_ads_admin_ajax').val(), {
|
831 |
'action': 'insert_ads_vi_update_adstxt',
|
832 |
'insert_ads_nonce': jQuery('#insert_ads_nonce').val(),
|
833 |
}, function(response) {
|
834 |
if(response.indexOf('###SUCCESS###') !== -1) {
|
835 |
-
jQuery('.wrap #
|
|
|
|
|
836 |
} else if(response.indexOf('###FAIL###') !== -1) {
|
837 |
-
jQuery('.wrap #
|
|
|
|
|
838 |
} else {
|
839 |
}
|
|
|
840 |
}
|
841 |
);
|
842 |
jQuery('.vi-card .plugin-card-bottom, .vi-card .plugin-card-top-content').animate({'opacity': 0}, 1000);
|
@@ -1014,6 +1025,7 @@ function insert_ads_vi_logout_handler() {
|
|
1014 |
'insert_ads_nonce': jQuery('#insert_ads_nonce').val(),
|
1015 |
}, function(response) {
|
1016 |
if(response.indexOf('###SUCCESS###') !== -1) {
|
|
|
1017 |
jQuery('.vi-card').html(response.replace('###SUCCESS###', ''));
|
1018 |
insert_ads_vi_signup_handler();
|
1019 |
insert_ads_vi_login_handler();
|
@@ -1111,6 +1123,85 @@ function insert_ads_vi_chart_draw() {
|
|
1111 |
}
|
1112 |
}
|
1113 |
jQuery(document).ready(function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1114 |
jQuery('.insert_ads_notice').on('click', '.notice-dismiss', function() {
|
1115 |
jQuery.post(
|
1116 |
jQuery('#insert_ads_admin_notice_ajax').val(), {
|
@@ -1119,4 +1210,109 @@ jQuery(document).ready(function() {
|
|
1119 |
}, function(response) { }
|
1120 |
);
|
1121 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1122 |
});
|
348 |
jQuery('#toggletext').text(toggleText);
|
349 |
}
|
350 |
})
|
351 |
+
jQuery('#insert_ads_inpostads_'+location+'_status').parent().addClass('pwithcheck').css({'display': 'block', 'margin': '10px 0'}).append('<span id="toggletext" style="padding-left:20px; position: relative; top: -10px;">' + toggleText + '</span>').appendTo('.ui-accordion-content:eq(0) .insert_ads_rule_block .smartlogixSectionInner');
|
352 |
},
|
353 |
function() {
|
354 |
args = {};
|
397 |
jQuery.post(
|
398 |
jQuery('#insert_ads_admin_ajax').val(), args, function(response) {
|
399 |
var sucdial = jQuery('<div id="sucdial">Succesfully updated!</div>').hide().fadeIn('1000');
|
400 |
+
if(jQuery('#sucdial').length){
|
401 |
+
jQuery(document).find('#sucdial').fadeIn('1000').delay('2000').fadeOut('1000');
|
402 |
+
} else {
|
403 |
+
jQuery('body').prepend(sucdial);
|
404 |
+
jQuery(document).find('#sucdial').delay('2000').fadeOut('1000');
|
405 |
+
}
|
406 |
}
|
407 |
);
|
408 |
},
|
829 |
'insert_ads_vi_login_username': insert_ads_vi_login_username,
|
830 |
'insert_ads_vi_login_password': insert_ads_vi_login_password,
|
831 |
}, function(response) {
|
832 |
+
|
833 |
if(response.indexOf('###SUCCESS###') !== -1) {
|
834 |
+
|
835 |
jQuery.post(
|
836 |
jQuery('#insert_ads_admin_ajax').val(), {
|
837 |
'action': 'insert_ads_vi_update_adstxt',
|
838 |
'insert_ads_nonce': jQuery('#insert_ads_nonce').val(),
|
839 |
}, function(response) {
|
840 |
if(response.indexOf('###SUCCESS###') !== -1) {
|
841 |
+
//jQuery('.wrap #poststuff').before(response.replace('###SUCCESS###', ''));
|
842 |
+
console.log('succ');
|
843 |
+
location.reload();
|
844 |
} else if(response.indexOf('###FAIL###') !== -1) {
|
845 |
+
jQuery('.wrap #poststuff').before(response.replace('###FAIL###', ''));
|
846 |
+
console.log('fail')
|
847 |
+
//setTimeout(function(){location.reload()}, 2000);
|
848 |
} else {
|
849 |
}
|
850 |
+
|
851 |
}
|
852 |
);
|
853 |
jQuery('.vi-card .plugin-card-bottom, .vi-card .plugin-card-top-content').animate({'opacity': 0}, 1000);
|
1025 |
'insert_ads_nonce': jQuery('#insert_ads_nonce').val(),
|
1026 |
}, function(response) {
|
1027 |
if(response.indexOf('###SUCCESS###') !== -1) {
|
1028 |
+
location.reload();
|
1029 |
jQuery('.vi-card').html(response.replace('###SUCCESS###', ''));
|
1030 |
insert_ads_vi_signup_handler();
|
1031 |
insert_ads_vi_login_handler();
|
1123 |
}
|
1124 |
}
|
1125 |
jQuery(document).ready(function() {
|
1126 |
+
jQuery('.post-new-php.post-type-insertpostads select[name="ad_position"] option[value="top"]').attr('selected', true);
|
1127 |
+
jQuery('.post-new-php.post-type-insertpostads select[name="ad_position"] option[value=""]').attr('selected', false);
|
1128 |
+
jQuery('.post-new-php.post-type-insertpostads #paragraph_number').hide();
|
1129 |
+
|
1130 |
+
jQuery('.post-type-insertpostads #search-submit').val('Search').addClass('button-primary');
|
1131 |
+
jQuery('.post-type-insertpostads #post-search-input').attr('placeholder', 'Enter advert title');
|
1132 |
+
|
1133 |
+
jQuery('.post-type-insertpostads #bulk-action-selector-top').before('<p class="bulk">Bulk actions:</p>');
|
1134 |
+
jQuery('.post-type-insertpostads #bulk-action-selector-top option[value="-1"]').text('Select action');
|
1135 |
+
|
1136 |
+
var getTitle = jQuery('.post-new-php.post-type-insertpostads #title').remove();
|
1137 |
+
jQuery('#ipa_meta .inside').prepend('<p id="place-title"><label>Advert Title:</label></p>');
|
1138 |
+
jQuery(getTitle).appendTo('#place-title');
|
1139 |
+
|
1140 |
+
var publishBtn = jQuery('body.post-new-php.post-type-insertpostads #publish').remove();
|
1141 |
+
jQuery('#ipa_meta').after(publishBtn);
|
1142 |
+
|
1143 |
+
var viBlock = jQuery('.postbox.vi-choose').remove();
|
1144 |
+
jQuery('.insert_ads_vi_popup_left_column p:last').prev().before(viBlock).before('<div style="clear:both"></div>');
|
1145 |
+
|
1146 |
+
var btnMore = jQuery('<a href="#" id="field-more"><i class="fa fa-plus-circle" aria-hidden="true"></i><text>Add field</text></a>');
|
1147 |
+
jQuery('textarea[id*=insert_ads_vi_code_settings_optional]:not(#insert_ads_vi_code_settings_optional_1)').parent().hide();
|
1148 |
+
jQuery('#insert_ads_vi_code_settings_optional_1').parent().append(btnMore);
|
1149 |
+
jQuery(document).on('click', '#field-more', function(e){
|
1150 |
+
if(jQuery('#insert_ads_vi_code_settings_optional_2').parent().is(':hidden')){
|
1151 |
+
e.preventDefault();
|
1152 |
+
jQuery(this).parent().next().show();
|
1153 |
+
jQuery(this).parent().next().append(btnMore);
|
1154 |
+
//jQuery(this).detach();
|
1155 |
+
} else if (jQuery('#insert_ads_vi_code_settings_optional_2').is(':visible')) {
|
1156 |
+
jQuery(this).parent().next().show();
|
1157 |
+
jQuery(this).detach();
|
1158 |
+
return false
|
1159 |
+
} else {
|
1160 |
+
jQuery(this).detach();
|
1161 |
+
return false
|
1162 |
+
}
|
1163 |
+
})
|
1164 |
+
|
1165 |
+
function showInp(){
|
1166 |
+
var loadSel = jQuery('input[name="cur-pos-rad"]:checked').val();
|
1167 |
+
if(loadSel == 'above'){
|
1168 |
+
jQuery('.vi-choose .insert_ads_popup_content_wrapper:first').show();
|
1169 |
+
jQuery('.vi-choose .insert_ads_popup_content_wrapper:last').hide();
|
1170 |
+
} else if(loadSel == 'middle') {
|
1171 |
+
jQuery('.vi-choose .insert_ads_popup_content_wrapper:first').hide();
|
1172 |
+
jQuery('.vi-choose .insert_ads_popup_content_wrapper:last').show();
|
1173 |
+
} else {
|
1174 |
+
jQuery('.vi-choose .insert_ads_popup_content_wrapper').hide();
|
1175 |
+
}
|
1176 |
+
}
|
1177 |
+
function notifyInp(){
|
1178 |
+
jQuery('.funcnot').each(function(){
|
1179 |
+
var getCheck = jQuery(this).parent('div').find('input:checkbox').is(':checked'),
|
1180 |
+
thisPos = jQuery(this).attr('data-pos');
|
1181 |
+
if(getCheck === true){
|
1182 |
+
jQuery(this).text('Press to switch off vi stories on ' + thisPos + ' of post content.');
|
1183 |
+
} else {
|
1184 |
+
jQuery(this).text('Press to activate vi stories on ' + thisPos + ' of post content.');
|
1185 |
+
}
|
1186 |
+
})
|
1187 |
+
}
|
1188 |
+
notifyInp();
|
1189 |
+
showInp();
|
1190 |
+
jQuery('#cur-pos-sel input').on('click', function(){
|
1191 |
+
showInp();
|
1192 |
+
console.log(jQuery('input[name="cur-pos-rad"]:checked').val());
|
1193 |
+
})
|
1194 |
+
jQuery('.postbox.vi-choose .ipcheckbox').on('click', function(){
|
1195 |
+
notifyInp();
|
1196 |
+
})
|
1197 |
+
/*jQuery('#insert_ads_vi_code_settings_status + div').click(function(){
|
1198 |
+
if(jQuery(this).prev().val() == 'true'){
|
1199 |
+
jQuery(this).prev().val('false')
|
1200 |
+
} else {
|
1201 |
+
jQuery(this).prev().val('true')
|
1202 |
+
}
|
1203 |
+
console.log(jQuery(this).prev().val());
|
1204 |
+
})*/
|
1205 |
jQuery('.insert_ads_notice').on('click', '.notice-dismiss', function() {
|
1206 |
jQuery.post(
|
1207 |
jQuery('#insert_ads_admin_notice_ajax').val(), {
|
1210 |
}, function(response) { }
|
1211 |
);
|
1212 |
});
|
1213 |
+
jQuery('body').on('click', '#set-update', function(){
|
1214 |
+
console.log('fdsfs');
|
1215 |
+
var insert_ads_vi_code_settings_ad_unit_type = jQuery('#insert_ads_vi_code_settings_ad_unit_type').val();
|
1216 |
+
var insert_ads_vi_code_settings_keywords = jQuery('#insert_ads_vi_code_settings_keywords').val();
|
1217 |
+
var insert_ads_vi_code_settings_iab_category_parent = jQuery('#insert_ads_vi_code_settings_iab_category_parent').val();
|
1218 |
+
var insert_ads_vi_code_settings_iab_category_child = jQuery('#insert_ads_vi_code_settings_iab_category_child').val();
|
1219 |
+
var insert_ads_vi_code_settings_language = jQuery('#insert_ads_vi_code_settings_language').val();
|
1220 |
+
var insert_ads_vi_code_settings_native_bg_color = jQuery('#insert_ads_vi_code_settings_native_bg_color').val();
|
1221 |
+
var insert_ads_vi_code_settings_native_text_color = jQuery('#insert_ads_vi_code_settings_native_text_color').val();
|
1222 |
+
var insert_ads_vi_code_settings_font_family = jQuery('#insert_ads_vi_code_settings_font_family').val();
|
1223 |
+
var insert_ads_vi_code_settings_font_size = jQuery('#insert_ads_vi_code_settings_font_size').val();
|
1224 |
+
var insert_ads_vi_code_settings_optional_1 = jQuery('#insert_ads_vi_code_settings_optional_1').val();
|
1225 |
+
var insert_ads_vi_code_settings_optional_2 = jQuery('#insert_ads_vi_code_settings_optional_2').val();
|
1226 |
+
var insert_ads_vi_code_settings_optional_3 = jQuery('#insert_ads_vi_code_settings_optional_3').val();
|
1227 |
+
var curLoc = jQuery('input[name="cur-pos-rad"]:checked').val();
|
1228 |
+
var curStat = jQuery('#insert_ads_inpostads_'+curLoc+'_status').is(':checked') ? true : false;
|
1229 |
+
jQuery('.ui-dialog-content').html('<div class="insert_ads_ajaxloader"></div>');
|
1230 |
+
jQuery('.insert_ads_ajaxloader').show();
|
1231 |
+
jQuery.post(
|
1232 |
+
jQuery('#insert_ads_admin_ajax').val(), {
|
1233 |
+
'action': 'insert_ads_vi_customize_adcode_form_save_action',
|
1234 |
+
'insert_ads_nonce': jQuery('#insert_ads_nonce').val(),
|
1235 |
+
'insert_ads_vi_code_settings_ad_unit_type': insert_ads_vi_code_settings_ad_unit_type,
|
1236 |
+
'insert_ads_vi_code_settings_keywords': insert_ads_vi_code_settings_keywords,
|
1237 |
+
'insert_ads_vi_code_settings_iab_category_parent': insert_ads_vi_code_settings_iab_category_parent,
|
1238 |
+
'insert_ads_vi_code_settings_iab_category_child': insert_ads_vi_code_settings_iab_category_child,
|
1239 |
+
'insert_ads_vi_code_settings_language': insert_ads_vi_code_settings_language,
|
1240 |
+
'insert_ads_vi_code_settings_native_bg_color': insert_ads_vi_code_settings_native_bg_color,
|
1241 |
+
'insert_ads_vi_code_settings_native_text_color': insert_ads_vi_code_settings_native_text_color,
|
1242 |
+
'insert_ads_vi_code_settings_font_family': insert_ads_vi_code_settings_font_family,
|
1243 |
+
'insert_ads_vi_code_settings_font_size': insert_ads_vi_code_settings_font_size,
|
1244 |
+
'insert_ads_vi_code_settings_optional_1': insert_ads_vi_code_settings_optional_1,
|
1245 |
+
'insert_ads_vi_code_settings_optional_2': insert_ads_vi_code_settings_optional_2,
|
1246 |
+
'insert_ads_vi_code_settings_optional_3': insert_ads_vi_code_settings_optional_3,
|
1247 |
+
}, function(response) {
|
1248 |
+
if(/*response.indexOf('###SUCCESS###') !== -1*/true) {
|
1249 |
+
jQuery('.ui-dialog-titlebar').find('button').last().button('enable').click();
|
1250 |
+
var successText = '<div id="sucessText" class="notice notice-success is-dismissible insert-post-ads-notice-welcome"><p>Settings saved!</p></div>';
|
1251 |
+
jQuery('#poststuff').before(successText);
|
1252 |
+
jQuery(document).find('#sucessText').delay('2000').fadeOut('1000');
|
1253 |
+
console.log('othe');
|
1254 |
+
var ajData= {},
|
1255 |
+
ajAction = 'action',
|
1256 |
+
ajActionVal = 'insert_ads_inpostads_'+curLoc+'_form_save_action',
|
1257 |
+
ajNonce = 'insert_ads_nonce',
|
1258 |
+
ajNonceVal = jQuery('#insert_ads_nonce').val(),
|
1259 |
+
ajStatus = 'insert_ads_inpostads_'+curLoc+'_status',
|
1260 |
+
ajStatusVal = curStat,
|
1261 |
+
ajType = 'insert_ads_inpostads_'+curLoc+'_primary_ad_code_type',
|
1262 |
+
ajTypeVal = 'vicode';
|
1263 |
+
ajData[ajAction] = ajActionVal;
|
1264 |
+
ajData[ajNonce] = ajNonceVal;
|
1265 |
+
ajData[ajStatus] = ajStatusVal;
|
1266 |
+
ajData[ajType] = ajTypeVal;
|
1267 |
+
jQuery.post(
|
1268 |
+
jQuery('#insert_ads_admin_ajax').val(), ajData, function(response){
|
1269 |
+
console.log('saved');
|
1270 |
+
var sucdial = jQuery('<div id="sucdial">Succesfully updated!</div>').hide().fadeIn('1000');
|
1271 |
+
if(jQuery('#sucdial').length){
|
1272 |
+
jQuery(document).find('#sucdial').fadeIn('1000').delay('2000').fadeOut('1000');
|
1273 |
+
} else {
|
1274 |
+
jQuery('body').prepend(sucdial);
|
1275 |
+
jQuery(document).find('#sucdial').delay('2000').fadeOut('1000');
|
1276 |
+
}
|
1277 |
+
|
1278 |
+
|
1279 |
+
jQuery.post(
|
1280 |
+
jQuery('#insert_ads_admin_ajax').val(), {
|
1281 |
+
'action': 'single_post',
|
1282 |
+
'insert_ads_nonce': jQuery('#insert_ads_nonce').val(),
|
1283 |
+
'title' : jQuery('#insert_ads_vi_code_settings_keywords').val(),
|
1284 |
+
'post_type' : 'insertpostads'
|
1285 |
+
})
|
1286 |
+
})
|
1287 |
+
|
1288 |
+
} else {
|
1289 |
+
jQuery('.ui-dialog-buttonset').find('button').first().button('disable');
|
1290 |
+
jQuery('.ui-dialog-buttonset').find('button').last().button('enable');
|
1291 |
+
jQuery('.ui-dialog-titlebar').find('button').last().button('enable');
|
1292 |
+
jQuery('.ui-dialog-content').html(response.replace('###FAIL###', ''));
|
1293 |
+
}
|
1294 |
+
}
|
1295 |
+
);
|
1296 |
+
})
|
1297 |
+
|
1298 |
+
jQuery('#set-submit').click(function(e){
|
1299 |
+
e.preventDefault();
|
1300 |
+
var dataForm = jQuery(this).parents('form').serializeArray();
|
1301 |
+
dataForm.push({name: 'submit', value: 'Save Settings'});
|
1302 |
+
console.log(dataForm);
|
1303 |
+
jQuery.ajax({
|
1304 |
+
url : 'edit.php?post_type=insertpostads&page=insert-post-ads',
|
1305 |
+
method : 'POST',
|
1306 |
+
data : dataForm,
|
1307 |
+
success : function(){
|
1308 |
+
var sucdial = jQuery('<div id="sucdial">Succesfully updated!</div>').hide().fadeIn('1000');
|
1309 |
+
if(jQuery('#sucdial').length){
|
1310 |
+
jQuery(document).find('#sucdial').fadeIn('1000').delay('2000').fadeOut('1000');
|
1311 |
+
} else {
|
1312 |
+
jQuery('body').prepend(sucdial);
|
1313 |
+
jQuery(document).find('#sucdial').delay('2000').fadeOut('1000');
|
1314 |
+
}
|
1315 |
+
}
|
1316 |
+
})
|
1317 |
+
})
|
1318 |
});
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: insertpostads
|
3 |
Tags: ad injection, ads, ads plugin, adsense, adsense injection, google adsense, insert ads in post, insert post ads, wordpress ads plugin, advertising plugin, banners plugin, post ads
|
4 |
Requires at least: 3.6
|
5 |
-
Tested up to: 4.9.
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -69,6 +69,11 @@ Thank you
|
|
69 |
|
70 |
== Changelog ==
|
71 |
|
|
|
|
|
|
|
|
|
|
|
72 |
= 1.2 =
|
73 |
* This update features vi stories from video intelligence - a video player that supplies both content and video advertising. Watch a demo: http://demo.vi.ai/ViewsterBlog_Nintendo.html
|
74 |
Read the FAQ: https://www.vi.ai/frequently-asked-questions-vi-stories-for-wordpress/?utm_source=WordPress&utm_medium=Plugin%20FAQ&utm_campaign=WP%20insertpostads
|
2 |
Contributors: insertpostads
|
3 |
Tags: ad injection, ads, ads plugin, adsense, adsense injection, google adsense, insert ads in post, insert post ads, wordpress ads plugin, advertising plugin, banners plugin, post ads
|
4 |
Requires at least: 3.6
|
5 |
+
Tested up to: 4.9.2
|
6 |
+
Stable tag: 1.3
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
69 |
|
70 |
== Changelog ==
|
71 |
|
72 |
+
= 1.3 =
|
73 |
+
* Improved UI for vi stories customization
|
74 |
+
* Bug fixes
|
75 |
+
* Improved compatibility with other wp plugins
|
76 |
+
|
77 |
= 1.2 =
|
78 |
* This update features vi stories from video intelligence - a video player that supplies both content and video advertising. Watch a demo: http://demo.vi.ai/ViewsterBlog_Nintendo.html
|
79 |
Read the FAQ: https://www.vi.ai/frequently-asked-questions-vi-stories-for-wordpress/?utm_source=WordPress&utm_medium=Plugin%20FAQ&utm_campaign=WP%20insertpostads
|
uninstall.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
if (!defined('WP_UNINSTALL_PLUGIN')) {
|
4 |
die;
|
5 |
}
|
6 |
-
|
7 |
$option_name = 'wporg_option';
|
8 |
|
9 |
delete_option($option_name);
|
@@ -14,5 +14,5 @@ delete_site_option($option_name);
|
|
14 |
global $wpdb;
|
15 |
$prefix = $wpdb->prefix;
|
16 |
//$wpdb->query('UPDATE wp_usermeta SET meta_value = "" WHERE meta_key = "insert_ads_1.6_admin_notice_dismissed"');
|
17 |
-
$wpdb->query('DELETE FROM '.$prefix.'usermeta WHERE `meta_key` = "
|
18 |
?>
|
3 |
if (!defined('WP_UNINSTALL_PLUGIN')) {
|
4 |
die;
|
5 |
}
|
6 |
+
require_once(dirname(__FILE__).'/insert-post-ads.php');
|
7 |
$option_name = 'wporg_option';
|
8 |
|
9 |
delete_option($option_name);
|
14 |
global $wpdb;
|
15 |
$prefix = $wpdb->prefix;
|
16 |
//$wpdb->query('UPDATE wp_usermeta SET meta_value = "" WHERE meta_key = "insert_ads_1.6_admin_notice_dismissed"');
|
17 |
+
$wpdb->query('DELETE FROM '.$prefix.'usermeta WHERE `meta_key` = "insert_ads_'.WP_INSADS_VERSION.'_admin_notice_dismissed"');
|
18 |
?>
|
views/add-vi.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="wrap">
|
2 |
+
<h2><?php echo $this->plugin->displayName; ?> » <?php _e( 'Add vi', $this->plugin->name ); ?></h2>
|
3 |
+
|
4 |
+
<?php
|
5 |
+
if ( isset( $this->message ) ) {
|
6 |
+
?>
|
7 |
+
<div class="updated fade"><p><?php echo $this->message; ?></p></div>
|
8 |
+
<?php
|
9 |
+
}
|
10 |
+
if ( isset( $this->errorMessage ) ) {
|
11 |
+
?>
|
12 |
+
<div class="error fade"><p><?php echo $this->errorMessage; ?></p></div>
|
13 |
+
<?php
|
14 |
+
}
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div id="poststuff">
|
18 |
+
<div id="post-body" class="metabox-holder">
|
19 |
+
<!-- Content -->
|
20 |
+
<div id="post-body-content">
|
21 |
+
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
|
22 |
+
<div class="postbox">
|
23 |
+
<?php insert_ads_vi_plugin_card();
|
24 |
+
//insert_ads_inpostads_form_get_content('above');
|
25 |
+
//insert_ads_vi_customize_adcode_form_get_content();
|
26 |
+
?>
|
27 |
+
</div>
|
28 |
+
<div class="postbox">
|
29 |
+
<?php
|
30 |
+
if(get_transient('insert_ads_vi_api_authetication_token')){
|
31 |
+
insert_ads_vi_customize_adcode_form_get_content();
|
32 |
+
}
|
33 |
+
?>
|
34 |
+
</div>
|
35 |
+
|
36 |
+
|
37 |
+
<div class="postbox vi-choose">
|
38 |
+
<?php
|
39 |
+
if(get_transient('insert_ads_vi_api_authetication_token')){
|
40 |
+
insert_ads_inpostads_plugin_card();
|
41 |
+
//insert_ads_inpostads_form_get_content('above');
|
42 |
+
//insert_ads_inpostads_form_get_content('middle');
|
43 |
+
}
|
44 |
+
?>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
|
48 |
+
<!-- /postbox -->
|
49 |
+
</div>
|
50 |
+
<!-- /normal-sortables -->
|
51 |
+
</div>
|
52 |
+
<!-- /post-body-content -->
|
53 |
+
|
54 |
+
<!-- Sidebar -->
|
55 |
+
|
56 |
+
<!-- /postbox-container -->
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
</div>
|
views/settings.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
<div id="post-body-content">
|
21 |
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
|
22 |
<div class="postbox">
|
23 |
-
<?php insert_ads_vi_plugin_card();
|
24 |
//insert_ads_inpostads_form_get_content('above');
|
25 |
?>
|
26 |
</div>
|
@@ -68,7 +68,7 @@
|
|
68 |
</form>
|
69 |
|
70 |
<div class="postbox vi-choose">
|
71 |
-
<?php insert_ads_inpostads_plugin_card();
|
72 |
//insert_ads_inpostads_form_get_content('above');
|
73 |
?>
|
74 |
</div>
|
20 |
<div id="post-body-content">
|
21 |
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
|
22 |
<div class="postbox">
|
23 |
+
<?php //insert_ads_vi_plugin_card();
|
24 |
//insert_ads_inpostads_form_get_content('above');
|
25 |
?>
|
26 |
</div>
|
68 |
</form>
|
69 |
|
70 |
<div class="postbox vi-choose">
|
71 |
+
<?php //insert_ads_inpostads_plugin_card();
|
72 |
//insert_ads_inpostads_form_get_content('above');
|
73 |
?>
|
74 |
</div>
|