Version Description
- New: Add filter to add 3 more paragraph AdSense ads placed with WP QUADS PRO
- New: Add ad health and checking function to detect if there are error in adsense settings
- New: Support link to troubleshooting guide if AdSense ads are not shown
- New: Add floating Save Settings button
- New: Grey out unused AdSense ad spots in general settings
- New: Tested up to Wordpress 4.7.1
- New: Use up to 20 maximum AdSense ads on one page from a collection of 10 different ads
- New: Allow the use of the same ad on several different ad positions at the same time
New: Complete rewrite of the main processing function for easier maintanance
Fix: Settings are lost after updating when db option quads_version is empty
Fix: AdSense option Hide on device X condition not working width shortcode [quads]
Fix: Rewrite admin html and css for a more robust structure to prevent to be overwritten by other plugin devs who think its cool to load their css stuff all over the admin area
Fix: Button Open All Ads only works on second click
Fix: Hide Sizing Options when ad type is not AdSense
Fix: Meta Box option "Hide all ads" is not hiding custom created ads with commercial themes like bimber.
Tweak: Enable quicktags button per default on first time installation
Tweak: Performance update. Uses less ressources
Download this release
Release Info
Developer | ReneHermi |
Plugin | AdSense Plugin WP QUADS |
Version | 1.4.3 |
Comparing to | |
See all releases |
Code changes from version 1.4.0 to 1.4.3
- assets/css/quads-admin.css +11 -3
- assets/css/quads-admin.min.css +1 -1
- assets/css/quads-plugins-admin.min.css +1 -0
- assets/js/ads.js +1 -0
- assets/js/quads-admin.js +44 -4
- assets/js/quads-admin.min.js +44 -4
- includes/admin/admin-actions.php +9 -0
- includes/admin/admin-notices.php +71 -6
- includes/admin/settings/display-settings.php +16 -8
- includes/admin/settings/register-settings.php +44 -71
- includes/admin/upgrades/upgrade-functions.php +2 -2
- includes/api.php +50 -3
- includes/conditionals.php +10 -2
- includes/frontend-checks.php +298 -0
- includes/meta-boxes.php +6 -5
- includes/quicktags.php +2 -0
- includes/shortcodes.php +33 -10
- includes/template-functions.php +801 -193
- includes/widgets.php +69 -36
- quick-adsense-reloaded.php +17 -44
- readme.txt +31 -4
assets/css/quads-admin.css
CHANGED
@@ -128,13 +128,13 @@ input.medium-text, textarea.medium-text {
|
|
128 |
|
129 |
|
130 |
|
131 |
-
#quads_tab_container .row{
|
132 |
padding-top:12px;
|
133 |
padding-bottom:12px;
|
134 |
}
|
135 |
|
136 |
|
137 |
-
#quads_tab_container .row label strong, #tab_container .row strong {
|
138 |
font-weight: bold;
|
139 |
}
|
140 |
|
@@ -463,7 +463,7 @@ li.quads-tabs {
|
|
463 |
max-width:640px;
|
464 |
}
|
465 |
|
466 |
-
#quads_settingslicenses_header .row.th{
|
467 |
min-width:250px;
|
468 |
}
|
469 |
|
@@ -795,3 +795,11 @@ li.quads-tabs {
|
|
795 |
min-height: 25px;
|
796 |
}
|
797 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
|
130 |
|
131 |
+
#quads_tab_container .quads-row{
|
132 |
padding-top:12px;
|
133 |
padding-bottom:12px;
|
134 |
}
|
135 |
|
136 |
|
137 |
+
#quads_tab_container .quads-row label strong, #tab_container .quads-row strong {
|
138 |
font-weight: bold;
|
139 |
}
|
140 |
|
463 |
max-width:640px;
|
464 |
}
|
465 |
|
466 |
+
#quads_settingslicenses_header .quads-row.th{
|
467 |
min-width:250px;
|
468 |
}
|
469 |
|
795 |
min-height: 25px;
|
796 |
}
|
797 |
|
798 |
+
|
799 |
+
#quads-validate{
|
800 |
+
margin-top: -20px;
|
801 |
+
display: block;
|
802 |
+
margin-left: 2px;
|
803 |
+
margin-bottom: 20px;
|
804 |
+
font-weight: bold;
|
805 |
+
}
|
assets/css/quads-admin.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.quads-share-button-container{margin:5px 0}.quads-share-button-container p{margin:0 0 10px}.quads-share-button{display:inline-block}.quads-share-button a{text-decoration:none}.quads-share-button .quads-share{font-family:sans-serif;font-weight:700;text-decoration:none;text-align:center;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;color:#FFF;display:inline;font-size:16px;width:40px;padding:4px 8px}.quads-share-button-twitter .quads-share{background-color:#00ABF0}.quads-share-button-facebook .quads-share{background-color:#3b5998}.quads-share-button-googleplus .quads-share{background-color:#F53424}.quads-share-button-facebook .share:active,.quads-share-button-googleplus .share:active,.quads-share-button-twitter .share:active{background-color:#353535}@media (max-width:925px){.quads-share-button .quads-share{font-size:15px;padding:8px 16px}}.quads-richeditor{font-size:11px}#quads-add-ons h2{margin:0 0 15px}#quads-add-ons .quadsshare-addons{float:left;margin:0 15px 15px 0;background:#f0f0f0;border:1px solid #ccc;width:320px;padding:8px;height:315px;position:relative}#quads-add-ons .quadsshare-addons h3{margin:0 0 8px;font-size:13px}#quads-add-ons .quadsshare-addons .button-secondary{position:absolute;bottom:8px;left:8px}#quads-add-ons .quadsshare-addons .third-party{display:none}#system-info-textarea{width:580px;height:400px;font-family:Menlo,Monaco,monospace;background:0 0;white-space:pre;overflow:auto;display:block}.quads-select-chosen{width:300px}input.large-text,textarea.large-text{max-width:600px}input.medium-text,textarea.medium-text{min-width:190px}#quads_tab_container ul{list-style:none;margin:0;padding:0;background:#fff;float:left}#quads_tab_container ul li:first-child.selected-tab{border-top:none}#quads_tab_container ul li a.selected-tab{font-weight:700;text-decoration:none}#quads_tab_container .row{padding-top:12px;padding-bottom:12px}#quads_tab_container .row label strong,#tab_container .row strong{font-weight:700}.quads-tabs a{padding:5px;color:#a1a1a1;text-transform:uppercase}.quads-tabs a strong{font-weight:700}li.quads-tabs{float:left;margin-left:0;background-color:#e5e5e5}#quads_tab_container>ul>li.quads-tabs.active{background-color:#fff}#quads_tab_container>ul>li.quads-tabs.active a{color:#83c11f}#quads_tab_container .quads-panel-container{background:#FFF;padding:20px;overflow:auto;text-align:left;margin-bottom:10px;max-width:640px;float:left;clear:both}.form-table{margin-top:-20px}#quads_tab_container .form-table th{vertical-align:top;text-align:left;padding:20px 10px 20px 0;line-height:1.3;font-weight:700;font-size:14px;color:#484848;width:30%}#quads_tab_container .form-table tr{border-bottom:1px solid #E7E7E7}#quads_tab_container span.description{display:block;font-weight:400;font-style:normal;font-size:13px;margin-top:7px;color:#484848}#quads_tab_container .col-title{font-size:18px;color:#484848}@media only screen and (max-width:680px){#quads_tab_container ul{float:none;background:#fff}#quads_tab_container .form-table tr>th{width:100%}#quads_tab_container span.description{font-size:14px}#quads_tab_container .form-table tr>th,#tab_container .form-table tr>td{padding:10px}#quads_tab_container .quads-tabs a{text-align:left}#quads_tab_container li.quads-tabs{float:none;margin-left:0}}#quads_tab_container ul li.quads-tabs{margin-bottom:0}#quads_tab_container ul li.quads-tabs a{display:block;padding:10px;text-decoration:none;font-weight:700}#quads_tab_container ul li.quads-tabs a:hover{color:#383838}#quads_tab_container ul li.quads-tabs a.active{text-decoration:underline}#quads_tab_container table tbody tr:nth-child(1)>th>div{font-size:20px}#quadstabcontainer>.quadstabs{background-color:#fff}#quadstabcontainer ul .active{background-color:#00adef;color:#fff;border-bottom-color:#0098D2}#quadstabcontainer ul .active:hover{background-color:#00A4E2;color:#fff;border-bottom-color:#0098D2}#quadstabcontainer ul li a{padding:10px 14px;background-color:#f3f3f3}#quadstabcontainer .quadstab-container{border:0 solid #ececec}.quads-quote-docs{font-family:Courier New,Courier,Fixed;color:#050}.quads-desc{display:block;font-style:italic;padding-top:10px}.quads-postbox{padding:10px;position:relative;min-width:255px;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;margin-bottom:20px}.nav-tab-active{background-color:#fff;border-bottom:0}#quads-add-ons{padding:20px}.quads-toggle{position:absolute;right:0;top:0}.quads-box-close .quads-close-open-icon{background-position:0 -38px}.quads-close-open-icon{width:38px;height:38px;background:url(../images/arrow-close.png) repeat-y #f4f4f4}.quads-ad-toggle-header{position:relative;background-color:#f4f4f4;margin-bottom:2px;padding:10px 10px 10px 15px;-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none;cursor:pointer!important}.quads-ad-toggle-container{padding:20px;background-color:#f4f4f4}.quads-toogle-title{font-size:16px;font-weight:700}.adsense-size-title,.quads-advanced-description label{font-weight:600;font-size:12px;text-transform:uppercase;float:left}.quads-advanced-description label{width:215px}.quads-advanced-ad-box{clear:both;margin-top:20px;margin-bottom:20px}.adsense-size-title{margin-right:0;line-height:32px;margin-left:14px;min-width:100px}.quads-select-style-overwrite{border:1px solid #e6e6e6;width:150px;overflow:hidden;background:url(../images/box_arrow.png) 120px 0 repeat-y #fff;margin:0 0 5px}.quads-select-style-overwrite select{width:150px}.quads-size-input{position:relative;top:-1px;width:110%;border:none;box-shadow:none;background:0 0;-webkit-appearance:none;font-family:'Open Sans',arial,sans-serif;color:#555;font-size:12px}.quads-pro-overlay{height:200px}.quads-license-error-notice,.quads-license-expires-soon-notice{background-color:#fff;padding:10px;overflow:auto;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);border:1px solid #ECECEC;border-radius:3px}.quads-license-error-notice a{color:#0097df;text-decoration:underline}.quads-license-error-notice{border-left:4px solid #dd3d36}.quads-license-expiration-date-notice,.quads-license-lifetime-notice,.quads-license-null{padding:0}.quads-license-expiration-date-notice .quads-license-data p,.quads-license-lifetime-notice .quads-license-data p{color:#666;font-size:14px;font-style:italic;margin:4px 0 0}#quads_settingslicenses_header-nav{display:none}#quads_settingslicenses_header{max-width:640px}#quads_settingslicenses_header .row.th{min-width:250px}.quads-notice{background:#fff;border-left:4px solid #46b450;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 15px 2px;padding:1px 12px}.quads_admin h2.nav-tab-wrapper{border:0}.quads_admin .nav-tab{border:0;text-transform:uppercase;color:#a1a1a1;font-weight:700}.quads-h1{margin-bottom:1.35rem;font-size:2.5em;line-height:3.68rem;letter-spacing:normal}.quads-h2{margin-top:0;margin-bottom:1.2rem;font-size:30px;line-height:2.5rem}.quads-heading-pro{color:#83c11f;font-weight:700}.quads-button.green{display:inline-block;background-color:#83c11f;padding:10px;min-width:170px;color:#fff;font-size:16px;text-decoration:none;text-align:center;margin-top:20px}#quads-add-ons .quads-footer{clear:both;margin-top:20px;font-style:italic}#quads-add-ons li{font-size:18px;line-height:29px;position:relative;padding-left:23px;list-style:none!important}#quads-add-ons li:before{width:1em;height:100%;background:url(data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%2377B227%22%20d%3D%22M1671%20566q0%2040%2D28%2068l%2D724%20724%2D136%20136q%2D28%2028%2D68%2028t%2D68%2D28l%2D136%2D136%2D362%2D362q%2D28%2D28%2D28%2D68t28%2D68l136%2D136q28%2D28%2068%2D28t68%2028l294%20295%20656%2D657q28%2D28%2068%2D28t68%2028l136%20136q28%2028%2028%2068z%22%2F%3E%3C%2Fsvg%3E) left .4em no-repeat;background-size:contain;content:"";position:absolute;top:0;left:0;color:#77b227}.adsense_admin_header{font-size:14px;font-weight:500}#quads-adsense-bg-div{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.65);z-index:250000}#quads-adsense-container{text-align:center;width:480px;margin:85px auto 0;background-color:#fff;padding:2%;border-radius:2px}#quads-adsense-container h3{margin-top:0}#quads-adsense-container textarea,.quads-ad-toggle-container textarea{width:100%}.quads-ad-toggle-container input{margin-top:7px;margin-bottom:10px}.quads-adsense-code label,input{margin-right:2px}#quads_settings\5b ad2\5d \5b g_data_ad_client\5d{width:200px}.quads-ad-toggle-container label{display:inline-block;margin-right:2px;margin-top:-3px}.quads_adsense_code .quads-add-adsense{margin:20px 5px 20px 0}.quads-label-left{min-width:71px}#quads-label-Type{min-width:67px}.quads-medium-size{width:110px}#quads-msg{display:none;margin:5px;background-color:#c55c5c;color:#fff}.quads-loader,.quads-success-modal{display:block;position:fixed;top:45%;left:25%;width:200px;height:auto;padding:5px 20px;z-index:1002;overflow:auto}.quads-form-table{width:100%}.quads-left-box{width:45%;min-height:100px;float:left;line-height:35px;min-width:300px}@media screen and (max-width:700px){.adsense-size-title{margin-left:0}.quads-left-box{width:45%;min-height:100px;float:none;line-height:35px;min-width:300px}.quads-style img{max-width:50px}}.adsense_admin_header ul li{margin-top:2px;margin-left:20px;list-style-type:square}.quads-general-helper,.quads-helper{background-color:#83c11f;width:15px;display:inline-block;top:4px;cursor:pointer;margin-left:2px}.quads-helper{border-radius:50%;border:2px solid #fff;height:15px;position:relative;margin-top:-4px}.quads-general-helper:after,.quads-helper:after{height:20px;font-family:sans-serif;content:"?";font-size:11px;font-weight:700;left:4px;position:absolute;color:#fff}.quads-helper:after{margin-top:-10px}.quads-general-helper:after{margin-top:-2px}.quads-general-helper{border-radius:50%;border:2px solid #fff;height:15px;position:relative;margin-top:-4px}.quads-message{padding:10px;border:1px solid #FBFBFB;border-radius:2px;background-color:#F8F8F8;position:absolute;max-width:500px;z-index:9999;display:none;box-shadow:0 0 5px rgba(0,0,0,.2);font-weight:400;line-height:20px;text-transform:none;font-size:14px}#quads-pro-hover{background-color:#83c11f;padding:20px;min-width:150px;color:#fff;display:block;position:relative;margin-top:-100px;margin-left:50%}#quads-pro-hover-background{width:100%;height:100%;background:rgba(0,0,0,.6)}#quads-open-toggle{clear:both;float:left;margin-top:10px}#quads_settingsadsense_header input[type=number].small-text{width:55px}.quads_adsense_code input.quads-bggrey{background-color:#f5f5f5;color:#939393}.quads-amp-code{color:#939393;height:130px}.quads-chosen-select .chosen-choices li.search-field input{min-height:25px}
|
1 |
+
.quads-share-button-container{margin:5px 0}.quads-share-button-container p{margin:0 0 10px}.quads-share-button{display:inline-block}.quads-share-button a{text-decoration:none}.quads-share-button .quads-share{font-family:sans-serif;font-weight:700;text-decoration:none;text-align:center;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;color:#FFF;display:inline;font-size:16px;width:40px;padding:4px 8px}.quads-share-button-twitter .quads-share{background-color:#00ABF0}.quads-share-button-facebook .quads-share{background-color:#3b5998}.quads-share-button-googleplus .quads-share{background-color:#F53424}.quads-share-button-facebook .share:active,.quads-share-button-googleplus .share:active,.quads-share-button-twitter .share:active{background-color:#353535}@media (max-width:925px){.quads-share-button .quads-share{font-size:15px;padding:8px 16px}}.quads-richeditor{font-size:11px}#quads-add-ons h2{margin:0 0 15px}#quads-add-ons .quadsshare-addons{float:left;margin:0 15px 15px 0;background:#f0f0f0;border:1px solid #ccc;width:320px;padding:8px;height:315px;position:relative}#quads-add-ons .quadsshare-addons h3{margin:0 0 8px;font-size:13px}#quads-add-ons .quadsshare-addons .button-secondary{position:absolute;bottom:8px;left:8px}#quads-add-ons .quadsshare-addons .third-party{display:none}#system-info-textarea{width:580px;height:400px;font-family:Menlo,Monaco,monospace;background:0 0;white-space:pre;overflow:auto;display:block}.quads-select-chosen{width:300px}input.large-text,textarea.large-text{max-width:600px}input.medium-text,textarea.medium-text{min-width:190px}#quads_tab_container ul{list-style:none;margin:0;padding:0;background:#fff;float:left}#quads_tab_container ul li:first-child.selected-tab{border-top:none}#quads_tab_container ul li a.selected-tab{font-weight:700;text-decoration:none}#quads_tab_container .quads-row{padding-top:12px;padding-bottom:12px}#quads_tab_container .quads-row label strong,#tab_container .quads-row strong{font-weight:700}.quads-tabs a{padding:5px;color:#a1a1a1;text-transform:uppercase}.quads-tabs a strong{font-weight:700}li.quads-tabs{float:left;margin-left:0;background-color:#e5e5e5}#quads_tab_container>ul>li.quads-tabs.active{background-color:#fff}#quads_tab_container>ul>li.quads-tabs.active a{color:#83c11f}#quads_tab_container .quads-panel-container{background:#FFF;padding:20px;overflow:auto;text-align:left;margin-bottom:10px;max-width:640px;float:left;clear:both}.form-table{margin-top:-20px}#quads_tab_container .form-table th{vertical-align:top;text-align:left;padding:20px 10px 20px 0;line-height:1.3;font-weight:700;font-size:14px;color:#484848;width:30%}#quads_tab_container .form-table tr{border-bottom:1px solid #E7E7E7}#quads_tab_container span.description{display:block;font-weight:400;font-style:normal;font-size:13px;margin-top:7px;color:#484848}#quads_tab_container .col-title{font-size:18px;color:#484848}@media only screen and (max-width:680px){#quads_tab_container ul{float:none;background:#fff}#quads_tab_container .form-table tr>th{width:100%}#quads_tab_container span.description{font-size:14px}#quads_tab_container .form-table tr>th,#tab_container .form-table tr>td{padding:10px}#quads_tab_container .quads-tabs a{text-align:left}#quads_tab_container li.quads-tabs{float:none;margin-left:0}}#quads_tab_container ul li.quads-tabs{margin-bottom:0}#quads_tab_container ul li.quads-tabs a{display:block;padding:10px;text-decoration:none;font-weight:700}#quads_tab_container ul li.quads-tabs a:hover{color:#383838}#quads_tab_container ul li.quads-tabs a.active{text-decoration:underline}#quads_tab_container table tbody tr:nth-child(1)>th>div{font-size:20px}#quadstabcontainer>.quadstabs{background-color:#fff}#quadstabcontainer ul .active{background-color:#00adef;color:#fff;border-bottom-color:#0098D2}#quadstabcontainer ul .active:hover{background-color:#00A4E2;color:#fff;border-bottom-color:#0098D2}#quadstabcontainer ul li a{padding:10px 14px;background-color:#f3f3f3}#quadstabcontainer .quadstab-container{border:0 solid #ececec}.quads-quote-docs{font-family:Courier New,Courier,Fixed;color:#050}.quads-desc{display:block;font-style:italic;padding-top:10px}.quads-postbox{padding:10px;position:relative;min-width:255px;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;margin-bottom:20px}.nav-tab-active{background-color:#fff;border-bottom:0}#quads-add-ons{padding:20px}.quads-toggle{position:absolute;right:0;top:0}.quads-box-close .quads-close-open-icon{background-position:0 -38px}.quads-close-open-icon{width:38px;height:38px;background:url(../images/arrow-close.png) repeat-y #f4f4f4}.quads-ad-toggle-header{position:relative;background-color:#f4f4f4;margin-bottom:2px;padding:10px 10px 10px 15px;-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none;cursor:pointer!important}.quads-ad-toggle-container{padding:20px;background-color:#f4f4f4}.quads-toogle-title{font-size:16px;font-weight:700}.adsense-size-title,.quads-advanced-description label{font-weight:600;font-size:12px;text-transform:uppercase;float:left}.quads-advanced-description label{width:215px}.quads-advanced-ad-box{clear:both;margin-top:20px;margin-bottom:20px}.adsense-size-title{margin-right:0;line-height:32px;margin-left:14px;min-width:100px}.quads-select-style-overwrite{border:1px solid #e6e6e6;width:150px;overflow:hidden;background:url(../images/box_arrow.png) 120px 0 repeat-y #fff;margin:0 0 5px}.quads-select-style-overwrite select{width:150px}.quads-size-input{position:relative;top:-1px;width:110%;border:none;box-shadow:none;background:0 0;-webkit-appearance:none;font-family:'Open Sans',arial,sans-serif;color:#555;font-size:12px}.quads-pro-overlay{height:200px}.quads-license-error-notice,.quads-license-expires-soon-notice{background-color:#fff;padding:10px;overflow:auto;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);border:1px solid #ECECEC;border-radius:3px}.quads-license-error-notice a{color:#0097df;text-decoration:underline}.quads-license-error-notice{border-left:4px solid #dd3d36}.quads-license-expiration-date-notice,.quads-license-lifetime-notice,.quads-license-null{padding:0}.quads-license-expiration-date-notice .quads-license-data p,.quads-license-lifetime-notice .quads-license-data p{color:#666;font-size:14px;font-style:italic;margin:4px 0 0}#quads_settingslicenses_header-nav{display:none}#quads_settingslicenses_header{max-width:640px}#quads_settingslicenses_header .quads-row.th{min-width:250px}.quads-notice{background:#fff;border-left:4px solid #46b450;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 15px 2px;padding:1px 12px}.quads_admin h2.nav-tab-wrapper{border:0}.quads_admin .nav-tab{border:0;text-transform:uppercase;color:#a1a1a1;font-weight:700}.quads-h1{margin-bottom:1.35rem;font-size:2.5em;line-height:3.68rem;letter-spacing:normal}.quads-h2{margin-top:0;margin-bottom:1.2rem;font-size:30px;line-height:2.5rem}.quads-heading-pro{color:#83c11f;font-weight:700}.quads-button.green{display:inline-block;background-color:#83c11f;padding:10px;min-width:170px;color:#fff;font-size:16px;text-decoration:none;text-align:center;margin-top:20px}#quads-add-ons .quads-footer{clear:both;margin-top:20px;font-style:italic}#quads-add-ons li{font-size:18px;line-height:29px;position:relative;padding-left:23px;list-style:none!important}#quads-add-ons li:before{width:1em;height:100%;background:url(data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%2377B227%22%20d%3D%22M1671%20566q0%2040%2D28%2068l%2D724%20724%2D136%20136q%2D28%2028%2D68%2028t%2D68%2D28l%2D136%2D136%2D362%2D362q%2D28%2D28%2D28%2D68t28%2D68l136%2D136q28%2D28%2068%2D28t68%2028l294%20295%20656%2D657q28%2D28%2068%2D28t68%2028l136%20136q28%2028%2028%2068z%22%2F%3E%3C%2Fsvg%3E) left .4em no-repeat;background-size:contain;content:"";position:absolute;top:0;left:0;color:#77b227}.adsense_admin_header{font-size:14px;font-weight:500}#quads-adsense-bg-div{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.65);z-index:250000}#quads-adsense-container{text-align:center;width:480px;margin:85px auto 0;background-color:#fff;padding:2%;border-radius:2px}#quads-adsense-container h3{margin-top:0}#quads-adsense-container textarea,.quads-ad-toggle-container textarea{width:100%}.quads-ad-toggle-container input{margin-top:7px;margin-bottom:10px}.quads-adsense-code label,input{margin-right:2px}#quads_settings\5b ad2\5d \5b g_data_ad_client\5d{width:200px}.quads-ad-toggle-container label{display:inline-block;margin-right:2px;margin-top:-3px}.quads_adsense_code .quads-add-adsense{margin:20px 5px 20px 0}.quads-label-left{min-width:71px}#quads-label-Type{min-width:67px}.quads-medium-size{width:110px}#quads-msg{display:none;margin:5px;background-color:#c55c5c;color:#fff}.quads-loader,.quads-success-modal{display:block;position:fixed;top:45%;left:25%;width:200px;height:auto;padding:5px 20px;z-index:1002;overflow:auto}.quads-form-table{width:100%}.quads-left-box{width:45%;min-height:100px;float:left;line-height:35px;min-width:300px}@media screen and (max-width:700px){.adsense-size-title{margin-left:0}.quads-left-box{width:45%;min-height:100px;float:none;line-height:35px;min-width:300px}.quads-style img{max-width:50px}}.quads-general-helper,.quads-helper{background-color:#83c11f;width:15px;display:inline-block;top:4px;cursor:pointer}.adsense_admin_header ul li{margin-top:2px;margin-left:20px;list-style-type:square}.quads-helper{border-radius:50%;border:2px solid #fff;height:15px;position:relative;margin-top:-4px;margin-left:2px}.quads-general-helper:after,.quads-helper:after{height:20px;font-family:sans-serif;content:"?";font-size:11px;font-weight:700;left:4px;position:absolute;color:#fff}.quads-helper:after{margin-top:-10px}.quads-general-helper:after{margin-top:-2px}.quads-general-helper{border-radius:50%;border:2px solid #fff;height:15px;position:relative;margin-top:-4px;margin-left:2px}.quads-message{padding:10px;border:1px solid #FBFBFB;border-radius:2px;background-color:#F8F8F8;position:absolute;max-width:500px;z-index:9999;display:none;box-shadow:0 0 5px rgba(0,0,0,.2);font-weight:400;line-height:20px;text-transform:none;font-size:14px}#quads-pro-hover{background-color:#83c11f;padding:20px;min-width:150px;color:#fff;display:block;position:relative;margin-top:-100px;margin-left:50%}#quads-pro-hover-background{width:100%;height:100%;background:rgba(0,0,0,.6)}#quads-open-toggle{clear:both;float:left;margin-top:10px}#quads_settingsadsense_header input[type=number].small-text{width:55px}.quads_adsense_code input.quads-bggrey{background-color:#f5f5f5;color:#939393}.quads-amp-code{color:#939393;height:130px}.quads-chosen-select .chosen-choices li.search-field input{min-height:25px}#quads-validate{margin-top:-20px;display:block;margin-left:2px;margin-bottom:20px;font-weight:700}
|
assets/css/quads-plugins-admin.min.css
CHANGED
@@ -32,6 +32,7 @@
|
|
32 |
margin:5px;
|
33 |
}
|
34 |
|
|
|
35 |
@media screen and (max-width:400px){
|
36 |
#quick-adsense-reloaded-feedback-content {
|
37 |
padding:0px;
|
32 |
margin:5px;
|
33 |
}
|
34 |
|
35 |
+
|
36 |
@media screen and (max-width:400px){
|
37 |
#quick-adsense-reloaded-feedback-content {
|
38 |
padding:0px;
|
assets/js/ads.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var wpquads_adblocker_check = true;
|
assets/js/quads-admin.js
CHANGED
@@ -1,7 +1,40 @@
|
|
1 |
var strict;
|
2 |
|
|
|
3 |
jQuery(document).ready(function ($) {
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
// Activate chosen select boxes
|
6 |
$(".quads-chosen-select").chosen({
|
7 |
inherit_select_classes: true
|
@@ -34,12 +67,15 @@ jQuery(document).ready(function ($) {
|
|
34 |
// });
|
35 |
|
36 |
/**
|
37 |
-
* Toggle Button Open All Ads
|
38 |
*/
|
39 |
$('#quads-open-toggle').click(function(){
|
40 |
-
|
|
|
|
|
|
|
41 |
$('.quads-ad-toggle-container').show();
|
42 |
-
$('#quads-open-toggle').html('Close
|
43 |
}else{
|
44 |
$('.quads-ad-toggle-container').hide();
|
45 |
$('#quads-open-toggle').html('Open All Ads');
|
@@ -386,7 +422,7 @@ jQuery(document).ready(function ($) {
|
|
386 |
});
|
387 |
|
388 |
|
389 |
-
// Toggle between AdSense or Plain Text
|
390 |
$(document).on('click', '.quads_adsense_type', function () {
|
391 |
|
392 |
var parentContainerID = $(this).parents('.quads-ad-toggle-container').attr('id');
|
@@ -394,11 +430,15 @@ jQuery(document).ready(function ($) {
|
|
394 |
if ($(this).val() === 'adsense') {
|
395 |
$('#' + parentContainerID).children('textarea').hide();
|
396 |
$('#' + parentContainerID).find('div.quads_adsense_code').show();
|
|
|
|
|
397 |
|
398 |
}
|
399 |
if ($(this).val() === 'plain_text') {
|
400 |
$('#' + parentContainerID).children('textarea').show();
|
401 |
$('#' + parentContainerID).children('div.quads_adsense_code').hide();
|
|
|
|
|
402 |
}
|
403 |
});
|
404 |
|
1 |
var strict;
|
2 |
|
3 |
+
|
4 |
jQuery(document).ready(function ($) {
|
5 |
|
6 |
+
// Inactive select fields are greyed out
|
7 |
+
$('.quads-assign').each(function(e){
|
8 |
+
if (!$(this).prop('checked')){
|
9 |
+
$(this).next('select').css('background-color', 'whitesmoke').css('color', '#939393');
|
10 |
+
}else {
|
11 |
+
$(this).next('select').css('background-color', 'white').css('color', 'black');
|
12 |
+
}
|
13 |
+
});
|
14 |
+
|
15 |
+
$('.quads-assign').click(function(){
|
16 |
+
if (!$(this).prop('checked')){
|
17 |
+
$(this).next('select').css('background-color', 'whitesmoke').css('color', '#939393');
|
18 |
+
} else {
|
19 |
+
$(this).next('select').css('background-color', 'white').css('color', 'black');
|
20 |
+
}
|
21 |
+
});
|
22 |
+
|
23 |
+
// Check if submit button is visible than stick it to the bottom of the page
|
24 |
+
$(window).scroll(function() {
|
25 |
+
var elem = '#quads_tab_container .submit';
|
26 |
+
var top_of_element = $(elem).offset().top;
|
27 |
+
var bottom_of_element = $(elem).offset().top + $(elem).outerHeight(false);
|
28 |
+
var bottom_of_screen = $(window).scrollTop() + $(window).height();
|
29 |
+
if (bottom_of_screen > top_of_element){
|
30 |
+
// The element is visible, do something
|
31 |
+
$('#quads-submit-button').css('position', 'relative').css('bottom', '20px');
|
32 |
+
} else {
|
33 |
+
// The element is NOT visible, do something else
|
34 |
+
$('#quads-submit-button').css('position', 'fixed').css('bottom', '20px');
|
35 |
+
}
|
36 |
+
});
|
37 |
+
|
38 |
// Activate chosen select boxes
|
39 |
$(".quads-chosen-select").chosen({
|
40 |
inherit_select_classes: true
|
67 |
// });
|
68 |
|
69 |
/**
|
70 |
+
* Toggle Button | Open All Ads
|
71 |
*/
|
72 |
$('#quads-open-toggle').click(function(){
|
73 |
+
console.log($('#quads-open-toggle').html());
|
74 |
+
|
75 |
+
|
76 |
+
if ($('#quads-open-toggle').text() === 'Open All Ads' ){
|
77 |
$('.quads-ad-toggle-container').show();
|
78 |
+
$('#quads-open-toggle').html('Close Ads');
|
79 |
}else{
|
80 |
$('.quads-ad-toggle-container').hide();
|
81 |
$('#quads-open-toggle').html('Open All Ads');
|
422 |
});
|
423 |
|
424 |
|
425 |
+
// Toggle between AdSense or Plain Text option
|
426 |
$(document).on('click', '.quads_adsense_type', function () {
|
427 |
|
428 |
var parentContainerID = $(this).parents('.quads-ad-toggle-container').attr('id');
|
430 |
if ($(this).val() === 'adsense') {
|
431 |
$('#' + parentContainerID).children('textarea').hide();
|
432 |
$('#' + parentContainerID).find('div.quads_adsense_code').show();
|
433 |
+
$('#' + parentContainerID).find('.quads-sizes').show();
|
434 |
+
$('#' + parentContainerID).find('.quads-sizes-container').css('clear','');
|
435 |
|
436 |
}
|
437 |
if ($(this).val() === 'plain_text') {
|
438 |
$('#' + parentContainerID).children('textarea').show();
|
439 |
$('#' + parentContainerID).children('div.quads_adsense_code').hide();
|
440 |
+
$('#' + parentContainerID).find('.quads-sizes').hide();
|
441 |
+
$('#' + parentContainerID).find('.quads-sizes-container').css('clear','both');
|
442 |
}
|
443 |
});
|
444 |
|
assets/js/quads-admin.min.js
CHANGED
@@ -1,7 +1,40 @@
|
|
1 |
var strict;
|
2 |
|
|
|
3 |
jQuery(document).ready(function ($) {
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
// Activate chosen select boxes
|
6 |
$(".quads-chosen-select").chosen({
|
7 |
inherit_select_classes: true
|
@@ -34,12 +67,15 @@ jQuery(document).ready(function ($) {
|
|
34 |
// });
|
35 |
|
36 |
/**
|
37 |
-
* Toggle Button Open All Ads
|
38 |
*/
|
39 |
$('#quads-open-toggle').click(function(){
|
40 |
-
|
|
|
|
|
|
|
41 |
$('.quads-ad-toggle-container').show();
|
42 |
-
$('#quads-open-toggle').html('Close
|
43 |
}else{
|
44 |
$('.quads-ad-toggle-container').hide();
|
45 |
$('#quads-open-toggle').html('Open All Ads');
|
@@ -386,7 +422,7 @@ jQuery(document).ready(function ($) {
|
|
386 |
});
|
387 |
|
388 |
|
389 |
-
// Toggle between AdSense or Plain Text
|
390 |
$(document).on('click', '.quads_adsense_type', function () {
|
391 |
|
392 |
var parentContainerID = $(this).parents('.quads-ad-toggle-container').attr('id');
|
@@ -394,11 +430,15 @@ jQuery(document).ready(function ($) {
|
|
394 |
if ($(this).val() === 'adsense') {
|
395 |
$('#' + parentContainerID).children('textarea').hide();
|
396 |
$('#' + parentContainerID).find('div.quads_adsense_code').show();
|
|
|
|
|
397 |
|
398 |
}
|
399 |
if ($(this).val() === 'plain_text') {
|
400 |
$('#' + parentContainerID).children('textarea').show();
|
401 |
$('#' + parentContainerID).children('div.quads_adsense_code').hide();
|
|
|
|
|
402 |
}
|
403 |
});
|
404 |
|
1 |
var strict;
|
2 |
|
3 |
+
|
4 |
jQuery(document).ready(function ($) {
|
5 |
|
6 |
+
// Inactive select fields are greyed out
|
7 |
+
$('.quads-assign').each(function(e){
|
8 |
+
if (!$(this).prop('checked')){
|
9 |
+
$(this).next('select').css('background-color', 'whitesmoke').css('color', '#939393');
|
10 |
+
}else {
|
11 |
+
$(this).next('select').css('background-color', 'white').css('color', 'black');
|
12 |
+
}
|
13 |
+
});
|
14 |
+
|
15 |
+
$('.quads-assign').click(function(){
|
16 |
+
if (!$(this).prop('checked')){
|
17 |
+
$(this).next('select').css('background-color', 'whitesmoke').css('color', '#939393');
|
18 |
+
} else {
|
19 |
+
$(this).next('select').css('background-color', 'white').css('color', 'black');
|
20 |
+
}
|
21 |
+
});
|
22 |
+
|
23 |
+
// Check if submit button is visible than stick it to the bottom of the page
|
24 |
+
$(window).scroll(function() {
|
25 |
+
var elem = '#quads_tab_container .submit';
|
26 |
+
var top_of_element = $(elem).offset().top;
|
27 |
+
var bottom_of_element = $(elem).offset().top + $(elem).outerHeight(false);
|
28 |
+
var bottom_of_screen = $(window).scrollTop() + $(window).height();
|
29 |
+
if (bottom_of_screen > top_of_element){
|
30 |
+
// The element is visible, do something
|
31 |
+
$('#quads-submit-button').css('position', 'relative').css('bottom', '20px');
|
32 |
+
} else {
|
33 |
+
// The element is NOT visible, do something else
|
34 |
+
$('#quads-submit-button').css('position', 'fixed').css('bottom', '20px');
|
35 |
+
}
|
36 |
+
});
|
37 |
+
|
38 |
// Activate chosen select boxes
|
39 |
$(".quads-chosen-select").chosen({
|
40 |
inherit_select_classes: true
|
67 |
// });
|
68 |
|
69 |
/**
|
70 |
+
* Toggle Button | Open All Ads
|
71 |
*/
|
72 |
$('#quads-open-toggle').click(function(){
|
73 |
+
console.log($('#quads-open-toggle').html());
|
74 |
+
|
75 |
+
|
76 |
+
if ($('#quads-open-toggle').text() === 'Open All Ads' ){
|
77 |
$('.quads-ad-toggle-container').show();
|
78 |
+
$('#quads-open-toggle').html('Close Ads');
|
79 |
}else{
|
80 |
$('.quads-ad-toggle-container').hide();
|
81 |
$('#quads-open-toggle').html('Open All Ads');
|
422 |
});
|
423 |
|
424 |
|
425 |
+
// Toggle between AdSense or Plain Text option
|
426 |
$(document).on('click', '.quads_adsense_type', function () {
|
427 |
|
428 |
var parentContainerID = $(this).parents('.quads-ad-toggle-container').attr('id');
|
430 |
if ($(this).val() === 'adsense') {
|
431 |
$('#' + parentContainerID).children('textarea').hide();
|
432 |
$('#' + parentContainerID).find('div.quads_adsense_code').show();
|
433 |
+
$('#' + parentContainerID).find('.quads-sizes').show();
|
434 |
+
$('#' + parentContainerID).find('.quads-sizes-container').css('clear','');
|
435 |
|
436 |
}
|
437 |
if ($(this).val() === 'plain_text') {
|
438 |
$('#' + parentContainerID).children('textarea').show();
|
439 |
$('#' + parentContainerID).children('div.quads_adsense_code').hide();
|
440 |
+
$('#' + parentContainerID).find('.quads-sizes').hide();
|
441 |
+
$('#' + parentContainerID).find('.quads-sizes-container').css('clear','both');
|
442 |
}
|
443 |
});
|
444 |
|
includes/admin/admin-actions.php
CHANGED
@@ -30,3 +30,12 @@ function quads_process_actions() {
|
|
30 |
}
|
31 |
add_action( 'admin_init', 'quads_process_actions' );
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
add_action( 'admin_init', 'quads_process_actions' );
|
32 |
|
33 |
+
/**
|
34 |
+
* Update option quads_show_theme_notice
|
35 |
+
* "no" means no further upgrade notices are shown
|
36 |
+
*/
|
37 |
+
function quads_close_upgrade_notice(){
|
38 |
+
update_option ('quads_show_theme_notice', 'no');
|
39 |
+
}
|
40 |
+
add_action('quads_close_upgrade_notice', 'quads_close_upgrade_notice');
|
41 |
+
|
includes/admin/admin-notices.php
CHANGED
@@ -29,6 +29,18 @@ function quads_admin_messages() {
|
|
29 |
quads_theme_notice();
|
30 |
|
31 |
quads_update_notice();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
//quads_plugin_deactivated_notice();
|
34 |
|
@@ -191,13 +203,13 @@ function quads_theme_notice(){
|
|
191 |
|
192 |
$show_notice = get_option('quads_show_theme_notice');
|
193 |
|
194 |
-
if( false !== $show_notice && 'no' !== $show_notice ) {
|
195 |
-
$message = __( '<strong>Extend the <strong>' . quads_is_commercial_theme(). '</strong> theme with <strong>WP QUADS PRO!</strong>
|
196 |
?>
|
197 |
-
<div class="updated notice
|
198 |
<p><?php echo $message; ?></p>
|
199 |
</div> <?php
|
200 |
-
update_option ('quads_show_theme_notice', 'no');
|
201 |
}
|
202 |
}
|
203 |
|
@@ -224,7 +236,7 @@ function quads_update_notice() {
|
|
224 |
//update_option ('quads_show_update_notice', 'no');
|
225 |
} else
|
226 |
if( !quads_is_advanced() ) {
|
227 |
-
$message = sprintf( __( '<strong>WP QUADS ' . QUADS_VERSION . ': <strong> Install <a href="%1s" target="_blank">WP QUADS PRO</a> to get custom post type support
|
228 |
$message .= '<br><br><a href="' . admin_url() . 'admin.php?page=quads-settings&quads-action=hide_update_notice" class="button-primary thankyou" target="_self" title="Close Notice" style="font-weight:bold;">Close Notice</a>';
|
229 |
?>
|
230 |
<div class="updated notice" style="border-left: 4px solid #ffba00;">
|
@@ -233,8 +245,61 @@ function quads_update_notice() {
|
|
233 |
<?php
|
234 |
}
|
235 |
}
|
236 |
-
|
|
|
|
|
237 |
function quads_hide_notice(){
|
238 |
update_option ('quads_show_update_notice', 'no');
|
239 |
}
|
240 |
add_action('quads_hide_update_notice', 'quads_hide_notice', 10);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
quads_theme_notice();
|
30 |
|
31 |
quads_update_notice();
|
32 |
+
|
33 |
+
if (!quads_is_any_ad_activated() && quads_is_admin_page() ){
|
34 |
+
echo '<div class="notice notice-warning">'.sprintf(__('<strong>No ads are activated!</strong> You need to assign at least 1 ad to an ad spot. Fix this in <a href="%s">General Settings</a>! Alternatively you need to use a shortcode in your posts or no ads are shown at all.', 'quick-adsense-reloaded'), admin_url().'admin.php?page=quads-settings&quads-message=settings-imported&tab=general#quads_settingsgeneral_header').'</div>';
|
35 |
+
}
|
36 |
+
|
37 |
+
if (!quads_is_post_type_activated() && quads_is_admin_page() ){
|
38 |
+
echo '<div class="notice notice-warning">'.sprintf(__('<strong>No ads are shown - No post types selected</strong> You need to select at least 1 post type like <i>blog</i> or <i>page</i>. Fix this in <a href="%s">General Settings</a> or no ads are shown at all.', 'quick-adsense-reloaded'), admin_url().'admin.php?page=quads-settings&quads-message=settings-imported&tab=general#quads_settingsgeneral_header').'</div>';
|
39 |
+
}
|
40 |
+
|
41 |
+
if (isset($_GET['quads-action']) && $_GET['quads-action'] === 'validate' && quads_is_admin_page() && quads_is_any_ad_activated() && quads_is_post_type_activated() ){
|
42 |
+
echo '<div class="notice notice-success">' . sprintf(__('<strong>No errors detected in WP QUADS settings.</strong> If ads are still not shown read the <a href="%s" target="_blank">troubleshooting guide</a>'), 'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=toplink') . '</div>';
|
43 |
+
}
|
44 |
|
45 |
//quads_plugin_deactivated_notice();
|
46 |
|
203 |
|
204 |
$show_notice = get_option('quads_show_theme_notice');
|
205 |
|
206 |
+
if( false !== $show_notice && 'no' !== $show_notice && quads_is_commercial_theme() ) {
|
207 |
+
$message = __( '<strong>Extend the <strong>' . quads_is_commercial_theme(). '</strong> theme with <strong>WP QUADS PRO!</strong><br>Save time and earn more - Bring your AdSense earnings to next level. <a href="http://wpquads.com?utm_campaign=adminnotice&utm_source=admin_notice&utm_medium=admin&utm_content=bimber_upgrade_notice" target="_blank"> Purchase Now</a> or <a href="http://wpquads.com?utm_campaign=free_plugin&utm_source=admin_notice&utm_medium=admin&utm_content=bimber_upgrade_notice" target="_blank">Get Details</a></strong> <p> <a href="'.admin_url().'admin.php?page=quads-settings&quads-action=close_upgrade_notice" class="button">Close Notice</a>', 'quick-adsense-reloaded' );
|
208 |
?>
|
209 |
+
<div class="updated notice" style="border-left: 4px solid #ffba00;">
|
210 |
<p><?php echo $message; ?></p>
|
211 |
</div> <?php
|
212 |
+
//update_option ('quads_show_theme_notice', 'no');
|
213 |
}
|
214 |
}
|
215 |
|
236 |
//update_option ('quads_show_update_notice', 'no');
|
237 |
} else
|
238 |
if( !quads_is_advanced() ) {
|
239 |
+
$message = sprintf( __( '<strong>WP QUADS ' . QUADS_VERSION . ': <strong> Install <a href="%1s" target="_blank">WP QUADS PRO</a> to get custom post type support in <a href="%2s">General Settings</a>.', 'quick-adsense-reloaded' ), 'http://wpquads.com?utm_campaign=admin_notice&utm_source=admin_notice&utm_medium=admin&utm_content=custom_post_type', admin_url() . 'admin.php?page=quads-settings' );
|
240 |
$message .= '<br><br><a href="' . admin_url() . 'admin.php?page=quads-settings&quads-action=hide_update_notice" class="button-primary thankyou" target="_self" title="Close Notice" style="font-weight:bold;">Close Notice</a>';
|
241 |
?>
|
242 |
<div class="updated notice" style="border-left: 4px solid #ffba00;">
|
245 |
<?php
|
246 |
}
|
247 |
}
|
248 |
+
/**
|
249 |
+
* Hide Notice and update db option quads_hide_notice
|
250 |
+
*/
|
251 |
function quads_hide_notice(){
|
252 |
update_option ('quads_show_update_notice', 'no');
|
253 |
}
|
254 |
add_action('quads_hide_update_notice', 'quads_hide_notice', 10);
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Check if any ad is activated and assigned in general settings
|
258 |
+
*
|
259 |
+
* @global array $quads_options
|
260 |
+
* @return boolean
|
261 |
+
*/
|
262 |
+
function quads_is_any_ad_activated() {
|
263 |
+
global $quads_options;
|
264 |
+
|
265 |
+
// Check if custom positions location_settings is empty or does not exists
|
266 |
+
$check = array();
|
267 |
+
if( isset( $quads_options['location_settings'] ) ) {
|
268 |
+
foreach ( $quads_options['location_settings'] as $location_array ) {
|
269 |
+
if( isset( $location_array['status'] ) ) {
|
270 |
+
$check[] = $location_array['status'];
|
271 |
+
}
|
272 |
+
}
|
273 |
+
}
|
274 |
+
|
275 |
+
//wp_die(print_r($check));
|
276 |
+
|
277 |
+
if( count( $check ) === 0 &&
|
278 |
+
!isset( $quads_options['pos1']['BegnAds'] ) &&
|
279 |
+
!isset( $quads_options['pos2']['MiddAds'] ) &&
|
280 |
+
!isset( $quads_options['pos3']['EndiAds'] ) &&
|
281 |
+
!isset( $quads_options['pos4']['MoreAds'] ) &&
|
282 |
+
!isset( $quads_options['pos5']['LapaAds'] ) &&
|
283 |
+
!isset( $quads_options['pos6']['Para1Ads'] ) &&
|
284 |
+
!isset( $quads_options['pos7']['Para2Ads'] ) &&
|
285 |
+
!isset( $quads_options['pos8']['Para3Ads'] ) &&
|
286 |
+
!isset( $quads_options['pos9']['Img1Ads'] ) ) {
|
287 |
+
return false;
|
288 |
+
}
|
289 |
+
return true;
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* Check if any post type is enabled
|
294 |
+
*
|
295 |
+
* @global array $quads_options
|
296 |
+
* @return boolean
|
297 |
+
*/
|
298 |
+
function quads_is_post_type_activated(){
|
299 |
+
global $quads_options;
|
300 |
+
|
301 |
+
if (empty($quads_options['post_types'])){
|
302 |
+
return false;
|
303 |
+
}
|
304 |
+
return true;
|
305 |
+
}
|
includes/admin/settings/display-settings.php
CHANGED
@@ -109,18 +109,18 @@ function quads_do_settings_fields($page, $section) {
|
|
109 |
}
|
110 |
|
111 |
if (!empty($field['args']['label_for']) && !quads_is_excluded_title( $field['args']['id'] )){
|
112 |
-
echo '<tr class="row">';
|
113 |
-
echo '<td class="row th">';
|
114 |
echo '<label for="' . esc_attr($field['args']['label_for']) . '">' . $field['title'] . '</label>';
|
115 |
echo '</td></tr>';
|
116 |
}else if (!empty($field['title']) && !quads_is_excluded_title( $field['args']['id'] ) && !empty($field['args']['helper-desc'])){
|
117 |
-
echo '<tr class="row">';
|
118 |
-
echo '<td class="row th">';
|
119 |
echo '<div class="col-title">' . $field['title'] . '<a class="quads-general-helper" href="#"></a><div class="quads-message">' . $field['args']['helper-desc']. '</div></div>';
|
120 |
echo '</td></tr>';
|
121 |
}else if (!empty($field['title']) && !quads_is_excluded_title( $field['args']['id'] ) ){
|
122 |
-
echo '<tr class="row">';
|
123 |
-
echo '<td class="row th">';
|
124 |
echo '<div class="col-title">' . $field['title'] . '</div>';
|
125 |
echo '</td></tr>';
|
126 |
}
|
@@ -223,6 +223,7 @@ function quads_options_page() {
|
|
223 |
<?php quads_get_tab_header( 'quads_settings_' . $active_tab, 'quads_settings_' . $active_tab ); ?>
|
224 |
<div class="quads-panel-container"> <!-- new //-->
|
225 |
<form method="post" action="options.php" id="quads_settings">
|
|
|
226 |
<?php
|
227 |
settings_fields( 'quads_settings' );
|
228 |
quads_do_settings_fields( 'quads_settings_' . $active_tab, 'quads_settings_' . $active_tab );
|
@@ -233,8 +234,12 @@ function quads_options_page() {
|
|
233 |
<?php
|
234 |
// do not show save button on add-on page
|
235 |
if ($active_tab !== 'addons'){
|
236 |
-
|
237 |
-
|
|
|
|
|
|
|
|
|
238 |
?>
|
239 |
</form>
|
240 |
<?php
|
@@ -242,6 +247,9 @@ function quads_options_page() {
|
|
242 |
'https://wordpress.org/support/plugin/quick-adsense-reloaded/reviews/#new-post',
|
243 |
'http://wpquads.com/support/'
|
244 |
);
|
|
|
|
|
|
|
245 |
?>
|
246 |
</div> <!-- new //-->
|
247 |
<?php quads_get_advertising(); ?>
|
109 |
}
|
110 |
|
111 |
if (!empty($field['args']['label_for']) && !quads_is_excluded_title( $field['args']['id'] )){
|
112 |
+
echo '<tr class="quads-row">';
|
113 |
+
echo '<td class="quads-row th">';
|
114 |
echo '<label for="' . esc_attr($field['args']['label_for']) . '">' . $field['title'] . '</label>';
|
115 |
echo '</td></tr>';
|
116 |
}else if (!empty($field['title']) && !quads_is_excluded_title( $field['args']['id'] ) && !empty($field['args']['helper-desc'])){
|
117 |
+
echo '<tr class="quads-row">';
|
118 |
+
echo '<td class="quads-row th">';
|
119 |
echo '<div class="col-title">' . $field['title'] . '<a class="quads-general-helper" href="#"></a><div class="quads-message">' . $field['args']['helper-desc']. '</div></div>';
|
120 |
echo '</td></tr>';
|
121 |
}else if (!empty($field['title']) && !quads_is_excluded_title( $field['args']['id'] ) ){
|
122 |
+
echo '<tr class="quads-row">';
|
123 |
+
echo '<td class="quads-row th">';
|
124 |
echo '<div class="col-title">' . $field['title'] . '</div>';
|
125 |
echo '</td></tr>';
|
126 |
}
|
223 |
<?php quads_get_tab_header( 'quads_settings_' . $active_tab, 'quads_settings_' . $active_tab ); ?>
|
224 |
<div class="quads-panel-container"> <!-- new //-->
|
225 |
<form method="post" action="options.php" id="quads_settings">
|
226 |
+
|
227 |
<?php
|
228 |
settings_fields( 'quads_settings' );
|
229 |
quads_do_settings_fields( 'quads_settings_' . $active_tab, 'quads_settings_' . $active_tab );
|
234 |
<?php
|
235 |
// do not show save button on add-on page
|
236 |
if ($active_tab !== 'addons'){
|
237 |
+
$other_attributes = array( 'id' => 'quads-submit-button' );
|
238 |
+
submit_button(null, 'primary', 'quads-save-settings' , true, $other_attributes );
|
239 |
+
?>
|
240 |
+
<a href="<?php echo admin_url() . '/admin.php?page=quads-settings&quads-action=validate'; ?> " id="quads-validate"><?php _e('Validate Settings','quick-adsense-reloaded')?></a>
|
241 |
+
<?php
|
242 |
+
}
|
243 |
?>
|
244 |
</form>
|
245 |
<?php
|
247 |
'https://wordpress.org/support/plugin/quick-adsense-reloaded/reviews/#new-post',
|
248 |
'http://wpquads.com/support/'
|
249 |
);
|
250 |
+
echo '<p>' . sprintf( __( '<strong>Ads are not showing? Read the <a href="%s" target="_blank">troubleshooting guide</a> to find out how to resolve this issue.', 'quick-adsense-reloaded' ),
|
251 |
+
'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=bottomlink'
|
252 |
+
);
|
253 |
?>
|
254 |
</div> <!-- new //-->
|
255 |
<?php quads_get_advertising(); ?>
|
includes/admin/settings/register-settings.php
CHANGED
@@ -124,7 +124,7 @@ function quads_get_registered_settings() {
|
|
124 |
'general' => apply_filters( 'quads_settings_general', array(
|
125 |
array(
|
126 |
'id' => 'general_header',
|
127 |
-
'name' => '<strong>' . __( 'General
|
128 |
'desc' => __( '', 'quick-adsense-reloaded' ),
|
129 |
'type' => 'header'
|
130 |
),
|
@@ -146,11 +146,21 @@ function quads_get_registered_settings() {
|
|
146 |
8 => '8',
|
147 |
9 => '9',
|
148 |
10 => '10',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
),
|
150 |
),
|
151 |
array(
|
152 |
'id' => 'ad_position',
|
153 |
-
'name' => __( 'Position', 'quick-adsense-reloaded' ),
|
154 |
'desc' => __( 'Assign and activate ads on specific ad places', 'quick-adsense-reloaded' ),
|
155 |
'type' => 'ad_position'
|
156 |
),
|
@@ -184,11 +194,12 @@ function quads_get_registered_settings() {
|
|
184 |
'adsense_header' => array(
|
185 |
'id' => 'adsense_header',
|
186 |
'name' => '<strong>' . __( 'AdSense Code', 'quick-adsense-reloaded' ) . '</strong>',
|
187 |
-
'desc' => '<div class="adsense_admin_header">' . sprintf( __( 'Paste up to 10 Ad codes on post body and up to 10 Ad codes on sidebar widget
|
188 |
. '<ul style="margin-top:10px;">'
|
189 |
-
. '<li
|
190 |
-
. '<li
|
191 |
. '</ul>'
|
|
|
192 |
. '<div id="quads-open-toggle" class="button">'.__('Open All Ads','quick-adsense-reloaded').'</div>',
|
193 |
'type' => 'header'
|
194 |
),
|
@@ -1469,73 +1480,75 @@ function quads_ad_position_callback( $args ) {
|
|
1469 |
|
1470 |
|
1471 |
// Pos 1
|
1472 |
-
$html = $quads->html->checkbox( array('name' => 'quads_settings[pos1][BegnAds]',
|
1473 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1474 |
-
$html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos1][BegnRnd]', 'selected' => !empty( $quads_options['pos1']['BegnRnd'] ) ? $quads_options['pos1']['BegnRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1475 |
$html .= ' ' . __( 'to <strong>Beginning of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
|
1476 |
|
1477 |
// Pos 2
|
1478 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos2][MiddAds]', 'current' => !empty( $quads_options['pos2']['MiddAds'] ) ? $quads_options['pos2']['MiddAds'] : null, 'class' => 'quads-checkbox') );
|
1479 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1480 |
-
$html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos2][MiddRnd]', 'selected' => !empty( $quads_options['pos2']['MiddRnd'] ) ? $quads_options['pos2']['MiddRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1481 |
$html .= ' ' . __( 'to <strong>Middle of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
|
1482 |
|
1483 |
// Pos 3
|
1484 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos3][EndiAds]', 'current' => !empty( $quads_options['pos3']['EndiAds'] ) ? $quads_options['pos3']['EndiAds'] : null, 'class' => 'quads-checkbox') );
|
1485 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1486 |
-
$html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos3][EndiRnd]', 'selected' => !empty( $quads_options['pos3']['EndiRnd'] ) ? $quads_options['pos3']['EndiRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1487 |
$html .= ' ' . __( 'to <strong>End of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
|
1488 |
|
1489 |
// Pos 4
|
1490 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos4][MoreAds]', 'current' => !empty( $quads_options['pos4']['MoreAds'] ) ? $quads_options['pos4']['MoreAds'] : null, 'class' => 'quads-checkbox') );
|
1491 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1492 |
-
$html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos4][MoreRnd]', 'selected' => !empty( $quads_options['pos4']['MoreRnd'] ) ? $quads_options['pos4']['MoreRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1493 |
$html .= ' ' . __( 'right after <strong>the <span style="font-family:Courier New,Courier,Fixed;"><!--more--></span> tag</strong>', 'quick-adsense-reloaded' ) . '</br>';
|
1494 |
|
1495 |
// Pos 5
|
1496 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos5][LapaAds]', 'current' => !empty( $quads_options['pos5']['LapaAds'] ) ? $quads_options['pos5']['LapaAds'] : null, 'class' => 'quads-checkbox') );
|
1497 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1498 |
-
$html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos5][LapaRnd]', 'selected' => !empty( $quads_options['pos5']['LapaRnd'] ) ? $quads_options['pos5']['LapaRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1499 |
$html .= ' ' . __( 'right before <strong>the last Paragraph</strong>', 'quick-adsense-reloaded' ) . ' </br>';
|
1500 |
|
1501 |
// Pos 6
|
1502 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos6][Par1Ads]', 'current' => !empty( $quads_options['pos6']['Par1Ads'] ) ? $quads_options['pos6']['Par1Ads'] : null, 'class' => 'quads-checkbox') );
|
1503 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1504 |
-
$html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos6][Par1Rnd]', 'selected' => !empty( $quads_options['pos6']['Par1Rnd'] ) ? $quads_options['pos6']['Par1Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1505 |
$html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
|
1506 |
-
$html .= $quads->html->select( array('options' => quads_get_values(), 'name' => 'quads_settings[pos6][Par1Nup]', 'selected' => !empty( $quads_options['pos6']['Par1Nup'] ) ? $quads_options['pos6']['Par1Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1507 |
$html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
|
1508 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos6][Par1Con]', 'current' => !empty( $quads_options['pos6']['Par1Con'] ) ? $quads_options['pos6']['Par1Con'] : null, 'class' => 'quads-checkbox') );
|
1509 |
$html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
|
1510 |
|
1511 |
// Pos 7
|
1512 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos7][Par2Ads]', 'current' => !empty( $quads_options['pos7']['Par2Ads'] ) ? $quads_options['pos7']['Par2Ads'] : null, 'class' => 'quads-checkbox') );
|
1513 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1514 |
-
$html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos7][Par2Rnd]', 'selected' => !empty( $quads_options['pos7']['Par2Rnd'] ) ? $quads_options['pos7']['Par2Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1515 |
$html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
|
1516 |
-
$html .= $quads->html->select( array('options' => quads_get_values(), 'name' => 'quads_settings[pos7][Par2Nup]', 'selected' => !empty( $quads_options['pos7']['Par2Nup'] ) ? $quads_options['pos7']['Par2Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1517 |
$html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
|
1518 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos7][Par2Con]', 'current' => !empty( $quads_options['pos7']['Par2Con'] ) ? $quads_options['pos7']['Par2Con'] : null, 'class' => 'quads-checkbox') );
|
1519 |
$html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
|
1520 |
|
1521 |
// Pos 8
|
1522 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos8][Par3Ads]', 'current' => !empty( $quads_options['pos8']['Par3Ads'] ) ? $quads_options['pos8']['Par3Ads'] : null, 'class' => 'quads-checkbox') );
|
1523 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1524 |
-
$html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos8][Par3Rnd]', 'selected' => !empty( $quads_options['pos8']['Par3Rnd'] ) ? $quads_options['pos8']['Par3Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1525 |
$html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
|
1526 |
-
$html .= $quads->html->select( array('options' => quads_get_values(), 'name' => 'quads_settings[pos8][Par3Nup]', 'selected' => !empty( $quads_options['pos8']['Par3Nup'] ) ? $quads_options['pos8']['Par3Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1527 |
$html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
|
1528 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos8][Par3Con]', 'current' => !empty( $quads_options['pos8']['Par3Con'] ) ? $quads_options['pos8']['Par3Con'] : null, 'class' => 'quads-checkbox') );
|
1529 |
$html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
|
1530 |
|
|
|
|
|
1531 |
// Pos 9
|
1532 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos9][Img1Ads]', 'current' => !empty( $quads_options['pos9']['Img1Ads'] ) ? $quads_options['pos9']['Img1Ads'] : null, 'class' => 'quads-checkbox') );
|
1533 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1534 |
$html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos9][Img1Rnd]', 'selected' => !empty( $quads_options['pos9']['Img1Rnd'] ) ? $quads_options['pos9']['Img1Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1535 |
$html .= ' ' . __( '<strong>After Image</strong>', 'quick-adsense-reloaded' ) . ' ';
|
1536 |
-
$html .= $quads->html->select( array('options' => quads_get_values(), 'name' => 'quads_settings[pos9][Img1Nup]', 'selected' => !empty( $quads_options['pos9']['Img1Nup'] ) ? $quads_options['pos9']['Img1Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1537 |
$html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
|
1538 |
-
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos9][Img1Con]', 'current' => !empty( $quads_options['pos9']['Img1Con'] ) ? $quads_options['pos9']['Img1Con'] : null, 'class' => 'quads-checkbox') );
|
1539 |
$html .= ' ' . __( 'after <b>Image\'s outer</b><b><span style="font-family:Courier New,Courier,Fixed;"> <div> wp-caption</span></b> if any.', 'quick-adsense-reloaded' ) . ' </br>';
|
1540 |
|
1541 |
echo apply_filters( 'quads_ad_position_callback', $html );
|
@@ -1567,46 +1580,6 @@ function quads_quicktags_callback( $args ) {
|
|
1567 |
echo $html;
|
1568 |
}
|
1569 |
|
1570 |
-
/**
|
1571 |
-
* This hook should be removed and the hook function should replace entire "quads_ad_position_callback" function.
|
1572 |
-
*/
|
1573 |
-
add_filter( 'quads_ad_position_callback', 'quads_render_ad_locations' );
|
1574 |
-
|
1575 |
-
/**
|
1576 |
-
* Return ad locations HTML based on new API.
|
1577 |
-
*
|
1578 |
-
* @param $html
|
1579 |
-
* @return string Locations HTML
|
1580 |
-
*/
|
1581 |
-
function quads_render_ad_locations( $html ) {
|
1582 |
-
global $quads_options, $_quads_registered_ad_locations, $quads;
|
1583 |
-
|
1584 |
-
if( isset( $_quads_registered_ad_locations ) && is_array( $_quads_registered_ad_locations ) ) {
|
1585 |
-
foreach ( $_quads_registered_ad_locations as $location => $location_args ) {
|
1586 |
-
|
1587 |
-
$location_settings = quads_get_ad_location_settings( $location );
|
1588 |
-
|
1589 |
-
$html .= $quads->html->checkbox( array(
|
1590 |
-
'name' => 'quads_settings[location_settings][' . $location . '][status]',
|
1591 |
-
'current' => !empty( $location_settings['status'] ) ? $location_settings['status'] : null,
|
1592 |
-
'class' => 'quads-checkbox'
|
1593 |
-
) );
|
1594 |
-
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1595 |
-
|
1596 |
-
$html .= $quads->html->select( array(
|
1597 |
-
'options' => quads_get_ads(),
|
1598 |
-
'name' => 'quads_settings[location_settings][' . $location . '][ad]',
|
1599 |
-
'selected' => !empty( $location_settings['ad'] ) ? $location_settings['ad'] : null,
|
1600 |
-
'show_option_all' => false,
|
1601 |
-
'show_option_none' => false
|
1602 |
-
) );
|
1603 |
-
$html .= ' ' . $location_args['description'] . '</br>';
|
1604 |
-
}
|
1605 |
-
}
|
1606 |
-
|
1607 |
-
return $html;
|
1608 |
-
}
|
1609 |
-
|
1610 |
/**
|
1611 |
* AdSense Code Callback
|
1612 |
*
|
@@ -1661,7 +1634,7 @@ function quads_adsense_code_callback( $args ) {
|
|
1661 |
<textarea style="vertical-align:top;margin-right:20px;" class="large-text quads-textarea" cols="50" rows="10" id="quads_settings[<?php echo $id; ?>][code]" name="quads_settings[<?php echo $id; ?>][code]"><?php echo esc_textarea( stripslashes( $code ) ); ?></textarea><label for="quads_settings[ <?php echo $id; ?> ][code]"> <?php echo $args['desc']; ?></label>
|
1662 |
<br>
|
1663 |
<div class="quads_adsense_code">
|
1664 |
-
<input type="button" style="vertical-align:inherit;" class="button button-primary quads-add-adsense" value="Copy / Paste AdSense Code"> <span>or add Ad Slot ID & Publisher ID manually below
|
1665 |
<br />
|
1666 |
<?php //echo __('Generate Ad Slot & Publisher ID automatically from your adsense code', 'quick-adsense-reloaded')?>
|
1667 |
<label class="quads-label-left" for="quads_settings[<?php echo $id; ?>][g_data_ad_slot]">Ad Slot ID </label><input type="text" class="quads-medium-size quads-bggrey" id="quads_settings[<?php echo $id; ?>][g_data_ad_slot]" name="quads_settings[<?php echo $id; ?>][g_data_ad_slot]" value="<?php echo $g_data_ad_slot; ?>">
|
124 |
'general' => apply_filters( 'quads_settings_general', array(
|
125 |
array(
|
126 |
'id' => 'general_header',
|
127 |
+
'name' => '<strong>' . __( 'General & Position', 'quick-adsense-reloaded' ) . '</strong>',
|
128 |
'desc' => __( '', 'quick-adsense-reloaded' ),
|
129 |
'type' => 'header'
|
130 |
),
|
146 |
8 => '8',
|
147 |
9 => '9',
|
148 |
10 => '10',
|
149 |
+
11 => '11',
|
150 |
+
12 => '12',
|
151 |
+
13 => '13',
|
152 |
+
14 => '14',
|
153 |
+
15 => '15',
|
154 |
+
16 => '16',
|
155 |
+
17 => '17',
|
156 |
+
18 => '18',
|
157 |
+
19 => '19',
|
158 |
+
20 => '20',
|
159 |
),
|
160 |
),
|
161 |
array(
|
162 |
'id' => 'ad_position',
|
163 |
+
'name' => __( 'Position - Default Ads', 'quick-adsense-reloaded' ),
|
164 |
'desc' => __( 'Assign and activate ads on specific ad places', 'quick-adsense-reloaded' ),
|
165 |
'type' => 'ad_position'
|
166 |
),
|
194 |
'adsense_header' => array(
|
195 |
'id' => 'adsense_header',
|
196 |
'name' => '<strong>' . __( 'AdSense Code', 'quick-adsense-reloaded' ) . '</strong>',
|
197 |
+
'desc' => '<div class="adsense_admin_header">' . sprintf( __( 'Paste up to 10 Ad codes on post body and up to 10 Ad codes on sidebar widget.<br><a href="%s" target="_blank">Read here</a> to find out the most effective AdSense banner sizes. </div>'
|
198 |
. '<ul style="margin-top:10px;">'
|
199 |
+
. '<li>- Use option <i>AdSense</i> for unmodified AdSense code</li>'
|
200 |
+
. '<li>- Use <i>Plain Text / HTML / JS</i> for modified AdSense code with custom css or for none AdSense ads</li></ul>', 'quick-adsense-reloaded' ), 'http://wpquads.com/effective-adsense-banner-size-formats/?utm_campaign=plugin&utm_source=general_tab&utm_medium=admin&utm_content=best_banner_sizes' )
|
201 |
. '</ul>'
|
202 |
+
. '<div style="clear:both;">' . sprintf( __( '<strong>Ads are not showing? Read the <a href="%s" target="_blank">troubleshooting guide</a> to find out how to resolve this issue.', 'quick-adsense-reloaded' ),'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=toplink') . '</div>'
|
203 |
. '<div id="quads-open-toggle" class="button">'.__('Open All Ads','quick-adsense-reloaded').'</div>',
|
204 |
'type' => 'header'
|
205 |
),
|
1480 |
|
1481 |
|
1482 |
// Pos 1
|
1483 |
+
$html = $quads->html->checkbox( array('name' => 'quads_settings[pos1][BegnAds]','current' => !empty( $quads_options['pos1']['BegnAds'] ) ? $quads_options['pos1']['BegnAds'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1484 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1485 |
+
$html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos1][BegnRnd]', 'name' => 'quads_settings[pos1][BegnRnd]', 'selected' => !empty( $quads_options['pos1']['BegnRnd'] ) ? $quads_options['pos1']['BegnRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1486 |
$html .= ' ' . __( 'to <strong>Beginning of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
|
1487 |
|
1488 |
// Pos 2
|
1489 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos2][MiddAds]', 'current' => !empty( $quads_options['pos2']['MiddAds'] ) ? $quads_options['pos2']['MiddAds'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1490 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1491 |
+
$html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos2][MiddRnd]', 'name' => 'quads_settings[pos2][MiddRnd]', 'selected' => !empty( $quads_options['pos2']['MiddRnd'] ) ? $quads_options['pos2']['MiddRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1492 |
$html .= ' ' . __( 'to <strong>Middle of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
|
1493 |
|
1494 |
// Pos 3
|
1495 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos3][EndiAds]', 'current' => !empty( $quads_options['pos3']['EndiAds'] ) ? $quads_options['pos3']['EndiAds'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1496 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1497 |
+
$html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos3][EndiRnd]', 'name' => 'quads_settings[pos3][EndiRnd]', 'selected' => !empty( $quads_options['pos3']['EndiRnd'] ) ? $quads_options['pos3']['EndiRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1498 |
$html .= ' ' . __( 'to <strong>End of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
|
1499 |
|
1500 |
// Pos 4
|
1501 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos4][MoreAds]', 'current' => !empty( $quads_options['pos4']['MoreAds'] ) ? $quads_options['pos4']['MoreAds'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1502 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1503 |
+
$html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos4][MoreRnd]', 'name' => 'quads_settings[pos4][MoreRnd]', 'selected' => !empty( $quads_options['pos4']['MoreRnd'] ) ? $quads_options['pos4']['MoreRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1504 |
$html .= ' ' . __( 'right after <strong>the <span style="font-family:Courier New,Courier,Fixed;"><!--more--></span> tag</strong>', 'quick-adsense-reloaded' ) . '</br>';
|
1505 |
|
1506 |
// Pos 5
|
1507 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos5][LapaAds]', 'current' => !empty( $quads_options['pos5']['LapaAds'] ) ? $quads_options['pos5']['LapaAds'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1508 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1509 |
+
$html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos5][LapaRnd]', 'name' => 'quads_settings[pos5][LapaRnd]', 'selected' => !empty( $quads_options['pos5']['LapaRnd'] ) ? $quads_options['pos5']['LapaRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1510 |
$html .= ' ' . __( 'right before <strong>the last Paragraph</strong>', 'quick-adsense-reloaded' ) . ' </br>';
|
1511 |
|
1512 |
// Pos 6
|
1513 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos6][Par1Ads]', 'current' => !empty( $quads_options['pos6']['Par1Ads'] ) ? $quads_options['pos6']['Par1Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1514 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1515 |
+
$html .= $quads->html->select( array('options' => quads_get_ads(),'id' => 'quads_settings[pos6][Par1Rnd]', 'name' => 'quads_settings[pos6][Par1Rnd]', 'selected' => !empty( $quads_options['pos6']['Par1Rnd'] ) ? $quads_options['pos6']['Par1Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1516 |
$html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
|
1517 |
+
$html .= $quads->html->select( array('options' => quads_get_values(), 'class' => 'quads-paragraph', 'id' => 'quads_settings[pos6][Par1Nup]', 'name' => 'quads_settings[pos6][Par1Nup]', 'selected' => !empty( $quads_options['pos6']['Par1Nup'] ) ? $quads_options['pos6']['Par1Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1518 |
$html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
|
1519 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos6][Par1Con]', 'current' => !empty( $quads_options['pos6']['Par1Con'] ) ? $quads_options['pos6']['Par1Con'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1520 |
$html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
|
1521 |
|
1522 |
// Pos 7
|
1523 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos7][Par2Ads]', 'current' => !empty( $quads_options['pos7']['Par2Ads'] ) ? $quads_options['pos7']['Par2Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1524 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1525 |
+
$html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos7][Par2Rnd]', 'name' => 'quads_settings[pos7][Par2Rnd]', 'selected' => !empty( $quads_options['pos7']['Par2Rnd'] ) ? $quads_options['pos7']['Par2Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1526 |
$html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
|
1527 |
+
$html .= $quads->html->select( array('options' => quads_get_values(), 'id' => 'quads_settings[pos7][Par2Nup]', 'name' => 'quads_settings[pos7][Par2Nup]', 'selected' => !empty( $quads_options['pos7']['Par2Nup'] ) ? $quads_options['pos7']['Par2Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1528 |
$html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
|
1529 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos7][Par2Con]', 'current' => !empty( $quads_options['pos7']['Par2Con'] ) ? $quads_options['pos7']['Par2Con'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1530 |
$html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
|
1531 |
|
1532 |
// Pos 8
|
1533 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos8][Par3Ads]', 'current' => !empty( $quads_options['pos8']['Par3Ads'] ) ? $quads_options['pos8']['Par3Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1534 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1535 |
+
$html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos8][Par3Rnd]', 'name' => 'quads_settings[pos8][Par3Rnd]', 'selected' => !empty( $quads_options['pos8']['Par3Rnd'] ) ? $quads_options['pos8']['Par3Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1536 |
$html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
|
1537 |
+
$html .= $quads->html->select( array('options' => quads_get_values(), 'id' => 'quads_settings[pos8][Par3Nup]', 'name' => 'quads_settings[pos8][Par3Nup]', 'selected' => !empty( $quads_options['pos8']['Par3Nup'] ) ? $quads_options['pos8']['Par3Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1538 |
$html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
|
1539 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos8][Par3Con]', 'current' => !empty( $quads_options['pos8']['Par3Con'] ) ? $quads_options['pos8']['Par3Con'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1540 |
$html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
|
1541 |
|
1542 |
+
$html .= apply_filters('quads_extra_paragraph', '');
|
1543 |
+
|
1544 |
// Pos 9
|
1545 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos9][Img1Ads]', 'current' => !empty( $quads_options['pos9']['Img1Ads'] ) ? $quads_options['pos9']['Img1Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1546 |
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
1547 |
$html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos9][Img1Rnd]', 'selected' => !empty( $quads_options['pos9']['Img1Rnd'] ) ? $quads_options['pos9']['Img1Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1548 |
$html .= ' ' . __( '<strong>After Image</strong>', 'quick-adsense-reloaded' ) . ' ';
|
1549 |
+
$html .= $quads->html->select( array('options' => quads_get_values(), 'id' => 'quads_settings[pos9][Img1Nup]', 'name' => 'quads_settings[pos9][Img1Nup]', 'selected' => !empty( $quads_options['pos9']['Img1Nup'] ) ? $quads_options['pos9']['Img1Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
|
1550 |
$html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
|
1551 |
+
$html .= $quads->html->checkbox( array('name' => 'quads_settings[pos9][Img1Con]', 'current' => !empty( $quads_options['pos9']['Img1Con'] ) ? $quads_options['pos9']['Img1Con'] : null, 'class' => 'quads-checkbox quads-assign') );
|
1552 |
$html .= ' ' . __( 'after <b>Image\'s outer</b><b><span style="font-family:Courier New,Courier,Fixed;"> <div> wp-caption</span></b> if any.', 'quick-adsense-reloaded' ) . ' </br>';
|
1553 |
|
1554 |
echo apply_filters( 'quads_ad_position_callback', $html );
|
1580 |
echo $html;
|
1581 |
}
|
1582 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1583 |
/**
|
1584 |
* AdSense Code Callback
|
1585 |
*
|
1634 |
<textarea style="vertical-align:top;margin-right:20px;" class="large-text quads-textarea" cols="50" rows="10" id="quads_settings[<?php echo $id; ?>][code]" name="quads_settings[<?php echo $id; ?>][code]"><?php echo esc_textarea( stripslashes( $code ) ); ?></textarea><label for="quads_settings[ <?php echo $id; ?> ][code]"> <?php echo $args['desc']; ?></label>
|
1635 |
<br>
|
1636 |
<div class="quads_adsense_code">
|
1637 |
+
<input type="button" style="vertical-align:inherit;" class="button button-primary quads-add-adsense" value="Copy / Paste AdSense Code"> <span>or add Ad Slot ID & Publisher ID manually below:</span>
|
1638 |
<br />
|
1639 |
<?php //echo __('Generate Ad Slot & Publisher ID automatically from your adsense code', 'quick-adsense-reloaded')?>
|
1640 |
<label class="quads-label-left" for="quads_settings[<?php echo $id; ?>][g_data_ad_slot]">Ad Slot ID </label><input type="text" class="quads-medium-size quads-bggrey" id="quads_settings[<?php echo $id; ?>][g_data_ad_slot]" name="quads_settings[<?php echo $id; ?>][g_data_ad_slot]" value="<?php echo $g_data_ad_slot; ?>">
|
includes/admin/upgrades/upgrade-functions.php
CHANGED
@@ -112,8 +112,8 @@ function quads_is_commercial_theme() {
|
|
112 |
$themes = array('Bunchy', 'Bimber', 'boombox', 'Boombox');
|
113 |
|
114 |
if( is_object( $my_theme ) && in_array( $my_theme->get( 'Name' ), $themes ) ) {
|
115 |
-
update_option( 'quads_show_theme_notice', $my_theme->get( 'Name' ) );
|
116 |
-
return
|
117 |
}
|
118 |
|
119 |
return false;
|
112 |
$themes = array('Bunchy', 'Bimber', 'boombox', 'Boombox');
|
113 |
|
114 |
if( is_object( $my_theme ) && in_array( $my_theme->get( 'Name' ), $themes ) ) {
|
115 |
+
//update_option( 'quads_show_theme_notice', $my_theme->get( 'Name' ) );
|
116 |
+
return $my_theme->get( 'Name' );
|
117 |
}
|
118 |
|
119 |
return false;
|
includes/api.php
CHANGED
@@ -33,6 +33,47 @@
|
|
33 |
*/
|
34 |
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
/**
|
37 |
* Register an ad position.
|
38 |
*
|
@@ -79,12 +120,14 @@ function quads_has_ad( $location ) {
|
|
79 |
return apply_filters( 'quads_has_ad', $result, $location );
|
80 |
}
|
81 |
/**
|
82 |
-
* Display
|
83 |
*
|
84 |
* @param array $args Displaying options
|
85 |
* @return string|void Ad code or none if echo set to true
|
86 |
*/
|
87 |
function quads_ad( $args ) {
|
|
|
|
|
88 |
$defaults = array(
|
89 |
'location' => '',
|
90 |
'echo' => true,
|
@@ -92,14 +135,18 @@ function quads_ad( $args ) {
|
|
92 |
$args = wp_parse_args( $args, $defaults );
|
93 |
$code = '';
|
94 |
|
|
|
|
|
|
|
|
|
|
|
95 |
if ( quads_has_ad( $args['location'] ) ) {
|
96 |
global $quads_options;
|
97 |
|
98 |
-
quads_set_ad_count_custom(); // increase amount of
|
99 |
|
100 |
$location_settings = quads_get_ad_location_settings( $args['location'] );
|
101 |
$code .= "\n".'<!-- WP QUADS Custom Ad v. ' . QUADS_VERSION .' -->'."\n";
|
102 |
-
//$code .= $quads_options[ 'ad' . $location_settings['ad'] ]['code'];
|
103 |
$code .= '<div class="quads-location quads-ad' .$location_settings['ad']. '" id="quads-ad' .$location_settings['ad']. '">'."\n";
|
104 |
$code .= quads_render_ad( 'ad' . $location_settings['ad'], $quads_options[ 'ad' . $location_settings['ad'] ]['code'] );
|
105 |
$code .= '</div>';
|
33 |
*/
|
34 |
|
35 |
|
36 |
+
/**
|
37 |
+
* Return ad locations HTML based on new API in general settings
|
38 |
+
*
|
39 |
+
* @param $html
|
40 |
+
* @return string Locations HTML
|
41 |
+
*/
|
42 |
+
function quads_render_ad_locations( $html ) {
|
43 |
+
global $quads_options, $_quads_registered_ad_locations, $quads;
|
44 |
+
|
45 |
+
if( isset( $_quads_registered_ad_locations ) && is_array( $_quads_registered_ad_locations ) ) {
|
46 |
+
foreach ( $_quads_registered_ad_locations as $location => $location_args ) {
|
47 |
+
|
48 |
+
$location_settings = quads_get_ad_location_settings( $location );
|
49 |
+
|
50 |
+
$html .= $quads->html->checkbox( array(
|
51 |
+
'name' => 'quads_settings[location_settings][' . $location . '][status]',
|
52 |
+
'current' => !empty( $location_settings['status'] ) ? $location_settings['status'] : null,
|
53 |
+
'class' => 'quads-checkbox quads-assign'
|
54 |
+
) );
|
55 |
+
$html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
|
56 |
+
|
57 |
+
$html .= $quads->html->select( array(
|
58 |
+
'options' => quads_get_ads(),
|
59 |
+
'name' => 'quads_settings[location_settings][' . $location . '][ad]',
|
60 |
+
'selected' => !empty( $location_settings['ad'] ) ? $location_settings['ad'] : null,
|
61 |
+
'show_option_all' => false,
|
62 |
+
'show_option_none' => false
|
63 |
+
) );
|
64 |
+
$html .= ' ' . $location_args['description'] . '</br>';
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
return $html;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* This hook should be removed and the hook function should replace entire "quads_ad_position_callback" function.
|
73 |
+
*/
|
74 |
+
add_filter( 'quads_ad_position_callback', 'quads_render_ad_locations' );
|
75 |
+
|
76 |
+
|
77 |
/**
|
78 |
* Register an ad position.
|
79 |
*
|
120 |
return apply_filters( 'quads_has_ad', $result, $location );
|
121 |
}
|
122 |
/**
|
123 |
+
* Display a custom ad
|
124 |
*
|
125 |
* @param array $args Displaying options
|
126 |
* @return string|void Ad code or none if echo set to true
|
127 |
*/
|
128 |
function quads_ad( $args ) {
|
129 |
+
global $post;
|
130 |
+
|
131 |
$defaults = array(
|
132 |
'location' => '',
|
133 |
'echo' => true,
|
135 |
$args = wp_parse_args( $args, $defaults );
|
136 |
$code = '';
|
137 |
|
138 |
+
// All ads are deactivated via post meta settings
|
139 |
+
if( quads_check_meta_setting( 'NoAds' ) === '1' ){
|
140 |
+
return false;
|
141 |
+
}
|
142 |
+
|
143 |
if ( quads_has_ad( $args['location'] ) ) {
|
144 |
global $quads_options;
|
145 |
|
146 |
+
quads_set_ad_count_custom(); // increase amount of Custom ads
|
147 |
|
148 |
$location_settings = quads_get_ad_location_settings( $args['location'] );
|
149 |
$code .= "\n".'<!-- WP QUADS Custom Ad v. ' . QUADS_VERSION .' -->'."\n";
|
|
|
150 |
$code .= '<div class="quads-location quads-ad' .$location_settings['ad']. '" id="quads-ad' .$location_settings['ad']. '">'."\n";
|
151 |
$code .= quads_render_ad( 'ad' . $location_settings['ad'], $quads_options[ 'ad' . $location_settings['ad'] ]['code'] );
|
152 |
$code .= '</div>';
|
includes/conditionals.php
CHANGED
@@ -70,8 +70,11 @@ function quads_get_total_ad_count(){
|
|
70 |
$shortcode = isset($visibleShortcodeAds) ? (int)$visibleShortcodeAds : 0;
|
71 |
$content = isset($visibleContentAdsGlobal) ? (int)$visibleContentAdsGlobal : 0;
|
72 |
$custom = isset($ad_count_custom) ? (int)$ad_count_custom : 0;
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
75 |
return $shortcode + $content + $custom + $widget;
|
76 |
}
|
77 |
|
@@ -88,6 +91,10 @@ function quads_ad_reach_max_count(){
|
|
88 |
global $quads_options;
|
89 |
|
90 |
$maxads = isset($quads_options['maxads']) ? $quads_options['maxads'] : 10;
|
|
|
|
|
|
|
|
|
91 |
if ( quads_get_total_ad_count() >= $maxads ){
|
92 |
return true;
|
93 |
}
|
@@ -135,6 +142,7 @@ function quads_set_ad_count_custom(){
|
|
135 |
* Increment count of active ads generated on widgets
|
136 |
*
|
137 |
* @return int amount of active widget ads
|
|
|
138 |
*/
|
139 |
function quads_set_ad_count_widget(){
|
140 |
global $ad_count_widget;
|
70 |
$shortcode = isset($visibleShortcodeAds) ? (int)$visibleShortcodeAds : 0;
|
71 |
$content = isset($visibleContentAdsGlobal) ? (int)$visibleContentAdsGlobal : 0;
|
72 |
$custom = isset($ad_count_custom) ? (int)$ad_count_custom : 0;
|
73 |
+
//$widget = isset($ad_count_widget) ? (int)$ad_count_widget : 0;
|
74 |
+
$widget = quads_get_number_widget_ads();
|
75 |
+
|
76 |
+
//wp_die($widget);
|
77 |
+
//wp_die( $shortcode + $content + $custom + $widget);
|
78 |
return $shortcode + $content + $custom + $widget;
|
79 |
}
|
80 |
|
91 |
global $quads_options;
|
92 |
|
93 |
$maxads = isset($quads_options['maxads']) ? $quads_options['maxads'] : 10;
|
94 |
+
$maxads = $maxads - quads_get_number_widget_ads();
|
95 |
+
|
96 |
+
//echo 'Total ads: '. quads_get_total_ad_count() . ' maxads: '. $maxads . '<br>';
|
97 |
+
|
98 |
if ( quads_get_total_ad_count() >= $maxads ){
|
99 |
return true;
|
100 |
}
|
142 |
* Increment count of active ads generated on widgets
|
143 |
*
|
144 |
* @return int amount of active widget ads
|
145 |
+
* @deprecated since 1.4.1
|
146 |
*/
|
147 |
function quads_set_ad_count_widget(){
|
148 |
global $ad_count_widget;
|
includes/frontend-checks.php
ADDED
@@ -0,0 +1,298 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Helper Functions
|
4 |
+
*
|
5 |
+
* @package QUADS
|
6 |
+
* @subpackage INCLUDES
|
7 |
+
* @copyright Copyright (c) 2016, René Hermenau
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @author René Hermenau
|
10 |
+
* @author Thank you Thomas Maier (advanced ads) for that great inspiration. I borrowed some code. Hope you dont mind:)
|
11 |
+
* @since 1.4.3
|
12 |
+
*/
|
13 |
+
// Exit if accessed directly
|
14 |
+
if( !defined( 'ABSPATH' ) )
|
15 |
+
exit;
|
16 |
+
|
17 |
+
function quads_frontend_checks_init() {
|
18 |
+
if( !is_admin() && is_admin_bar_showing() && current_user_can( 'update_plugins' )
|
19 |
+
) {
|
20 |
+
add_action( 'admin_bar_menu', 'quads_add_admin_bar_menu', 1000 );
|
21 |
+
add_filter( 'the_content', 'quads_check_the_content_filter' );
|
22 |
+
add_filter( 'wp_footer', 'quads_check_adblocker', -101 );
|
23 |
+
add_filter( 'quads-ad-output', 'after_ad_output', 10, 2 );
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
add_action( 'init', 'quads_frontend_checks_init' );
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Create WP QUADS List possible error cases in the admin-bar.
|
31 |
+
*
|
32 |
+
* @param obj $wp_admin_bar WP_Admin_Bar
|
33 |
+
*/
|
34 |
+
function quads_add_admin_bar_menu( $wp_admin_bar ) {
|
35 |
+
global $quads_options, $wp_the_query, $post, $wp_scripts, $the_content;
|
36 |
+
|
37 |
+
$error = false;
|
38 |
+
|
39 |
+
$wp_admin_bar->add_node( array(
|
40 |
+
'id' => 'quads_ad_check',
|
41 |
+
'title' => __( 'Ad Check', 'quick-adsense-reloaded' ),
|
42 |
+
) );
|
43 |
+
|
44 |
+
// Hidden by default
|
45 |
+
$wp_admin_bar->add_node( array(
|
46 |
+
'parent' => 'quads_ad_check',
|
47 |
+
'id' => 'quads_ad_check_jquery',
|
48 |
+
'title' => __( '- JavaScript / jQuery error', 'quick-adsense-reloaded' ),
|
49 |
+
'href' => 'http://wpquads.com/docs/javascript-issues-breaking-adsense-ads/',
|
50 |
+
'meta' => array(
|
51 |
+
'class' => 'quads-hidden quads_ad_check_warning',
|
52 |
+
'target' => '_blank'
|
53 |
+
)
|
54 |
+
) );
|
55 |
+
|
56 |
+
// Hidden by default
|
57 |
+
$wp_admin_bar->add_node( array(
|
58 |
+
'parent' => 'quads_ad_check',
|
59 |
+
'id' => 'quads_ad_check_adblocker_enabled',
|
60 |
+
'title' => __( '- Ad blocker enabled', 'quick-adsense-reloaded' ),
|
61 |
+
'meta' => array(
|
62 |
+
'class' => 'quads-hidden quads_ad_check_warning',
|
63 |
+
'target' => '_blank'
|
64 |
+
)
|
65 |
+
) );
|
66 |
+
// Hidden by default
|
67 |
+
if( $wp_the_query->is_singular() ) {
|
68 |
+
// Check if the_content filter is available
|
69 |
+
if( !$the_content ) {
|
70 |
+
$wp_admin_bar->add_node( array(
|
71 |
+
'parent' => 'quads_ad_check',
|
72 |
+
'id' => 'quads_ad_check_the_content_not_invoked',
|
73 |
+
'title' => __( '- <em>the_content</em> filter does not exist', 'quick-adsense-reloaded' ),
|
74 |
+
'href' => 'http://wpquads.com/docs/the_content-filter-missing/',
|
75 |
+
'meta' => array(
|
76 |
+
'class' => 'quads_ad_check_warning',
|
77 |
+
'target' => '_blank'
|
78 |
+
)
|
79 |
+
) );
|
80 |
+
$error = true;
|
81 |
+
}
|
82 |
+
// Hidden by default
|
83 |
+
if( !empty( $post->ID ) ) {
|
84 |
+
$ad_settings = get_post_meta( $post->ID, '_quads_config_visibility', true );
|
85 |
+
|
86 |
+
if( !empty( $ad_settings['NoAds'] ) ) {
|
87 |
+
$wp_admin_bar->add_node( array(
|
88 |
+
'parent' => 'quads_ad_check',
|
89 |
+
'id' => 'quads_ad_check_disabled_on_page',
|
90 |
+
'title' => __( '- All Ads are disabled on this page', 'quick-adsense-reloaded' ),
|
91 |
+
'href' => get_edit_post_link( $post->ID ) . '#quads-ad-settings',
|
92 |
+
'meta' => array(
|
93 |
+
'class' => 'quads_ad_check_warning',
|
94 |
+
'target' => '_blank'
|
95 |
+
)
|
96 |
+
) );
|
97 |
+
$error = true;
|
98 |
+
}
|
99 |
+
if( !empty( $ad_settings['OffDef'] ) ) {
|
100 |
+
$wp_admin_bar->add_node( array(
|
101 |
+
'parent' => 'quads_ad_check',
|
102 |
+
'id' => 'quads_ad_check_disabled_in_content',
|
103 |
+
'title' => __( '- Default Ads disabled in content of this page', 'quick-adsense-reloaded' ),
|
104 |
+
'href' => get_edit_post_link( $post->ID ) . '#quads-ad-settings',
|
105 |
+
'meta' => array(
|
106 |
+
'class' => 'quads_ad_check_warning',
|
107 |
+
'target' => '_blank'
|
108 |
+
)
|
109 |
+
) );
|
110 |
+
$error = true;
|
111 |
+
}
|
112 |
+
} else {
|
113 |
+
$wp_admin_bar->add_node( array(
|
114 |
+
'parent' => 'quads_ad_check',
|
115 |
+
'id' => 'quads_ad_check_post_zero',
|
116 |
+
'title' => __( '- Current post ID is 0 ', 'quick-adsense-reloaded' ),
|
117 |
+
'href' => 'https://wpadvancedads.com/manual/known-plugin-conflicts/#frontend-issue-post-id-empty',
|
118 |
+
'meta' => array(
|
119 |
+
'class' => 'quads_ad_check_warning',
|
120 |
+
'target' => '_blank'
|
121 |
+
)
|
122 |
+
) );
|
123 |
+
$error = true;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
if( $wp_the_query->is_404() && !empty( $quads_options['disabled-ads']['404'] ) ) {
|
128 |
+
$wp_admin_bar->add_node( array(
|
129 |
+
'parent' => 'quads_ad_check',
|
130 |
+
'id' => 'quads_ad_check_no_404',
|
131 |
+
'title' => __( 'Ads are disabled on 404 pages', 'quick-adsense-reloaded' ),
|
132 |
+
'href' => admin_url( 'admin.php?page=quads-settings' ),
|
133 |
+
'meta' => array(
|
134 |
+
'class' => 'quads_ad_check_warning',
|
135 |
+
'target' => '_blank'
|
136 |
+
)
|
137 |
+
) );
|
138 |
+
$error = true;
|
139 |
+
}
|
140 |
+
|
141 |
+
if( !$wp_the_query->is_singular() && !empty( $quads_options['disabled-ads']['archives'] ) ) {
|
142 |
+
$wp_admin_bar->add_node( array(
|
143 |
+
'parent' => 'quads_ad_check',
|
144 |
+
'id' => 'quads_ad_check_no_archive',
|
145 |
+
'title' => __( 'Ads are disabled on non singular pages', 'quick-adsense-reloaded' ),
|
146 |
+
'href' => admin_url( 'admin.php?page=quads-settings' ),
|
147 |
+
'meta' => array(
|
148 |
+
'class' => 'quads_ad_check_warning',
|
149 |
+
'target' => '_blank'
|
150 |
+
)
|
151 |
+
) );
|
152 |
+
$error = true;
|
153 |
+
}
|
154 |
+
|
155 |
+
if( !extension_loaded( 'dom' ) ) {
|
156 |
+
$wp_admin_bar->add_node( array(
|
157 |
+
'parent' => 'quads_ad_check',
|
158 |
+
'id' => 'quads_ad_check_no_dom_document',
|
159 |
+
'title' => sprintf( __( 'The %s extension(s) is not loaded', 'quick-adsense-reloaded' ), 'dom' ),
|
160 |
+
'href' => 'http://php.net/manual/en/book.dom.php',
|
161 |
+
'meta' => array(
|
162 |
+
'class' => 'quads_ad_check_warning',
|
163 |
+
'target' => '_blank'
|
164 |
+
)
|
165 |
+
) );
|
166 |
+
$error = true;
|
167 |
+
}
|
168 |
+
|
169 |
+
if( !$error ) {
|
170 |
+
$wp_admin_bar->add_node( array(
|
171 |
+
'parent' => 'quads_ad_check',
|
172 |
+
'id' => 'quads_ad_check_fine',
|
173 |
+
'title' => __( 'WP QUADS is working fine', 'quick-adsense-reloaded' ),
|
174 |
+
'href' => false,
|
175 |
+
'meta' => array(
|
176 |
+
'target' => '_blank',
|
177 |
+
)
|
178 |
+
) );
|
179 |
+
}
|
180 |
+
|
181 |
+
$wp_admin_bar->add_node( array(
|
182 |
+
'parent' => 'quads_ad_check',
|
183 |
+
'id' => 'quads_ad_check_debug_dfp',
|
184 |
+
'title' => __( 'debug DFP ads', 'quick-adsense-reloaded' ),
|
185 |
+
'href' => esc_url( add_query_arg( 'googfc', '' ) ),
|
186 |
+
'meta' => array(
|
187 |
+
'class' => 'quads-hidden quads_ad_check_debug_dfp_link',
|
188 |
+
'target' => '_blank',
|
189 |
+
)
|
190 |
+
) );
|
191 |
+
|
192 |
+
$wp_admin_bar->add_node( array(
|
193 |
+
'parent' => 'quads_ad_check',
|
194 |
+
'id' => 'quads_ad_check_highlight_ads',
|
195 |
+
'title' => sprintf( '<label><input id="quads_highlight_ads_checkbox" type="checkbox"> %s</label>', __( 'highlight ads', 'quick-adsense-reloaded' ) )
|
196 |
+
) );
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Set variable to 'true' when 'the_content' filter is available.
|
201 |
+
*
|
202 |
+
* @param string $content
|
203 |
+
* @return string $content
|
204 |
+
*/
|
205 |
+
function quads_check_the_content_filter( $content ) {
|
206 |
+
global $the_content;
|
207 |
+
|
208 |
+
$the_content = true;
|
209 |
+
|
210 |
+
return $content;
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Check conditions and display warning. Conditions: AdBlocker enabled, jQuery is included in header
|
215 |
+
*/
|
216 |
+
function quads_check_adblocker() {
|
217 |
+
?>
|
218 |
+
<!--noptimize--><style>.quads-hidden { display: none; } .quads-adminbar-is-warnings { background: #ef4000 ! important; color: #fff !important; }
|
219 |
+
.quads-highlight-ads { outline:6px solid #83c11f !important; }</style>
|
220 |
+
<script type="text/javascript" src="<?php echo QUADS_PLUGIN_URL . 'assets/js/ads.js' ?>"></script>
|
221 |
+
<script>
|
222 |
+
(function (d, w) {
|
223 |
+
var jquery_not_detected = typeof jQuery === 'undefined';
|
224 |
+
|
225 |
+
var addEvent = function (obj, type, fn) {
|
226 |
+
if (obj.addEventListener)
|
227 |
+
obj.addEventListener(type, fn, false);
|
228 |
+
else if (obj.attachEvent)
|
229 |
+
obj.attachEvent('on' + type, function () {
|
230 |
+
return fn.call(obj, window.event);
|
231 |
+
});
|
232 |
+
};
|
233 |
+
|
234 |
+
function highlight_ads() {
|
235 |
+
try {
|
236 |
+
var ad_wrappers = document.querySelectorAll('div[id^="quads-ad"]')
|
237 |
+
} catch (e) {
|
238 |
+
return;
|
239 |
+
}
|
240 |
+
for (i = 0; i < ad_wrappers.length; i++) {
|
241 |
+
if (this.checked) {
|
242 |
+
ad_wrappers[i].className += ' quads-highlight-ads';
|
243 |
+
} else {
|
244 |
+
ad_wrappers[i].className = ad_wrappers[i].className.replace('quads-highlight-ads', '');
|
245 |
+
}
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
addEvent(w, 'load', function () {
|
250 |
+
var adblock_item = d.getElementById('wp-admin-bar-quads_ad_check_adblocker_enabled'),
|
251 |
+
jQuery_item = d.getElementById('wp-admin-bar-quads_ad_check_jquery'),
|
252 |
+
fine_item = d.getElementById('wp-admin-bar-quads_ad_check_fine'),
|
253 |
+
hide_fine = false;
|
254 |
+
|
255 |
+
var highlight_checkbox = d.getElementById('quads_highlight_ads_checkbox');
|
256 |
+
if (highlight_checkbox) {
|
257 |
+
addEvent(highlight_checkbox, 'change', highlight_ads);
|
258 |
+
}
|
259 |
+
if (adblock_item && typeof wpquads_adblocker_check === 'undefined' || false === wpquads_adblocker_check) {
|
260 |
+
// show quads-hidden item
|
261 |
+
adblock_item.className = adblock_item.className.replace(/quads-hidden/, '');
|
262 |
+
hide_fine = true;
|
263 |
+
}
|
264 |
+
|
265 |
+
if (jQuery_item && jquery_not_detected) {
|
266 |
+
// show quads-hidden item
|
267 |
+
jQuery_item.className = jQuery_item.className.replace(/quads-hidden/, '');
|
268 |
+
hide_fine = true;
|
269 |
+
}
|
270 |
+
|
271 |
+
if (hide_fine && fine_item) {
|
272 |
+
fine_item.className += ' quads-hidden';
|
273 |
+
}
|
274 |
+
|
275 |
+
showCount();
|
276 |
+
});
|
277 |
+
|
278 |
+
var showCount = function () {
|
279 |
+
try {
|
280 |
+
// select not quads-hidden warning items, exclude the 'fine_item'
|
281 |
+
var warning_count = document.querySelectorAll('.quads_ad_check_warning:not(.quads-hidden)').length;
|
282 |
+
} catch (e) {
|
283 |
+
return;
|
284 |
+
}
|
285 |
+
|
286 |
+
if (warning_count) {
|
287 |
+
var header = document.querySelector('#wp-admin-bar-quads_ad_check > div');
|
288 |
+
|
289 |
+
if (header) {
|
290 |
+
header.innerHTML += ' <i>(' + warning_count + ')</i>';
|
291 |
+
header.className += ' quads-adminbar-is-warnings';
|
292 |
+
}
|
293 |
+
}
|
294 |
+
};
|
295 |
+
})(document, window);
|
296 |
+
</script><!--/noptimize-->
|
297 |
+
<?php
|
298 |
+
}
|
includes/meta-boxes.php
CHANGED
@@ -8,11 +8,12 @@
|
|
8 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
* @since 0.9.6
|
10 |
*/
|
11 |
-
function quads_load_meta_box () {
|
12 |
new Quads_Meta_Box();
|
13 |
-
}
|
14 |
-
add_action( 'load-post.php', 'quads_load_meta_box' );
|
15 |
-
add_action( 'load-post-new.php', 'quads_load_meta_box' );
|
|
|
16 |
/**
|
17 |
* Ads options for a single post
|
18 |
*/
|
@@ -40,7 +41,7 @@ class Quads_Meta_Box {
|
|
40 |
__('WP QUADS - Hide Ads', 'quick-adsense-reloaded'), // title
|
41 |
array($this, 'render_meta_box'), // render function callback
|
42 |
$post_type, // post_type
|
43 |
-
'
|
44 |
'default' // priority
|
45 |
);
|
46 |
}
|
8 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
* @since 0.9.6
|
10 |
*/
|
11 |
+
//function quads_load_meta_box () {
|
12 |
new Quads_Meta_Box();
|
13 |
+
//}
|
14 |
+
//add_action( 'load-post.php', 'quads_load_meta_box' );
|
15 |
+
//add_action( 'load-post-new.php', 'quads_load_meta_box' );
|
16 |
+
//add_action( 'add_meta_boxes', 'quads_load_meta_box' );
|
17 |
/**
|
18 |
* Ads options for a single post
|
19 |
*/
|
41 |
__('WP QUADS - Hide Ads', 'quick-adsense-reloaded'), // title
|
42 |
array($this, 'render_meta_box'), // render function callback
|
43 |
$post_type, // post_type
|
44 |
+
'advanced', // context
|
45 |
'default' // priority
|
46 |
);
|
47 |
}
|
includes/quicktags.php
CHANGED
@@ -43,6 +43,8 @@ function quads_get_quicktags_from_content ( $content ) {
|
|
43 |
}
|
44 |
return $found;
|
45 |
}
|
|
|
|
|
46 |
/**
|
47 |
* Removes all quicktags from content
|
48 |
*
|
43 |
}
|
44 |
return $found;
|
45 |
}
|
46 |
+
|
47 |
+
|
48 |
/**
|
49 |
* Removes all quicktags from content
|
50 |
*
|
includes/shortcodes.php
CHANGED
@@ -24,20 +24,42 @@ add_shortcode( 'quads', 'quads_shortcode_display_ad', 1); // Important use a ver
|
|
24 |
* @since 0.9.4
|
25 |
* @param array $atts
|
26 |
*/
|
27 |
-
function quads_shortcode_display_ad($atts) {
|
28 |
-
|
29 |
-
return;
|
30 |
|
|
|
|
|
|
|
31 |
|
32 |
//return quads_check_meta_setting('NoAds');
|
33 |
-
if
|
34 |
return;
|
|
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
|
|
|
|
|
|
|
|
40 |
|
|
|
|
|
41 |
|
42 |
/**
|
43 |
* return ad content
|
@@ -56,7 +78,7 @@ function quads_get_ad($id = 0) {
|
|
56 |
if ( isset($quads_options['ad' . $id]['code']) ){
|
57 |
// Count how often the shortcode is used - Important
|
58 |
quads_set_ad_count_shortcode();
|
59 |
-
|
60 |
//return $code . $quads_options['ad' . $id]['code'];
|
61 |
return quads_render_ad('ad' . $id, $quads_options['ad' . $id]['code']);
|
62 |
}
|
@@ -73,8 +95,9 @@ function quads_get_ad($id = 0) {
|
|
73 |
function quads_check_meta_setting($key){
|
74 |
global $post;
|
75 |
|
76 |
-
if ( !isset($post->ID ) )
|
77 |
-
|
|
|
78 |
|
79 |
$meta_key = '_quads_config_visibility';
|
80 |
|
24 |
* @since 0.9.4
|
25 |
* @param array $atts
|
26 |
*/
|
27 |
+
function quads_shortcode_display_ad( $atts ) {
|
28 |
+
global $quads_options;
|
|
|
29 |
|
30 |
+
if( !quads_ad_is_allowed() )
|
31 |
+
return;
|
32 |
+
|
33 |
|
34 |
//return quads_check_meta_setting('NoAds');
|
35 |
+
if( quads_check_meta_setting( 'NoAds' ) === '1' ){
|
36 |
return;
|
37 |
+
}
|
38 |
|
39 |
+
// The ad id
|
40 |
+
$id = isset( $atts['id'] ) ? ( int ) $atts['id'] : 0;
|
41 |
+
|
42 |
+
$arr = array(
|
43 |
+
'float:left;margin:%1$dpx %1$dpx %1$dpx 0;',
|
44 |
+
'float:none;margin:%1$dpx 0 %1$dpx 0;text-align:center;',
|
45 |
+
'float:right;margin:%1$dpx 0 %1$dpx %1$dpx;',
|
46 |
+
'float:none;margin:0px;');
|
47 |
+
|
48 |
+
$adsalign = $quads_options['ad' . $id]['align'];
|
49 |
+
$adsmargin = isset( $quads_options['ad' . $id]['margin'] ) ? $quads_options['ad' . $id]['margin'] : '3'; // default
|
50 |
+
$margin = sprintf( $arr[( int ) $adsalign], $adsmargin );
|
51 |
+
|
52 |
+
|
53 |
+
// Do not create any inline style on AMP site
|
54 |
+
$style = !quads_is_amp_endpoint() ? apply_filters( 'quads_filter_margins', $margin, 'ad' . $id ) : '';
|
55 |
|
56 |
+
$code = "\n" . '<!-- WP QUADS v. ' . QUADS_VERSION . ' Shortcode Ad -->' . "\n" .
|
57 |
+
'<div class="quads-location quads-ad' . $id . '" id="quads-ad' . $id . '" style="' . $style . '">' . "\n";
|
58 |
+
$code .= do_shortcode( quads_get_ad( $id ) );
|
59 |
+
$code .= '</div>' . "\n";
|
60 |
|
61 |
+
return $code;
|
62 |
+
}
|
63 |
|
64 |
/**
|
65 |
* return ad content
|
78 |
if ( isset($quads_options['ad' . $id]['code']) ){
|
79 |
// Count how often the shortcode is used - Important
|
80 |
quads_set_ad_count_shortcode();
|
81 |
+
//$code = "\n".'<!-- WP QUADS Shortcode Ad v. ' . QUADS_VERSION .' -->'."\n";
|
82 |
//return $code . $quads_options['ad' . $id]['code'];
|
83 |
return quads_render_ad('ad' . $id, $quads_options['ad' . $id]['code']);
|
84 |
}
|
95 |
function quads_check_meta_setting($key){
|
96 |
global $post;
|
97 |
|
98 |
+
if ( !isset($post->ID ) ){
|
99 |
+
return false;
|
100 |
+
}
|
101 |
|
102 |
$meta_key = '_quads_config_visibility';
|
103 |
|
includes/template-functions.php
CHANGED
@@ -16,20 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
16 |
add_filter('the_content', 'quads_post_settings_to_quicktags', 5);
|
17 |
add_filter('the_content', 'quads_process_content', quads_get_load_priority());
|
18 |
|
19 |
-
|
20 |
-
* Get load priority
|
21 |
-
*
|
22 |
-
* @global arr $quads_options
|
23 |
-
* @return int
|
24 |
-
*/
|
25 |
-
function quads_get_load_priority(){
|
26 |
-
global $quads_options;
|
27 |
-
|
28 |
-
if (!empty($quads_options['priority'])){
|
29 |
-
return intval($quads_options['priority']);
|
30 |
-
}
|
31 |
-
return 20;
|
32 |
-
}
|
33 |
|
34 |
/**
|
35 |
* Adds quicktags, defined via post meta options, to content.
|
@@ -78,17 +65,651 @@ function quads_get_visibility_quicktags_str ( $post_id = null ) {
|
|
78 |
return $str;
|
79 |
}
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|