Version Description
- Bug fixes and Security updates
Download this release
Release Info
Developer | namith.jawahar |
Plugin | Quick Adsense |
Version | 2.8 |
Comparing to | |
See all releases |
Code changes from version 2.7 to 2.8
- {includes → assets}/css/admin.css +9 -333
- {includes → assets}/images/ajax-loader.gif +0 -0
- {includes → assets}/js/Chart.bundle.min.js +0 -0
- {includes → assets}/js/admin.js +210 -333
- includes/GeoIP/GeoIPCountry.php +0 -428
- includes/adsense.php +248 -254
- includes/class-filehandler.php +137 -0
- includes/content.php +691 -600
- includes/controls.php +181 -90
- includes/countries.php +1000 -0
- includes/defaults.php +299 -293
- includes/images/adpushup-970x250-red.png +0 -0
- includes/images/advertisement-preview.png +0 -0
- includes/images/ajax-loader-flat.gif +0 -0
- includes/images/jquery.minicolors.png +0 -0
- includes/images/privacy.png +0 -0
- includes/js/gdpr.js +0 -198
- includes/js/jquery.minicolors.js +0 -1108
- includes/js/vi-check.js +0 -62
- includes/loader.php +20 -0
- includes/quicktags.php +39 -33
- includes/settings.php +191 -729
- includes/templates/adunit-onpost.php +64 -0
- includes/templates/adunit-widget.php +23 -0
- includes/templates/block-adsense-adstxt-notice.php +16 -0
- includes/templates/block-adsense-adstxt-update-failed.php +7 -0
- includes/templates/block-adunit-advanced.php +202 -0
- includes/templates/block-general-adsense.php +30 -0
- includes/templates/block-general-appearance.php +167 -0
- includes/templates/block-general-assign-position.php +316 -0
- includes/templates/block-general-quicktag.php +91 -0
- includes/templates/block-stats-chart.php +6 -0
- includes/templates/js/script-admin-notice.php +7 -0
- includes/templates/js/script-frontend-stats.php +11 -0
- includes/templates/page-settings.php +32 -0
- includes/templates/section-general.php +25 -0
- includes/templates/section-header-footer.php +40 -0
- includes/templates/section-onpost-content.php +91 -0
- includes/templates/section-widgets.php +89 -0
- includes/vendor/GeoIP/GeoIPCountry.php +235 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0000.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0100.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0200.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0400.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0800.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/1.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/10.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/100.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/1000.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/101.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/102.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/103.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/104.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/105.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/106.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/107.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/108.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/109.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/11.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/110.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/111.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/112.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/113.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/114.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/115.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/116.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/117.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/118.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/119.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/12.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/120.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/121.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/122.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/123.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/124.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/125.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/126.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/127.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/128.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/129.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/13.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/130.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/131.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/132.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/133.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/134.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/135.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/136.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/137.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/138.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/139.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/14.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/140.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/141.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/142.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/143.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/144.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/145.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/146.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/147.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/148.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/149.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/15.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/150.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/151.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/152.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/153.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/154.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/155.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/156.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/157.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/158.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/159.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/16.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/160.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/161.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/162.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/163.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/164.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/165.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/166.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/167.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/168.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/169.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/17.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/170.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/171.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/172.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/173.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/174.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/175.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/176.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/177.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/178.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/179.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/18.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/180.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/181.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/182.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/183.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/184.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/185.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/186.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/187.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/188.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/189.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/19.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/190.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/191.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/192.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/193.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/194.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/195.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/196.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/197.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/198.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/199.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/20.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/200.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2000.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2001.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2002.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2003.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/201.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/202.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/203.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/204.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/205.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/206.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/207.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/208.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/209.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/21.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/210.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/211.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/212.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/213.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/214.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/215.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/216.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/217.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/218.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/219.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/22.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/220.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/221.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/222.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/223.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/224.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/225.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/226.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/227.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/228.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/229.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/23.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/230.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/231.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/232.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/233.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/234.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/235.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/236.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/237.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/238.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/239.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/24.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2400.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2401.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2402.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2403.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2404.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2405.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2406.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2407.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2408.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2409.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240A.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240B.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240C.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240D.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240E.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240F.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/241.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/242.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/243.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/244.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/245.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/246.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/247.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/248.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/249.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/25.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/250.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/251.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/252.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/253.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/254.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/255.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/26.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2600.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2601.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2602.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2603.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2604.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2605.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2606.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2607.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2608.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2609.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/260A.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/260C.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/260D.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/260E.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/260F.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2610.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2620.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/27.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/28.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2800.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2801.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2802.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2803.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2804.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2806.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/29.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A00.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A01.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A02.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A03.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A04.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A05.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A06.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A07.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A08.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A0A.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A0B.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2C00.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2C0E.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2C0F.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/3.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/30.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/31.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/32.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/33.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/34.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/35.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/36.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/37.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/38.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/39.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/4.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/40.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/4000.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/41.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/42.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/43.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/44.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/45.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/46.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/47.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/48.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/49.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/5.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/50.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/51.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/52.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/53.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/54.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/55.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/56.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/57.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/58.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/59.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/6.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/60.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/6000.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/61.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/62.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/63.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/64.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/65.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/66.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/67.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/68.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/69.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/7.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/70.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/71.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/72.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/73.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/74.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/75.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/76.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/77.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/78.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/79.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/8.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/80.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/8000.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/81.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/82.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/83.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/84.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/85.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/86.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/87.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/88.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/89.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/9.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/90.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/91.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/92.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/93.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/94.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/95.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/96.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/97.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/98.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/99.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/A000.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/C000.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/E000.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/F000.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/F800.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/FC00.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/FE00.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/FE80.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/FEC0.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/FF00.php +0 -0
- includes/{GeoIP → vendor/GeoIP}/LICENSE +0 -0
- includes/{MobileDetect → vendor/MobileDetect}/LICENSE.txt +0 -0
- includes/{MobileDetect → vendor/MobileDetect}/Mobile_Detect.php +0 -0
- includes/widgets.php +71 -38
- quick-adsense.php +25 -39
- readme.txt +8 -2
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
{includes → assets}/css/admin.css
RENAMED
@@ -153,6 +153,7 @@
|
|
153 |
}
|
154 |
|
155 |
#quick_adsense_onpost_content_controls_wrapper {
|
|
|
156 |
}
|
157 |
|
158 |
#quick_adsense_onpost_content_controls_wrapper #quick_adsense_onpost_content_global_controls_wrapper {
|
@@ -175,6 +176,7 @@
|
|
175 |
}
|
176 |
|
177 |
#quick_adsense_onpost_content_controls_wrapper #quick_adsense_onpost_content_adunits_wrapper {
|
|
|
178 |
}
|
179 |
|
180 |
#quick_adsense_onpost_content_controls_wrapper #quick_adsense_onpost_content_adunits_wrapper .quick_adsense_onpost_adunits_label {
|
@@ -271,340 +273,14 @@
|
|
271 |
margin-left: -10px;
|
272 |
}
|
273 |
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
.minicolors-sprite {
|
281 |
-
background-image: url(../images/jquery.minicolors.png);
|
282 |
-
}
|
283 |
-
|
284 |
-
.minicolors-swatch {
|
285 |
-
position: absolute;
|
286 |
-
vertical-align: middle;
|
287 |
-
background-position: -80px 0;
|
288 |
-
border: solid 1px #ccc;
|
289 |
-
cursor: text;
|
290 |
-
padding: 0;
|
291 |
-
margin: 0;
|
292 |
-
display: inline-block;
|
293 |
-
}
|
294 |
-
|
295 |
-
.minicolors-swatch-color {
|
296 |
-
position: absolute;
|
297 |
-
top: 0;
|
298 |
-
left: 0;
|
299 |
-
right: 0;
|
300 |
-
bottom: 0;
|
301 |
-
}
|
302 |
-
|
303 |
-
.minicolors input[type=hidden] + .minicolors-swatch {
|
304 |
-
width: 28px;
|
305 |
-
position: static;
|
306 |
-
cursor: pointer;
|
307 |
-
}
|
308 |
-
|
309 |
-
.minicolors input[type=hidden][disabled] + .minicolors-swatch {
|
310 |
-
cursor: default;
|
311 |
-
}
|
312 |
-
|
313 |
-
/* Panel */
|
314 |
-
.minicolors-panel {
|
315 |
-
position: absolute;
|
316 |
-
width: 173px;
|
317 |
-
background: white;
|
318 |
-
border: solid 1px #CCC;
|
319 |
-
box-shadow: 0 0 20px rgba(0, 0, 0, .2);
|
320 |
-
z-index: 99999;
|
321 |
-
box-sizing: content-box;
|
322 |
-
display: none;
|
323 |
-
}
|
324 |
-
|
325 |
-
.minicolors-panel.minicolors-visible {
|
326 |
-
display: block;
|
327 |
-
}
|
328 |
-
|
329 |
-
/* Panel positioning */
|
330 |
-
.minicolors-position-top .minicolors-panel {
|
331 |
-
top: -154px;
|
332 |
-
}
|
333 |
-
|
334 |
-
.minicolors-position-right .minicolors-panel {
|
335 |
-
right: 0;
|
336 |
-
}
|
337 |
-
|
338 |
-
.minicolors-position-bottom .minicolors-panel {
|
339 |
-
top: 30px;
|
340 |
-
}
|
341 |
-
|
342 |
-
.minicolors-position-left .minicolors-panel {
|
343 |
-
left: 0;
|
344 |
-
}
|
345 |
-
|
346 |
-
.minicolors-with-opacity .minicolors-panel {
|
347 |
-
width: 194px;
|
348 |
-
}
|
349 |
-
|
350 |
-
.minicolors .minicolors-grid {
|
351 |
-
position: relative;
|
352 |
-
top: 1px;
|
353 |
-
left: 1px;
|
354 |
-
width: 150px;
|
355 |
-
height: 150px;
|
356 |
-
background-position: -120px 0;
|
357 |
-
cursor: crosshair;
|
358 |
-
}
|
359 |
-
|
360 |
-
.minicolors .minicolors-grid-inner {
|
361 |
-
position: absolute;
|
362 |
-
top: 0;
|
363 |
-
left: 0;
|
364 |
-
width: 150px;
|
365 |
-
height: 150px;
|
366 |
-
}
|
367 |
-
|
368 |
-
.minicolors-slider-saturation .minicolors-grid {
|
369 |
-
background-position: -420px 0;
|
370 |
-
}
|
371 |
-
|
372 |
-
.minicolors-slider-saturation .minicolors-grid-inner {
|
373 |
-
background-position: -270px 0;
|
374 |
-
background-image: inherit;
|
375 |
-
}
|
376 |
-
|
377 |
-
.minicolors-slider-brightness .minicolors-grid {
|
378 |
-
background-position: -570px 0;
|
379 |
-
}
|
380 |
-
|
381 |
-
.minicolors-slider-brightness .minicolors-grid-inner {
|
382 |
-
background-color: black;
|
383 |
-
}
|
384 |
-
|
385 |
-
.minicolors-slider-wheel .minicolors-grid {
|
386 |
-
background-position: -720px 0;
|
387 |
-
}
|
388 |
-
|
389 |
-
.minicolors-slider,
|
390 |
-
.minicolors-opacity-slider {
|
391 |
-
position: absolute;
|
392 |
-
top: 1px;
|
393 |
-
left: 152px;
|
394 |
-
width: 20px;
|
395 |
-
height: 150px;
|
396 |
-
background-color: white;
|
397 |
-
background-position: 0 0;
|
398 |
-
cursor: row-resize;
|
399 |
-
}
|
400 |
-
|
401 |
-
.minicolors-slider-saturation .minicolors-slider {
|
402 |
-
background-position: -60px 0;
|
403 |
-
}
|
404 |
-
|
405 |
-
.minicolors-slider-brightness .minicolors-slider {
|
406 |
-
background-position: -20px 0;
|
407 |
-
}
|
408 |
-
|
409 |
-
.minicolors-slider-wheel .minicolors-slider {
|
410 |
-
background-position: -20px 0;
|
411 |
-
}
|
412 |
-
|
413 |
-
.minicolors-opacity-slider {
|
414 |
-
left: 173px;
|
415 |
-
background-position: -40px 0;
|
416 |
-
display: none;
|
417 |
-
}
|
418 |
-
|
419 |
-
.minicolors-with-opacity .minicolors-opacity-slider {
|
420 |
-
display: block;
|
421 |
-
}
|
422 |
-
|
423 |
-
/* Pickers */
|
424 |
-
.minicolors-grid .minicolors-picker {
|
425 |
-
position: absolute;
|
426 |
-
top: 70px;
|
427 |
-
left: 70px;
|
428 |
-
width: 12px;
|
429 |
-
height: 12px;
|
430 |
-
border: solid 1px black;
|
431 |
-
border-radius: 10px;
|
432 |
-
margin-top: -6px;
|
433 |
-
margin-left: -6px;
|
434 |
-
background: none;
|
435 |
}
|
436 |
|
437 |
-
.minicolors-grid .minicolors-picker > div {
|
438 |
-
position: absolute;
|
439 |
-
top: 0;
|
440 |
-
left: 0;
|
441 |
-
width: 8px;
|
442 |
-
height: 8px;
|
443 |
-
border-radius: 8px;
|
444 |
-
border: solid 2px white;
|
445 |
-
box-sizing: content-box;
|
446 |
-
}
|
447 |
-
|
448 |
-
.minicolors-picker {
|
449 |
-
position: absolute;
|
450 |
-
top: 0;
|
451 |
-
left: 0;
|
452 |
-
width: 18px;
|
453 |
-
height: 2px;
|
454 |
-
background: white;
|
455 |
-
border: solid 1px black;
|
456 |
-
margin-top: -2px;
|
457 |
-
box-sizing: content-box;
|
458 |
-
}
|
459 |
-
|
460 |
-
/* Swatches */
|
461 |
-
.minicolors-swatches,
|
462 |
-
.minicolors-swatches li {
|
463 |
-
margin: 5px 0 3px 5px;
|
464 |
-
padding: 0;
|
465 |
-
list-style: none;
|
466 |
-
overflow: hidden;
|
467 |
-
}
|
468 |
-
|
469 |
-
.minicolors-swatches .minicolors-swatch {
|
470 |
-
position: relative;
|
471 |
-
float: left;
|
472 |
-
cursor: pointer;
|
473 |
-
margin:0 4px 0 0;
|
474 |
-
}
|
475 |
-
|
476 |
-
.minicolors-with-opacity .minicolors-swatches .minicolors-swatch {
|
477 |
-
margin-right: 7px;
|
478 |
-
}
|
479 |
-
|
480 |
-
.minicolors-swatch.selected {
|
481 |
-
border-color: #000;
|
482 |
-
}
|
483 |
-
|
484 |
-
.minicolors-inline {
|
485 |
-
display: inline-block;
|
486 |
-
}
|
487 |
-
|
488 |
-
.minicolors-inline .minicolors-input {
|
489 |
-
display: none !important;
|
490 |
-
}
|
491 |
-
|
492 |
-
.minicolors-inline .minicolors-panel {
|
493 |
-
position: relative;
|
494 |
-
top: auto;
|
495 |
-
left: auto;
|
496 |
-
box-shadow: none;
|
497 |
-
z-index: auto;
|
498 |
-
display: inline-block;
|
499 |
-
}
|
500 |
-
|
501 |
-
.minicolors-theme-default .minicolors-swatch {
|
502 |
-
top: 5px;
|
503 |
-
left: 5px;
|
504 |
-
width: 18px;
|
505 |
-
height: 18px;
|
506 |
-
}
|
507 |
-
|
508 |
-
.minicolors-theme-default .minicolors-swatches .minicolors-swatch {
|
509 |
-
margin-bottom: 2px;
|
510 |
-
top: 0;
|
511 |
-
left: 0;
|
512 |
-
width: 18px;
|
513 |
-
height: 18px;
|
514 |
-
}
|
515 |
-
|
516 |
-
.minicolors-theme-default.minicolors-position-right .minicolors-swatch {
|
517 |
-
left: auto;
|
518 |
-
right: 5px;
|
519 |
-
}
|
520 |
-
|
521 |
-
.minicolors-theme-default.minicolors {
|
522 |
-
width: auto;
|
523 |
-
display: inline-block;
|
524 |
-
}
|
525 |
-
|
526 |
-
.minicolors-theme-default .minicolors-input {
|
527 |
-
height: 20px;
|
528 |
-
width: auto;
|
529 |
-
display: inline-block;
|
530 |
-
padding-left: 26px;
|
531 |
-
}
|
532 |
-
|
533 |
-
.minicolors-theme-default.minicolors-position-right .minicolors-input {
|
534 |
-
padding-right: 26px;
|
535 |
-
padding-left: inherit;
|
536 |
-
}
|
537 |
-
|
538 |
-
.minicolors-theme-bootstrap .minicolors-swatch {
|
539 |
-
z-index: 2;
|
540 |
-
top: 3px;
|
541 |
-
left: 3px;
|
542 |
-
width: 28px;
|
543 |
-
height: 28px;
|
544 |
-
border-radius: 3px;
|
545 |
-
}
|
546 |
-
|
547 |
-
.minicolors-theme-bootstrap .minicolors-swatches .minicolors-swatch {
|
548 |
-
margin-bottom: 2px;
|
549 |
-
top: 0;
|
550 |
-
left: 0;
|
551 |
-
width: 20px;
|
552 |
-
height: 20px;
|
553 |
-
}
|
554 |
-
|
555 |
-
.minicolors-theme-bootstrap .minicolors-swatch-color {
|
556 |
-
border-radius: inherit;
|
557 |
-
}
|
558 |
-
|
559 |
-
.minicolors-theme-bootstrap.minicolors-position-right > .minicolors-swatch {
|
560 |
-
left: auto;
|
561 |
-
right: 3px;
|
562 |
-
}
|
563 |
-
|
564 |
-
.minicolors-theme-bootstrap .minicolors-input {
|
565 |
-
float: none;
|
566 |
-
padding-left: 44px;
|
567 |
-
}
|
568 |
-
|
569 |
-
.minicolors-theme-bootstrap.minicolors-position-right .minicolors-input {
|
570 |
-
padding-right: 44px;
|
571 |
-
padding-left: 12px;
|
572 |
-
}
|
573 |
-
|
574 |
-
.minicolors-theme-bootstrap .minicolors-input.input-lg + .minicolors-swatch {
|
575 |
-
top: 4px;
|
576 |
-
left: 4px;
|
577 |
-
width: 37px;
|
578 |
-
height: 37px;
|
579 |
-
border-radius: 5px;
|
580 |
-
}
|
581 |
-
|
582 |
-
.minicolors-theme-bootstrap .minicolors-input.input-sm + .minicolors-swatch {
|
583 |
-
width: 24px;
|
584 |
-
height: 24px;
|
585 |
-
}
|
586 |
-
|
587 |
-
.minicolors-theme-bootstrap .minicolors-input.input-xs + .minicolors-swatch {
|
588 |
-
width: 18px;
|
589 |
-
height: 18px;
|
590 |
-
}
|
591 |
-
|
592 |
-
.input-group .minicolors-theme-bootstrap:not(:first-child) .minicolors-input {
|
593 |
-
border-top-left-radius: 0;
|
594 |
-
border-bottom-left-radius: 0;
|
595 |
-
}
|
596 |
-
|
597 |
-
.minicolors-theme-semanticui .minicolors-swatch {
|
598 |
-
top: 0;
|
599 |
-
left: 0;
|
600 |
-
padding: 18px;
|
601 |
-
}
|
602 |
-
|
603 |
-
.minicolors-theme-semanticui input {
|
604 |
-
text-indent: 30px;
|
605 |
-
}
|
606 |
-
/* End Minicolors */
|
607 |
-
|
608 |
@media only screen and (max-width: 1200px) {
|
609 |
#quick_adsense_bottom_left_section_wrapper {
|
610 |
float: none;
|
@@ -647,4 +323,4 @@
|
|
647 |
#quick_adsense_widget_adunits_wrapper a.button-secondary {
|
648 |
margin-left: 0;
|
649 |
}
|
650 |
-
}
|
153 |
}
|
154 |
|
155 |
#quick_adsense_onpost_content_controls_wrapper {
|
156 |
+
|
157 |
}
|
158 |
|
159 |
#quick_adsense_onpost_content_controls_wrapper #quick_adsense_onpost_content_global_controls_wrapper {
|
176 |
}
|
177 |
|
178 |
#quick_adsense_onpost_content_controls_wrapper #quick_adsense_onpost_content_adunits_wrapper {
|
179 |
+
|
180 |
}
|
181 |
|
182 |
#quick_adsense_onpost_content_controls_wrapper #quick_adsense_onpost_content_adunits_wrapper .quick_adsense_onpost_adunits_label {
|
273 |
margin-left: -10px;
|
274 |
}
|
275 |
|
276 |
+
.quick_adsense_ajaxloader {
|
277 |
+
background: url(../images/ajax-loader.gif) no-repeat center center;
|
278 |
+
max-width: 320px;
|
279 |
+
min-width: 100px;
|
280 |
+
height: 100px;
|
281 |
+
margin: auto;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
}
|
283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
@media only screen and (max-width: 1200px) {
|
285 |
#quick_adsense_bottom_left_section_wrapper {
|
286 |
float: none;
|
323 |
#quick_adsense_widget_adunits_wrapper a.button-secondary {
|
324 |
margin-left: 0;
|
325 |
}
|
326 |
+
}
|
{includes → assets}/images/ajax-loader.gif
RENAMED
File without changes
|
{includes → assets}/js/Chart.bundle.min.js
RENAMED
File without changes
|
{includes → assets}/js/admin.js
RENAMED
@@ -1,43 +1,34 @@
|
|
1 |
-
jQuery(document).ready(function() {
|
2 |
-
jQuery(
|
3 |
-
|
|
|
4 |
jQuery('#quick_adsense_settings_enable_position_beginning_of_post').click(quick_adsense_settings_enable_position_beginning_of_post);
|
5 |
jQuery('#quick_adsense_settings_enable_position_middle_of_post').click(quick_adsense_settings_enable_position_middle_of_post);
|
6 |
-
jQuery('#quick_adsense_settings_enable_position_end_of_post').click(quick_adsense_settings_enable_position_end_of_post);
|
7 |
-
jQuery('#quick_adsense_settings_enable_position_after_more_tag').click(quick_adsense_settings_enable_position_after_more_tag);
|
8 |
-
jQuery('#quick_adsense_settings_enable_position_before_last_para').click(quick_adsense_settings_enable_position_before_last_para);
|
9 |
-
jQuery('#quick_adsense_settings_enable_position_after_para_option_1').click(quick_adsense_settings_enable_position_after_para_option_1);
|
10 |
-
jQuery('#quick_adsense_settings_enable_position_after_para_option_2').click(quick_adsense_settings_enable_position_after_para_option_2);
|
11 |
-
jQuery('#quick_adsense_settings_enable_position_after_para_option_3').click(quick_adsense_settings_enable_position_after_para_option_3);
|
12 |
-
jQuery('#quick_adsense_settings_enable_position_after_image_option_1').click(quick_adsense_settings_enable_position_after_image_option_1);
|
13 |
jQuery('#quick_adsense_settings_enable_on_posts').click(quick_adsense_settings_enable_on_posts);
|
14 |
-
jQuery('#quick_adsense_settings_enable_on_pages').click(quick_adsense_settings_enable_on_pages);
|
15 |
jQuery('#quick_adsense_settings_enable_on_homepage').click(quick_adsense_settings_enable_on_homepage);
|
16 |
jQuery('#quick_adsense_settings_enable_on_categories').click(quick_adsense_settings_enable_on_categories);
|
17 |
jQuery('#quick_adsense_settings_enable_on_archives').click(quick_adsense_settings_enable_on_archives);
|
18 |
jQuery('#quick_adsense_settings_enable_on_tags').click(quick_adsense_settings_enable_on_tags);
|
19 |
-
jQuery('#quick_adsense_settings_enable_all_possible_ads').click(quick_adsense_settings_enable_all_possible_ads);
|
20 |
-
jQuery('#quick_adsense_settings_disable_widgets_on_homepage').click(quick_adsense_settings_disable_widgets_on_homepage);
|
21 |
-
jQuery('#quick_adsense_settings_disable_for_loggedin_users').click(quick_adsense_settings_disable_for_loggedin_users);
|
22 |
-
jQuery('#quick_adsense_settings_enable_quicktag_buttons').click(quick_adsense_settings_enable_quicktag_buttons);
|
23 |
-
jQuery('#quick_adsense_settings_disable_randomads_quicktag_button').click(quick_adsense_settings_disable_randomads_quicktag_button);
|
24 |
-
jQuery('#quick_adsense_settings_disable_disablead_quicktag_buttons').click(quick_adsense_settings_disable_disablead_quicktag_buttons);
|
25 |
jQuery('#quick_adsense_settings_disable_positionad_quicktag_buttons').click(quick_adsense_settings_disable_positionad_quicktag_buttons);
|
26 |
-
|
27 |
-
jQuery('#quick_adsense_settings_onpost_enable_global_style').click(quick_adsense_settings_onpost_enable_global_style);
|
28 |
jQuery('#quick_adsense_settings_onpost_global_alignment').click(quick_adsense_settings_onpost_enable_global_style);
|
29 |
jQuery('#quick_adsense_settings_onpost_global_margin').click(quick_adsense_settings_onpost_enable_global_style);
|
30 |
-
|
31 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').change(function() {
|
32 |
-
quick_adsense_vi_check_status(this);
|
33 |
-
quick_adsense_settings_handle_vi_single_selection();
|
34 |
-
});
|
35 |
|
36 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').change(function() {
|
37 |
-
quick_adsense_vi_check_status(this);
|
38 |
-
quick_adsense_settings_handle_vi_single_selection();
|
39 |
-
});
|
40 |
-
|
41 |
quick_adsense_settings_enable_position_beginning_of_post();
|
42 |
quick_adsense_settings_enable_position_middle_of_post();
|
43 |
quick_adsense_settings_enable_position_end_of_post();
|
@@ -61,10 +52,9 @@ jQuery(document).ready(function() {
|
|
61 |
quick_adsense_settings_disable_disablead_quicktag_buttons();
|
62 |
quick_adsense_settings_disable_positionad_quicktag_buttons();
|
63 |
quick_adsense_settings_onpost_enable_global_style();
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
if(jQuery('#quick_adsense_onpost_content_adunits_showall_button').text() == ' Show All') {
|
68 |
jQuery('#quick_adsense_onpost_content_adunits_all_wrapper').slideDown();
|
69 |
jQuery('#quick_adsense_onpost_content_adunits_showall_button').html('<span class="dashicons dashicons-arrow-up"></span> <b>Show Less</b>');
|
70 |
} else {
|
@@ -72,9 +62,9 @@ jQuery(document).ready(function() {
|
|
72 |
jQuery('#quick_adsense_onpost_content_adunits_showall_button').html('<span class="dashicons dashicons-arrow-down"></span> <b>Show All</b>');
|
73 |
}
|
74 |
});
|
75 |
-
|
76 |
-
jQuery('#quick_adsense_widget_adunits_showall_button').click(function() {
|
77 |
-
if(jQuery('#quick_adsense_widget_adunits_showall_button').text() == ' Show All') {
|
78 |
jQuery('#quick_adsense_widget_adunits_all_wrapper').slideDown();
|
79 |
jQuery('#quick_adsense_widget_adunits_showall_button').html('<span class="dashicons dashicons-arrow-up"></span> <b>Show Less</b>');
|
80 |
} else {
|
@@ -83,133 +73,125 @@ jQuery(document).ready(function() {
|
|
83 |
}
|
84 |
});
|
85 |
|
86 |
-
jQuery('#quick_adsense_settings_form').submit(function() {
|
87 |
-
jQuery('#quick_adsense_settings_form select').each(function() {
|
88 |
-
if(jQuery(this).prop('disabled') == true) {
|
89 |
jQuery(this).prop('disabled', false);
|
90 |
}
|
91 |
});
|
92 |
});
|
93 |
|
94 |
jQuery('#quick_adsense_settings_form').fadeIn();
|
95 |
-
if(window.location.href.indexOf('#quick_adsense_adstxt_adsense_auto_update') > -1) {
|
96 |
quick_adsense_adstxt_adsense_auto_update();
|
97 |
}
|
98 |
-
|
99 |
-
jQuery('.quick_adsense_onpost_ad_reset_stats').click(function() {
|
100 |
jQuery(this).prop('disabled', true);
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
jQuery(this).prop('disabled', false);
|
110 |
-
});
|
111 |
-
}
|
112 |
-
}
|
113 |
-
);
|
114 |
});
|
115 |
-
|
116 |
-
jQuery('.quick_adsense_onpost_ad_show_stats').click(function() {
|
117 |
-
jQuery('<div id="quick_adsense_onpost_ad_show_stats_dialog" data-index="'+jQuery(this).attr('data-index')+'"></div>').html('<div class="quick_adsense_ajaxloader"></div>').dialog({
|
118 |
'modal': true,
|
119 |
'resizable': false,
|
120 |
'width': jQuery("body").width() * 0.5,
|
121 |
'maxWidth': jQuery("body").width() * 0.5,
|
122 |
'maxHeight': jQuery("body").height() * 0.9,
|
123 |
-
'title': 'Ad'+jQuery(this).attr('data-index')+' Performance Stats (30 Days)',
|
124 |
position: { my: 'center', at: 'center', of: window },
|
125 |
open: function (event, ui) {
|
126 |
-
jQuery('.ui-dialog').css({'z-index': 999999, 'max-width': '90%'});
|
127 |
-
jQuery('.ui-widget-overlay').css({'z-index': 999998, 'opacity': 0.8, 'background': '#000000'});
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
jQuery('#
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
|
|
|
|
|
|
153 |
},
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
display:
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
display: true,
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
}
|
177 |
-
|
178 |
display: true,
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
title: function(tooltipItem, data) {
|
198 |
-
var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
199 |
-
var dateParts = tooltipItem[0].xLabel.split('/');
|
200 |
-
var date = new Date(dateParts[2], dateParts[0]-1, dateParts[1]);
|
201 |
-
return monthNames[date.getMonth()]+' '+date.getDate();
|
202 |
-
}
|
203 |
}
|
204 |
}
|
205 |
}
|
206 |
-
}
|
207 |
-
}
|
208 |
}
|
209 |
-
);
|
210 |
},
|
211 |
-
buttons: {
|
212 |
-
close: function() {
|
213 |
jQuery(this).dialog('destroy');
|
214 |
}
|
215 |
})
|
@@ -217,99 +199,96 @@ jQuery(document).ready(function() {
|
|
217 |
});
|
218 |
|
219 |
function quick_adsense_adstxt_adsense_auto_update() {
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
}
|
242 |
-
},
|
243 |
-
close: function() {
|
244 |
-
jQuery(this).dialog('destroy');
|
245 |
}
|
246 |
-
}
|
247 |
-
|
248 |
-
|
249 |
-
|
|
|
250 |
}
|
251 |
-
);
|
252 |
}
|
253 |
|
254 |
function quick_adsense_settings_reset_to_default() {
|
255 |
jQuery('#quick_adsense_settings_max_ads_per_page').val('3');
|
256 |
-
|
257 |
-
jQuery('#quick_adsense_settings_enable_position_beginning_of_post').prop('checked', true);
|
258 |
jQuery('#quick_adsense_settings_ad_beginning_of_post').val('1');
|
259 |
jQuery('#quick_adsense_settings_enable_position_middle_of_post').prop('checked', false);
|
260 |
jQuery('#quick_adsense_settings_ad_middle_of_post').val('0');
|
261 |
jQuery('#quick_adsense_settings_enable_position_end_of_post').prop('checked', true);
|
262 |
jQuery('#quick_adsense_settings_ad_end_of_post').val('0');
|
263 |
-
|
264 |
jQuery('#quick_adsense_settings_enable_position_after_more_tag').prop('checked', false);
|
265 |
jQuery('#quick_adsense_settings_ad_after_more_tag').val('0');
|
266 |
jQuery('#quick_adsense_settings_enable_position_before_last_para').prop('checked', false);
|
267 |
jQuery('#quick_adsense_settings_ad_before_last_para').val('0');
|
268 |
-
|
269 |
-
for(var i = 1; i <= 3; i++) {
|
270 |
-
jQuery('#quick_adsense_settings_enable_position_after_para_option_'+i).prop('checked', false);
|
271 |
-
jQuery('#quick_adsense_settings_ad_after_para_option_'+i).val('0');
|
272 |
-
jQuery('#quick_adsense_settings_position_after_para_option_'+i).val('1');
|
273 |
-
jQuery('#quick_adsense_settings_enable_jump_position_after_para_option_'+i).prop('checked', false);
|
274 |
}
|
275 |
-
|
276 |
-
for(var i = 1; i <= 1; i++) {
|
277 |
-
jQuery('#quick_adsense_settings_enable_position_after_image_option_'+i).prop('checked', false);
|
278 |
-
jQuery('#quick_adsense_settings_ad_after_image_option_'+i).val('0');
|
279 |
-
jQuery('#quick_adsense_settings_position_after_image_option_'+i).val('1');
|
280 |
-
jQuery('#quick_adsense_settings_enable_jump_position_after_image_option_'+i).prop('checked', false);
|
281 |
}
|
282 |
-
|
283 |
jQuery('#quick_adsense_settings_enable_on_posts').prop('checked', true);
|
284 |
jQuery('#quick_adsense_settings_enable_on_pages').prop('checked', true);
|
285 |
-
|
286 |
jQuery('#quick_adsense_settings_enable_on_homepage').prop('checked', false);
|
287 |
jQuery('#quick_adsense_settings_enable_on_categories').prop('checked', false);
|
288 |
jQuery('#quick_adsense_settings_enable_on_archives').prop('checked', false);
|
289 |
jQuery('#quick_adsense_settings_enable_on_tags').prop('checked', false);
|
290 |
jQuery('#quick_adsense_settings_enable_all_possible_ads').prop('checked', false);
|
291 |
-
|
292 |
jQuery('#quick_adsense_settings_disable_widgets_on_homepage').prop('checked', false);
|
293 |
-
|
294 |
jQuery('#quick_adsense_settings_disable_for_loggedin_users').prop('checked', false);
|
295 |
-
|
296 |
jQuery('#quick_adsense_settings_enable_quicktag_buttons').prop('checked', true);
|
297 |
jQuery('#quick_adsense_settings_disable_randomads_quicktag_button').prop('checked', false);
|
298 |
jQuery('#quick_adsense_settings_disable_disablead_quicktag_buttons').prop('checked', false);
|
299 |
jQuery('#quick_adsense_settings_disable_positionad_quicktag_buttons').prop('checked', false);
|
300 |
-
|
301 |
jQuery('#quick_adsense_settings_onpost_enable_global_style').prop('checked', false);
|
302 |
jQuery('#quick_adsense_settings_onpost_global_alignment').val('2');
|
303 |
jQuery('#quick_adsense_settings_onpost_global_margin').val('10');
|
304 |
-
|
305 |
-
for(var i = 1; i <= 10; i++) {
|
306 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_content').val('');
|
307 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_alignment').val('2');
|
308 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_margin').val('10');
|
309 |
-
|
310 |
-
jQuery('#quick_adsense_settings_widget_ad_'+i+'_content').val('');
|
311 |
}
|
312 |
-
|
313 |
quick_adsense_settings_enable_position_beginning_of_post();
|
314 |
quick_adsense_settings_enable_position_middle_of_post();
|
315 |
quick_adsense_settings_enable_position_end_of_post();
|
@@ -333,33 +312,30 @@ function quick_adsense_settings_reset_to_default() {
|
|
333 |
quick_adsense_settings_disable_disablead_quicktag_buttons();
|
334 |
quick_adsense_settings_disable_positionad_quicktag_buttons();
|
335 |
quick_adsense_settings_onpost_enable_global_style();
|
336 |
-
quick_adsense_settings_handle_vi_single_selection();
|
337 |
}
|
338 |
|
339 |
function quick_adsense_settings_enable_position_beginning_of_post() {
|
340 |
-
if(jQuery('#quick_adsense_settings_enable_position_beginning_of_post').prop('checked') == true) {
|
341 |
jQuery('#quick_adsense_settings_ad_beginning_of_post').prop('disabled', false);
|
342 |
jQuery('#quick_adsense_settings_ad_beginning_of_post').parent().removeClass('disabled');
|
343 |
} else {
|
344 |
jQuery('#quick_adsense_settings_ad_beginning_of_post').prop('disabled', true);
|
345 |
jQuery('#quick_adsense_settings_ad_beginning_of_post').parent().addClass('disabled');
|
346 |
}
|
347 |
-
quick_adsense_settings_handle_vi_single_selection();
|
348 |
}
|
349 |
|
350 |
function quick_adsense_settings_enable_position_middle_of_post() {
|
351 |
-
if(jQuery('#quick_adsense_settings_enable_position_middle_of_post').prop('checked') == true) {
|
352 |
jQuery('#quick_adsense_settings_ad_middle_of_post').prop('disabled', false);
|
353 |
jQuery('#quick_adsense_settings_ad_middle_of_post').parent().removeClass('disabled');
|
354 |
} else {
|
355 |
jQuery('#quick_adsense_settings_ad_middle_of_post').prop('disabled', true);
|
356 |
jQuery('#quick_adsense_settings_ad_middle_of_post').parent().addClass('disabled');
|
357 |
}
|
358 |
-
quick_adsense_settings_handle_vi_single_selection();
|
359 |
}
|
360 |
|
361 |
function quick_adsense_settings_enable_position_end_of_post() {
|
362 |
-
if(jQuery('#quick_adsense_settings_enable_position_end_of_post').prop('checked') == true) {
|
363 |
jQuery('#quick_adsense_settings_ad_end_of_post').prop('disabled', false);
|
364 |
jQuery('#quick_adsense_settings_ad_end_of_post').parent().removeClass('disabled');
|
365 |
} else {
|
@@ -369,7 +345,7 @@ function quick_adsense_settings_enable_position_end_of_post() {
|
|
369 |
}
|
370 |
|
371 |
function quick_adsense_settings_enable_position_after_more_tag() {
|
372 |
-
if(jQuery('#quick_adsense_settings_enable_position_after_more_tag').prop('checked') == true) {
|
373 |
jQuery('#quick_adsense_settings_ad_after_more_tag').prop('disabled', false);
|
374 |
jQuery('#quick_adsense_settings_ad_after_more_tag').parent().removeClass('disabled');
|
375 |
} else {
|
@@ -377,9 +353,9 @@ function quick_adsense_settings_enable_position_after_more_tag() {
|
|
377 |
jQuery('#quick_adsense_settings_ad_after_more_tag').parent().addClass('disabled');
|
378 |
}
|
379 |
}
|
380 |
-
|
381 |
function quick_adsense_settings_enable_position_before_last_para() {
|
382 |
-
if(jQuery('#quick_adsense_settings_enable_position_before_last_para').prop('checked') == true) {
|
383 |
jQuery('#quick_adsense_settings_ad_before_last_para').prop('disabled', false);
|
384 |
jQuery('#quick_adsense_settings_ad_before_last_para').parent().removeClass('disabled');
|
385 |
} else {
|
@@ -389,7 +365,7 @@ function quick_adsense_settings_enable_position_before_last_para() {
|
|
389 |
}
|
390 |
|
391 |
function quick_adsense_settings_enable_position_after_para_option_1() {
|
392 |
-
if(jQuery('#quick_adsense_settings_enable_position_after_para_option_1').prop('checked') == true) {
|
393 |
jQuery('#quick_adsense_settings_ad_after_para_option_1').prop('disabled', false);
|
394 |
jQuery('#quick_adsense_settings_position_after_para_option_1').prop('disabled', false);
|
395 |
jQuery('#quick_adsense_settings_enable_jump_position_after_para_option_1').prop('disabled', false);
|
@@ -403,7 +379,7 @@ function quick_adsense_settings_enable_position_after_para_option_1() {
|
|
403 |
}
|
404 |
|
405 |
function quick_adsense_settings_enable_position_after_para_option_2() {
|
406 |
-
if(jQuery('#quick_adsense_settings_enable_position_after_para_option_2').prop('checked') == true) {
|
407 |
jQuery('#quick_adsense_settings_ad_after_para_option_2').prop('disabled', false);
|
408 |
jQuery('#quick_adsense_settings_position_after_para_option_2').prop('disabled', false);
|
409 |
jQuery('#quick_adsense_settings_enable_jump_position_after_para_option_2').prop('disabled', false);
|
@@ -417,7 +393,7 @@ function quick_adsense_settings_enable_position_after_para_option_2() {
|
|
417 |
}
|
418 |
|
419 |
function quick_adsense_settings_enable_position_after_para_option_3() {
|
420 |
-
if(jQuery('#quick_adsense_settings_enable_position_after_para_option_3').prop('checked') == true) {
|
421 |
jQuery('#quick_adsense_settings_ad_after_para_option_3').prop('disabled', false);
|
422 |
jQuery('#quick_adsense_settings_position_after_para_option_3').prop('disabled', false);
|
423 |
jQuery('#quick_adsense_settings_enable_jump_position_after_para_option_3').prop('disabled', false);
|
@@ -431,7 +407,7 @@ function quick_adsense_settings_enable_position_after_para_option_3() {
|
|
431 |
}
|
432 |
|
433 |
function quick_adsense_settings_enable_position_after_image_option_1() {
|
434 |
-
if(jQuery('#quick_adsense_settings_enable_position_after_image_option_1').prop('checked') == true) {
|
435 |
jQuery('#quick_adsense_settings_ad_after_image_option_1').prop('disabled', false);
|
436 |
jQuery('#quick_adsense_settings_position_after_image_option_1').prop('disabled', false);
|
437 |
jQuery('#quick_adsense_settings_enable_jump_position_after_image_option_1').prop('disabled', false);
|
@@ -445,7 +421,7 @@ function quick_adsense_settings_enable_position_after_image_option_1() {
|
|
445 |
}
|
446 |
|
447 |
function quick_adsense_settings_enable_on_posts() {
|
448 |
-
if(jQuery('#quick_adsense_settings_enable_on_posts').prop('checked') == true) {
|
449 |
jQuery('#quick_adsense_settings_enable_on_posts').parent().removeClass('disabled');
|
450 |
} else {
|
451 |
jQuery('#quick_adsense_settings_enable_on_posts').parent().addClass('disabled');
|
@@ -453,7 +429,7 @@ function quick_adsense_settings_enable_on_posts() {
|
|
453 |
}
|
454 |
|
455 |
function quick_adsense_settings_enable_on_pages() {
|
456 |
-
if(jQuery('#quick_adsense_settings_enable_on_pages').prop('checked') == true) {
|
457 |
jQuery('#quick_adsense_settings_enable_on_pages').parent().removeClass('disabled');
|
458 |
} else {
|
459 |
jQuery('#quick_adsense_settings_enable_on_pages').parent().addClass('disabled');
|
@@ -461,7 +437,7 @@ function quick_adsense_settings_enable_on_pages() {
|
|
461 |
}
|
462 |
|
463 |
function quick_adsense_settings_enable_on_homepage() {
|
464 |
-
if(jQuery('#quick_adsense_settings_enable_on_homepage').prop('checked') == true) {
|
465 |
jQuery('#quick_adsense_settings_enable_on_homepage').parent().removeClass('disabled');
|
466 |
} else {
|
467 |
jQuery('#quick_adsense_settings_enable_on_homepage').parent().addClass('disabled');
|
@@ -469,7 +445,7 @@ function quick_adsense_settings_enable_on_homepage() {
|
|
469 |
}
|
470 |
|
471 |
function quick_adsense_settings_enable_on_categories() {
|
472 |
-
if(jQuery('#quick_adsense_settings_enable_on_categories').prop('checked') == true) {
|
473 |
jQuery('#quick_adsense_settings_enable_on_categories').parent().removeClass('disabled');
|
474 |
} else {
|
475 |
jQuery('#quick_adsense_settings_enable_on_categories').parent().addClass('disabled');
|
@@ -477,7 +453,7 @@ function quick_adsense_settings_enable_on_categories() {
|
|
477 |
}
|
478 |
|
479 |
function quick_adsense_settings_enable_on_archives() {
|
480 |
-
if(jQuery('#quick_adsense_settings_enable_on_archives').prop('checked') == true) {
|
481 |
jQuery('#quick_adsense_settings_enable_on_archives').parent().removeClass('disabled');
|
482 |
} else {
|
483 |
jQuery('#quick_adsense_settings_enable_on_archives').parent().addClass('disabled');
|
@@ -485,7 +461,7 @@ function quick_adsense_settings_enable_on_archives() {
|
|
485 |
}
|
486 |
|
487 |
function quick_adsense_settings_enable_on_tags() {
|
488 |
-
if(jQuery('#quick_adsense_settings_enable_on_tags').prop('checked') == true) {
|
489 |
jQuery('#quick_adsense_settings_enable_on_tags').parent().removeClass('disabled');
|
490 |
} else {
|
491 |
jQuery('#quick_adsense_settings_enable_on_tags').parent().addClass('disabled');
|
@@ -493,7 +469,7 @@ function quick_adsense_settings_enable_on_tags() {
|
|
493 |
}
|
494 |
|
495 |
function quick_adsense_settings_enable_all_possible_ads() {
|
496 |
-
if(jQuery('#quick_adsense_settings_enable_all_possible_ads').prop('checked') == true) {
|
497 |
jQuery('#quick_adsense_settings_enable_all_possible_ads').parent().removeClass('disabled');
|
498 |
} else {
|
499 |
jQuery('#quick_adsense_settings_enable_all_possible_ads').parent().addClass('disabled');
|
@@ -501,7 +477,7 @@ function quick_adsense_settings_enable_all_possible_ads() {
|
|
501 |
}
|
502 |
|
503 |
function quick_adsense_settings_disable_widgets_on_homepage() {
|
504 |
-
if(jQuery('#quick_adsense_settings_disable_widgets_on_homepage').prop('checked') == true) {
|
505 |
jQuery('#quick_adsense_settings_disable_widgets_on_homepage').parent().removeClass('disabled');
|
506 |
} else {
|
507 |
jQuery('#quick_adsense_settings_disable_widgets_on_homepage').parent().addClass('disabled');
|
@@ -509,7 +485,7 @@ function quick_adsense_settings_disable_widgets_on_homepage() {
|
|
509 |
}
|
510 |
|
511 |
function quick_adsense_settings_disable_for_loggedin_users() {
|
512 |
-
if(jQuery('#quick_adsense_settings_disable_for_loggedin_users').prop('checked') == true) {
|
513 |
jQuery('#quick_adsense_settings_disable_for_loggedin_users').parent().removeClass('disabled');
|
514 |
} else {
|
515 |
jQuery('#quick_adsense_settings_disable_for_loggedin_users').parent().addClass('disabled');
|
@@ -517,7 +493,7 @@ function quick_adsense_settings_disable_for_loggedin_users() {
|
|
517 |
}
|
518 |
|
519 |
function quick_adsense_settings_enable_quicktag_buttons() {
|
520 |
-
if(jQuery('#quick_adsense_settings_enable_quicktag_buttons').prop('checked') == true) {
|
521 |
jQuery('#quick_adsense_settings_enable_quicktag_buttons').parent().removeClass('disabled');
|
522 |
} else {
|
523 |
jQuery('#quick_adsense_settings_enable_quicktag_buttons').parent().addClass('disabled');
|
@@ -525,7 +501,7 @@ function quick_adsense_settings_enable_quicktag_buttons() {
|
|
525 |
}
|
526 |
|
527 |
function quick_adsense_settings_disable_randomads_quicktag_button() {
|
528 |
-
if(jQuery('#quick_adsense_settings_disable_randomads_quicktag_button').prop('checked') == true) {
|
529 |
jQuery('#quick_adsense_settings_disable_randomads_quicktag_button').parent().removeClass('disabled');
|
530 |
} else {
|
531 |
jQuery('#quick_adsense_settings_disable_randomads_quicktag_button').parent().addClass('disabled');
|
@@ -533,7 +509,7 @@ function quick_adsense_settings_disable_randomads_quicktag_button() {
|
|
533 |
}
|
534 |
|
535 |
function quick_adsense_settings_disable_disablead_quicktag_buttons() {
|
536 |
-
if(jQuery('#quick_adsense_settings_disable_disablead_quicktag_buttons').prop('checked') == true) {
|
537 |
jQuery('#quick_adsense_settings_disable_disablead_quicktag_buttons').parent().removeClass('disabled');
|
538 |
} else {
|
539 |
jQuery('#quick_adsense_settings_disable_disablead_quicktag_buttons').parent().addClass('disabled');
|
@@ -541,7 +517,7 @@ function quick_adsense_settings_disable_disablead_quicktag_buttons() {
|
|
541 |
}
|
542 |
|
543 |
function quick_adsense_settings_disable_positionad_quicktag_buttons() {
|
544 |
-
if(jQuery('#quick_adsense_settings_disable_positionad_quicktag_buttons').prop('checked') == true) {
|
545 |
jQuery('#quick_adsense_settings_disable_positionad_quicktag_buttons').parent().removeClass('disabled');
|
546 |
} else {
|
547 |
jQuery('#quick_adsense_settings_disable_positionad_quicktag_buttons').parent().addClass('disabled');
|
@@ -549,124 +525,25 @@ function quick_adsense_settings_disable_positionad_quicktag_buttons() {
|
|
549 |
}
|
550 |
|
551 |
function quick_adsense_settings_onpost_enable_global_style() {
|
552 |
-
if(jQuery('#quick_adsense_settings_onpost_enable_global_style').prop('checked') == true) {
|
553 |
jQuery('#quick_adsense_settings_onpost_enable_global_style').parent().removeClass('disabled');
|
554 |
jQuery('#quick_adsense_settings_onpost_global_alignment').prop('disabled', false);
|
555 |
jQuery('#quick_adsense_settings_onpost_global_margin').prop('disabled', false);
|
556 |
-
for(var i = 1; i <= 10; i++) {
|
557 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_alignment').val(jQuery('#quick_adsense_settings_onpost_global_alignment').val());
|
558 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_margin').val(jQuery('#quick_adsense_settings_onpost_global_margin').val());
|
559 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_alignment').prop('disabled', true);
|
560 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_margin').prop('disabled', true);
|
561 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_alignment').parent().addClass('disabled');
|
562 |
}
|
563 |
} else {
|
564 |
jQuery('#quick_adsense_settings_onpost_enable_global_style').parent().addClass('disabled');
|
565 |
jQuery('#quick_adsense_settings_onpost_global_alignment').prop('disabled', true);
|
566 |
jQuery('#quick_adsense_settings_onpost_global_margin').prop('disabled', true);
|
567 |
-
for(var i = 1; i <= 10; i++) {
|
568 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_alignment').prop('disabled', false);
|
569 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_margin').prop('disabled', false);
|
570 |
-
jQuery('#quick_adsense_settings_onpost_ad_'+i+'_alignment').parent().removeClass('disabled');
|
571 |
}
|
572 |
}
|
573 |
}
|
574 |
-
|
575 |
-
function quick_adsense_settings_handle_vi_single_selection() {
|
576 |
-
/*
|
577 |
-
Logic Table for vi Single Selection
|
578 |
-
Beginning Enabled, Other Beginning Enabled, vi Beginning Disabled, Other Beginning Disabled, vi
|
579 |
-
|
580 |
-
Middle Enabled, Other B1, M1 B1, M0 B0, M1 B0, M1, Random - B
|
581 |
-
|
582 |
-
Middle Enabled, vi B0, M1 ------ B0, M1 B0, M1, Random - B
|
583 |
-
|
584 |
-
Middle Disabled, Other B1, M0 B1, M0 B0, M0 B0, M0, Random B
|
585 |
-
|
586 |
-
Middle Disabled, vi B1, M0, Random - M B1, M0, Random - M B0, M0, Random M B0, M0, Random B, Random M
|
587 |
-
*/
|
588 |
-
if(jQuery('#quick_adsense_settings_enable_position_middle_of_post').prop('checked') == true) {
|
589 |
-
if(jQuery('#quick_adsense_settings_ad_middle_of_post').val() != '100') {
|
590 |
-
if(jQuery('#quick_adsense_settings_enable_position_beginning_of_post').prop('checked') == true) {
|
591 |
-
if(jQuery('#quick_adsense_settings_ad_beginning_of_post').val() != '100') { //Middle Enabled, Other + Beginning Enabled, Other = B1, M1
|
592 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', false);
|
593 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', false);
|
594 |
-
} else { //Middle Enabled, Other + Beginning Enabled, vi = B1, M0
|
595 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', false);
|
596 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', true);
|
597 |
-
}
|
598 |
-
} else {
|
599 |
-
if(jQuery('#quick_adsense_settings_ad_beginning_of_post').val() != '100') { //Middle Enabled, Other + Beginning Disabled, Other = B0, M1
|
600 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', true);
|
601 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', false);
|
602 |
-
} else { //Middle Enabled, Other + Beginning Disabled, vi = B0, M1, Random - B
|
603 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', true);
|
604 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', false);
|
605 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').val('0');
|
606 |
-
}
|
607 |
-
}
|
608 |
-
} else {
|
609 |
-
if(jQuery('#quick_adsense_settings_enable_position_beginning_of_post').prop('checked') == true) {
|
610 |
-
if(jQuery('#quick_adsense_settings_ad_beginning_of_post').val() != '100') { //Middle Enabled, vi + Beginning Enabled, Other = B0, M1
|
611 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', true);
|
612 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', false);
|
613 |
-
} else { //Middle Enabled, vi + Beginning Enabled, vi = ------
|
614 |
-
// This state should never be reached - Error
|
615 |
-
alert('Error');
|
616 |
-
}
|
617 |
-
} else {
|
618 |
-
if(jQuery('#quick_adsense_settings_ad_beginning_of_post').val() != '100') { //Middle Enabled, vi + Beginning Disabled, Other = B0, M1
|
619 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', true);
|
620 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', false);
|
621 |
-
} else { //Middle Enabled, vi + Beginning Disabled, vi = B0, M1, Random - B
|
622 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', true);
|
623 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', false);
|
624 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').val('0');
|
625 |
-
}
|
626 |
-
}
|
627 |
-
}
|
628 |
-
} else {
|
629 |
-
if(jQuery('#quick_adsense_settings_ad_middle_of_post').val() != '100') {
|
630 |
-
if(jQuery('#quick_adsense_settings_enable_position_beginning_of_post').prop('checked') == true) {
|
631 |
-
if(jQuery('#quick_adsense_settings_ad_beginning_of_post').val() != '100') { //Middle Disabled, Other + Beginning Enabled, Other = B1, M0
|
632 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', false);
|
633 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', true);
|
634 |
-
} else { //Middle Disabled, Other + Beginning Enabled, vi = B1, M0
|
635 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', false);
|
636 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', true);
|
637 |
-
}
|
638 |
-
} else {
|
639 |
-
if(jQuery('#quick_adsense_settings_ad_beginning_of_post').val() != '100') { //Middle Disabled, Other + Beginning Disabled, Other = B0, M0
|
640 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', true);
|
641 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', true);
|
642 |
-
} else { //Middle Disabled, Other + Beginning Disabled, vi = B0, M0, Random B
|
643 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', true);
|
644 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', true);
|
645 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').val('0');
|
646 |
-
}
|
647 |
-
}
|
648 |
-
} else {
|
649 |
-
if(jQuery('#quick_adsense_settings_enable_position_beginning_of_post').prop('checked') == true) {
|
650 |
-
if(jQuery('#quick_adsense_settings_ad_beginning_of_post').val() != '100') { //Middle Enabled, vi + Beginning Enabled, Other = B1, M0, Random - M
|
651 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', false);
|
652 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', true);
|
653 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').val('0');
|
654 |
-
} else { //Middle Enabled, vi + Beginning Enabled, vi = B1, M0, Random - M
|
655 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', false);
|
656 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', true);
|
657 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').val('0');
|
658 |
-
}
|
659 |
-
} else {
|
660 |
-
if(jQuery('#quick_adsense_settings_ad_beginning_of_post').val() != '100') { //Middle Enabled, vi + Beginning Disabled, Other = B0, M0, Random M
|
661 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', true);
|
662 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', true);
|
663 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').val('0');
|
664 |
-
} else { //Middle Enabled, vi + Beginning Disabled, vi = B0, M0, Random B, Random M
|
665 |
-
jQuery('#quick_adsense_settings_ad_beginning_of_post').children('option[value="100"]').prop('disabled', true);
|
666 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').children('option[value="100"]').prop('disabled', true);
|
667 |
-
jQuery('#quick_adsense_settings_ad_middle_of_post').val('0');
|
668 |
-
}
|
669 |
-
}
|
670 |
-
}
|
671 |
-
}
|
672 |
-
}
|
1 |
+
jQuery(document).ready(function () {
|
2 |
+
jQuery("#quick_adsense_settings_tabs").tabs();
|
3 |
+
jQuery('#quick_adsense_settings_reset_to_default').click(quick_adsense_settings_reset_to_default);
|
4 |
+
|
5 |
jQuery('#quick_adsense_settings_enable_position_beginning_of_post').click(quick_adsense_settings_enable_position_beginning_of_post);
|
6 |
jQuery('#quick_adsense_settings_enable_position_middle_of_post').click(quick_adsense_settings_enable_position_middle_of_post);
|
7 |
+
jQuery('#quick_adsense_settings_enable_position_end_of_post').click(quick_adsense_settings_enable_position_end_of_post);
|
8 |
+
jQuery('#quick_adsense_settings_enable_position_after_more_tag').click(quick_adsense_settings_enable_position_after_more_tag);
|
9 |
+
jQuery('#quick_adsense_settings_enable_position_before_last_para').click(quick_adsense_settings_enable_position_before_last_para);
|
10 |
+
jQuery('#quick_adsense_settings_enable_position_after_para_option_1').click(quick_adsense_settings_enable_position_after_para_option_1);
|
11 |
+
jQuery('#quick_adsense_settings_enable_position_after_para_option_2').click(quick_adsense_settings_enable_position_after_para_option_2);
|
12 |
+
jQuery('#quick_adsense_settings_enable_position_after_para_option_3').click(quick_adsense_settings_enable_position_after_para_option_3);
|
13 |
+
jQuery('#quick_adsense_settings_enable_position_after_image_option_1').click(quick_adsense_settings_enable_position_after_image_option_1);
|
14 |
jQuery('#quick_adsense_settings_enable_on_posts').click(quick_adsense_settings_enable_on_posts);
|
15 |
+
jQuery('#quick_adsense_settings_enable_on_pages').click(quick_adsense_settings_enable_on_pages);
|
16 |
jQuery('#quick_adsense_settings_enable_on_homepage').click(quick_adsense_settings_enable_on_homepage);
|
17 |
jQuery('#quick_adsense_settings_enable_on_categories').click(quick_adsense_settings_enable_on_categories);
|
18 |
jQuery('#quick_adsense_settings_enable_on_archives').click(quick_adsense_settings_enable_on_archives);
|
19 |
jQuery('#quick_adsense_settings_enable_on_tags').click(quick_adsense_settings_enable_on_tags);
|
20 |
+
jQuery('#quick_adsense_settings_enable_all_possible_ads').click(quick_adsense_settings_enable_all_possible_ads);
|
21 |
+
jQuery('#quick_adsense_settings_disable_widgets_on_homepage').click(quick_adsense_settings_disable_widgets_on_homepage);
|
22 |
+
jQuery('#quick_adsense_settings_disable_for_loggedin_users').click(quick_adsense_settings_disable_for_loggedin_users);
|
23 |
+
jQuery('#quick_adsense_settings_enable_quicktag_buttons').click(quick_adsense_settings_enable_quicktag_buttons);
|
24 |
+
jQuery('#quick_adsense_settings_disable_randomads_quicktag_button').click(quick_adsense_settings_disable_randomads_quicktag_button);
|
25 |
+
jQuery('#quick_adsense_settings_disable_disablead_quicktag_buttons').click(quick_adsense_settings_disable_disablead_quicktag_buttons);
|
26 |
jQuery('#quick_adsense_settings_disable_positionad_quicktag_buttons').click(quick_adsense_settings_disable_positionad_quicktag_buttons);
|
27 |
+
|
28 |
+
jQuery('#quick_adsense_settings_onpost_enable_global_style').click(quick_adsense_settings_onpost_enable_global_style);
|
29 |
jQuery('#quick_adsense_settings_onpost_global_alignment').click(quick_adsense_settings_onpost_enable_global_style);
|
30 |
jQuery('#quick_adsense_settings_onpost_global_margin').click(quick_adsense_settings_onpost_enable_global_style);
|
|
|
|
|
|
|
|
|
|
|
31 |
|
|
|
|
|
|
|
|
|
|
|
32 |
quick_adsense_settings_enable_position_beginning_of_post();
|
33 |
quick_adsense_settings_enable_position_middle_of_post();
|
34 |
quick_adsense_settings_enable_position_end_of_post();
|
52 |
quick_adsense_settings_disable_disablead_quicktag_buttons();
|
53 |
quick_adsense_settings_disable_positionad_quicktag_buttons();
|
54 |
quick_adsense_settings_onpost_enable_global_style();
|
55 |
+
|
56 |
+
jQuery('#quick_adsense_onpost_content_adunits_showall_button').click(function () {
|
57 |
+
if (jQuery('#quick_adsense_onpost_content_adunits_showall_button').text() == ' Show All') {
|
|
|
58 |
jQuery('#quick_adsense_onpost_content_adunits_all_wrapper').slideDown();
|
59 |
jQuery('#quick_adsense_onpost_content_adunits_showall_button').html('<span class="dashicons dashicons-arrow-up"></span> <b>Show Less</b>');
|
60 |
} else {
|
62 |
jQuery('#quick_adsense_onpost_content_adunits_showall_button').html('<span class="dashicons dashicons-arrow-down"></span> <b>Show All</b>');
|
63 |
}
|
64 |
});
|
65 |
+
|
66 |
+
jQuery('#quick_adsense_widget_adunits_showall_button').click(function () {
|
67 |
+
if (jQuery('#quick_adsense_widget_adunits_showall_button').text() == ' Show All') {
|
68 |
jQuery('#quick_adsense_widget_adunits_all_wrapper').slideDown();
|
69 |
jQuery('#quick_adsense_widget_adunits_showall_button').html('<span class="dashicons dashicons-arrow-up"></span> <b>Show Less</b>');
|
70 |
} else {
|
73 |
}
|
74 |
});
|
75 |
|
76 |
+
jQuery('#quick_adsense_settings_form').submit(function () {
|
77 |
+
jQuery('#quick_adsense_settings_form select').each(function () {
|
78 |
+
if (jQuery(this).prop('disabled') == true) {
|
79 |
jQuery(this).prop('disabled', false);
|
80 |
}
|
81 |
});
|
82 |
});
|
83 |
|
84 |
jQuery('#quick_adsense_settings_form').fadeIn();
|
85 |
+
if (window.location.href.indexOf('#quick_adsense_adstxt_adsense_auto_update') > -1) {
|
86 |
quick_adsense_adstxt_adsense_auto_update();
|
87 |
}
|
88 |
+
|
89 |
+
jQuery('.quick_adsense_onpost_ad_reset_stats').click(function () {
|
90 |
jQuery(this).prop('disabled', true);
|
91 |
+
wp.ajax.post('quick_adsense_onpost_ad_reset_stats', {
|
92 |
+
nonce: quick_adsense.nonce,
|
93 |
+
index: jQuery(this).attr('data-index'),
|
94 |
+
}).done(function (result) {
|
95 |
+
jQuery('.quick_adsense_onpost_ad_reset_stats').each(function () {
|
96 |
+
jQuery(this).prop('disabled', false);
|
97 |
+
});
|
98 |
+
});
|
|
|
|
|
|
|
|
|
|
|
99 |
});
|
100 |
+
|
101 |
+
jQuery('.quick_adsense_onpost_ad_show_stats').click(function () {
|
102 |
+
jQuery('<div id="quick_adsense_onpost_ad_show_stats_dialog" data-index="' + jQuery(this).attr('data-index') + '"></div>').html('<div class="quick_adsense_ajaxloader"></div>').dialog({
|
103 |
'modal': true,
|
104 |
'resizable': false,
|
105 |
'width': jQuery("body").width() * 0.5,
|
106 |
'maxWidth': jQuery("body").width() * 0.5,
|
107 |
'maxHeight': jQuery("body").height() * 0.9,
|
108 |
+
'title': 'Ad' + jQuery(this).attr('data-index') + ' Performance Stats (30 Days)',
|
109 |
position: { my: 'center', at: 'center', of: window },
|
110 |
open: function (event, ui) {
|
111 |
+
jQuery('.ui-dialog').css({ 'z-index': 999999, 'max-width': '90%' });
|
112 |
+
jQuery('.ui-widget-overlay').css({ 'z-index': 999998, 'opacity': 0.8, 'background': '#000000' });
|
113 |
+
wp.ajax.post('quick_adsense_onpost_ad_get_stats_chart', {
|
114 |
+
nonce: quick_adsense.nonce,
|
115 |
+
index: jQuery('#quick_adsense_onpost_ad_show_stats_dialog').attr('data-index'),
|
116 |
+
}).done(function (result) {
|
117 |
+
jQuery('.quick_adsense_ajaxloader').hide();
|
118 |
+
jQuery('#quick_adsense_onpost_ad_show_stats_dialog').html(result);
|
119 |
+
jQuery('.ui-accordion .ui-accordion-content').css('max-height', (jQuery("body").height() * 0.45));
|
120 |
+
jQuery('.ui-dialog').css({ 'position': 'fixed' });
|
121 |
+
jQuery('#quick_adsense_onpost_ad_show_stats_dialog').delay(500).dialog({ position: { my: 'center', at: 'center', of: window } });
|
122 |
+
|
123 |
+
jQuery('#quick_adsense_ad_stats_chart_wrapper canvas').attr('width', jQuery('#quick_adsense_ad_stats_chart_wrapper').width() + 'px');
|
124 |
+
jQuery('#quick_adsense_ad_stats_chart_wrapper canvas').attr('height', jQuery('#quick_adsense_ad_stats_chart_wrapper').height() + 'px');
|
125 |
+
if (jQuery('#quick_adsense_ad_stats_chart_data').length) {
|
126 |
+
var quick_adsense_ad_stats_chart = new Chart(jQuery('#quick_adsense_ad_stats_chart'), {
|
127 |
+
type: 'line',
|
128 |
+
responsive: false,
|
129 |
+
data: {
|
130 |
+
datasets: [{
|
131 |
+
data: JSON.parse(jQuery('#quick_adsense_ad_stats_chart_data').val()),
|
132 |
+
backgroundColor: '#EDF5FB',
|
133 |
+
borderColor: '#186EAE',/*E8EBEF*/
|
134 |
+
borderWidth: 1
|
135 |
+
}]
|
136 |
+
},
|
137 |
+
options: {
|
138 |
+
title: {
|
139 |
+
display: false,
|
140 |
+
backgroundColor: '#EDF5FB'
|
141 |
},
|
142 |
+
legend: {
|
143 |
+
display: false,
|
144 |
+
},
|
145 |
+
scales: {
|
146 |
+
xAxes: [{
|
147 |
+
type: "time",
|
148 |
+
display: true,
|
149 |
+
scaleLabel: {
|
150 |
+
display: true
|
151 |
+
},
|
152 |
+
gridLines: {
|
153 |
display: true,
|
154 |
+
drawTicks: true
|
155 |
+
},
|
156 |
+
ticks: {
|
157 |
+
display: true
|
158 |
+
}
|
159 |
+
}],
|
160 |
+
yAxes: [{
|
161 |
+
display: true,
|
162 |
+
scaleLabel: {
|
163 |
+
display: true
|
164 |
+
},
|
165 |
+
gridLines: {
|
166 |
display: true,
|
167 |
+
drawTicks: true
|
168 |
+
},
|
169 |
+
ticks: {
|
170 |
+
display: true
|
171 |
+
}
|
172 |
+
}]
|
173 |
+
},
|
174 |
+
tooltips: {
|
175 |
+
displayColors: false,
|
176 |
+
callbacks: {
|
177 |
+
label: function (tooltipItem, data) {
|
178 |
+
return ['Impressions: ' + parseInt(data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]['y'], 10), 'Clicks: ' + parseInt(data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]['y1'], 10)];
|
179 |
+
},
|
180 |
+
title: function (tooltipItem, data) {
|
181 |
+
var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
182 |
+
var dateParts = tooltipItem[0].xLabel.split('/');
|
183 |
+
var date = new Date(dateParts[2], dateParts[0] - 1, dateParts[1]);
|
184 |
+
return monthNames[date.getMonth()] + ' ' + date.getDate();
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
}
|
186 |
}
|
187 |
}
|
188 |
+
}
|
189 |
+
});
|
190 |
}
|
191 |
+
});
|
192 |
},
|
193 |
+
buttons: {},
|
194 |
+
close: function () {
|
195 |
jQuery(this).dialog('destroy');
|
196 |
}
|
197 |
})
|
199 |
});
|
200 |
|
201 |
function quick_adsense_adstxt_adsense_auto_update() {
|
202 |
+
wp.ajax.post('quick_adsense_adstxt_adsense_auto_update', {
|
203 |
+
nonce: quick_adsense_adstxt_adsense.nonce,
|
204 |
+
}).done(function (result) {
|
205 |
+
jQuery('.quick_adsense_adstxt_adsense_notice').hide();
|
206 |
+
}.fail(function(result) {
|
207 |
+
if ("undefined" !== typeof result) {
|
208 |
+
jQuery(result).dialog({
|
209 |
+
'modal': true,
|
210 |
+
'resizable': false,
|
211 |
+
'title': 'Ads.txt Auto Updation Failed',
|
212 |
+
'width': jQuery("body").width() * 0.5,
|
213 |
+
'maxWidth': jQuery("body").width() * 0.5,
|
214 |
+
'maxHeight': jQuery("body").height() * 0.9,
|
215 |
+
position: { my: 'center', at: 'center', of: window },
|
216 |
+
open: function (event, ui) {
|
217 |
+
jQuery('.ui-dialog').css({ 'z-index': 999999, 'max-width': '90%' });
|
218 |
+
jQuery('.ui-widget-overlay').css({ 'z-index': 999998, 'opacity': 0.8, 'background': '#000000' });
|
219 |
+
},
|
220 |
+
buttons: {
|
221 |
+
'Cancel': function () {
|
222 |
+
jQuery(this).dialog("close");
|
|
|
|
|
|
|
|
|
223 |
}
|
224 |
+
},
|
225 |
+
close: function () {
|
226 |
+
jQuery(this).dialog('destroy');
|
227 |
+
}
|
228 |
+
});
|
229 |
}
|
230 |
+
}));
|
231 |
}
|
232 |
|
233 |
function quick_adsense_settings_reset_to_default() {
|
234 |
jQuery('#quick_adsense_settings_max_ads_per_page').val('3');
|
235 |
+
|
236 |
+
jQuery('#quick_adsense_settings_enable_position_beginning_of_post').prop('checked', true);
|
237 |
jQuery('#quick_adsense_settings_ad_beginning_of_post').val('1');
|
238 |
jQuery('#quick_adsense_settings_enable_position_middle_of_post').prop('checked', false);
|
239 |
jQuery('#quick_adsense_settings_ad_middle_of_post').val('0');
|
240 |
jQuery('#quick_adsense_settings_enable_position_end_of_post').prop('checked', true);
|
241 |
jQuery('#quick_adsense_settings_ad_end_of_post').val('0');
|
242 |
+
|
243 |
jQuery('#quick_adsense_settings_enable_position_after_more_tag').prop('checked', false);
|
244 |
jQuery('#quick_adsense_settings_ad_after_more_tag').val('0');
|
245 |
jQuery('#quick_adsense_settings_enable_position_before_last_para').prop('checked', false);
|
246 |
jQuery('#quick_adsense_settings_ad_before_last_para').val('0');
|
247 |
+
|
248 |
+
for (var i = 1; i <= 3; i++) {
|
249 |
+
jQuery('#quick_adsense_settings_enable_position_after_para_option_' + i).prop('checked', false);
|
250 |
+
jQuery('#quick_adsense_settings_ad_after_para_option_' + i).val('0');
|
251 |
+
jQuery('#quick_adsense_settings_position_after_para_option_' + i).val('1');
|
252 |
+
jQuery('#quick_adsense_settings_enable_jump_position_after_para_option_' + i).prop('checked', false);
|
253 |
}
|
254 |
+
|
255 |
+
for (var i = 1; i <= 1; i++) {
|
256 |
+
jQuery('#quick_adsense_settings_enable_position_after_image_option_' + i).prop('checked', false);
|
257 |
+
jQuery('#quick_adsense_settings_ad_after_image_option_' + i).val('0');
|
258 |
+
jQuery('#quick_adsense_settings_position_after_image_option_' + i).val('1');
|
259 |
+
jQuery('#quick_adsense_settings_enable_jump_position_after_image_option_' + i).prop('checked', false);
|
260 |
}
|
261 |
+
|
262 |
jQuery('#quick_adsense_settings_enable_on_posts').prop('checked', true);
|
263 |
jQuery('#quick_adsense_settings_enable_on_pages').prop('checked', true);
|
264 |
+
|
265 |
jQuery('#quick_adsense_settings_enable_on_homepage').prop('checked', false);
|
266 |
jQuery('#quick_adsense_settings_enable_on_categories').prop('checked', false);
|
267 |
jQuery('#quick_adsense_settings_enable_on_archives').prop('checked', false);
|
268 |
jQuery('#quick_adsense_settings_enable_on_tags').prop('checked', false);
|
269 |
jQuery('#quick_adsense_settings_enable_all_possible_ads').prop('checked', false);
|
270 |
+
|
271 |
jQuery('#quick_adsense_settings_disable_widgets_on_homepage').prop('checked', false);
|
272 |
+
|
273 |
jQuery('#quick_adsense_settings_disable_for_loggedin_users').prop('checked', false);
|
274 |
+
|
275 |
jQuery('#quick_adsense_settings_enable_quicktag_buttons').prop('checked', true);
|
276 |
jQuery('#quick_adsense_settings_disable_randomads_quicktag_button').prop('checked', false);
|
277 |
jQuery('#quick_adsense_settings_disable_disablead_quicktag_buttons').prop('checked', false);
|
278 |
jQuery('#quick_adsense_settings_disable_positionad_quicktag_buttons').prop('checked', false);
|
279 |
+
|
280 |
jQuery('#quick_adsense_settings_onpost_enable_global_style').prop('checked', false);
|
281 |
jQuery('#quick_adsense_settings_onpost_global_alignment').val('2');
|
282 |
jQuery('#quick_adsense_settings_onpost_global_margin').val('10');
|
283 |
+
|
284 |
+
for (var i = 1; i <= 10; i++) {
|
285 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_content').val('');
|
286 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_alignment').val('2');
|
287 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_margin').val('10');
|
288 |
+
|
289 |
+
jQuery('#quick_adsense_settings_widget_ad_' + i + '_content').val('');
|
290 |
}
|
291 |
+
|
292 |
quick_adsense_settings_enable_position_beginning_of_post();
|
293 |
quick_adsense_settings_enable_position_middle_of_post();
|
294 |
quick_adsense_settings_enable_position_end_of_post();
|
312 |
quick_adsense_settings_disable_disablead_quicktag_buttons();
|
313 |
quick_adsense_settings_disable_positionad_quicktag_buttons();
|
314 |
quick_adsense_settings_onpost_enable_global_style();
|
|
|
315 |
}
|
316 |
|
317 |
function quick_adsense_settings_enable_position_beginning_of_post() {
|
318 |
+
if (jQuery('#quick_adsense_settings_enable_position_beginning_of_post').prop('checked') == true) {
|
319 |
jQuery('#quick_adsense_settings_ad_beginning_of_post').prop('disabled', false);
|
320 |
jQuery('#quick_adsense_settings_ad_beginning_of_post').parent().removeClass('disabled');
|
321 |
} else {
|
322 |
jQuery('#quick_adsense_settings_ad_beginning_of_post').prop('disabled', true);
|
323 |
jQuery('#quick_adsense_settings_ad_beginning_of_post').parent().addClass('disabled');
|
324 |
}
|
|
|
325 |
}
|
326 |
|
327 |
function quick_adsense_settings_enable_position_middle_of_post() {
|
328 |
+
if (jQuery('#quick_adsense_settings_enable_position_middle_of_post').prop('checked') == true) {
|
329 |
jQuery('#quick_adsense_settings_ad_middle_of_post').prop('disabled', false);
|
330 |
jQuery('#quick_adsense_settings_ad_middle_of_post').parent().removeClass('disabled');
|
331 |
} else {
|
332 |
jQuery('#quick_adsense_settings_ad_middle_of_post').prop('disabled', true);
|
333 |
jQuery('#quick_adsense_settings_ad_middle_of_post').parent().addClass('disabled');
|
334 |
}
|
|
|
335 |
}
|
336 |
|
337 |
function quick_adsense_settings_enable_position_end_of_post() {
|
338 |
+
if (jQuery('#quick_adsense_settings_enable_position_end_of_post').prop('checked') == true) {
|
339 |
jQuery('#quick_adsense_settings_ad_end_of_post').prop('disabled', false);
|
340 |
jQuery('#quick_adsense_settings_ad_end_of_post').parent().removeClass('disabled');
|
341 |
} else {
|
345 |
}
|
346 |
|
347 |
function quick_adsense_settings_enable_position_after_more_tag() {
|
348 |
+
if (jQuery('#quick_adsense_settings_enable_position_after_more_tag').prop('checked') == true) {
|
349 |
jQuery('#quick_adsense_settings_ad_after_more_tag').prop('disabled', false);
|
350 |
jQuery('#quick_adsense_settings_ad_after_more_tag').parent().removeClass('disabled');
|
351 |
} else {
|
353 |
jQuery('#quick_adsense_settings_ad_after_more_tag').parent().addClass('disabled');
|
354 |
}
|
355 |
}
|
356 |
+
|
357 |
function quick_adsense_settings_enable_position_before_last_para() {
|
358 |
+
if (jQuery('#quick_adsense_settings_enable_position_before_last_para').prop('checked') == true) {
|
359 |
jQuery('#quick_adsense_settings_ad_before_last_para').prop('disabled', false);
|
360 |
jQuery('#quick_adsense_settings_ad_before_last_para').parent().removeClass('disabled');
|
361 |
} else {
|
365 |
}
|
366 |
|
367 |
function quick_adsense_settings_enable_position_after_para_option_1() {
|
368 |
+
if (jQuery('#quick_adsense_settings_enable_position_after_para_option_1').prop('checked') == true) {
|
369 |
jQuery('#quick_adsense_settings_ad_after_para_option_1').prop('disabled', false);
|
370 |
jQuery('#quick_adsense_settings_position_after_para_option_1').prop('disabled', false);
|
371 |
jQuery('#quick_adsense_settings_enable_jump_position_after_para_option_1').prop('disabled', false);
|
379 |
}
|
380 |
|
381 |
function quick_adsense_settings_enable_position_after_para_option_2() {
|
382 |
+
if (jQuery('#quick_adsense_settings_enable_position_after_para_option_2').prop('checked') == true) {
|
383 |
jQuery('#quick_adsense_settings_ad_after_para_option_2').prop('disabled', false);
|
384 |
jQuery('#quick_adsense_settings_position_after_para_option_2').prop('disabled', false);
|
385 |
jQuery('#quick_adsense_settings_enable_jump_position_after_para_option_2').prop('disabled', false);
|
393 |
}
|
394 |
|
395 |
function quick_adsense_settings_enable_position_after_para_option_3() {
|
396 |
+
if (jQuery('#quick_adsense_settings_enable_position_after_para_option_3').prop('checked') == true) {
|
397 |
jQuery('#quick_adsense_settings_ad_after_para_option_3').prop('disabled', false);
|
398 |
jQuery('#quick_adsense_settings_position_after_para_option_3').prop('disabled', false);
|
399 |
jQuery('#quick_adsense_settings_enable_jump_position_after_para_option_3').prop('disabled', false);
|
407 |
}
|
408 |
|
409 |
function quick_adsense_settings_enable_position_after_image_option_1() {
|
410 |
+
if (jQuery('#quick_adsense_settings_enable_position_after_image_option_1').prop('checked') == true) {
|
411 |
jQuery('#quick_adsense_settings_ad_after_image_option_1').prop('disabled', false);
|
412 |
jQuery('#quick_adsense_settings_position_after_image_option_1').prop('disabled', false);
|
413 |
jQuery('#quick_adsense_settings_enable_jump_position_after_image_option_1').prop('disabled', false);
|
421 |
}
|
422 |
|
423 |
function quick_adsense_settings_enable_on_posts() {
|
424 |
+
if (jQuery('#quick_adsense_settings_enable_on_posts').prop('checked') == true) {
|
425 |
jQuery('#quick_adsense_settings_enable_on_posts').parent().removeClass('disabled');
|
426 |
} else {
|
427 |
jQuery('#quick_adsense_settings_enable_on_posts').parent().addClass('disabled');
|
429 |
}
|
430 |
|
431 |
function quick_adsense_settings_enable_on_pages() {
|
432 |
+
if (jQuery('#quick_adsense_settings_enable_on_pages').prop('checked') == true) {
|
433 |
jQuery('#quick_adsense_settings_enable_on_pages').parent().removeClass('disabled');
|
434 |
} else {
|
435 |
jQuery('#quick_adsense_settings_enable_on_pages').parent().addClass('disabled');
|
437 |
}
|
438 |
|
439 |
function quick_adsense_settings_enable_on_homepage() {
|
440 |
+
if (jQuery('#quick_adsense_settings_enable_on_homepage').prop('checked') == true) {
|
441 |
jQuery('#quick_adsense_settings_enable_on_homepage').parent().removeClass('disabled');
|
442 |
} else {
|
443 |
jQuery('#quick_adsense_settings_enable_on_homepage').parent().addClass('disabled');
|
445 |
}
|
446 |
|
447 |
function quick_adsense_settings_enable_on_categories() {
|
448 |
+
if (jQuery('#quick_adsense_settings_enable_on_categories').prop('checked') == true) {
|
449 |
jQuery('#quick_adsense_settings_enable_on_categories').parent().removeClass('disabled');
|
450 |
} else {
|
451 |
jQuery('#quick_adsense_settings_enable_on_categories').parent().addClass('disabled');
|
453 |
}
|
454 |
|
455 |
function quick_adsense_settings_enable_on_archives() {
|
456 |
+
if (jQuery('#quick_adsense_settings_enable_on_archives').prop('checked') == true) {
|
457 |
jQuery('#quick_adsense_settings_enable_on_archives').parent().removeClass('disabled');
|
458 |
} else {
|
459 |
jQuery('#quick_adsense_settings_enable_on_archives').parent().addClass('disabled');
|
461 |
}
|
462 |
|
463 |
function quick_adsense_settings_enable_on_tags() {
|
464 |
+
if (jQuery('#quick_adsense_settings_enable_on_tags').prop('checked') == true) {
|
465 |
jQuery('#quick_adsense_settings_enable_on_tags').parent().removeClass('disabled');
|
466 |
} else {
|
467 |
jQuery('#quick_adsense_settings_enable_on_tags').parent().addClass('disabled');
|
469 |
}
|
470 |
|
471 |
function quick_adsense_settings_enable_all_possible_ads() {
|
472 |
+
if (jQuery('#quick_adsense_settings_enable_all_possible_ads').prop('checked') == true) {
|
473 |
jQuery('#quick_adsense_settings_enable_all_possible_ads').parent().removeClass('disabled');
|
474 |
} else {
|
475 |
jQuery('#quick_adsense_settings_enable_all_possible_ads').parent().addClass('disabled');
|
477 |
}
|
478 |
|
479 |
function quick_adsense_settings_disable_widgets_on_homepage() {
|
480 |
+
if (jQuery('#quick_adsense_settings_disable_widgets_on_homepage').prop('checked') == true) {
|
481 |
jQuery('#quick_adsense_settings_disable_widgets_on_homepage').parent().removeClass('disabled');
|
482 |
} else {
|
483 |
jQuery('#quick_adsense_settings_disable_widgets_on_homepage').parent().addClass('disabled');
|
485 |
}
|
486 |
|
487 |
function quick_adsense_settings_disable_for_loggedin_users() {
|
488 |
+
if (jQuery('#quick_adsense_settings_disable_for_loggedin_users').prop('checked') == true) {
|
489 |
jQuery('#quick_adsense_settings_disable_for_loggedin_users').parent().removeClass('disabled');
|
490 |
} else {
|
491 |
jQuery('#quick_adsense_settings_disable_for_loggedin_users').parent().addClass('disabled');
|
493 |
}
|
494 |
|
495 |
function quick_adsense_settings_enable_quicktag_buttons() {
|
496 |
+
if (jQuery('#quick_adsense_settings_enable_quicktag_buttons').prop('checked') == true) {
|
497 |
jQuery('#quick_adsense_settings_enable_quicktag_buttons').parent().removeClass('disabled');
|
498 |
} else {
|
499 |
jQuery('#quick_adsense_settings_enable_quicktag_buttons').parent().addClass('disabled');
|
501 |
}
|
502 |
|
503 |
function quick_adsense_settings_disable_randomads_quicktag_button() {
|
504 |
+
if (jQuery('#quick_adsense_settings_disable_randomads_quicktag_button').prop('checked') == true) {
|
505 |
jQuery('#quick_adsense_settings_disable_randomads_quicktag_button').parent().removeClass('disabled');
|
506 |
} else {
|
507 |
jQuery('#quick_adsense_settings_disable_randomads_quicktag_button').parent().addClass('disabled');
|
509 |
}
|
510 |
|
511 |
function quick_adsense_settings_disable_disablead_quicktag_buttons() {
|
512 |
+
if (jQuery('#quick_adsense_settings_disable_disablead_quicktag_buttons').prop('checked') == true) {
|
513 |
jQuery('#quick_adsense_settings_disable_disablead_quicktag_buttons').parent().removeClass('disabled');
|
514 |
} else {
|
515 |
jQuery('#quick_adsense_settings_disable_disablead_quicktag_buttons').parent().addClass('disabled');
|
517 |
}
|
518 |
|
519 |
function quick_adsense_settings_disable_positionad_quicktag_buttons() {
|
520 |
+
if (jQuery('#quick_adsense_settings_disable_positionad_quicktag_buttons').prop('checked') == true) {
|
521 |
jQuery('#quick_adsense_settings_disable_positionad_quicktag_buttons').parent().removeClass('disabled');
|
522 |
} else {
|
523 |
jQuery('#quick_adsense_settings_disable_positionad_quicktag_buttons').parent().addClass('disabled');
|
525 |
}
|
526 |
|
527 |
function quick_adsense_settings_onpost_enable_global_style() {
|
528 |
+
if (jQuery('#quick_adsense_settings_onpost_enable_global_style').prop('checked') == true) {
|
529 |
jQuery('#quick_adsense_settings_onpost_enable_global_style').parent().removeClass('disabled');
|
530 |
jQuery('#quick_adsense_settings_onpost_global_alignment').prop('disabled', false);
|
531 |
jQuery('#quick_adsense_settings_onpost_global_margin').prop('disabled', false);
|
532 |
+
for (var i = 1; i <= 10; i++) {
|
533 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_alignment').val(jQuery('#quick_adsense_settings_onpost_global_alignment').val());
|
534 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_margin').val(jQuery('#quick_adsense_settings_onpost_global_margin').val());
|
535 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_alignment').prop('disabled', true);
|
536 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_margin').prop('disabled', true);
|
537 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_alignment').parent().addClass('disabled');
|
538 |
}
|
539 |
} else {
|
540 |
jQuery('#quick_adsense_settings_onpost_enable_global_style').parent().addClass('disabled');
|
541 |
jQuery('#quick_adsense_settings_onpost_global_alignment').prop('disabled', true);
|
542 |
jQuery('#quick_adsense_settings_onpost_global_margin').prop('disabled', true);
|
543 |
+
for (var i = 1; i <= 10; i++) {
|
544 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_alignment').prop('disabled', false);
|
545 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_margin').prop('disabled', false);
|
546 |
+
jQuery('#quick_adsense_settings_onpost_ad_' + i + '_alignment').parent().removeClass('disabled');
|
547 |
}
|
548 |
}
|
549 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/GeoIP/GeoIPCountry.php
DELETED
@@ -1,428 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Created by PhpStorm.
|
4 |
-
* User: sjhc1170
|
5 |
-
* Date: 20/04/2017
|
6 |
-
* Time: 08:55
|
7 |
-
*/
|
8 |
-
|
9 |
-
namespace Iriven;
|
10 |
-
use ZipArchive;
|
11 |
-
use SplFileObject;
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Class GeoIPCountry
|
15 |
-
* @package Iriven\GeoIPCountry
|
16 |
-
*/
|
17 |
-
class GeoIPCountry
|
18 |
-
{
|
19 |
-
const DOWNLOAD_LINK = 'http://software77.net/geo-ip/?DL=%s';
|
20 |
-
const DOWNLOADED_FILE = 'GeoIP';
|
21 |
-
const DS = DIRECTORY_SEPARATOR;
|
22 |
-
private $DataLocation = null;
|
23 |
-
private $EditModeEnabled = false;
|
24 |
-
private $IsoCode = null;
|
25 |
-
private $IpPackageID = ['ipv4'=>'1','ipv6'=>'7'];
|
26 |
-
private $PackageLocation = null;
|
27 |
-
private $PackageName = self::DOWNLOADED_FILE;
|
28 |
-
private $UpdateUrl = self::DOWNLOAD_LINK;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* GeoIPCountry constructor.
|
32 |
-
*/
|
33 |
-
public function __construct()
|
34 |
-
{
|
35 |
-
$this->PackageLocation = realpath($this->getStoragePath());
|
36 |
-
$this->DataLocation = realpath($this->getStoragePath(false));
|
37 |
-
$this->prepareLookup();
|
38 |
-
return $this;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @return $this
|
43 |
-
*/
|
44 |
-
public function Admin()
|
45 |
-
{
|
46 |
-
$this->EditModeEnabled = true;
|
47 |
-
return $this;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* @return $this
|
52 |
-
*/
|
53 |
-
private function DownloadPackage()
|
54 |
-
{
|
55 |
-
if($this->EditModeEnabled)
|
56 |
-
{
|
57 |
-
set_time_limit(0); //prevent timeout
|
58 |
-
try
|
59 |
-
{
|
60 |
-
foreach ($this->IpPackageID AS $ipVersion=>$packageId)
|
61 |
-
{
|
62 |
-
$Archive = $this->PackageLocation.self::DS.$this->PackageName;
|
63 |
-
$Archive .=($ipVersion==='ipv6')?'6R.csv.gz':'.csv.gz';
|
64 |
-
if(!file_exists($Archive))
|
65 |
-
{
|
66 |
-
$url = sprintf($this->UpdateUrl,$packageId);
|
67 |
-
$curl=curl_init();
|
68 |
-
$Handler = fopen($Archive,'w+');
|
69 |
-
curl_setopt($curl, CURLOPT_URL, str_replace(' ','%20',$url));
|
70 |
-
curl_setopt($curl, CURLOPT_FILE, $Handler); //auto write to file
|
71 |
-
curl_setopt($curl, CURLOPT_TIMEOUT, 5040);
|
72 |
-
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
73 |
-
if(curl_exec($curl) === false)
|
74 |
-
throw new \Exception(curl_error($curl));
|
75 |
-
curl_close($curl);
|
76 |
-
fclose($Handler);
|
77 |
-
}
|
78 |
-
}
|
79 |
-
}
|
80 |
-
catch (\Exception $e)
|
81 |
-
{
|
82 |
-
trigger_error($e->getMessage());
|
83 |
-
}
|
84 |
-
}
|
85 |
-
return $this;
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* If IPV6, Returns the IP in it's fullest format.
|
90 |
-
* @example
|
91 |
-
* ::1 => 0000:0000:0000:0000:0000:0000:0000:0001
|
92 |
-
* 220F::127.0.0.1 => 220F:0000:0000:0000:0000:0000:7F00:0001
|
93 |
-
* 2F:A1::1 => 002F:00A1:0000:0000:0000:0000:0000:0001
|
94 |
-
* @param $Ip
|
95 |
-
* @return mixed|string
|
96 |
-
*/
|
97 |
-
private function ExpandIPAddress($Ip)
|
98 |
-
{
|
99 |
-
if (strpos($Ip, ':') !== false) // IPv6 address
|
100 |
-
{
|
101 |
-
$hex = unpack('H*hex', inet_pton($Ip));
|
102 |
-
$Ip = substr(preg_replace('/([A-f0-9]{4})/', "$1:", $hex['hex']), 0, -1);
|
103 |
-
$Ip = strtoupper($Ip);
|
104 |
-
}
|
105 |
-
return $Ip;
|
106 |
-
}
|
107 |
-
/**
|
108 |
-
* @param $ip
|
109 |
-
* @return null|string
|
110 |
-
*/
|
111 |
-
private function getIPRangeProviderFile($ip)
|
112 |
-
{
|
113 |
-
try
|
114 |
-
{
|
115 |
-
if(!preg_match('/[.:]/', $ip)) $ip = $this->long2ip($ip, false);
|
116 |
-
if(!filter_var($ip,FILTER_VALIDATE_IP,[FILTER_FLAG_IPV4|FILTER_FLAG_IPV6]))
|
117 |
-
throw new \Exception('Invalid IP given');
|
118 |
-
$delimiter = (strpos($ip,':')===false)? '.' : ':';
|
119 |
-
$DBfile = current(explode($delimiter,$ip)).'.php';
|
120 |
-
return $DBfile;
|
121 |
-
}
|
122 |
-
catch (\Exception $e)
|
123 |
-
{
|
124 |
-
trigger_error($e->getMessage());
|
125 |
-
}
|
126 |
-
return null;
|
127 |
-
}
|
128 |
-
/**
|
129 |
-
* @param bool $isArchive
|
130 |
-
* @return string
|
131 |
-
*/
|
132 |
-
private function getStoragePath($isArchive=true)
|
133 |
-
{
|
134 |
-
$tmp = ini_get('upload_tmp_dir')?:sys_get_temp_dir ();
|
135 |
-
$isArchive OR $tmp = rtrim(__DIR__, self::DS);
|
136 |
-
try{
|
137 |
-
if (!is_writeable($tmp))
|
138 |
-
throw new \Exception(sprintf('The required destination path is not writable: %s', $tmp));
|
139 |
-
}
|
140 |
-
catch(\Exception $e)
|
141 |
-
{
|
142 |
-
trigger_error($e->getMessage(),E_USER_ERROR);
|
143 |
-
}
|
144 |
-
$tmp .= self::DS.($isArchive? 'GeoIPCountry' : 'GeoIPDatas');
|
145 |
-
if(!is_dir($tmp)) mkdir($tmp,'0755', true);
|
146 |
-
return $tmp;
|
147 |
-
}
|
148 |
-
/**
|
149 |
-
* Convert both IPV4 and IPv6 address to an integer
|
150 |
-
* @param $Ip
|
151 |
-
* @return mixed|string
|
152 |
-
*/
|
153 |
-
private function ip2long($Ip)
|
154 |
-
{
|
155 |
-
$decimal = null;
|
156 |
-
$Ip = $this->ExpandIPAddress($Ip);
|
157 |
-
try
|
158 |
-
{
|
159 |
-
switch ($Ip):
|
160 |
-
case (strpos($Ip, '.') !== false):
|
161 |
-
if(!filter_var($Ip,FILTER_VALIDATE_IP,[FILTER_FLAG_IPV4]))
|
162 |
-
throw new \Exception('Invalid IPV4 given');
|
163 |
-
$decimal .= ip2long($Ip);
|
164 |
-
break;
|
165 |
-
case (strpos($Ip, ':') !== false):
|
166 |
-
if(!filter_var($Ip,FILTER_VALIDATE_IP,[FILTER_FLAG_IPV6]))
|
167 |
-
throw new \Exception('Invalid IPV6 given');
|
168 |
-
$network = inet_pton($Ip);
|
169 |
-
$parts = unpack('C*', $network);
|
170 |
-
foreach ($parts as &$byte)
|
171 |
-
$decimal.= str_pad(decbin($byte), 8, '0', STR_PAD_LEFT);
|
172 |
-
break;
|
173 |
-
default:
|
174 |
-
throw new \Exception($Ip.' is not a valid IP address');
|
175 |
-
break;
|
176 |
-
endswitch;
|
177 |
-
}
|
178 |
-
catch (\Exception $e)
|
179 |
-
{
|
180 |
-
trigger_error($e->getMessage(),E_USER_ERROR);
|
181 |
-
}
|
182 |
-
return $decimal;
|
183 |
-
}
|
184 |
-
/**
|
185 |
-
* Convert an IP address from decimal format to presentation format
|
186 |
-
*
|
187 |
-
* @param $decimal
|
188 |
-
* @param bool $compress
|
189 |
-
* @return mixed|string
|
190 |
-
*/
|
191 |
-
private function long2ip($decimal,$compress = true)
|
192 |
-
{
|
193 |
-
$Ip = null;
|
194 |
-
if(preg_match('/[.:]/', $decimal))
|
195 |
-
return strtoupper($decimal);
|
196 |
-
switch ($decimal):
|
197 |
-
case (strlen($decimal) <= 32):
|
198 |
-
$Ip .= long2ip($decimal);
|
199 |
-
break;
|
200 |
-
default:
|
201 |
-
$pad = 128 - strlen($decimal);
|
202 |
-
for ($i = 1; $i <= $pad; $i++)
|
203 |
-
$decimal = '0'.$decimal;
|
204 |
-
for ($bits = 0; $bits <= 7; $bits++)
|
205 |
-
{
|
206 |
-
$binPart = substr($decimal,($bits*16),16);
|
207 |
-
$Ip .= dechex(bindec($binPart)).':';
|
208 |
-
}
|
209 |
-
$Ip = inet_ntop(inet_pton(substr($Ip,0,-1)));
|
210 |
-
break;
|
211 |
-
endswitch;
|
212 |
-
$Ip = strtoupper($Ip);
|
213 |
-
return $compress? $Ip : $this->ExpandIPAddress($Ip);
|
214 |
-
}
|
215 |
-
/**
|
216 |
-
* @param null $ip
|
217 |
-
* @return bool
|
218 |
-
*/
|
219 |
-
public function isReservedIP($ip=null)
|
220 |
-
{
|
221 |
-
if($ip) $this->resolve($ip);
|
222 |
-
return !$this->IsoCode OR strcasecmp($this->IsoCode,'ZZ') == 0 ;
|
223 |
-
}
|
224 |
-
/**
|
225 |
-
* @return $this
|
226 |
-
*/
|
227 |
-
private function prepareLookup()
|
228 |
-
{
|
229 |
-
$totalRangeFiles = count(glob($this->DataLocation.'/*[0-9]*.php'));
|
230 |
-
if($totalRangeFiles < 332)
|
231 |
-
{
|
232 |
-
$this->Admin()->updateDatabase();
|
233 |
-
$this->EditModeEnabled = false;
|
234 |
-
}
|
235 |
-
return $this;
|
236 |
-
}
|
237 |
-
/**
|
238 |
-
* @param null $ip
|
239 |
-
* @return null|string
|
240 |
-
*/
|
241 |
-
public function resolve($ip = null)
|
242 |
-
{
|
243 |
-
try
|
244 |
-
{
|
245 |
-
$ip OR $ip = $this->getRemoteIP();
|
246 |
-
if(!preg_match('/[.:]/', $ip)) $ip = $this->long2ip($ip);
|
247 |
-
$ip = $this->ExpandIPAddress($ip);
|
248 |
-
if(!filter_var($ip,FILTER_VALIDATE_IP,[FILTER_FLAG_IPV4|FILTER_FLAG_IPV6]))
|
249 |
-
throw new \Exception('Invalid IP given');
|
250 |
-
$ipFilename = $this->getIPRangeProviderFile($ip);
|
251 |
-
$ipLong = $this->ip2long($ip);
|
252 |
-
$ipFilePath = realpath($this->DataLocation.self::DS.$ipFilename);
|
253 |
-
if(!file_exists($ipFilePath))
|
254 |
-
throw new \Exception('IP Ranges provider file not found');
|
255 |
-
$IpRanges = include $ipFilePath;
|
256 |
-
foreach($IpRanges as $Range):
|
257 |
-
if(!is_array($Range) OR sizeof($Range) !== 3) continue;
|
258 |
-
if(preg_match('/^[01]+$/', $ipLong))
|
259 |
-
{
|
260 |
-
$Range[0] = $this->ip2long($Range[0]);
|
261 |
-
$Range[1] = $this->ip2long($Range[1]);
|
262 |
-
}
|
263 |
-
if($Range[1] < $ipLong) continue;
|
264 |
-
if(($Range[0]<=$ipLong))
|
265 |
-
{
|
266 |
-
$this->IsoCode = $Range[2]?:'ZZ';
|
267 |
-
break;
|
268 |
-
}
|
269 |
-
endforeach;
|
270 |
-
}
|
271 |
-
catch (\Exception $e)
|
272 |
-
{
|
273 |
-
trigger_error($e->getMessage());
|
274 |
-
}
|
275 |
-
return $this->IsoCode;
|
276 |
-
}
|
277 |
-
|
278 |
-
/**
|
279 |
-
* Auto Get the current visitor IP Address
|
280 |
-
* @return string
|
281 |
-
*/
|
282 |
-
private function getRemoteIP()
|
283 |
-
{
|
284 |
-
$ip = null;
|
285 |
-
$serverIPKeys =['HTTP_X_COMING_FROM', 'HTTP_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_X_CLUSTER_CLIENT_IP',
|
286 |
-
'HTTP_X_FORWARDED', 'HTTP_VIA', 'HTTP_CLIENT_IP','HTTP_X_FORWARDED_FOR','REMOTE_ADDR'];
|
287 |
-
foreach ($serverIPKeys AS $IPKey):
|
288 |
-
if(array_key_exists($IPKey,$_SERVER))
|
289 |
-
{
|
290 |
-
if (!strlen($_SERVER[$IPKey])) continue;
|
291 |
-
$ip = $_SERVER[$IPKey];
|
292 |
-
break;
|
293 |
-
}
|
294 |
-
endforeach;
|
295 |
-
if (($CommaPos = strpos($ip, ',')) > 0)
|
296 |
-
$ip = substr($ip, 0, ($CommaPos - 1));
|
297 |
-
return $ip?:'0.0.0.0';
|
298 |
-
}
|
299 |
-
/**
|
300 |
-
* @return $this
|
301 |
-
*/
|
302 |
-
public function updateDatabase()
|
303 |
-
{
|
304 |
-
if($this->EditModeEnabled)
|
305 |
-
{
|
306 |
-
$this->DownloadPackage()->ExtractArchive();
|
307 |
-
$ExtractedFileName = pathinfo($this->PackageName,PATHINFO_FILENAME);
|
308 |
-
$ExtractedFiles = glob($this->PackageLocation.self::DS.$ExtractedFileName.'*.csv');
|
309 |
-
if($ExtractedFiles)
|
310 |
-
{
|
311 |
-
set_time_limit(0); //prevent timeout
|
312 |
-
foreach ($ExtractedFiles AS $ExtractedFile):
|
313 |
-
$files = [];
|
314 |
-
foreach (new SplFileObject($ExtractedFile) as $line)
|
315 |
-
{
|
316 |
-
if (substr($line, 0, 1) === '#') continue;
|
317 |
-
$line = str_replace('"','',$line);
|
318 |
-
$temp = explode(',', $line);
|
319 |
-
if (count($temp)<4) continue;
|
320 |
-
$filename = null;
|
321 |
-
$ipMin = null;
|
322 |
-
$ipMax = null;
|
323 |
-
$Alpha2 = null;
|
324 |
-
switch ($temp[0]):
|
325 |
-
case (strpos($temp[0], '-') !== false):
|
326 |
-
list($ipMin,$ipMax) = explode('-',$temp[0]);
|
327 |
-
$Alpha2 = $temp[1];
|
328 |
-
$filename = current(explode(':',$this->ExpandIPAddress($ipMin))).'.php';
|
329 |
-
break;
|
330 |
-
default:
|
331 |
-
if (count($temp)<7) break;
|
332 |
-
$ipMin = (int) $temp[0];
|
333 |
-
$ipMax = (int) $temp[1];
|
334 |
-
$Alpha2 = $temp[4];
|
335 |
-
$filename = current(explode('.',$this->long2ip($ipMin))).'.php';
|
336 |
-
break;
|
337 |
-
endswitch;
|
338 |
-
$dataFile = $this->PackageLocation.self::DS.$filename;
|
339 |
-
$files[] = $filename;
|
340 |
-
$fileContent = null;
|
341 |
-
if(!file_exists($dataFile))
|
342 |
-
{
|
343 |
-
$fileContent .= '<?php'.PHP_EOL;
|
344 |
-
$fileContent .= 'return ['.PHP_EOL;
|
345 |
-
}
|
346 |
-
$fileContent .= '[\''.$ipMin.'\', \''.$ipMax.'\', \''.$Alpha2.'\'],'.PHP_EOL;
|
347 |
-
file_put_contents($dataFile, $fileContent,FILE_APPEND | LOCK_EX);
|
348 |
-
}
|
349 |
-
if($files):
|
350 |
-
foreach ($files as $file)
|
351 |
-
{
|
352 |
-
$source = $this->PackageLocation.self::DS.$file;
|
353 |
-
$destination = $this->DataLocation.self::DS.$file;
|
354 |
-
if(!file_exists($source)) continue;
|
355 |
-
$sourceContent = '];';
|
356 |
-
file_put_contents($source, $sourceContent,FILE_APPEND | LOCK_EX);
|
357 |
-
rename($source,$destination);
|
358 |
-
@chmod($destination,0644);
|
359 |
-
}
|
360 |
-
endif;
|
361 |
-
if(file_exists($ExtractedFile)) @unlink($ExtractedFile);
|
362 |
-
endforeach;
|
363 |
-
}
|
364 |
-
$this->EditModeEnabled = false;
|
365 |
-
}
|
366 |
-
return $this;
|
367 |
-
}
|
368 |
-
|
369 |
-
/**
|
370 |
-
* @param null $file
|
371 |
-
* @return $this
|
372 |
-
*/
|
373 |
-
private function ExtractArchive($file = null)
|
374 |
-
{
|
375 |
-
if($this->EditModeEnabled)
|
376 |
-
{
|
377 |
-
!$file OR $this->PackageName = pathinfo(realpath($file), PATHINFO_FILENAME);
|
378 |
-
try{
|
379 |
-
$Packages = array_filter(glob($this->PackageLocation.self::DS.$this->PackageName.'*.{gz,zip}',GLOB_BRACE), 'is_file');
|
380 |
-
if($Packages)
|
381 |
-
{
|
382 |
-
$bufferSize = 4096;
|
383 |
-
$Package = null;
|
384 |
-
foreach($Packages AS $PackageFile):
|
385 |
-
$PackageExt = pathinfo($PackageFile, PATHINFO_EXTENSION);
|
386 |
-
if(!in_array(strtolower($PackageExt),['zip','gz'],true)) continue;
|
387 |
-
$ExtractedFilename = pathinfo($PackageFile,PATHINFO_FILENAME).'.csv';
|
388 |
-
$ExtractedFile = realpath($this->PackageLocation).self::DS.$ExtractedFilename;
|
389 |
-
switch ($PackageExt):
|
390 |
-
case (strcasecmp($PackageExt,'gz') == 0):
|
391 |
-
$file = gzopen($PackageFile, 'rb');
|
392 |
-
$Handler = fopen($ExtractedFile, 'wb');
|
393 |
-
while (!gzeof($file))
|
394 |
-
{
|
395 |
-
fwrite($Handler, gzread($file, $bufferSize));
|
396 |
-
}
|
397 |
-
fclose($Handler);
|
398 |
-
gzclose($file);
|
399 |
-
break;
|
400 |
-
case (strcasecmp($PackageExt,'zip') == 0):
|
401 |
-
$zip = new ZipArchive;
|
402 |
-
if ($zip->open($PackageFile) !== false)
|
403 |
-
{
|
404 |
-
for($i = 0; $i < $zip->numFiles; $i++)
|
405 |
-
{
|
406 |
-
$filename = $zip->getNameIndex($i);
|
407 |
-
if(strcasecmp(pathinfo($filename,PATHINFO_EXTENSION),'csv') == 0)
|
408 |
-
copy('zip://'.$PackageFile.'#'.$filename, $ExtractedFile);
|
409 |
-
}
|
410 |
-
$zip->close();
|
411 |
-
}
|
412 |
-
break;
|
413 |
-
default:
|
414 |
-
throw new \Exception('The Downloaded package must be a zip or gz file: "'.$PackageExt.'" file given');
|
415 |
-
break;
|
416 |
-
endswitch;
|
417 |
-
if(file_exists($PackageFile)) @unlink($PackageFile);
|
418 |
-
endforeach;
|
419 |
-
}
|
420 |
-
}
|
421 |
-
catch (\Exception $e)
|
422 |
-
{
|
423 |
-
trigger_error($e->getMessage(),E_USER_ERROR);
|
424 |
-
}
|
425 |
-
}
|
426 |
-
return $this;
|
427 |
-
}
|
428 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/adsense.php
CHANGED
@@ -1,254 +1,248 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
if(!isset($
|
38 |
-
$
|
39 |
-
}
|
40 |
-
if(
|
41 |
-
set_transient('quick_adsense_adstxt_adsense_autocheck_content', $
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
$
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
}
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
$output .= '<p><a onclick="quick_adsense_adstxt_content_download()" class="button button-primary" href="javascript:;">Download ads.txt</a></p>';
|
250 |
-
$output .= '</div>';
|
251 |
-
return $output;
|
252 |
-
}
|
253 |
-
/* End Common Functions */
|
254 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Adsense specific features.
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Add inline script to hide the notice on clicking dismiss button.
|
8 |
+
*/
|
9 |
+
add_action(
|
10 |
+
'admin_enqueue_scripts',
|
11 |
+
function() {
|
12 |
+
wp_localize_script(
|
13 |
+
'jquery',
|
14 |
+
'quick_adsense_adstxt_adsense',
|
15 |
+
[
|
16 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
17 |
+
'nonce' => wp_create_nonce( 'quick-adsense-adstxt-adsense-nonce' ),
|
18 |
+
]
|
19 |
+
);
|
20 |
+
wp_add_inline_script(
|
21 |
+
'jquery',
|
22 |
+
quick_adsense_load_file( 'templates/js/script-admin-notice.php' )
|
23 |
+
);
|
24 |
+
}
|
25 |
+
);
|
26 |
+
|
27 |
+
/**
|
28 |
+
* This function checks for and displays the admin notice when needed.
|
29 |
+
*
|
30 |
+
* @param boolean $is_ajax Specific where the function is being called during an ajax call.
|
31 |
+
*/
|
32 |
+
function quick_adsense_adstxt_adsense_admin_notice( $is_ajax = false ) {
|
33 |
+
if ( current_user_can( 'manage_options' ) ) {
|
34 |
+
if ( ! get_option( 'quick_adsense_adstxt_adsense_admin_notice_dismissed' ) ) {
|
35 |
+
$adstxt_new_adsense_entries = get_transient( 'quick_adsense_adstxt_adsense_autocheck_content' );
|
36 |
+
if ( 'CHECKED' !== $adstxt_new_adsense_entries ) {
|
37 |
+
if ( ! isset( $adstxt_new_adsense_entries ) || ( false === $adstxt_new_adsense_entries ) ) {
|
38 |
+
$adstxt_new_adsense_entries = quick_adsense_adstxt_adsense_get_status();
|
39 |
+
}
|
40 |
+
if ( false !== $adstxt_new_adsense_entries ) {
|
41 |
+
set_transient( 'quick_adsense_adstxt_adsense_autocheck_content', $adstxt_new_adsense_entries, DAY_IN_SECONDS );
|
42 |
+
$screen = get_current_screen();
|
43 |
+
echo wp_kses(
|
44 |
+
quick_adsense_load_file(
|
45 |
+
'templates/block-adsense-adstxt-notice.php',
|
46 |
+
[
|
47 |
+
'screen_id' => $screen->id,
|
48 |
+
'is_ajax' => $is_ajax,
|
49 |
+
'adstxt_new_adsense_entries' => implode( '<br />', $adstxt_new_adsense_entries ),
|
50 |
+
]
|
51 |
+
),
|
52 |
+
quick_adsense_get_allowed_html()
|
53 |
+
);
|
54 |
+
} else {
|
55 |
+
set_transient( 'quick_adsense_adstxt_adsense_autocheck_content', 'CHECKED', DAY_IN_SECONDS );
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
61 |
+
add_action( 'admin_notices', 'quick_adsense_adstxt_adsense_admin_notice' );
|
62 |
+
|
63 |
+
/**
|
64 |
+
* This function checks whether new entries need to be added to ads.txt based on the adcodes added.
|
65 |
+
*
|
66 |
+
* @return mixed False is no changes are needed, New ads.txt lines as an array if changes are required.
|
67 |
+
*/
|
68 |
+
function quick_adsense_adstxt_adsense_get_status() {
|
69 |
+
$file_handler = new QuickAdsense\FileHandler( 'ads.txt' );
|
70 |
+
if ( $file_handler->exists() ) {
|
71 |
+
$adsense_publisher_ids = quick_adsense_adstxt_adsense_get_publisherids();
|
72 |
+
$adstxt_content = $file_handler->read();
|
73 |
+
if ( false !== $adstxt_content ) {
|
74 |
+
$adstxt_content_data = array_filter( explode( "\n", trim( $adstxt_content ) ), 'trim' );
|
75 |
+
if ( is_array( $adstxt_content_data ) ) {
|
76 |
+
$adstxt_existing_adsense_entries = [];
|
77 |
+
foreach ( $adstxt_content_data as $line ) {
|
78 |
+
if ( strpos( $line, 'google.com' ) !== false ) {
|
79 |
+
$adstxt_existing_adsense_entries[] = $line;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
$adstxt_new_adsense_entries = [];
|
84 |
+
if ( count( $adstxt_existing_adsense_entries ) === 0 ) {
|
85 |
+
if ( is_array( $adsense_publisher_ids ) && ( count( $adsense_publisher_ids ) > 0 ) ) {
|
86 |
+
foreach ( $adsense_publisher_ids as $adsense_publisher_id ) {
|
87 |
+
$adstxt_new_adsense_entries[] = 'google.com, ' . $adsense_publisher_id . ', DIRECT, f08c47fec0942fa0';
|
88 |
+
}
|
89 |
+
}
|
90 |
+
} else {
|
91 |
+
if ( is_array( $adsense_publisher_ids ) && ( count( $adsense_publisher_ids ) > 0 ) ) {
|
92 |
+
foreach ( $adsense_publisher_ids as $adsense_publisher_id ) {
|
93 |
+
$entry_exists = false;
|
94 |
+
foreach ( $adstxt_existing_adsense_entries as $adstxt_existing_adsense_entry ) {
|
95 |
+
if ( strpos( $adstxt_existing_adsense_entry, $adsense_publisher_id ) !== false ) {
|
96 |
+
$entry_exists = true;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
if ( false === $entry_exists ) {
|
100 |
+
$adstxt_new_adsense_entries[] = 'google.com, ' . $adsense_publisher_id . ', DIRECT, f08c47fec0942fa0';
|
101 |
+
}
|
102 |
+
}
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
if ( isset( $adstxt_new_adsense_entries ) && count( $adstxt_new_adsense_entries ) > 0 ) {
|
109 |
+
return $adstxt_new_adsense_entries;
|
110 |
+
}
|
111 |
+
return false;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Function to extract publisher Ids from settings.
|
116 |
+
*
|
117 |
+
* @return mixed False if no publisher ids found, Array of publisher ids if publisher ids found.
|
118 |
+
*/
|
119 |
+
function quick_adsense_adstxt_adsense_get_publisherids() {
|
120 |
+
$adsense_publisher_ids = [];
|
121 |
+
|
122 |
+
$settings = get_option( 'quick_adsense_settings' );
|
123 |
+
if ( isset( $settings ) && is_array( $settings ) ) {
|
124 |
+
for ( $i = 1; $i <= 10; $i++ ) {
|
125 |
+
if ( isset( $settings[ 'onpost_ad_' . $i . '_content' ] ) && ( '' !== $settings[ 'onpost_ad_' . $i . '_content' ] ) ) {
|
126 |
+
$temp = quick_adsense_adstxt_adsense_extract_publisherids( $settings[ 'onpost_ad_' . $i . '_content' ] );
|
127 |
+
if ( false !== $temp ) {
|
128 |
+
$adsense_publisher_ids = array_merge( $adsense_publisher_ids, $temp );
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
if ( isset( $settings[ 'widget_ad_' . $i . '_content' ] ) && ( '' !== $settings[ 'widget_ad_' . $i . '_content' ] ) ) {
|
133 |
+
$temp = quick_adsense_adstxt_adsense_extract_publisherids( $settings[ 'widget_ad_' . $i . '_content' ] );
|
134 |
+
if ( false !== $temp ) {
|
135 |
+
$adsense_publisher_ids = array_merge( $adsense_publisher_ids, $temp );
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
if ( isset( $settings['header_embed_code'] ) && ( '' !== $settings['header_embed_code'] ) ) {
|
140 |
+
$temp = quick_adsense_adstxt_adsense_extract_publisherids( $settings['header_embed_code'] );
|
141 |
+
if ( false !== $temp ) {
|
142 |
+
$adsense_publisher_ids = array_merge( $adsense_publisher_ids, $temp );
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
if ( isset( $settings['footer_embed_code'] ) && ( '' !== $settings['footer_embed_code'] ) ) {
|
147 |
+
$temp = quick_adsense_adstxt_adsense_extract_publisherids( $settings['footer_embed_code'] );
|
148 |
+
if ( false !== $temp ) {
|
149 |
+
$adsense_publisher_ids = array_merge( $adsense_publisher_ids, $temp );
|
150 |
+
}
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|
154 |
+
$adsense_publisher_ids = array_unique( $adsense_publisher_ids );
|
155 |
+
|
156 |
+
if ( count( $adsense_publisher_ids ) > 0 ) {
|
157 |
+
return $adsense_publisher_ids;
|
158 |
+
}
|
159 |
+
return false;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Function to extract publisher Ids from provided adcode.
|
164 |
+
*
|
165 |
+
* @param string $ad_code The ad code.
|
166 |
+
*
|
167 |
+
* @return mixed False if no publisher ids found, Array of publisher ids if publisher ids found.
|
168 |
+
*/
|
169 |
+
function quick_adsense_adstxt_adsense_extract_publisherids( $ad_code ) {
|
170 |
+
$publisher_ids = [];
|
171 |
+
if ( isset( $ad_code ) && ( '' !== $ad_code ) ) {
|
172 |
+
if ( preg_match( '/googlesyndication.com/', $ad_code ) ) {
|
173 |
+
if ( preg_match( '/data-ad-client=/', $ad_code ) ) {
|
174 |
+
// ASYNC AD CODE.
|
175 |
+
$ad_code_parts = explode( 'data-ad-client', $ad_code );
|
176 |
+
} elseif ( preg_match( '/client=ca-pub-/', $ad_code ) ) {
|
177 |
+
// NEW ASYNC AD CODE.
|
178 |
+
$ad_code_parts = explode( 'ca-pub-', str_replace( 'ca-pub-', 'ca-pub-"', $ad_code ) );
|
179 |
+
} else {
|
180 |
+
// ORDINARY AD CODE.
|
181 |
+
$ad_code_parts = explode( 'google_ad_client', $ad_code );
|
182 |
+
}
|
183 |
+
if ( isset( $ad_code_parts[1] ) && ( '' !== $ad_code_parts[1] ) ) {
|
184 |
+
preg_match( '#"([a-zA-Z0-9-\s]+)"#', stripslashes( $ad_code_parts[1] ), $matches );
|
185 |
+
if ( isset( $matches[1] ) && ( '' !== $matches[1] ) ) {
|
186 |
+
$publisher_ids[] = str_replace( [ '"', ' ', 'ca-' ], [ '' ], $matches[1] );
|
187 |
+
}
|
188 |
+
}
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
if ( count( $publisher_ids ) > 0 ) {
|
193 |
+
return $publisher_ids;
|
194 |
+
}
|
195 |
+
return false;
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* This action dismisses the Ads.txt admin notice permanently.
|
200 |
+
*/
|
201 |
+
add_action(
|
202 |
+
'wp_ajax_quick_adsense_adstxt_adsense_admin_notice_dismiss',
|
203 |
+
function() {
|
204 |
+
if ( isset( $_POST['nonce'] ) && wp_verify_nonce( sanitize_key( $_POST['nonce'] ), 'quick-adsense-adstxt-adsense-nonce' ) ) {
|
205 |
+
update_option( 'quick_adsense_adstxt_adsense_admin_notice_dismissed', 'true' );
|
206 |
+
wp_send_json_success();
|
207 |
+
}
|
208 |
+
wp_send_json_error();
|
209 |
+
}
|
210 |
+
);
|
211 |
+
|
212 |
+
/**
|
213 |
+
* This action handles the Ajax trigerred Ads.txt update.
|
214 |
+
*/
|
215 |
+
add_action(
|
216 |
+
'wp_ajax_quick_adsense_adstxt_adsense_auto_update',
|
217 |
+
function() {
|
218 |
+
if ( isset( $_POST['nonce'] ) && wp_verify_nonce( sanitize_key( $_POST['nonce'] ), 'quick-adsense-adstxt-adsense-nonce' ) ) {
|
219 |
+
$adstxt_new_adsense_entries = quick_adsense_adstxt_adsense_get_status();
|
220 |
+
$file_handler = new QuickAdsense\FileHandler( 'ads.txt' );
|
221 |
+
if ( false !== $adstxt_new_adsense_entries ) {
|
222 |
+
$adstxt_content = $file_handler->read();
|
223 |
+
$adstxt_content_data = array_filter( explode( "\n", trim( $adstxt_content ) ), 'trim' );
|
224 |
+
$adstxt_updated_content = array_filter( array_merge( $adstxt_content_data, $adstxt_new_adsense_entries ), 'trim' );
|
225 |
+
}
|
226 |
+
if ( isset( $adstxt_updated_content ) && is_array( $adstxt_updated_content ) && ( count( $adstxt_updated_content ) > 0 ) ) {
|
227 |
+
$adstxt_updated_content = implode( "\n", $adstxt_updated_content );
|
228 |
+
if ( $file_handler->write( $adstxt_updated_content ) ) {
|
229 |
+
wp_send_json_success();
|
230 |
+
} else {
|
231 |
+
wp_send_json_error(
|
232 |
+
wp_kses(
|
233 |
+
quick_adsense_load_file(
|
234 |
+
'templates/block-adsense-adstxt-update-failed.php',
|
235 |
+
[
|
236 |
+
'content' => $adstxt_updated_content,
|
237 |
+
]
|
238 |
+
),
|
239 |
+
quick_adsense_get_allowed_html()
|
240 |
+
)
|
241 |
+
);
|
242 |
+
}
|
243 |
+
}
|
244 |
+
}
|
245 |
+
wp_send_json_error();
|
246 |
+
}
|
247 |
+
);
|
248 |
+
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-filehandler.php
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace QuickAdsense;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* FileHandler acts as a wrapper for the WordPress Filesystem API
|
6 |
+
*/
|
7 |
+
class FileHandler {
|
8 |
+
/**
|
9 |
+
* The full path to the file.
|
10 |
+
*
|
11 |
+
* @var array $file_path
|
12 |
+
*/
|
13 |
+
private $file_path = '';
|
14 |
+
|
15 |
+
/**
|
16 |
+
* The content to be sent to the file.
|
17 |
+
*
|
18 |
+
* @var array $file_content
|
19 |
+
*/
|
20 |
+
private $file_content = '';
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Access credentials for the file.
|
24 |
+
*
|
25 |
+
* @var array $file_credentials
|
26 |
+
*/
|
27 |
+
private $file_credentials = false;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Holds an instance of the builtin WordPress global $wp_filesystem.
|
31 |
+
*
|
32 |
+
* @var object $wp_filesystem
|
33 |
+
*/
|
34 |
+
private $wp_filesystem = null;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Initialize the class
|
38 |
+
*
|
39 |
+
* @param string $file_path Complete path to the file to be loaded relative to the site root.
|
40 |
+
* @param string $file_content Content to write into the file.
|
41 |
+
*/
|
42 |
+
public function __construct( $file_path = '', $file_content = '' ) {
|
43 |
+
global $wp_filesystem;
|
44 |
+
$this->file_content = $file_content;
|
45 |
+
$this->file_credentials = false;
|
46 |
+
if ( get_filesystem_method() === 'direct' ) {
|
47 |
+
$this->file_credentials = request_filesystem_credentials( '', '', false, false, [] );
|
48 |
+
if ( WP_Filesystem( $this->file_credentials ) ) {
|
49 |
+
$this->file_path = $wp_filesystem->abspath() . $file_path;
|
50 |
+
$this->wp_filesystem = $wp_filesystem;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Check if a file exist.
|
57 |
+
*
|
58 |
+
* @param string $file_path Complete path to the file to be loaded relative to the site root.
|
59 |
+
*
|
60 |
+
* @return boolean true on success, false on faliure.
|
61 |
+
*/
|
62 |
+
public function exists( $file_path = '' ) {
|
63 |
+
if ( isset( $this->wp_filesystem ) ) {
|
64 |
+
if ( '' === $file_path ) {
|
65 |
+
$file_path = $this->file_path;
|
66 |
+
} else {
|
67 |
+
$file_path = $this->wp_filesystem->abspath() . $file_path;
|
68 |
+
}
|
69 |
+
if ( file_exists( $file_path ) ) {
|
70 |
+
return true;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
return false;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Read a file.
|
78 |
+
*
|
79 |
+
* @param string $file_path Complete path to the file to be loaded relative to the site root.
|
80 |
+
*
|
81 |
+
* @return mixed The content of the file on success, false on faliure.
|
82 |
+
*/
|
83 |
+
public function read( $file_path = '' ) {
|
84 |
+
if ( isset( $this->wp_filesystem ) ) {
|
85 |
+
if ( '' === $file_path ) {
|
86 |
+
$file_path = $this->file_path;
|
87 |
+
} else {
|
88 |
+
$file_path = $this->wp_filesystem->abspath() . $file_path;
|
89 |
+
}
|
90 |
+
return $this->wp_filesystem->get_contents( $file_path );
|
91 |
+
}
|
92 |
+
return false;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Create and write content to a file.
|
97 |
+
*
|
98 |
+
* @param string $file_content Content to write into the file.
|
99 |
+
* @param string $file_path Complete path to the file to be loaded relative to the site root.
|
100 |
+
*
|
101 |
+
* @return boolean true on success, false on faliure
|
102 |
+
*/
|
103 |
+
public function write( $file_content = '', $file_path = '' ) {
|
104 |
+
if ( isset( $this->wp_filesystem ) ) {
|
105 |
+
if ( '' === $file_path ) {
|
106 |
+
$file_path = $this->file_path;
|
107 |
+
} else {
|
108 |
+
$file_path = $this->wp_filesystem->abspath() . $file_path;
|
109 |
+
}
|
110 |
+
if ( '' === $file_content ) {
|
111 |
+
$file_content = $this->file_content;
|
112 |
+
}
|
113 |
+
return $this->wp_filesystem->put_contents( $file_path, $file_content, FS_CHMOD_FILE );
|
114 |
+
}
|
115 |
+
return false;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Delete a file
|
120 |
+
*
|
121 |
+
* @param string $file_path Complete path to the file to be loaded relative to the site root.
|
122 |
+
*
|
123 |
+
* @return boolean true on success, false on faliure.
|
124 |
+
*/
|
125 |
+
public function delete( $file_path = '' ) {
|
126 |
+
if ( isset( $this->wp_filesystem ) ) {
|
127 |
+
if ( '' === $file_path ) {
|
128 |
+
$file_path = $this->file_path;
|
129 |
+
} else {
|
130 |
+
$file_path = $this->wp_filesystem->abspath() . $file_path;
|
131 |
+
}
|
132 |
+
return $this->wp_filesystem->delete( $file_path, false, 'f' );
|
133 |
+
}
|
134 |
+
return false;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
includes/content.php
CHANGED
@@ -1,600 +1,691 @@
|
|
1 |
-
<?php
|
2 |
-
$
|
3 |
-
$
|
4 |
-
$
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
}
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
$
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
$
|
88 |
-
$
|
89 |
-
|
90 |
-
|
91 |
-
$
|
92 |
-
$
|
93 |
-
|
94 |
-
$
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
$
|
99 |
-
|
100 |
-
$
|
101 |
-
$
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
$
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
$
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
$
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
if($
|
136 |
-
$
|
137 |
-
} else {
|
138 |
-
$
|
139 |
-
array_push($
|
140 |
-
};
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
$
|
152 |
-
|
153 |
-
|
154 |
-
$
|
155 |
-
|
156 |
-
|
157 |
-
$
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
$
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
if(
|
210 |
-
$
|
211 |
-
$
|
212 |
-
$
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
$
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
$
|
281 |
-
$
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
$
|
303 |
-
|
304 |
-
$content
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
$
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
$
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
return
|
365 |
-
}
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
)
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
}
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
$
|
414 |
-
$
|
415 |
-
'',
|
416 |
-
'
|
417 |
-
'
|
418 |
-
'
|
419 |
-
'
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
$
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
}
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
if(isset(
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
$
|
581 |
-
if(
|
582 |
-
$
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$quick_adsense_ads_displayed = 0;
|
3 |
+
$quick_adsense_ads_id = [];
|
4 |
+
$quick_adsense_begin_end = 0;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Hook into the header to embed the Header tracking or ad code.
|
8 |
+
*/
|
9 |
+
add_action(
|
10 |
+
'wp_head',
|
11 |
+
function() {
|
12 |
+
$settings = get_option( 'quick_adsense_settings' );
|
13 |
+
if ( isset( $settings['header_embed_code'] ) && ( '' !== $settings['header_embed_code'] ) ) {
|
14 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
15 |
+
// Need to allow output of scripts, iframes etc necessary to output ads and trackers.
|
16 |
+
echo $settings['header_embed_code'];
|
17 |
+
// phpcs:enable
|
18 |
+
}
|
19 |
+
}
|
20 |
+
);
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Hook into the footer to embed the Footer tracking or ad code.
|
24 |
+
*/
|
25 |
+
add_action(
|
26 |
+
'wp_footer',
|
27 |
+
function() {
|
28 |
+
$settings = get_option( 'quick_adsense_settings' );
|
29 |
+
if ( isset( $settings['footer_embed_code'] ) && ( '' !== $settings['footer_embed_code'] ) ) {
|
30 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
31 |
+
// Need to allow output of scripts, iframes etc necessary to output ads and trackers.
|
32 |
+
echo $settings['footer_embed_code'];
|
33 |
+
// phpcs:enable
|
34 |
+
}
|
35 |
+
}
|
36 |
+
);
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Filter the post content to embed ads.
|
40 |
+
*/
|
41 |
+
add_filter(
|
42 |
+
'the_content',
|
43 |
+
function( $content ) {
|
44 |
+
global $quick_adsense_ads_displayed;
|
45 |
+
global $quick_adsense_ads_id;
|
46 |
+
global $quick_adsense_begin_end;
|
47 |
+
$settings = get_option( 'quick_adsense_settings' );
|
48 |
+
|
49 |
+
if ( ! quick_adsense_postads_isactive( $settings, $content ) ) {
|
50 |
+
$content = quick_adsense_content_clean_tags( $content );
|
51 |
+
return $content;
|
52 |
+
}
|
53 |
+
/* Begin Enforce Max Ads Per Page Rule */
|
54 |
+
$quick_adsense_ads_to_display = $settings['max_ads_per_page'];
|
55 |
+
if ( strpos( $content, '<!--OffWidget-->' ) === false ) {
|
56 |
+
for ( $i = 1; $i <= 10; $i++ ) {
|
57 |
+
$widget_id = sanitize_title( str_replace( [ '(', ')' ], '', sprintf( 'AdsWidget%d (Quick Adsense)', $i ) ) );
|
58 |
+
$quick_adsense_ads_to_display -= ( is_active_widget( true, $widget_id ) ) ? 1 : 0;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
if ( $quick_adsense_ads_displayed >= $quick_adsense_ads_to_display ) {
|
62 |
+
$content = quick_adsense_content_clean_tags( $content );
|
63 |
+
return $content;
|
64 |
+
};
|
65 |
+
/* End Enforce Max Ads Per Page Rule */
|
66 |
+
|
67 |
+
/* Begin Check for Available Ad Blocks */
|
68 |
+
if ( ! count( $quick_adsense_ads_id ) ) {
|
69 |
+
for ( $i = 1; $i <= 10; $i++ ) {
|
70 |
+
if ( isset( $settings[ 'onpost_ad_' . $i . '_content' ] ) && ! empty( $settings[ 'onpost_ad_' . $i . '_content' ] ) ) {
|
71 |
+
if ( quick_adsense_advanced_postads_isactive( $settings, $i ) ) {
|
72 |
+
array_push( $quick_adsense_ads_id, (string) $i );
|
73 |
+
}
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
array_push( $quick_adsense_ads_id, 100 );
|
78 |
+
|
79 |
+
if ( ! count( $quick_adsense_ads_id ) ) {
|
80 |
+
$content = quick_adsense_content_clean_tags( $content );
|
81 |
+
return $content;
|
82 |
+
};
|
83 |
+
/* End Check for Available Ad Blocks */
|
84 |
+
|
85 |
+
/* Begin Insert StandIns for all Ad Blocks */
|
86 |
+
$content = str_replace( '<p></p>', '##QA-TP1##', $content );
|
87 |
+
$content = str_replace( '<p> </p>', '##QA-TP2##', $content );
|
88 |
+
$offdef = ( strpos( $content, '<!--OffDef-->' ) !== false );
|
89 |
+
if ( ! $offdef ) {
|
90 |
+
$quick_adsense_ads_id_cus = [];
|
91 |
+
$cusads = 'CusAds';
|
92 |
+
$cusrnd = 'CusRnd';
|
93 |
+
|
94 |
+
$quick_adsense_enable_position_after_more_tag = ( ( isset( $settings['enable_position_after_more_tag'] ) ) ? $settings['enable_position_after_more_tag'] : '' );
|
95 |
+
$quick_adsense_ad_after_more_tag = ( ( isset( $settings['ad_after_more_tag'] ) ) ? $settings['ad_after_more_tag'] : '' );
|
96 |
+
|
97 |
+
$quick_adsense_enable_position_before_last_para = ( ( isset( $settings['enable_position_before_last_para'] ) ) ? $settings['enable_position_before_last_para'] : '' );
|
98 |
+
$quick_adsense_ad_before_last_para = ( ( isset( $settings['ad_before_last_para'] ) ) ? $settings['ad_before_last_para'] : '' );
|
99 |
+
|
100 |
+
$quick_adsense_enable_position_beginning_of_post = ( ( isset( $settings['enable_position_beginning_of_post'] ) ) ? $settings['enable_position_beginning_of_post'] : '' );
|
101 |
+
$quick_adsense_ad_beginning_of_post = ( ( isset( $settings['ad_beginning_of_post'] ) ) ? $settings['ad_beginning_of_post'] : '' );
|
102 |
+
|
103 |
+
$quick_adsense_enable_position_middle_of_post = ( ( isset( $settings['enable_position_middle_of_post'] ) ) ? $settings['enable_position_middle_of_post'] : '' );
|
104 |
+
$quick_adsense_ad_middle_of_post = ( ( isset( $settings['ad_middle_of_post'] ) ) ? $settings['ad_middle_of_post'] : '' );
|
105 |
+
|
106 |
+
$quick_adsense_enable_position_end_of_post = ( ( isset( $settings['enable_position_end_of_post'] ) ) ? $settings['enable_position_end_of_post'] : '' );
|
107 |
+
$quick_adsense_ad_end_of_post = ( ( isset( $settings['ad_end_of_post'] ) ) ? $settings['ad_end_of_post'] : '' );
|
108 |
+
|
109 |
+
for ( $i = 1; $i <= 3; $i++ ) {
|
110 |
+
$quick_adsense_enable_position_after_para[ $i ] = ( ( isset( $settings[ 'enable_position_after_para_option_' . $i ] ) ) ? $settings[ 'enable_position_after_para_option_' . $i ] : '' );
|
111 |
+
$quick_adsense_ad_after_para[ $i ] = ( ( isset( $settings[ 'ad_after_para_option_' . $i ] ) ) ? $settings[ 'ad_after_para_option_' . $i ] : '' );
|
112 |
+
$quick_adsense_position_after_para[ $i ] = ( ( isset( $settings[ 'position_after_para_option_' . $i ] ) ) ? $settings[ 'position_after_para_option_' . $i ] : '' );
|
113 |
+
$quick_adsense_enable_jump_position_after_para[ $i ] = ( ( isset( $settings[ 'enable_jump_position_after_para_option_' . $i ] ) ) ? $settings[ 'enable_jump_position_after_para_option_' . $i ] : '' );
|
114 |
+
}
|
115 |
+
|
116 |
+
for ( $i = 1; $i <= 1; $i++ ) {
|
117 |
+
$quick_adsense_enable_position_after_image = ( ( isset( $settings[ 'enable_position_after_image_option_' . $i ] ) ) ? $settings[ 'enable_position_after_image_option_' . $i ] : '' );
|
118 |
+
$quick_adsense_ad_after_image = ( ( isset( $settings[ 'ad_after_image_option_' . $i ] ) ) ? $settings[ 'ad_after_image_option_' . $i ] : '' );
|
119 |
+
$quick_adsense_position_after_image = ( ( isset( $settings[ 'position_after_image_option_' . $i ] ) ) ? $settings[ 'position_after_image_option_' . $i ] : '' );
|
120 |
+
$quick_adsense_enable_jump_position_after_image = ( ( isset( $settings[ 'enable_jump_position_after_image_option_' . $i ] ) ) ? $settings[ 'enable_jump_position_after_image_option_' . $i ] : '' );
|
121 |
+
}
|
122 |
+
|
123 |
+
if ( 0 === $quick_adsense_ad_beginning_of_post ) {
|
124 |
+
$quick_adsense_ad_beginning_of_post_stand_in = $cusrnd;
|
125 |
+
} else {
|
126 |
+
$quick_adsense_ad_beginning_of_post_stand_in = $cusads . $quick_adsense_ad_beginning_of_post;
|
127 |
+
array_push( $quick_adsense_ads_id_cus, $quick_adsense_ad_beginning_of_post );
|
128 |
+
};
|
129 |
+
if ( 0 === $quick_adsense_ad_after_more_tag ) {
|
130 |
+
$quick_adsense_ad_after_more_tag_stand_in = $cusrnd;
|
131 |
+
} else {
|
132 |
+
$quick_adsense_ad_after_more_tag_stand_in = $cusads . $quick_adsense_ad_after_more_tag;
|
133 |
+
array_push( $quick_adsense_ads_id_cus, $quick_adsense_ad_after_more_tag );
|
134 |
+
};
|
135 |
+
if ( 0 === $quick_adsense_ad_middle_of_post ) {
|
136 |
+
$quick_adsense_ad_middle_of_post_stand_in = $cusrnd;
|
137 |
+
} else {
|
138 |
+
$quick_adsense_ad_middle_of_post_stand_in = $cusads . $quick_adsense_ad_middle_of_post;
|
139 |
+
array_push( $quick_adsense_ads_id_cus, $quick_adsense_ad_middle_of_post );
|
140 |
+
};
|
141 |
+
if ( 0 === $quick_adsense_ad_before_last_para ) {
|
142 |
+
$quick_adsense_ad_before_last_para_stand_in = $cusrnd;
|
143 |
+
} else {
|
144 |
+
$quick_adsense_ad_before_last_para_stand_in = $cusads . $quick_adsense_ad_before_last_para;
|
145 |
+
array_push( $quick_adsense_ads_id_cus, $quick_adsense_ad_before_last_para );
|
146 |
+
};
|
147 |
+
if ( 0 === $quick_adsense_ad_end_of_post ) {
|
148 |
+
$quick_adsense_ad_end_of_post_stand_in = $cusrnd;
|
149 |
+
} else {
|
150 |
+
$quick_adsense_ad_end_of_post_stand_in = $cusads . $quick_adsense_ad_end_of_post;
|
151 |
+
array_push( $quick_adsense_ads_id_cus, $quick_adsense_ad_end_of_post );
|
152 |
+
};
|
153 |
+
for ( $i = 1; $i <= 3; $i++ ) {
|
154 |
+
if ( 0 === $quick_adsense_ad_after_para[ $i ] ) {
|
155 |
+
$quick_adsense_ad_after_para_stand_in[ $i ] = $cusrnd;
|
156 |
+
} else {
|
157 |
+
$quick_adsense_ad_after_para_stand_in[ $i ] = $cusads . $quick_adsense_ad_after_para[ $i ];
|
158 |
+
array_push( $quick_adsense_ads_id_cus, $quick_adsense_ad_after_para[ $i ] );
|
159 |
+
};
|
160 |
+
}
|
161 |
+
if ( 0 === $quick_adsense_ad_after_image ) {
|
162 |
+
$quick_adsense_ad_after_image_stand_in = $cusrnd;
|
163 |
+
} else {
|
164 |
+
$quick_adsense_ad_after_image_stand_in = $cusads . $quick_adsense_ad_after_image;
|
165 |
+
array_push( $quick_adsense_ads_id_cus, $quick_adsense_ad_after_image );
|
166 |
+
};
|
167 |
+
|
168 |
+
if ( $quick_adsense_enable_position_middle_of_post && ( strpos( $content, '<!--OffMiddle-->' ) === false ) ) {
|
169 |
+
if ( substr_count( strtolower( $content ), '</p>' ) >= 2 ) {
|
170 |
+
$quick_adsense_selected_tag = '</p>';
|
171 |
+
$content = str_replace( '</P>', $quick_adsense_selected_tag, $content );
|
172 |
+
$quick_adsense_temp_array = explode( $quick_adsense_selected_tag, $content );
|
173 |
+
$j = 0;
|
174 |
+
$k = strlen( $content ) / 2;
|
175 |
+
$quick_adsense_temp_array_count = count( $quick_adsense_temp_array );
|
176 |
+
for ( $i = 0; $i < $quick_adsense_temp_array_count; $i++ ) {
|
177 |
+
$j += strlen( $quick_adsense_temp_array[ $i ] ) + 4;
|
178 |
+
if ( $j > $k ) {
|
179 |
+
if ( ( $k - ( $j - strlen( $quick_adsense_temp_array[ $i ] ) ) ) > ( $j - $k ) && $i + 1 < count( $quick_adsense_temp_array ) ) {
|
180 |
+
$quick_adsense_temp_array[ $i + 1 ] = '<!--' . $quick_adsense_ad_middle_of_post_stand_in . '-->' . $quick_adsense_temp_array[ $i + 1 ];
|
181 |
+
} else {
|
182 |
+
$quick_adsense_temp_array[ $i ] = '<!--' . $quick_adsense_ad_middle_of_post_stand_in . '-->' . $quick_adsense_temp_array[ $i ];
|
183 |
+
}
|
184 |
+
break;
|
185 |
+
}
|
186 |
+
$quick_adsense_temp_array_count = count( $quick_adsense_temp_array );
|
187 |
+
}
|
188 |
+
$content = implode( $quick_adsense_selected_tag, $quick_adsense_temp_array );
|
189 |
+
}
|
190 |
+
}
|
191 |
+
if ( $quick_adsense_enable_position_after_more_tag && ( strpos( $content, '<!--OffAfMore-->' ) === false ) ) {
|
192 |
+
$content = str_replace( '<span id="more-' . get_the_ID() . '"></span>', '<!--' . $quick_adsense_ad_after_more_tag_stand_in . '-->', $content );
|
193 |
+
}
|
194 |
+
if ( $quick_adsense_enable_position_beginning_of_post && ( strpos( $content, '<!--OffBegin-->' ) === false ) ) {
|
195 |
+
$content = '<!--' . $quick_adsense_ad_beginning_of_post_stand_in . '-->' . $content;
|
196 |
+
}
|
197 |
+
if ( $quick_adsense_enable_position_end_of_post && ( strpos( $content, '<!--OffEnd-->' ) === false ) ) {
|
198 |
+
$content = $content . '<!--' . $quick_adsense_ad_end_of_post_stand_in . '-->';
|
199 |
+
}
|
200 |
+
if ( $quick_adsense_enable_position_before_last_para && ( strpos( $content, '<!--OffBfLastPara-->' ) === false ) ) {
|
201 |
+
$quick_adsense_selected_tag = '<p>';
|
202 |
+
$content = str_replace( '<P>', $quick_adsense_selected_tag, $content );
|
203 |
+
$quick_adsense_temp_array = explode( $quick_adsense_selected_tag, $content );
|
204 |
+
if ( count( $quick_adsense_temp_array ) > 2 ) {
|
205 |
+
$content = implode( $quick_adsense_selected_tag, array_slice( $quick_adsense_temp_array, 0, count( $quick_adsense_temp_array ) - 1 ) ) . '<!--' . $quick_adsense_ad_before_last_para_stand_in . '-->' . $quick_adsense_selected_tag . $quick_adsense_temp_array[ count( $quick_adsense_temp_array ) - 1 ];
|
206 |
+
}
|
207 |
+
}
|
208 |
+
for ( $i = 1; $i <= 3; $i++ ) {
|
209 |
+
if ( $quick_adsense_enable_position_after_para[ $i ] ) {
|
210 |
+
$quick_adsense_selected_tag = '</p>';
|
211 |
+
$content = str_replace( '</P>', $quick_adsense_selected_tag, $content );
|
212 |
+
$quick_adsense_temp_array = explode( $quick_adsense_selected_tag, $content );
|
213 |
+
if ( (int) $quick_adsense_position_after_para[ $i ] < count( $quick_adsense_temp_array ) ) {
|
214 |
+
$content = implode( $quick_adsense_selected_tag, array_slice( $quick_adsense_temp_array, 0, $quick_adsense_position_after_para[ $i ] ) ) . $quick_adsense_selected_tag . '<!--' . $quick_adsense_ad_after_para_stand_in[ $i ] . '-->' . implode( $quick_adsense_selected_tag, array_slice( $quick_adsense_temp_array, $quick_adsense_position_after_para[ $i ] ) );
|
215 |
+
} elseif ( $quick_adsense_enable_jump_position_after_para[ $i ] ) {
|
216 |
+
$content = implode( $quick_adsense_selected_tag, $quick_adsense_temp_array ) . '<!--' . $quick_adsense_ad_after_para_stand_in[ $i ] . '-->';
|
217 |
+
}
|
218 |
+
}
|
219 |
+
}
|
220 |
+
if ( $quick_adsense_enable_position_after_image ) {
|
221 |
+
$quick_adsense_selected_tag = '<img';
|
222 |
+
$j = '>';
|
223 |
+
$k = '[/caption]';
|
224 |
+
$l = '</a>';
|
225 |
+
$content = str_replace( '<IMG', $quick_adsense_selected_tag, $content );
|
226 |
+
$content = str_replace( '</A>', $l, $content );
|
227 |
+
$quick_adsense_temp_array = explode( $quick_adsense_selected_tag, $content );
|
228 |
+
if ( (int) $quick_adsense_position_after_image < count( $quick_adsense_temp_array ) ) {
|
229 |
+
$m = explode( $j, $quick_adsense_temp_array[ $quick_adsense_position_after_image ] );
|
230 |
+
if ( count( $m ) > 1 ) {
|
231 |
+
$n = explode( $k, $quick_adsense_temp_array[ $quick_adsense_position_after_image ] );
|
232 |
+
$o = ( count( $n ) > 1 ) ? ( strpos( strtolower( $n[0] ), '[caption ' ) === false ) : false;
|
233 |
+
$p = explode( $l, $quick_adsense_temp_array[ $quick_adsense_position_after_image ] );
|
234 |
+
$q = ( count( $p ) > 1 ) ? ( strpos( strtolower( $p[0] ), '<a href' ) === false ) : false;
|
235 |
+
if ( $quick_adsense_enable_jump_position_after_image && $o ) {
|
236 |
+
$quick_adsense_temp_array[ $quick_adsense_position_after_image ] = implode( $k, array_slice( $n, 0, 1 ) ) . $k . "\r\n" . '<!--' . $quick_adsense_ad_after_image_stand_in . '-->' . "\r\n" . implode( $k, array_slice( $n, 1 ) );
|
237 |
+
} elseif ( $q ) {
|
238 |
+
$quick_adsense_temp_array[ $quick_adsense_position_after_image ] = implode( $l, array_slice( $p, 0, 1 ) ) . $l . "\r\n" . '<!--' . $quick_adsense_ad_after_image_stand_in . '-->' . "\r\n" . implode( $l, array_slice( $p, 1 ) );
|
239 |
+
} else {
|
240 |
+
$quick_adsense_temp_array[ $quick_adsense_position_after_image ] = implode( $j, array_slice( $m, 0, 1 ) ) . $j . "\r\n" . '<!--' . $quick_adsense_ad_after_image_stand_in . '-->' . "\r\n" . implode( $j, array_slice( $m, 1 ) );
|
241 |
+
}
|
242 |
+
}
|
243 |
+
$content = implode( $quick_adsense_selected_tag, $quick_adsense_temp_array );
|
244 |
+
}
|
245 |
+
}
|
246 |
+
}
|
247 |
+
/* End Insert StandIns for all Ad Blocks */
|
248 |
+
|
249 |
+
/* Begin Replace StandIns for all Ad Blocks */
|
250 |
+
$content = '<!--EmptyClear-->' . $content . "\n" . '<div style="font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;"></div>';
|
251 |
+
$content = quick_adsense_content_clean_tags( $content, true );
|
252 |
+
$ismany = ( ! is_single() && ! is_page() );
|
253 |
+
$showall = ( ( isset( $settings['enable_all_possible_ads'] ) ) ? $settings['enable_all_possible_ads'] : '' );
|
254 |
+
|
255 |
+
if ( ! $offdef ) {
|
256 |
+
$quick_adsense_ads_id_cus_count = count( $quick_adsense_ads_id_cus );
|
257 |
+
for ( $i = 1; $i <= $quick_adsense_ads_id_cus_count; $i++ ) {
|
258 |
+
if ( $showall || ! $ismany || $i !== $quick_adsense_begin_end ) {
|
259 |
+
if ( ( ( strpos( $content, '<!--' . $cusads . $quick_adsense_ads_id_cus[ $i - 1 ] . '-->' ) !== false ) || ( strpos( $content, '<!--' . $cusads . $quick_adsense_ads_id_cus[ $i - 1 ] . '-->' ) !== false ) ) && in_array( $quick_adsense_ads_id_cus[ $i - 1 ], $quick_adsense_ads_id, true ) ) {
|
260 |
+
$content = quick_adsense_content_replace_ads( $content, $cusads . $quick_adsense_ads_id_cus[ $i - 1 ], $quick_adsense_ads_id_cus[ $i - 1 ] );
|
261 |
+
$content = quick_adsense_content_replace_ads( $content, $cusads . $quick_adsense_ads_id_cus[ $i - 1 ], $quick_adsense_ads_id_cus[ $i - 1 ] );
|
262 |
+
$quick_adsense_ads_id = quick_adsense_content_del_element( $quick_adsense_ads_id, array_search( $quick_adsense_ads_id_cus[ $i - 1 ], $quick_adsense_ads_id, true ) );
|
263 |
+
$quick_adsense_ads_displayed++;
|
264 |
+
if ( $quick_adsense_ads_displayed >= $quick_adsense_ads_to_display || ! count( $quick_adsense_ads_id ) ) {
|
265 |
+
$content = quick_adsense_content_clean_tags( $content );
|
266 |
+
return $content;
|
267 |
+
};
|
268 |
+
$quick_adsense_begin_end = $i;
|
269 |
+
if ( ! $showall && $ismany ) {
|
270 |
+
break;
|
271 |
+
}
|
272 |
+
}
|
273 |
+
}
|
274 |
+
$quick_adsense_ads_id_cus_count = count( $quick_adsense_ads_id_cus );
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
if ( $showall || ! $ismany ) {
|
279 |
+
$j = 0;
|
280 |
+
$quick_adsense_ads_id_count = count( $quick_adsense_ads_id );
|
281 |
+
for ( $i = 1; $i <= $quick_adsense_ads_id_count; $i++ ) {
|
282 |
+
if ( strpos( $content, '<!--Ads' . $quick_adsense_ads_id[ $j ] . '-->' ) !== false ) {
|
283 |
+
$content = quick_adsense_content_replace_ads( $content, 'Ads' . $quick_adsense_ads_id[ $j ], $quick_adsense_ads_id[ $j ] );
|
284 |
+
$quick_adsense_ads_id = quick_adsense_content_del_element( $quick_adsense_ads_id, $j );
|
285 |
+
$quick_adsense_ads_displayed++;
|
286 |
+
if ( ( $quick_adsense_ads_displayed >= $quick_adsense_ads_to_display ) || ! count( $quick_adsense_ads_id ) ) {
|
287 |
+
$content = quick_adsense_content_clean_tags( $content );
|
288 |
+
return $content;
|
289 |
+
};
|
290 |
+
} else {
|
291 |
+
$j++;
|
292 |
+
}
|
293 |
+
$quick_adsense_ads_id_count = count( $quick_adsense_ads_id );
|
294 |
+
}
|
295 |
+
}
|
296 |
+
|
297 |
+
if ( ( strpos( $content, '<!--' . $cusrnd . '-->' ) !== false ) && ( $showall || ! $ismany ) ) {
|
298 |
+
$j = substr_count( $content, '<!--' . $cusrnd . '-->' );
|
299 |
+
for ( $i = count( $quick_adsense_ads_id ); $i <= $j - 1; $i++ ) {
|
300 |
+
array_push( $quick_adsense_ads_id, -1 );
|
301 |
+
}
|
302 |
+
shuffle( $quick_adsense_ads_id );
|
303 |
+
for ( $i = 1; $i <= $j; $i++ ) {
|
304 |
+
$content = quick_adsense_content_replace_ads( $content, $cusrnd, $quick_adsense_ads_id[0] );
|
305 |
+
$quick_adsense_ads_id = quick_adsense_content_del_element( $quick_adsense_ads_id, 0 );
|
306 |
+
$quick_adsense_ads_displayed++;
|
307 |
+
if ( ( $quick_adsense_ads_displayed >= $quick_adsense_ads_to_display ) || ! count( $quick_adsense_ads_id ) ) {
|
308 |
+
$content = quick_adsense_content_clean_tags( $content );
|
309 |
+
return $content;
|
310 |
+
};
|
311 |
+
}
|
312 |
+
}
|
313 |
+
if ( ( strpos( $content, '<!--' . $cusrnd . '-->' ) !== false ) && ( $showall || ! $ismany ) ) {
|
314 |
+
$quick_adsense_ads_id = $quick_adsense_ads_id;
|
315 |
+
$key = array_search( '100', $quick_adsense_ads_id, true );
|
316 |
+
if ( false !== $key ) {
|
317 |
+
unset( $quick_adsense_ads_id[ $key ] );
|
318 |
+
}
|
319 |
+
$j = substr_count( $content, '<!--' . $cusrnd . '-->' );
|
320 |
+
for ( $i = count( $quick_adsense_ads_id ); $i <= $j - 1; $i++ ) {
|
321 |
+
array_push( $quick_adsense_ads_id, -1 );
|
322 |
+
}
|
323 |
+
shuffle( $quick_adsense_ads_id );
|
324 |
+
for ( $i = 1; $i <= $j; $i++ ) {
|
325 |
+
$content = quick_adsense_content_replace_ads( $content, $cusrnd, $quick_adsense_ads_id[0] );
|
326 |
+
$quick_adsense_ads_id = quick_adsense_content_del_element( $quick_adsense_ads_id, 0 );
|
327 |
+
$quick_adsense_ads_displayed++;
|
328 |
+
if ( ( $quick_adsense_ads_displayed >= $quick_adsense_ads_to_display ) || ! count( $quick_adsense_ads_id ) ) {
|
329 |
+
$content = quick_adsense_content_clean_tags( $content );
|
330 |
+
return $content;
|
331 |
+
};
|
332 |
+
}
|
333 |
+
}
|
334 |
+
|
335 |
+
if ( strpos( $content, '<!--RndAds-->' ) !== false && ( $showall || ! $ismany ) ) {
|
336 |
+
$quick_adsense_ads_id_tmp = [];
|
337 |
+
shuffle( $quick_adsense_ads_id );
|
338 |
+
for ( $i = 1; $i <= ( $quick_adsense_ads_to_display - $quick_adsense_ads_displayed ); $i++ ) {
|
339 |
+
if ( $i <= count( $quick_adsense_ads_id ) ) {
|
340 |
+
array_push( $quick_adsense_ads_id_tmp, $quick_adsense_ads_id[ $i - 1 ] );
|
341 |
+
}
|
342 |
+
}
|
343 |
+
$j = substr_count( $content, '<!--RndAds-->' );
|
344 |
+
for ( $i = count( $quick_adsense_ads_id_tmp ); $i <= $j - 1; $i++ ) {
|
345 |
+
array_push( $quick_adsense_ads_id_tmp, -1 );
|
346 |
+
}
|
347 |
+
shuffle( $quick_adsense_ads_id_tmp );
|
348 |
+
for ( $i = 1; $i <= $j; $i++ ) {
|
349 |
+
$tmp = $quick_adsense_ads_id_tmp[0];
|
350 |
+
$content = quick_adsense_content_replace_ads( $content, 'RndAds', $quick_adsense_ads_id_tmp[0] );
|
351 |
+
$quick_adsense_ads_id_tmp = quick_adsense_content_del_element( $quick_adsense_ads_id_tmp, 0 );
|
352 |
+
if ( -1 !== $tmp ) {
|
353 |
+
$quick_adsense_ads_displayed++;
|
354 |
+
};
|
355 |
+
if ( $quick_adsense_ads_displayed >= $quick_adsense_ads_to_display || ! count( $quick_adsense_ads_id_tmp ) ) {
|
356 |
+
$content = quick_adsense_content_clean_tags( $content );
|
357 |
+
return $content;
|
358 |
+
};
|
359 |
+
}
|
360 |
+
}
|
361 |
+
/* End Replace StandIns for all Ad Blocks */
|
362 |
+
|
363 |
+
$content = quick_adsense_content_clean_tags( $content );
|
364 |
+
return $content;
|
365 |
+
}
|
366 |
+
);
|
367 |
+
|
368 |
+
/**
|
369 |
+
* This function checks whether the ads are active on a post.
|
370 |
+
*
|
371 |
+
* @param array $settings The user settings.
|
372 |
+
* @param string $content The content.
|
373 |
+
*
|
374 |
+
* @return boolean true on success, false on faliure.
|
375 |
+
*/
|
376 |
+
function quick_adsense_postads_isactive( $settings, $content ) {
|
377 |
+
if ( is_feed() ) {
|
378 |
+
return false;
|
379 |
+
} elseif ( strpos( $content, '<!--NoAds-->' ) !== false ) {
|
380 |
+
return false;
|
381 |
+
} elseif ( strpos( $content, '<!--OffAds-->' ) !== false ) {
|
382 |
+
return false;
|
383 |
+
} elseif ( is_single() && ! ( isset( $settings['enable_on_posts'] ) ) ) {
|
384 |
+
return false;
|
385 |
+
} elseif ( is_page() && ! ( isset( $settings['enable_on_pages'] ) ) ) {
|
386 |
+
return false;
|
387 |
+
} elseif ( is_home() && ! ( isset( $settings['enable_on_homepage'] ) ) ) {
|
388 |
+
return false;
|
389 |
+
} elseif ( is_category() && ! ( isset( $settings['enable_on_categories'] ) ) ) {
|
390 |
+
return false;
|
391 |
+
} elseif ( is_archive() && ! ( isset( $settings['enable_on_archives'] ) ) ) {
|
392 |
+
return false;
|
393 |
+
} elseif ( is_tag() && ! ( isset( $settings['enable_on_tags'] ) ) ) {
|
394 |
+
return false;
|
395 |
+
} elseif ( is_user_logged_in() && ( isset( $settings['disable_for_loggedin_users'] ) ) ) {
|
396 |
+
return false;
|
397 |
+
} else {
|
398 |
+
return true;
|
399 |
+
}
|
400 |
+
}
|
401 |
+
|
402 |
+
/**
|
403 |
+
* This function removes the quicktags from the content.
|
404 |
+
*
|
405 |
+
* @param string $content The content.
|
406 |
+
* @param boolean $trimonly Just trim (remove p tags around the quicktag) or completly remove the quicktag.
|
407 |
+
*
|
408 |
+
* @return string The processed content.
|
409 |
+
*/
|
410 |
+
function quick_adsense_content_clean_tags( $content, $trimonly = false ) {
|
411 |
+
global $quick_adsense_ads_displayed;
|
412 |
+
global $quick_adsense_ads_id;
|
413 |
+
global $quick_adsense_begin_end;
|
414 |
+
$quicktags = [
|
415 |
+
'EmptyClear',
|
416 |
+
'RndAds',
|
417 |
+
'NoAds',
|
418 |
+
'OffDef',
|
419 |
+
'OffAds',
|
420 |
+
'OffWidget',
|
421 |
+
'OffBegin',
|
422 |
+
'OffMiddle',
|
423 |
+
'OffEnd',
|
424 |
+
'OffBfMore',
|
425 |
+
'OffAfLastPara',
|
426 |
+
'CusRnd',
|
427 |
+
];
|
428 |
+
for ( $i = 1; $i <= 10; $i++ ) {
|
429 |
+
array_push( $quicktags, 'CusAds' . $i );
|
430 |
+
array_push( $quicktags, 'Ads' . $i );
|
431 |
+
};
|
432 |
+
foreach ( $quicktags as $quicktag ) {
|
433 |
+
if ( ( strpos( $content, '<!--' . $quicktag . '-->' ) !== false ) || ( 'EmptyClear' === $quicktag ) ) {
|
434 |
+
if ( $trimonly ) {
|
435 |
+
$content = str_replace( '<p><!--' . $quicktag . '--></p>', '<!--' . $quicktag . '-->', $content );
|
436 |
+
} else {
|
437 |
+
$content = str_replace( [ '<p><!--' . $quicktag . '--></p>', '<!--' . $quicktag . '-->' ], '', $content );
|
438 |
+
$content = str_replace( '##QA-TP1##', '<p></p>', $content );
|
439 |
+
$content = str_replace( '##QA-TP2##', '<p> </p>', $content );
|
440 |
+
}
|
441 |
+
}
|
442 |
+
}
|
443 |
+
if ( ! $trimonly && ( is_single() || is_page() ) ) {
|
444 |
+
$quick_adsense_ads_displayed = 0;
|
445 |
+
$quick_adsense_ads_id = [];
|
446 |
+
$quick_adsense_begin_end = 0;
|
447 |
+
}
|
448 |
+
return $content;
|
449 |
+
}
|
450 |
+
|
451 |
+
/**
|
452 |
+
* This function replaces the quicktag with the actual ad.
|
453 |
+
*
|
454 |
+
* @param string $content The content.
|
455 |
+
* @param string $quicktag The quicktag.
|
456 |
+
* @param integer $ad_index The array index.
|
457 |
+
*
|
458 |
+
* @return string The processed content.
|
459 |
+
*/
|
460 |
+
function quick_adsense_content_replace_ads( $content, $quicktag, $ad_index ) {
|
461 |
+
if ( strpos( $content, '<!--' . $quicktag . '-->' ) === false ) {
|
462 |
+
return $content;
|
463 |
+
}
|
464 |
+
$settings = get_option( 'quick_adsense_settings' );
|
465 |
+
$onpost_ad_styles = [
|
466 |
+
'',
|
467 |
+
'float: left; margin: %1$dpx %1$dpx %1$dpx 0;',
|
468 |
+
'float: none; margin:%1$dpx 0 %1$dpx 0; text-align:center;',
|
469 |
+
'float: right; margin:%1$dpx 0 %1$dpx %1$dpx;',
|
470 |
+
'float: none; margin:0px;',
|
471 |
+
];
|
472 |
+
|
473 |
+
if ( ( -1 !== $ad_index ) ) {
|
474 |
+
$onpost_ad_alignment = ( ( isset( $settings[ 'onpost_ad_' . $ad_index . '_alignment' ] ) ) ? $settings[ 'onpost_ad_' . $ad_index . '_alignment' ] : '' );
|
475 |
+
$onpost_ad_margin = ( ( isset( $settings[ 'onpost_ad_' . $ad_index . '_margin' ] ) ) ? $settings[ 'onpost_ad_' . $ad_index . '_margin' ] : '' );
|
476 |
+
$onpost_ad_style = sprintf( $onpost_ad_styles[ (int) $onpost_ad_alignment ], $onpost_ad_margin );
|
477 |
+
$onpost_ad_code = ( ( isset( $settings[ 'onpost_ad_' . $ad_index . '_content' ] ) ) ? $settings[ 'onpost_ad_' . $ad_index . '_content' ] : '' );
|
478 |
+
$onpost_ad_code = '<div class="' . md5( get_bloginfo( 'url' ) ) . '" data-index="' . $ad_index . '" style="' . $onpost_ad_style . '">' . "\n" . $onpost_ad_code . "\n" . '</div>' . "\n";
|
479 |
+
} else {
|
480 |
+
$onpost_ad_code = '';
|
481 |
+
}
|
482 |
+
$content = explode( '<!--' . $quicktag . '-->', $content, 2 );
|
483 |
+
return $content[0] . $onpost_ad_code . $content[1];
|
484 |
+
}
|
485 |
+
|
486 |
+
/**
|
487 |
+
* Delete the selected item from the array by index.
|
488 |
+
*
|
489 |
+
* @param array $quick_adsense_temp_array The input array.
|
490 |
+
* @param integer $index The array index.
|
491 |
+
*
|
492 |
+
* @return array The processed array.
|
493 |
+
*/
|
494 |
+
function quick_adsense_content_del_element( $quick_adsense_temp_array, $index ) {
|
495 |
+
$copy = [];
|
496 |
+
if ( function_exists( 'quick_adsense_postads_update_impressions' ) ) {
|
497 |
+
quick_adsense_postads_update_impressions( $quick_adsense_temp_array[ $index ] );
|
498 |
+
}
|
499 |
+
$quick_adsense_temp_array_count = count( $quick_adsense_temp_array );
|
500 |
+
for ( $i = 0; $i < $quick_adsense_temp_array_count; $i++ ) {
|
501 |
+
if ( $index !== $i ) {
|
502 |
+
array_push( $copy, $quick_adsense_temp_array[ $i ] );
|
503 |
+
$quick_adsense_temp_array_count = count( $quick_adsense_temp_array );
|
504 |
+
}
|
505 |
+
}
|
506 |
+
return $copy;
|
507 |
+
}
|
508 |
+
|
509 |
+
/**
|
510 |
+
* This function checks if the selected ad is active basedon the user settings.
|
511 |
+
*
|
512 |
+
* @param array $settings The user settings.
|
513 |
+
* @param integer $index The ad index.
|
514 |
+
*
|
515 |
+
* @return boolean true on success, false on faliure.
|
516 |
+
*/
|
517 |
+
function quick_adsense_advanced_postads_isactive( $settings, $index ) {
|
518 |
+
$mobile_detect = new Mobile_Detect();
|
519 |
+
// Begin Device Type.
|
520 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_device_mobile' ] ) && $mobile_detect->isMobile() ) {
|
521 |
+
return false;
|
522 |
+
}
|
523 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_device_tablet' ] ) && $mobile_detect->isTablet() ) {
|
524 |
+
return false;
|
525 |
+
}
|
526 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_device_desktop' ] ) && ! $mobile_detect->isMobile() && ! $mobile_detect->isTablet() ) {
|
527 |
+
return false;
|
528 |
+
}
|
529 |
+
// End Device Type.
|
530 |
+
// Begin Visitor Source.
|
531 |
+
$referer = quick_adsense_get_value( $_SERVER, 'HTTP_REFERER' );
|
532 |
+
if ( '' === $referer ) {
|
533 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_visitor_direct' ] ) ) {
|
534 |
+
return false;
|
535 |
+
}
|
536 |
+
} else {
|
537 |
+
if ( preg_match( '/www\.google.*|search\.msn.*|search\.yahoo.*|www\.bing.*|msxml\.excite\.com|search.lycos\.com|www\.alltheweb\.com|search\.aol\.com|ask\.com|www\.hotbot\.com|www\.metacrawler\.com|search\.netscape\.com|go\.google\.com|dpxml\.webcrawler\.com|search\.earthlink\.net|www\.ask\.co\.uk/i', $referer ) ) {
|
538 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_visitor_searchengine' ] ) ) {
|
539 |
+
return false;
|
540 |
+
}
|
541 |
+
} else {
|
542 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_visitor_indirect' ] ) ) {
|
543 |
+
return false;
|
544 |
+
}
|
545 |
+
}
|
546 |
+
}
|
547 |
+
// End Visitor Source.
|
548 |
+
// Begin Visitor Type.
|
549 |
+
if ( is_user_logged_in() ) {
|
550 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_visitor_loggedin' ] ) ) {
|
551 |
+
return false;
|
552 |
+
}
|
553 |
+
} else {
|
554 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_visitor_guest' ] ) ) {
|
555 |
+
return false;
|
556 |
+
}
|
557 |
+
}
|
558 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_visitor_bot' ] ) && $mobile_detect->is( 'Bot' ) ) {
|
559 |
+
return false;
|
560 |
+
}
|
561 |
+
if (
|
562 |
+
isset( $settings[ 'onpost_ad_' . $index . '_hide_visitor_knownbrowser' ] ) ||
|
563 |
+
isset( $settings[ 'onpost_ad_' . $index . '_hide_visitor_unknownbrowser' ] )
|
564 |
+
) {
|
565 |
+
if (
|
566 |
+
$mobile_detect->match( '/msie|firefox|safari|chrome|edge|opera|netscape|maxthon|konqueror|mobile/i' )
|
567 |
+
) {
|
568 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_visitor_knownbrowser' ] ) ) {
|
569 |
+
return false;
|
570 |
+
}
|
571 |
+
} else {
|
572 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_hide_visitor_unknownbrowser' ] ) ) {
|
573 |
+
return false;
|
574 |
+
}
|
575 |
+
}
|
576 |
+
}
|
577 |
+
// End Visitor Type.
|
578 |
+
// Begin Geotargeting.
|
579 |
+
if ( isset( $settings[ 'onpost_ad_' . $index . '_limit_visitor_country' ] ) && ( is_array( $settings[ 'onpost_ad_' . $index . '_limit_visitor_country' ] ) ) && ( count( $settings[ 'onpost_ad_' . $index . '_limit_visitor_country' ] ) > 0 ) ) {
|
580 |
+
$user_ip = quick_adsense_get_value( $_SERVER, 'REMOTE_ADDR' );
|
581 |
+
if ( '' !== $user_ip ) {
|
582 |
+
$geo_ip = new \iriven\GeoIPCountry();
|
583 |
+
$country_code = $geo_ip->resolve( $user_ip );
|
584 |
+
if ( ! in_array( $country_code, $settings[ 'onpost_ad_' . $index . '_limit_visitor_country' ], true ) ) {
|
585 |
+
return false;
|
586 |
+
}
|
587 |
+
}
|
588 |
+
}
|
589 |
+
// End Geotargeting.
|
590 |
+
return true;
|
591 |
+
}
|
592 |
+
|
593 |
+
/**
|
594 |
+
* This function increments the ad impressions for the ad at the selected index.
|
595 |
+
*
|
596 |
+
* @param integer $index The array index.
|
597 |
+
*/
|
598 |
+
function quick_adsense_postads_update_impressions( $index ) {
|
599 |
+
$settings = get_option( 'quick_adsense_settings' );
|
600 |
+
if ( isset( $settings ) && isset( $settings[ 'onpost_ad_' . $index . '_enable_stats' ] ) ) {
|
601 |
+
$stats = get_option( 'quick_adsense_onpost_ad_' . $index . '_stats' );
|
602 |
+
if ( isset( $stats ) && is_array( $stats ) ) {
|
603 |
+
if ( isset( $stats[ gmdate( 'dmY' ) ] ) ) {
|
604 |
+
$stats[ gmdate( 'dmY' ) ]['i'] += 1;
|
605 |
+
} else {
|
606 |
+
$stats[ gmdate( 'dmY' ) ] = [
|
607 |
+
'i' => 1,
|
608 |
+
'c' => 0,
|
609 |
+
];
|
610 |
+
$stats_count = count( $stats );
|
611 |
+
while ( $stats_count > 30 ) {
|
612 |
+
array_shift( $stats );
|
613 |
+
$stats_count = count( $stats );
|
614 |
+
}
|
615 |
+
}
|
616 |
+
} else {
|
617 |
+
$stats = [
|
618 |
+
gmdate( 'dmY' ) => [
|
619 |
+
'i' => 1,
|
620 |
+
'c' => 0,
|
621 |
+
],
|
622 |
+
];
|
623 |
+
}
|
624 |
+
update_option( 'quick_adsense_onpost_ad_' . $index . '_stats', $stats );
|
625 |
+
}
|
626 |
+
}
|
627 |
+
|
628 |
+
/**
|
629 |
+
* Add inline script to frontend to record ad stats.
|
630 |
+
*/
|
631 |
+
add_action(
|
632 |
+
'wp_enqueue_scripts',
|
633 |
+
function() {
|
634 |
+
wp_enqueue_script( 'jquery' );
|
635 |
+
wp_add_inline_script(
|
636 |
+
'jquery',
|
637 |
+
quick_adsense_load_file(
|
638 |
+
'templates/js/script-frontend-stats.php',
|
639 |
+
[
|
640 |
+
'target' => md5( get_bloginfo( 'url' ) ),
|
641 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
642 |
+
'nonce' => wp_create_nonce( 'quick-adsense-stats' ),
|
643 |
+
]
|
644 |
+
)
|
645 |
+
);
|
646 |
+
}
|
647 |
+
);
|
648 |
+
|
649 |
+
|
650 |
+
add_action( 'wp_ajax_quick_adsense_onpost_ad_click', 'quick_adsense_onpost_ad_click' );
|
651 |
+
add_action( 'wp_ajax_nopriv_quick_adsense_onpost_ad_click', 'quick_adsense_onpost_ad_click' );
|
652 |
+
/**
|
653 |
+
* Ajax handler for "quick_adsense_onpost_ad_click" action which updates the ad click stats.
|
654 |
+
*/
|
655 |
+
function quick_adsense_onpost_ad_click() {
|
656 |
+
if ( isset( $_POST['quick_adsense_nonce'] ) && wp_verify_nonce( sanitize_key( $_POST['quick_adsense_nonce'] ), 'quick-adsense-stats' ) ) {
|
657 |
+
if ( isset( $_POST['quick_adsense_onpost_ad_index'] ) ) {
|
658 |
+
$index = sanitize_key( $_POST['quick_adsense_onpost_ad_index'] );
|
659 |
+
$settings = get_option( 'quick_adsense_settings' );
|
660 |
+
if ( isset( $settings ) && isset( $settings[ 'onpost_ad_' . $index . '_enable_stats' ] ) ) {
|
661 |
+
$stats = get_option( 'quick_adsense_onpost_ad_' . $index . '_stats' );
|
662 |
+
if ( isset( $stats ) && is_array( $stats ) ) {
|
663 |
+
if ( isset( $stats[ gmdate( 'dmY' ) ] ) ) {
|
664 |
+
$stats[ gmdate( 'dmY' ) ]['c'] += 1;
|
665 |
+
} else {
|
666 |
+
$stats[ gmdate( 'dmY' ) ] = [
|
667 |
+
'i' => 0,
|
668 |
+
'c' => 1,
|
669 |
+
];
|
670 |
+
$stats_count = count( $stats );
|
671 |
+
while ( $stats_count > 30 ) {
|
672 |
+
array_shift( $stats );
|
673 |
+
$stats_count = count( $stats );
|
674 |
+
}
|
675 |
+
}
|
676 |
+
} else {
|
677 |
+
$stats = [
|
678 |
+
gmdate( 'dmY' ) => [
|
679 |
+
'i' => 0,
|
680 |
+
'c' => 1,
|
681 |
+
],
|
682 |
+
];
|
683 |
+
}
|
684 |
+
update_option( 'quick_adsense_onpost_ad_' . $index . '_stats', $stats );
|
685 |
+
wp_send_json_success();
|
686 |
+
}
|
687 |
+
}
|
688 |
+
}
|
689 |
+
wp_send_json_error();
|
690 |
+
}
|
691 |
+
|
includes/controls.php
CHANGED
@@ -1,90 +1,181 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
$output .= '<
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
$output .= '<
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
$output .= '<
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
$output .= '</
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
$output .= '<
|
73 |
-
}
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Function to return the markup to display an HTML user input element.
|
4 |
+
*
|
5 |
+
* @param string $type The element type.
|
6 |
+
* @param string $label The element label.
|
7 |
+
* @param string $id The element id.
|
8 |
+
* @param string $name The element name.
|
9 |
+
* @param string $value The element value.
|
10 |
+
* @param array $data The element data. Eg for options in a select.
|
11 |
+
* @param string $class The element classes.
|
12 |
+
* @param string $style The element styles.
|
13 |
+
* @param string $placeholder The element placeholder.
|
14 |
+
*
|
15 |
+
* @return string the markup for the HTML element.
|
16 |
+
*/
|
17 |
+
function quickadsense_get_control( $type, $label, $id, $name, $value = '', $data = null, $class = 'input widefat', $style = '', $placeholder = '' ) {
|
18 |
+
$output = '';
|
19 |
+
switch ( $type ) {
|
20 |
+
case 'hidden':
|
21 |
+
$output .= '<input type="text" id="' . $id . '" name="' . $name . '" value="' . $value . '" style="display: none;" />';
|
22 |
+
break;
|
23 |
+
case 'text':
|
24 |
+
if ( '' !== $label ) {
|
25 |
+
$output .= '<label for="' . $name . '">' . $label . '</label>';
|
26 |
+
}
|
27 |
+
$output .= '<input type="text" id="' . $id . '" name="' . $name . '" value="' . $value . '" class="multilanguage-input ' . $class . '" style="' . $style . '" placeholder="' . $placeholder . '" />';
|
28 |
+
break;
|
29 |
+
case 'password':
|
30 |
+
if ( '' !== $label ) {
|
31 |
+
$output .= '<label for="' . $name . '">' . $label . '</label>';
|
32 |
+
}
|
33 |
+
$output .= '<input type="password" id="' . $id . '" name="' . $name . '" value="' . $value . '" class="multilanguage-input ' . $class . '" style="' . $style . '" placeholder="' . $placeholder . '" />';
|
34 |
+
break;
|
35 |
+
case 'number':
|
36 |
+
if ( '' !== $label ) {
|
37 |
+
$output .= '<label for="' . $name . '">' . $label . '</label>';
|
38 |
+
}
|
39 |
+
$output .= '<input type="number" id="' . $id . '" name="' . $name . '" value="' . $value . '" class="multilanguage-input ' . $class . '" style="' . $style . '" placeholder="' . $placeholder . '" />';
|
40 |
+
break;
|
41 |
+
case 'checkbox':
|
42 |
+
$output .= '<input type="checkbox" id="' . $id . '" name="' . $name . '" value="1" class="input" ' . checked( $value, 1, false ) . ' style="' . $style . '" />';
|
43 |
+
if ( '' !== $label ) {
|
44 |
+
$output .= '<label for="' . $name . '">' . $label . '</label>';
|
45 |
+
}
|
46 |
+
break;
|
47 |
+
case 'textarea':
|
48 |
+
if ( '' !== $label ) {
|
49 |
+
$output .= '<label for="' . $name . '">' . $label . '</label><br />';
|
50 |
+
}
|
51 |
+
$output .= '<textarea id="' . $id . '" name="' . $name . '" class="multilanguage-input ' . $class . '" class="multilanguage-input ' . $class . '" style="height: 100px; ' . $style . '" placeholder="' . $placeholder . '">' . $value . '</textarea>';
|
52 |
+
break;
|
53 |
+
case 'textarea-big':
|
54 |
+
if ( '' !== $label ) {
|
55 |
+
$output .= '<label for="' . $name . '">' . $label . '</label><br />';
|
56 |
+
}
|
57 |
+
$output .= '<textarea id="' . $id . '" name="' . $name . '" class="multilanguage-input ' . $class . '" class="multilanguage-input ' . $class . '" style="height: 300px; ' . $style . '" placeholder="' . $placeholder . '">' . $value . '</textarea>';
|
58 |
+
break;
|
59 |
+
case 'select':
|
60 |
+
if ( '' !== $label ) {
|
61 |
+
$output .= '<label for="' . $name . '">' . $label . '</label>';
|
62 |
+
}
|
63 |
+
$output .= '<select id="' . $id . '" name="' . $name . '" class="' . $class . '" style="' . $style . '" >';
|
64 |
+
if ( $data ) {
|
65 |
+
foreach ( $data as $option ) {
|
66 |
+
$metadata = '';
|
67 |
+
if ( isset( $option['metadata'] ) && is_array( $option['metadata'] ) ) {
|
68 |
+
foreach ( $option['metadata'] as $key => $metavalue ) {
|
69 |
+
$metadata .= 'data-' . $key . '="' . $metavalue . '"';
|
70 |
+
}
|
71 |
+
}
|
72 |
+
$output .= '<option ' . $metadata . ' value="' . $option['value'] . '" ' . selected( $value, $option['value'], false ) . '>' . $option['text'] . '</option>';
|
73 |
+
}
|
74 |
+
}
|
75 |
+
$output .= '</select>';
|
76 |
+
break;
|
77 |
+
case 'upload':
|
78 |
+
if ( '' !== $label ) {
|
79 |
+
$output .= '<label for="' . $name . '">' . $label . '</label><br />';
|
80 |
+
}
|
81 |
+
$output .= '<input type="text" id="' . $id . '" name="' . $name . '" value="' . $value . '" class="' . $class . '" class="width: 74%;" style="' . $style . '" />';
|
82 |
+
$output .= '<input type="button" value="Upload Image" class="quick_adsense_uploader_button" id="upload_image_button" class="width: 25%;" />';
|
83 |
+
break;
|
84 |
+
case 'multiselect':
|
85 |
+
if ( '' !== $label ) {
|
86 |
+
$output .= '<label for="' . $name . '">' . $label . '</label><br />';
|
87 |
+
}
|
88 |
+
$output .= '<select id="' . $id . '" name="' . $name . '" class="' . $class . '" multiple="multiple" style="height: 120px; ' . $style . '" >';
|
89 |
+
if ( $data ) {
|
90 |
+
foreach ( $data as $option ) {
|
91 |
+
if ( is_array( $value ) && in_array( $option['value'], $value, true ) ) {
|
92 |
+
$output .= '<option value="' . $option['value'] . '" selected="selected">' . $option['text'] . '</option>';
|
93 |
+
} else {
|
94 |
+
$output .= '<option value="' . $option['value'] . '">' . $option['text'] . '</option>';
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
$output .= '</select>';
|
99 |
+
break;
|
100 |
+
}
|
101 |
+
return $output;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Check for null and empty and returns the value or the default
|
106 |
+
*
|
107 |
+
* @param array $data The data.
|
108 |
+
* @param string $field_name The name of field/key for data.
|
109 |
+
* @param string $default The default value to send if the selected data value if empty or not set.
|
110 |
+
*/
|
111 |
+
function quick_adsense_get_value( $data, $field_name, $default = '' ) {
|
112 |
+
if ( isset( $data ) && is_array( $data ) && isset( $data[ $field_name ] ) && ( '' !== $data[ $field_name ] ) ) {
|
113 |
+
return $data[ $field_name ];
|
114 |
+
}
|
115 |
+
return $default;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Allowed HTML attributes and tags for the wp_kses function.
|
120 |
+
*/
|
121 |
+
function quick_adsense_get_allowed_html() {
|
122 |
+
$common_html_attributes = [
|
123 |
+
'id' => [],
|
124 |
+
'name' => [],
|
125 |
+
'class' => [],
|
126 |
+
'for' => [],
|
127 |
+
'href' => [],
|
128 |
+
'rel' => [],
|
129 |
+
'title' => [],
|
130 |
+
'datetime' => [],
|
131 |
+
'style' => [],
|
132 |
+
'alt' => [],
|
133 |
+
'height' => [],
|
134 |
+
'src' => [],
|
135 |
+
'width' => [],
|
136 |
+
'type' => [],
|
137 |
+
'value' => [],
|
138 |
+
'checked' => [],
|
139 |
+
'selected' => [],
|
140 |
+
'multiple' => [],
|
141 |
+
'data-index' => [],
|
142 |
+
'onclick' => [],
|
143 |
+
];
|
144 |
+
$common_html_tags = [
|
145 |
+
'a' => $common_html_attributes,
|
146 |
+
'abbr' => $common_html_attributes,
|
147 |
+
'b' => $common_html_attributes,
|
148 |
+
'br' => $common_html_attributes,
|
149 |
+
'blockquote' => $common_html_attributes,
|
150 |
+
'cite' => $common_html_attributes,
|
151 |
+
'code' => $common_html_attributes,
|
152 |
+
'del' => $common_html_attributes,
|
153 |
+
'dd' => $common_html_attributes,
|
154 |
+
'div' => $common_html_attributes,
|
155 |
+
'dl' => $common_html_attributes,
|
156 |
+
'dt' => $common_html_attributes,
|
157 |
+
'em' => $common_html_attributes,
|
158 |
+
'h1' => $common_html_attributes,
|
159 |
+
'h2' => $common_html_attributes,
|
160 |
+
'h3' => $common_html_attributes,
|
161 |
+
'h4' => $common_html_attributes,
|
162 |
+
'h5' => $common_html_attributes,
|
163 |
+
'h6' => $common_html_attributes,
|
164 |
+
'i' => $common_html_attributes,
|
165 |
+
'img' => $common_html_attributes,
|
166 |
+
'label' => $common_html_attributes,
|
167 |
+
'li' => $common_html_attributes,
|
168 |
+
'ol' => $common_html_attributes,
|
169 |
+
'ul' => $common_html_attributes,
|
170 |
+
'p' => $common_html_attributes,
|
171 |
+
'q' => $common_html_attributes,
|
172 |
+
'span' => $common_html_attributes,
|
173 |
+
'strike' => $common_html_attributes,
|
174 |
+
'strong' => $common_html_attributes,
|
175 |
+
'input' => $common_html_attributes,
|
176 |
+
'textarea' => $common_html_attributes,
|
177 |
+
'select' => $common_html_attributes,
|
178 |
+
'option' => $common_html_attributes,
|
179 |
+
];
|
180 |
+
return $common_html_tags;
|
181 |
+
}
|
includes/countries.php
ADDED
@@ -0,0 +1,1000 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This function returns an array of countries and their shortnames.
|
4 |
+
*
|
5 |
+
* @return array Array of country names and shortnames.
|
6 |
+
*/
|
7 |
+
function quick_adsense_get_countries() {
|
8 |
+
$data = [
|
9 |
+
[
|
10 |
+
'value' => 'AD',
|
11 |
+
'text' => 'Andorra',
|
12 |
+
],
|
13 |
+
[
|
14 |
+
'value' => 'AE',
|
15 |
+
'text' => 'United Arab Emirates',
|
16 |
+
],
|
17 |
+
[
|
18 |
+
'value' => 'AF',
|
19 |
+
'text' => 'Afghanistan',
|
20 |
+
],
|
21 |
+
[
|
22 |
+
'value' => 'AG',
|
23 |
+
'text' => 'Antigua and Barbuda',
|
24 |
+
],
|
25 |
+
[
|
26 |
+
'value' => 'AI',
|
27 |
+
'text' => 'Anguilla',
|
28 |
+
],
|
29 |
+
[
|
30 |
+
'value' => 'AL',
|
31 |
+
'text' => 'Albania',
|
32 |
+
],
|
33 |
+
[
|
34 |
+
'value' => 'AM',
|
35 |
+
'text' => 'Armenia',
|
36 |
+
],
|
37 |
+
[
|
38 |
+
'value' => 'AN',
|
39 |
+
'text' => 'Netherlands Antilles',
|
40 |
+
],
|
41 |
+
[
|
42 |
+
'value' => 'AO',
|
43 |
+
'text' => 'Angola',
|
44 |
+
],
|
45 |
+
[
|
46 |
+
'value' => 'AQ',
|
47 |
+
'text' => 'Antarctica',
|
48 |
+
],
|
49 |
+
[
|
50 |
+
'value' => 'AR',
|
51 |
+
'text' => 'Argentina',
|
52 |
+
],
|
53 |
+
[
|
54 |
+
'value' => 'AS',
|
55 |
+
'text' => 'American Samoa',
|
56 |
+
],
|
57 |
+
[
|
58 |
+
'value' => 'AT',
|
59 |
+
'text' => 'Austria',
|
60 |
+
],
|
61 |
+
[
|
62 |
+
'value' => 'AU',
|
63 |
+
'text' => 'Australia',
|
64 |
+
],
|
65 |
+
[
|
66 |
+
'value' => 'AW',
|
67 |
+
'text' => 'Aruba',
|
68 |
+
],
|
69 |
+
[
|
70 |
+
'value' => 'AZ',
|
71 |
+
'text' => 'Azerbaijan',
|
72 |
+
],
|
73 |
+
[
|
74 |
+
'value' => 'BA',
|
75 |
+
'text' => 'Bosnia and Herzegovina',
|
76 |
+
],
|
77 |
+
[
|
78 |
+
'value' => 'BB',
|
79 |
+
'text' => 'Barbados',
|
80 |
+
],
|
81 |
+
[
|
82 |
+
'value' => 'BD',
|
83 |
+
'text' => 'Bangladesh',
|
84 |
+
],
|
85 |
+
[
|
86 |
+
'value' => 'BE',
|
87 |
+
'text' => 'Belgium',
|
88 |
+
],
|
89 |
+
[
|
90 |
+
'value' => 'BF',
|
91 |
+
'text' => 'Burkina Faso',
|
92 |
+
],
|
93 |
+
[
|
94 |
+
'value' => 'BG',
|
95 |
+
'text' => 'Bulgaria',
|
96 |
+
],
|
97 |
+
[
|
98 |
+
'value' => 'BH',
|
99 |
+
'text' => 'Bahrain',
|
100 |
+
],
|
101 |
+
[
|
102 |
+
'value' => 'BI',
|
103 |
+
'text' => 'Burundi',
|
104 |
+
],
|
105 |
+
[
|
106 |
+
'value' => 'BJ',
|
107 |
+
'text' => 'Benin',
|
108 |
+
],
|
109 |
+
[
|
110 |
+
'value' => 'BM',
|
111 |
+
'text' => 'Bermuda',
|
112 |
+
],
|
113 |
+
[
|
114 |
+
'value' => 'BN',
|
115 |
+
'text' => 'Brunei Darussalam',
|
116 |
+
],
|
117 |
+
[
|
118 |
+
'value' => 'BO',
|
119 |
+
'text' => 'Bolivia',
|
120 |
+
],
|
121 |
+
[
|
122 |
+
'value' => 'BR',
|
123 |
+
'text' => 'Brazil',
|
124 |
+
],
|
125 |
+
[
|
126 |
+
'value' => 'BS',
|
127 |
+
'text' => 'Bahamas',
|
128 |
+
],
|
129 |
+
[
|
130 |
+
'value' => 'BT',
|
131 |
+
'text' => 'Bhutan',
|
132 |
+
],
|
133 |
+
[
|
134 |
+
'value' => 'BV',
|
135 |
+
'text' => 'Bouvet Island',
|
136 |
+
],
|
137 |
+
[
|
138 |
+
'value' => 'BW',
|
139 |
+
'text' => 'Botswana',
|
140 |
+
],
|
141 |
+
[
|
142 |
+
'value' => 'BY',
|
143 |
+
'text' => 'Belarus',
|
144 |
+
],
|
145 |
+
[
|
146 |
+
'value' => 'BZ',
|
147 |
+
'text' => 'Belize',
|
148 |
+
],
|
149 |
+
[
|
150 |
+
'value' => 'CA',
|
151 |
+
'text' => 'Canada',
|
152 |
+
],
|
153 |
+
[
|
154 |
+
'value' => 'CC',
|
155 |
+
'text' => 'Cocos (Keeling) Islands',
|
156 |
+
],
|
157 |
+
[
|
158 |
+
'value' => 'CD',
|
159 |
+
'text' => 'The Democratic Republic of the Congo',
|
160 |
+
],
|
161 |
+
[
|
162 |
+
'value' => 'CF',
|
163 |
+
'text' => 'Central African Republic',
|
164 |
+
],
|
165 |
+
[
|
166 |
+
'value' => 'CG',
|
167 |
+
'text' => 'Congo',
|
168 |
+
],
|
169 |
+
[
|
170 |
+
'value' => 'CH',
|
171 |
+
'text' => 'Switzerland',
|
172 |
+
],
|
173 |
+
[
|
174 |
+
'value' => 'CI',
|
175 |
+
'text' => 'Cote D\'Ivoire',
|
176 |
+
],
|
177 |
+
[
|
178 |
+
'value' => 'CK',
|
179 |
+
'text' => 'Cook Islands',
|
180 |
+
],
|
181 |
+
[
|
182 |
+
'value' => 'CL',
|
183 |
+
'text' => 'Chile',
|
184 |
+
],
|
185 |
+
[
|
186 |
+
'value' => 'CM',
|
187 |
+
'text' => 'Cameroon',
|
188 |
+
],
|
189 |
+
[
|
190 |
+
'value' => 'CN',
|
191 |
+
'text' => 'China',
|
192 |
+
],
|
193 |
+
[
|
194 |
+
'value' => 'CO',
|
195 |
+
'text' => 'Colombia',
|
196 |
+
],
|
197 |
+
[
|
198 |
+
'value' => 'CR',
|
199 |
+
'text' => 'Costa Rica',
|
200 |
+
],
|
201 |
+
[
|
202 |
+
'value' => 'CU',
|
203 |
+
'text' => 'Cuba',
|
204 |
+
],
|
205 |
+
[
|
206 |
+
'value' => 'CV',
|
207 |
+
'text' => 'Cape Verde',
|
208 |
+
],
|
209 |
+
[
|
210 |
+
'value' => 'CX',
|
211 |
+
'text' => 'Christmas Island',
|
212 |
+
],
|
213 |
+
[
|
214 |
+
'value' => 'CY',
|
215 |
+
'text' => 'Cyprus',
|
216 |
+
],
|
217 |
+
[
|
218 |
+
'value' => 'CZ',
|
219 |
+
'text' => 'Czech Republic',
|
220 |
+
],
|
221 |
+
[
|
222 |
+
'value' => 'DE',
|
223 |
+
'text' => 'Germany',
|
224 |
+
],
|
225 |
+
[
|
226 |
+
'value' => 'DJ',
|
227 |
+
'text' => 'Djibouti',
|
228 |
+
],
|
229 |
+
[
|
230 |
+
'value' => 'DK',
|
231 |
+
'text' => 'Denmark',
|
232 |
+
],
|
233 |
+
[
|
234 |
+
'value' => 'DM',
|
235 |
+
'text' => 'Dominica',
|
236 |
+
],
|
237 |
+
[
|
238 |
+
'value' => 'DO',
|
239 |
+
'text' => 'Dominican Republic',
|
240 |
+
],
|
241 |
+
[
|
242 |
+
'value' => 'DZ',
|
243 |
+
'text' => 'Algeria',
|
244 |
+
],
|
245 |
+
[
|
246 |
+
'value' => 'EC',
|
247 |
+
'text' => 'Ecuador',
|
248 |
+
],
|
249 |
+
[
|
250 |
+
'value' => 'EE',
|
251 |
+
'text' => 'Estonia',
|
252 |
+
],
|
253 |
+
[
|
254 |
+
'value' => 'EG',
|
255 |
+
'text' => 'Egypt',
|
256 |
+
],
|
257 |
+
[
|
258 |
+
'value' => 'EH',
|
259 |
+
'text' => 'Western Sahara',
|
260 |
+
],
|
261 |
+
[
|
262 |
+
'value' => 'ER',
|
263 |
+
'text' => 'Eritrea',
|
264 |
+
],
|
265 |
+
[
|
266 |
+
'value' => 'ES',
|
267 |
+
'text' => 'Spain',
|
268 |
+
],
|
269 |
+
[
|
270 |
+
'value' => 'ET',
|
271 |
+
'text' => 'Ethiopia',
|
272 |
+
],
|
273 |
+
[
|
274 |
+
'value' => 'FI',
|
275 |
+
'text' => 'Finland',
|
276 |
+
],
|
277 |
+
[
|
278 |
+
'value' => 'FJ',
|
279 |
+
'text' => 'Fiji',
|
280 |
+
],
|
281 |
+
[
|
282 |
+
'value' => 'FK',
|
283 |
+
'text' => 'Falkland Islands (Malvinas)',
|
284 |
+
],
|
285 |
+
[
|
286 |
+
'value' => 'FM',
|
287 |
+
'text' => 'Federated States of Micronesia',
|
288 |
+
],
|
289 |
+
[
|
290 |
+
'value' => 'FO',
|
291 |
+
'text' => 'Faroe Islands',
|
292 |
+
],
|
293 |
+
[
|
294 |
+
'value' => 'FR',
|
295 |
+
'text' => 'France',
|
296 |
+
],
|
297 |
+
[
|
298 |
+
'value' => 'FX',
|
299 |
+
'text' => 'France Metropolitan',
|
300 |
+
],
|
301 |
+
[
|
302 |
+
'value' => 'GA',
|
303 |
+
'text' => 'Gabon',
|
304 |
+
],
|
305 |
+
[
|
306 |
+
'value' => 'GB',
|
307 |
+
'text' => 'United Kingdom',
|
308 |
+
],
|
309 |
+
[
|
310 |
+
'value' => 'GD',
|
311 |
+
'text' => 'Grenada',
|
312 |
+
],
|
313 |
+
[
|
314 |
+
'value' => 'GE',
|
315 |
+
'text' => 'Georgia',
|
316 |
+
],
|
317 |
+
[
|
318 |
+
'value' => 'GF',
|
319 |
+
'text' => 'French Guiana',
|
320 |
+
],
|
321 |
+
[
|
322 |
+
'value' => 'GH',
|
323 |
+
'text' => 'Ghana',
|
324 |
+
],
|
325 |
+
[
|
326 |
+
'value' => 'GI',
|
327 |
+
'text' => 'Gibraltar',
|
328 |
+
],
|
329 |
+
[
|
330 |
+
'value' => 'GL',
|
331 |
+
'text' => 'Greenland',
|
332 |
+
],
|
333 |
+
[
|
334 |
+
'value' => 'GM',
|
335 |
+
'text' => 'Gambia',
|
336 |
+
],
|
337 |
+
[
|
338 |
+
'value' => 'GN',
|
339 |
+
'text' => 'Guinea',
|
340 |
+
],
|
341 |
+
[
|
342 |
+
'value' => 'GP',
|
343 |
+
'text' => 'Guadeloupe',
|
344 |
+
],
|
345 |
+
[
|
346 |
+
'value' => 'GQ',
|
347 |
+
'text' => 'Equatorial Guinea',
|
348 |
+
],
|
349 |
+
[
|
350 |
+
'value' => 'GR',
|
351 |
+
'text' => 'Greece',
|
352 |
+
],
|
353 |
+
[
|
354 |
+
'value' => 'GS',
|
355 |
+
'text' => 'South Georgia and the South Sandwich Islands',
|
356 |
+
],
|
357 |
+
[
|
358 |
+
'value' => 'GT',
|
359 |
+
'text' => 'Guatemala',
|
360 |
+
],
|
361 |
+
[
|
362 |
+
'value' => 'GU',
|
363 |
+
'text' => 'Guam',
|
364 |
+
],
|
365 |
+
[
|
366 |
+
'value' => 'GW',
|
367 |
+
'text' => 'Guinea-Bissau',
|
368 |
+
],
|
369 |
+
[
|
370 |
+
'value' => 'GY',
|
371 |
+
'text' => 'Guyana',
|
372 |
+
],
|
373 |
+
[
|
374 |
+
'value' => 'HK',
|
375 |
+
'text' => 'Hong Kong',
|
376 |
+
],
|
377 |
+
[
|
378 |
+
'value' => 'HM',
|
379 |
+
'text' => 'Heard Island and McDonald Islands',
|
380 |
+
],
|
381 |
+
[
|
382 |
+
'value' => 'HN',
|
383 |
+
'text' => 'Honduras',
|
384 |
+
],
|
385 |
+
[
|
386 |
+
'value' => 'HR',
|
387 |
+
'text' => 'Croatia',
|
388 |
+
],
|
389 |
+
[
|
390 |
+
'value' => 'HT',
|
391 |
+
'text' => 'Haiti',
|
392 |
+
],
|
393 |
+
[
|
394 |
+
'value' => 'HU',
|
395 |
+
'text' => 'Hungary',
|
396 |
+
],
|
397 |
+
[
|
398 |
+
'value' => 'ID',
|
399 |
+
'text' => 'Indonesia',
|
400 |
+
],
|
401 |
+
[
|
402 |
+
'value' => 'IE',
|
403 |
+
'text' => 'Ireland',
|
404 |
+
],
|
405 |
+
[
|
406 |
+
'value' => 'IL',
|
407 |
+
'text' => 'Israel',
|
408 |
+
],
|
409 |
+
[
|
410 |
+
'value' => 'IN',
|
411 |
+
'text' => 'India',
|
412 |
+
],
|
413 |
+
[
|
414 |
+
'value' => 'IO',
|
415 |
+
'text' => 'British Indian Ocean Territory',
|
416 |
+
],
|
417 |
+
[
|
418 |
+
'value' => 'IQ',
|
419 |
+
'text' => 'Iraq',
|
420 |
+
],
|
421 |
+
[
|
422 |
+
'value' => 'IR',
|
423 |
+
'text' => 'Islamic Republic of Iran',
|
424 |
+
],
|
425 |
+
[
|
426 |
+
'value' => 'IS',
|
427 |
+
'text' => 'Iceland',
|
428 |
+
],
|
429 |
+
[
|
430 |
+
'value' => 'IT',
|
431 |
+
'text' => 'Italy',
|
432 |
+
],
|
433 |
+
[
|
434 |
+
'value' => 'JM',
|
435 |
+
'text' => 'Jamaica',
|
436 |
+
],
|
437 |
+
[
|
438 |
+
'value' => 'JO',
|
439 |
+
'text' => 'Jordan',
|
440 |
+
],
|
441 |
+
[
|
442 |
+
'value' => 'JP',
|
443 |
+
'text' => 'Japan',
|
444 |
+
],
|
445 |
+
[
|
446 |
+
'value' => 'KE',
|
447 |
+
'text' => 'Kenya',
|
448 |
+
],
|
449 |
+
[
|
450 |
+
'value' => 'KG',
|
451 |
+
'text' => 'Kyrgyzstan',
|
452 |
+
],
|
453 |
+
[
|
454 |
+
'value' => 'KH',
|
455 |
+
'text' => 'Cambodia',
|
456 |
+
],
|
457 |
+
[
|
458 |
+
'value' => 'KI',
|
459 |
+
'text' => 'Kiribati',
|
460 |
+
],
|
461 |
+
[
|
462 |
+
'value' => 'KM',
|
463 |
+
'text' => 'Comoros',
|
464 |
+
],
|
465 |
+
[
|
466 |
+
'value' => 'KN',
|
467 |
+
'text' => 'Saint Kitts and Nevis',
|
468 |
+
],
|
469 |
+
[
|
470 |
+
'value' => 'KP',
|
471 |
+
'text' => 'Democratic People\'s Republic of Korea',
|
472 |
+
],
|
473 |
+
[
|
474 |
+
'value' => 'KR',
|
475 |
+
'text' => 'Republic of Korea',
|
476 |
+
],
|
477 |
+
[
|
478 |
+
'value' => 'KW',
|
479 |
+
'text' => 'Kuwait',
|
480 |
+
],
|
481 |
+
[
|
482 |
+
'value' => 'KY',
|
483 |
+
'text' => 'Cayman Islands',
|
484 |
+
],
|
485 |
+
[
|
486 |
+
'value' => 'KZ',
|
487 |
+
'text' => 'Kazakhstan',
|
488 |
+
],
|
489 |
+
[
|
490 |
+
'value' => 'LA',
|
491 |
+
'text' => 'Lao People\'s Democratic Republic',
|
492 |
+
],
|
493 |
+
[
|
494 |
+
'value' => 'LB',
|
495 |
+
'text' => 'Lebanon',
|
496 |
+
],
|
497 |
+
[
|
498 |
+
'value' => 'LC',
|
499 |
+
'text' => 'Saint Lucia',
|
500 |
+
],
|
501 |
+
[
|
502 |
+
'value' => 'LI',
|
503 |
+
'text' => 'Liechtenstein',
|
504 |
+
],
|
505 |
+
[
|
506 |
+
'value' => 'LK',
|
507 |
+
'text' => 'Sri Lanka',
|
508 |
+
],
|
509 |
+
[
|
510 |
+
'value' => 'LR',
|
511 |
+
'text' => 'Liberia',
|
512 |
+
],
|
513 |
+
[
|
514 |
+
'value' => 'LS',
|
515 |
+
'text' => 'Lesotho',
|
516 |
+
],
|
517 |
+
[
|
518 |
+
'value' => 'LT',
|
519 |
+
'text' => 'Lithuania',
|
520 |
+
],
|
521 |
+
[
|
522 |
+
'value' => 'LU',
|
523 |
+
'text' => 'Luxembourg',
|
524 |
+
],
|
525 |
+
[
|
526 |
+
'value' => 'LV',
|
527 |
+
'text' => 'Latvia',
|
528 |
+
],
|
529 |
+
[
|
530 |
+
'value' => 'LY',
|
531 |
+
'text' => 'Libyan Arab Jamahiriya',
|
532 |
+
],
|
533 |
+
[
|
534 |
+
'value' => 'MA',
|
535 |
+
'text' => 'Morocco',
|
536 |
+
],
|
537 |
+
[
|
538 |
+
'value' => 'MC',
|
539 |
+
'text' => 'Monaco',
|
540 |
+
],
|
541 |
+
[
|
542 |
+
'value' => 'MD',
|
543 |
+
'text' => 'Republic of Moldova',
|
544 |
+
],
|
545 |
+
[
|
546 |
+
'value' => 'MG',
|
547 |
+
'text' => 'Madagascar',
|
548 |
+
],
|
549 |
+
[
|
550 |
+
'value' => 'MH',
|
551 |
+
'text' => 'Marshall Islands',
|
552 |
+
],
|
553 |
+
[
|
554 |
+
'value' => 'MK',
|
555 |
+
'text' => 'Macedonia',
|
556 |
+
],
|
557 |
+
[
|
558 |
+
'value' => 'ML',
|
559 |
+
'text' => 'Mali',
|
560 |
+
],
|
561 |
+
[
|
562 |
+
'value' => 'MM',
|
563 |
+
'text' => 'Myanmar',
|
564 |
+
],
|
565 |
+
[
|
566 |
+
'value' => 'MN',
|
567 |
+
'text' => 'Mongolia',
|
568 |
+
],
|
569 |
+
[
|
570 |
+
'value' => 'MO',
|
571 |
+
'text' => 'Macau',
|
572 |
+
],
|
573 |
+
[
|
574 |
+
'value' => 'MP',
|
575 |
+
'text' => 'Northern Mariana Islands',
|
576 |
+
],
|
577 |
+
[
|
578 |
+
'value' => 'MQ',
|
579 |
+
'text' => 'Martinique',
|
580 |
+
],
|
581 |
+
[
|
582 |
+
'value' => 'MR',
|
583 |
+
'text' => 'Mauritania',
|
584 |
+
],
|
585 |
+
[
|
586 |
+
'value' => 'MS',
|
587 |
+
'text' => 'Montserrat',
|
588 |
+
],
|
589 |
+
[
|
590 |
+
'value' => 'MT',
|
591 |
+
'text' => 'Malta',
|
592 |
+
],
|
593 |
+
[
|
594 |
+
'value' => 'MU',
|
595 |
+
'text' => 'Mauritius',
|
596 |
+
],
|
597 |
+
[
|
598 |
+
'value' => 'MV',
|
599 |
+
'text' => 'Maldives',
|
600 |
+
],
|
601 |
+
[
|
602 |
+
'value' => 'MW',
|
603 |
+
'text' => 'Malawi',
|
604 |
+
],
|
605 |
+
[
|
606 |
+
'value' => 'MX',
|
607 |
+
'text' => 'Mexico',
|
608 |
+
],
|
609 |
+
[
|
610 |
+
'value' => 'MY',
|
611 |
+
'text' => 'Malaysia',
|
612 |
+
],
|
613 |
+
[
|
614 |
+
'value' => 'MZ',
|
615 |
+
'text' => 'Mozambique',
|
616 |
+
],
|
617 |
+
[
|
618 |
+
'value' => 'NA',
|
619 |
+
'text' => 'Namibia',
|
620 |
+
],
|
621 |
+
[
|
622 |
+
'value' => 'NC',
|
623 |
+
'text' => 'New Caledonia',
|
624 |
+
],
|
625 |
+
[
|
626 |
+
'value' => 'NE',
|
627 |
+
'text' => 'Niger',
|
628 |
+
],
|
629 |
+
[
|
630 |
+
'value' => 'NF',
|
631 |
+
'text' => 'Norfolk Island',
|
632 |
+
],
|
633 |
+
[
|
634 |
+
'value' => 'NG',
|
635 |
+
'text' => 'Nigeria',
|
636 |
+
],
|
637 |
+
[
|
638 |
+
'value' => 'NI',
|
639 |
+
'text' => 'Nicaragua',
|
640 |
+
],
|
641 |
+
[
|
642 |
+
'value' => 'NL',
|
643 |
+
'text' => 'Netherlands',
|
644 |
+
],
|
645 |
+
[
|
646 |
+
'value' => 'NO',
|
647 |
+
'text' => 'Norway',
|
648 |
+
],
|
649 |
+
[
|
650 |
+
'value' => 'NP',
|
651 |
+
'text' => 'Nepal',
|
652 |
+
],
|
653 |
+
[
|
654 |
+
'value' => 'NR',
|
655 |
+
'text' => 'Nauru',
|
656 |
+
],
|
657 |
+
[
|
658 |
+
'value' => 'NU',
|
659 |
+
'text' => 'Niue',
|
660 |
+
],
|
661 |
+
[
|
662 |
+
'value' => 'NZ',
|
663 |
+
'text' => 'New Zealand',
|
664 |
+
],
|
665 |
+
[
|
666 |
+
'value' => 'OM',
|
667 |
+
'text' => 'Oman',
|
668 |
+
],
|
669 |
+
[
|
670 |
+
'value' => 'PA',
|
671 |
+
'text' => 'Panama',
|
672 |
+
],
|
673 |
+
[
|
674 |
+
'value' => 'PE',
|
675 |
+
'text' => 'Peru',
|
676 |
+
],
|
677 |
+
[
|
678 |
+
'value' => 'PF',
|
679 |
+
'text' => 'French Polynesia',
|
680 |
+
],
|
681 |
+
[
|
682 |
+
'value' => 'PG',
|
683 |
+
'text' => 'Papua New Guinea',
|
684 |
+
],
|
685 |
+
[
|
686 |
+
'value' => 'PH',
|
687 |
+
'text' => 'Philippines',
|
688 |
+
],
|
689 |
+
[
|
690 |
+
'value' => 'PK',
|
691 |
+
'text' => 'Pakistan',
|
692 |
+
],
|
693 |
+
[
|
694 |
+
'value' => 'PL',
|
695 |
+
'text' => 'Poland',
|
696 |
+
],
|
697 |
+
[
|
698 |
+
'value' => 'PM',
|
699 |
+
'text' => 'Saint Pierre and Miquelon',
|
700 |
+
],
|
701 |
+
[
|
702 |
+
'value' => 'PN',
|
703 |
+
'text' => 'Pitcairn Islands',
|
704 |
+
],
|
705 |
+
[
|
706 |
+
'value' => 'PR',
|
707 |
+
'text' => 'Puerto Rico',
|
708 |
+
],
|
709 |
+
[
|
710 |
+
'value' => 'PS',
|
711 |
+
'text' => 'Palestinian Territory',
|
712 |
+
],
|
713 |
+
[
|
714 |
+
'value' => 'PT',
|
715 |
+
'text' => 'Portugal',
|
716 |
+
],
|
717 |
+
[
|
718 |
+
'value' => 'PW',
|
719 |
+
'text' => 'Palau',
|
720 |
+
],
|
721 |
+
[
|
722 |
+
'value' => 'PY',
|
723 |
+
'text' => 'Paraguay',
|
724 |
+
],
|
725 |
+
[
|
726 |
+
'value' => 'QA',
|
727 |
+
'text' => 'Qatar',
|
728 |
+
],
|
729 |
+
[
|
730 |
+
'value' => 'RE',
|
731 |
+
'text' => 'Reunion',
|
732 |
+
],
|
733 |
+
[
|
734 |
+
'value' => 'RO',
|
735 |
+
'text' => 'Romania',
|
736 |
+
],
|
737 |
+
[
|
738 |
+
'value' => 'RU',
|
739 |
+
'text' => 'Russian Federation',
|
740 |
+
],
|
741 |
+
[
|
742 |
+
'value' => 'RW',
|
743 |
+
'text' => 'Rwanda',
|
744 |
+
],
|
745 |
+
[
|
746 |
+
'value' => 'SA',
|
747 |
+
'text' => 'Saudi Arabia',
|
748 |
+
],
|
749 |
+
[
|
750 |
+
'value' => 'SB',
|
751 |
+
'text' => 'Solomon Islands',
|
752 |
+
],
|
753 |
+
[
|
754 |
+
'value' => 'SC',
|
755 |
+
'text' => 'Seychelles',
|
756 |
+
],
|
757 |
+
[
|
758 |
+
'value' => 'SD',
|
759 |
+
'text' => 'Sudan',
|
760 |
+
],
|
761 |
+
[
|
762 |
+
'value' => 'SE',
|
763 |
+
'text' => 'Sweden',
|
764 |
+
],
|
765 |
+
[
|
766 |
+
'value' => 'SG',
|
767 |
+
'text' => 'Singapore',
|
768 |
+
],
|
769 |
+
[
|
770 |
+
'value' => 'SH',
|
771 |
+
'text' => 'Saint Helena',
|
772 |
+
],
|
773 |
+
[
|
774 |
+
'value' => 'SI',
|
775 |
+
'text' => 'Slovenia',
|
776 |
+
],
|
777 |
+
[
|
778 |
+
'value' => 'SJ',
|
779 |
+
'text' => 'Svalbard and Jan Mayen',
|
780 |
+
],
|
781 |
+
[
|
782 |
+
'value' => 'SK',
|
783 |
+
'text' => 'Slovakia',
|
784 |
+
],
|
785 |
+
[
|
786 |
+
'value' => 'SL',
|
787 |
+
'text' => 'Sierra Leone',
|
788 |
+
],
|
789 |
+
[
|
790 |
+
'value' => 'SM',
|
791 |
+
'text' => 'San Marino',
|
792 |
+
],
|
793 |
+
[
|
794 |
+
'value' => 'SN',
|
795 |
+
'text' => 'Senegal',
|
796 |
+
],
|
797 |
+
[
|
798 |
+
'value' => 'SO',
|
799 |
+
'text' => 'Somalia',
|
800 |
+
],
|
801 |
+
[
|
802 |
+
'value' => 'SR',
|
803 |
+
'text' => 'Suriname',
|
804 |
+
],
|
805 |
+
[
|
806 |
+
'value' => 'ST',
|
807 |
+
'text' => 'Sao Tome and Principe',
|
808 |
+
],
|
809 |
+
[
|
810 |
+
'value' => 'SV',
|
811 |
+
'text' => 'El Salvador',
|
812 |
+
],
|
813 |
+
[
|
814 |
+
'value' => 'SY',
|
815 |
+
'text' => 'Syrian Arab Republic',
|
816 |
+
],
|
817 |
+
[
|
818 |
+
'value' => 'SZ',
|
819 |
+
'text' => 'Swaziland',
|
820 |
+
],
|
821 |
+
[
|
822 |
+
'value' => 'TC',
|
823 |
+
'text' => 'Turks and Caicos Islands',
|
824 |
+
],
|
825 |
+
[
|
826 |
+
'value' => 'TD',
|
827 |
+
'text' => 'Chad',
|
828 |
+
],
|
829 |
+
[
|
830 |
+
'value' => 'TF',
|
831 |
+
'text' => 'French Southern Territories',
|
832 |
+
],
|
833 |
+
[
|
834 |
+
'value' => 'TG',
|
835 |
+
'text' => 'Togo',
|
836 |
+
],
|
837 |
+
[
|
838 |
+
'value' => 'TH',
|
839 |
+
'text' => 'Thailand',
|
840 |
+
],
|
841 |
+
[
|
842 |
+
'value' => 'TJ',
|
843 |
+
'text' => 'Tajikistan',
|
844 |
+
],
|
845 |
+
[
|
846 |
+
'value' => 'TK',
|
847 |
+
'text' => 'Tokelau',
|
848 |
+
],
|
849 |
+
[
|
850 |
+
'value' => 'TM',
|
851 |
+
'text' => 'Turkmenistan',
|
852 |
+
],
|
853 |
+
[
|
854 |
+
'value' => 'TN',
|
855 |
+
'text' => 'Tunisia',
|
856 |
+
],
|
857 |
+
[
|
858 |
+
'value' => 'TO',
|
859 |
+
'text' => 'Tonga',
|
860 |
+
],
|
861 |
+
[
|
862 |
+
'value' => 'TL',
|
863 |
+
'text' => 'Timor-Leste',
|
864 |
+
],
|
865 |
+
[
|
866 |
+
'value' => 'TR',
|
867 |
+
'text' => 'Turkey',
|
868 |
+
],
|
869 |
+
[
|
870 |
+
'value' => 'TT',
|
871 |
+
'text' => 'Trinidad and Tobago',
|
872 |
+
],
|
873 |
+
[
|
874 |
+
'value' => 'TV',
|
875 |
+
'text' => 'Tuvalu',
|
876 |
+
],
|
877 |
+
[
|
878 |
+
'value' => 'TW',
|
879 |
+
'text' => 'Taiwan',
|
880 |
+
],
|
881 |
+
[
|
882 |
+
'value' => 'TZ',
|
883 |
+
'text' => 'United Republic of Tanzania',
|
884 |
+
],
|
885 |
+
[
|
886 |
+
'value' => 'UA',
|
887 |
+
'text' => 'Ukraine',
|
888 |
+
],
|
889 |
+
[
|
890 |
+
'value' => 'UG',
|
891 |
+
'text' => 'Uganda',
|
892 |
+
],
|
893 |
+
[
|
894 |
+
'value' => 'UM',
|
895 |
+
'text' => 'United States Minor Outlying Islands',
|
896 |
+
],
|
897 |
+
[
|
898 |
+
'value' => 'US',
|
899 |
+
'text' => 'United States',
|
900 |
+
],
|
901 |
+
[
|
902 |
+
'value' => 'UY',
|
903 |
+
'text' => 'Uruguay',
|
904 |
+
],
|
905 |
+
[
|
906 |
+
'value' => 'UZ',
|
907 |
+
'text' => 'Uzbekistan',
|
908 |
+
],
|
909 |
+
[
|
910 |
+
'value' => 'VA',
|
911 |
+
'text' => 'Holy See (Vatican City State)',
|
912 |
+
],
|
913 |
+
[
|
914 |
+
'value' => 'VC',
|
915 |
+
'text' => 'Saint Vincent and the Grenadines',
|
916 |
+
],
|
917 |
+
[
|
918 |
+
'value' => 'VE',
|
919 |
+
'text' => 'Venezuela',
|
920 |
+
],
|
921 |
+
[
|
922 |
+
'value' => 'VG',
|
923 |
+
'text' => 'British Virgin Islands',
|
924 |
+
],
|
925 |
+
[
|
926 |
+
'value' => 'VI',
|
927 |
+
'text' => 'U.S. Virgin Islands',
|
928 |
+
],
|
929 |
+
[
|
930 |
+
'value' => 'VN',
|
931 |
+
'text' => 'Vietnam',
|
932 |
+
],
|
933 |
+
[
|
934 |
+
'value' => 'VU',
|
935 |
+
'text' => 'Vanuatu',
|
936 |
+
],
|
937 |
+
[
|
938 |
+
'value' => 'WF',
|
939 |
+
'text' => 'Wallis and Futuna',
|
940 |
+
],
|
941 |
+
[
|
942 |
+
'value' => 'WS',
|
943 |
+
'text' => 'Samoa',
|
944 |
+
],
|
945 |
+
[
|
946 |
+
'value' => 'YE',
|
947 |
+
'text' => 'Yemen',
|
948 |
+
],
|
949 |
+
[
|
950 |
+
'value' => 'YT',
|
951 |
+
'text' => 'Mayotte',
|
952 |
+
],
|
953 |
+
[
|
954 |
+
'value' => 'RS',
|
955 |
+
'text' => 'Serbia',
|
956 |
+
],
|
957 |
+
[
|
958 |
+
'value' => 'ZA',
|
959 |
+
'text' => 'South Africa',
|
960 |
+
],
|
961 |
+
[
|
962 |
+
'value' => 'ZM',
|
963 |
+
'text' => 'Zambia',
|
964 |
+
],
|
965 |
+
[
|
966 |
+
'value' => 'ME',
|
967 |
+
'text' => 'Montenegro',
|
968 |
+
],
|
969 |
+
[
|
970 |
+
'value' => 'ZW',
|
971 |
+
'text' => 'Zimbabwe',
|
972 |
+
],
|
973 |
+
[
|
974 |
+
'value' => 'AX',
|
975 |
+
'text' => 'Aland Islands',
|
976 |
+
],
|
977 |
+
[
|
978 |
+
'value' => 'GG',
|
979 |
+
'text' => 'Guernsey',
|
980 |
+
],
|
981 |
+
[
|
982 |
+
'value' => 'IM',
|
983 |
+
'text' => 'Isle of Man',
|
984 |
+
],
|
985 |
+
[
|
986 |
+
'value' => 'JE',
|
987 |
+
'text' => 'Jersey',
|
988 |
+
],
|
989 |
+
[
|
990 |
+
'value' => 'BL',
|
991 |
+
'text' => 'Saint Barthelemy',
|
992 |
+
],
|
993 |
+
[
|
994 |
+
'value' => 'MF',
|
995 |
+
'text' => 'Saint Martin',
|
996 |
+
],
|
997 |
+
];
|
998 |
+
array_multisort( array_column( $data, 'text' ), SORT_ASC, $data );
|
999 |
+
return $data;
|
1000 |
+
}
|
includes/defaults.php
CHANGED
@@ -1,293 +1,299 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
}
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
if(
|
157 |
-
|
158 |
-
|
159 |
-
if(
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
$
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
$
|
186 |
-
$
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
$
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
}
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
}
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The default settings for the plugin.
|
4 |
+
*/
|
5 |
+
function quick_adsense_get_defaults() {
|
6 |
+
$settings = [];
|
7 |
+
|
8 |
+
$settings['max_ads_per_page'] = '3';
|
9 |
+
|
10 |
+
$settings['enable_position_beginning_of_post'] = '1';
|
11 |
+
$settings['ad_beginning_of_post'] = '1';
|
12 |
+
$settings['enable_position_middle_of_post'] = '0';
|
13 |
+
$settings['ad_middle_of_post'] = '0';
|
14 |
+
$settings['enable_position_end_of_post'] = '1';
|
15 |
+
$settings['ad_end_of_post'] = '0';
|
16 |
+
|
17 |
+
$settings['enable_position_after_more_tag'] = '0';
|
18 |
+
$settings['ad_after_more_tag'] = '0';
|
19 |
+
$settings['enable_position_before_last_para'] = '0';
|
20 |
+
$settings['ad_before_last_para'] = '0';
|
21 |
+
|
22 |
+
for ( $i = 1; $i <= 3; $i++ ) {
|
23 |
+
$settings[ 'enable_position_after_para_option_' . $i ] = '0';
|
24 |
+
$settings[ 'ad_after_para_option_' . $i ] = '0';
|
25 |
+
$settings[ 'position_after_para_option_' . $i ] = '1';
|
26 |
+
$settings[ 'enable_jump_position_after_para_option_' . $i ] = '0';
|
27 |
+
}
|
28 |
+
|
29 |
+
for ( $i = 1; $i <= 1; $i++ ) {
|
30 |
+
$settings[ 'enable_position_after_image_option_' . $i ] = '0';
|
31 |
+
$settings[ 'ad_after_image_option_' . $i ] = '0';
|
32 |
+
$settings[ 'position_after_image_option_' . $i ] = '1';
|
33 |
+
$settings[ 'enable_jump_position_after_image_option_' . $i ] = '0';
|
34 |
+
}
|
35 |
+
|
36 |
+
$settings['enable_on_posts'] = '1';
|
37 |
+
$settings['enable_on_pages'] = '1';
|
38 |
+
|
39 |
+
$settings['enable_on_homepage'] = '0';
|
40 |
+
$settings['enable_on_categories'] = '0';
|
41 |
+
$settings['enable_on_archives'] = '0';
|
42 |
+
$settings['enable_on_tags'] = '0';
|
43 |
+
$settings['enable_all_possible_ads'] = '0';
|
44 |
+
|
45 |
+
$settings['disable_widgets_on_homepage'] = '0';
|
46 |
+
|
47 |
+
$settings['disable_for_loggedin_users'] = '0';
|
48 |
+
|
49 |
+
$settings['enable_quicktag_buttons'] = '1';
|
50 |
+
$settings['disable_randomads_quicktag_button'] = '0';
|
51 |
+
$settings['disable_disablead_quicktag_buttons'] = '0';
|
52 |
+
$settings['disable_positionad_quicktag_buttons'] = '0';
|
53 |
+
|
54 |
+
$settings['onpost_enable_global_style'] = '0';
|
55 |
+
$settings['onpost_global_alignment'] = '2';
|
56 |
+
$settings['onpost_global_margin'] = '10';
|
57 |
+
|
58 |
+
for ( $i = 1; $i <= 10; $i++ ) {
|
59 |
+
$settings[ 'onpost_ad_' . $i . '_content' ] = '';
|
60 |
+
$settings[ 'onpost_ad_' . $i . '_alignment' ] = '2';
|
61 |
+
$settings[ 'onpost_ad_' . $i . '_margin' ] = '10';
|
62 |
+
|
63 |
+
$settings[ 'widget_ad_' . $i . '_content' ] = '';
|
64 |
+
}
|
65 |
+
return $settings;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Action to update the settings storage for previous versions of the plugin.
|
70 |
+
*/
|
71 |
+
add_action(
|
72 |
+
'init',
|
73 |
+
function() {
|
74 |
+
$settings = get_option( 'quick_adsense_settings' );
|
75 |
+
if ( isset( $settings ) && is_array( $settings ) ) {
|
76 |
+
// Existing 2.1+ User.
|
77 |
+
return;
|
78 |
+
} else {
|
79 |
+
// New User OR V2.0 User OR V1.X User.
|
80 |
+
$quick_adsense_2_settings = get_option( 'quick_adsense_2_options' );
|
81 |
+
if ( isset( $quick_adsense_2_settings ) && is_array( $quick_adsense_2_settings ) && ( count( $quick_adsense_2_settings ) > 1 ) ) {
|
82 |
+
// V2.0 User.
|
83 |
+
$settings = quick_adsense_get_defaults();
|
84 |
+
|
85 |
+
$settings['max_ads_per_page'] = quick_adsense_get_value( $quick_adsense_2_settings, 'AdsDisp', $settings['max_ads_per_page'] );
|
86 |
+
|
87 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'BegnAds', false ) ) {
|
88 |
+
$settings['enable_position_beginning_of_post'] = '1';
|
89 |
+
}
|
90 |
+
$settings['ad_beginning_of_post'] = quick_adsense_get_value( $quick_adsense_2_settings, 'BegnRnd', $settings['ad_beginning_of_post'] );
|
91 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'MiddAds', false ) ) {
|
92 |
+
$settings['enable_position_middle_of_post'] = '1';
|
93 |
+
}
|
94 |
+
$settings['ad_middle_of_post'] = quick_adsense_get_value( $quick_adsense_2_settings, 'MiddRnd', $settings['ad_middle_of_post'] );
|
95 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'EndiAds', false ) ) {
|
96 |
+
$settings['enable_position_end_of_post'] = '1';
|
97 |
+
}
|
98 |
+
$settings['ad_end_of_post'] = quick_adsense_get_value( $quick_adsense_2_settings, 'EndiRnd', $settings['ad_end_of_post'] );
|
99 |
+
|
100 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'MoreAds', false ) ) {
|
101 |
+
$settings['enable_position_after_more_tag'] = '1';
|
102 |
+
}
|
103 |
+
$settings['ad_after_more_tag'] = quick_adsense_get_value( $quick_adsense_2_settings, 'MoreRnd', $settings['ad_after_more_tag'] );
|
104 |
+
|
105 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'LapaAds', false ) ) {
|
106 |
+
$settings['enable_position_before_last_para'] = '1';
|
107 |
+
}
|
108 |
+
$settings['ad_before_last_para'] = quick_adsense_get_value( $quick_adsense_2_settings, 'LapaRnd', $settings['ad_before_last_para'] );
|
109 |
+
|
110 |
+
for ( $i = 1; $i <= 3; $i++ ) {
|
111 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'Par' . $i . 'Ads', false ) ) {
|
112 |
+
$settings[ 'enable_position_after_para_option_' . $i ] = '1';
|
113 |
+
}
|
114 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'Par' . $i . 'Rnd', false ) ) {
|
115 |
+
$settings[ 'ad_after_para_option_' . $i ] = '1';
|
116 |
+
}
|
117 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'Par' . $i . 'Nup', false ) ) {
|
118 |
+
$settings[ 'position_after_para_option_' . $i ] = '1';
|
119 |
+
}
|
120 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'Par' . $i . 'Con', false ) ) {
|
121 |
+
$settings[ 'enable_jump_position_after_para_option_' . $i ] = '1';
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
for ( $i = 1; $i <= 1; $i++ ) {
|
126 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'Img' . $i . 'Ads', false ) ) {
|
127 |
+
$settings[ 'enable_position_after_image_option_' . $i ] = '1';
|
128 |
+
}
|
129 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'Img' . $i . 'Rnd', false ) ) {
|
130 |
+
$settings[ 'ad_after_image_option_' . $i ] = '1';
|
131 |
+
}
|
132 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'Img' . $i . 'Nup', false ) ) {
|
133 |
+
$settings[ 'position_after_image_option_' . $i ] = '1';
|
134 |
+
}
|
135 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'Img' . $i . 'Con', false ) ) {
|
136 |
+
$settings[ 'enable_jump_position_after_image_option_' . $i ] = '1';
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'AppPost', false ) ) {
|
141 |
+
$settings['enable_on_posts'] = '1';
|
142 |
+
}
|
143 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'AppPage', false ) ) {
|
144 |
+
$settings['enable_on_pages'] = '1';
|
145 |
+
}
|
146 |
+
|
147 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'AppHome', false ) ) {
|
148 |
+
$settings['enable_on_homepage'] = '1';
|
149 |
+
}
|
150 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'AppCate', false ) ) {
|
151 |
+
$settings['enable_on_categories'] = '1';
|
152 |
+
}
|
153 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'AppArch', false ) ) {
|
154 |
+
$settings['enable_on_archives'] = '1';
|
155 |
+
}
|
156 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'AppTags', false ) ) {
|
157 |
+
$settings['enable_on_tags'] = '1';
|
158 |
+
}
|
159 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'AppMaxA', false ) ) {
|
160 |
+
$settings['enable_all_possible_ads'] = '1';
|
161 |
+
}
|
162 |
+
|
163 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'AppSide', false ) ) {
|
164 |
+
$settings['disable_widgets_on_homepage'] = '1';
|
165 |
+
}
|
166 |
+
|
167 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'AppLogg', false ) ) {
|
168 |
+
$settings['disable_for_loggedin_users'] = '1';
|
169 |
+
}
|
170 |
+
|
171 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'QckTags', false ) ) {
|
172 |
+
$settings['enable_quicktag_buttons'] = '1';
|
173 |
+
}
|
174 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'QckRnds', false ) ) {
|
175 |
+
$settings['disable_randomads_quicktag_button'] = '1';
|
176 |
+
}
|
177 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'QckOffs', false ) ) {
|
178 |
+
$settings['disable_disablead_quicktag_buttons'] = '1';
|
179 |
+
}
|
180 |
+
if ( false !== quick_adsense_get_value( $quick_adsense_2_settings, 'QckOfPs', false ) ) {
|
181 |
+
$settings['disable_positionad_quicktag_buttons'] = '1';
|
182 |
+
}
|
183 |
+
|
184 |
+
for ( $i = 1; $i <= 10; $i++ ) {
|
185 |
+
$settings[ 'onpost_ad_' . $i . '_content' ] = quick_adsense_get_value( $quick_adsense_2_settings, 'AdsCode' . $i, $settings[ 'onpost_ad_' . $i . '_content' ] );
|
186 |
+
$settings[ 'onpost_ad_' . $i . '_alignment' ] = quick_adsense_get_value( $quick_adsense_2_settings, 'AdsAdsAlignMargin' . $i, $settings[ 'onpost_ad_' . $i . '_alignment' ] );
|
187 |
+
$settings[ 'onpost_ad_' . $i . '_margin' ] = quick_adsense_get_value( $quick_adsense_2_settings, 'AdsMargin' . $i, $settings[ 'onpost_ad_' . $i . '_margin' ] );
|
188 |
+
|
189 |
+
$settings[ 'widget_ad_' . $i . '_content' ] = quick_adsense_get_value( $quick_adsense_2_settings, 'WidCode' . $i, $settings[ 'widget_ad_' . $i . '_content' ] );
|
190 |
+
}
|
191 |
+
update_option( 'quick_adsense_settings', $settings );
|
192 |
+
update_option( 'quick_adsense_2_options_bak', $quick_adsense_2_settings );
|
193 |
+
delete_option( 'quick_adsense_2_options' );
|
194 |
+
} else {
|
195 |
+
// New User or V1.X User.
|
196 |
+
$quick_adsense_1_ads_disp = get_option( 'AdsDisp' );
|
197 |
+
if ( isset( $quick_adsense_1_ads_disp ) && in_array( $quick_adsense_1_ads_disp, [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ], true ) ) {
|
198 |
+
// V1.X User.
|
199 |
+
$settings = quick_adsense_get_defaults();
|
200 |
+
$settings['max_ads_per_page'] = get_option( 'AdsDisp', $settings['max_ads_per_page'] );
|
201 |
+
|
202 |
+
if ( false !== get_option( 'BegnAds' ) ) {
|
203 |
+
$settings['enable_position_beginning_of_post'] = '1';
|
204 |
+
}
|
205 |
+
$settings['ad_beginning_of_post'] = get_option( 'BegnRnd', $settings['ad_beginning_of_post'] );
|
206 |
+
if ( false !== get_option( 'MiddAds' ) ) {
|
207 |
+
$settings['enable_position_middle_of_post'] = '1';
|
208 |
+
}
|
209 |
+
$settings['ad_middle_of_post'] = get_option( 'MiddRnd', $settings['ad_middle_of_post'] );
|
210 |
+
if ( false !== get_option( 'EndiAds' ) ) {
|
211 |
+
$settings['enable_position_end_of_post'] = '1';
|
212 |
+
}
|
213 |
+
$settings['ad_end_of_post'] = get_option( 'EndiRnd', $settings['ad_end_of_post'] );
|
214 |
+
|
215 |
+
if ( false !== get_option( 'MoreAds' ) ) {
|
216 |
+
$settings['enable_position_after_more_tag'] = '1';
|
217 |
+
}
|
218 |
+
$settings['ad_after_more_tag'] = get_option( 'MoreRnd', $settings['ad_after_more_tag'] );
|
219 |
+
if ( false !== get_option( 'LapaAds' ) ) {
|
220 |
+
$settings['enable_position_before_last_para'] = '1';
|
221 |
+
}
|
222 |
+
$settings['ad_before_last_para'] = get_option( 'LapaRnd', $settings['ad_before_last_para'] );
|
223 |
+
|
224 |
+
for ( $i = 1; $i <= 3; $i++ ) {
|
225 |
+
$settings[ 'enable_position_after_para_option_' . $i ] = get_option( 'Par' . $i . 'Ads', $settings[ 'enable_position_after_para_option_' . $i ] );
|
226 |
+
$settings[ 'ad_after_para_option_' . $i ] = get_option( 'Par' . $i . 'Rnd', $settings[ 'ad_after_para_option_' . $i ] );
|
227 |
+
$settings[ 'position_after_para_option_' . $i ] = get_option( 'Par' . $i . 'Nup', $settings[ 'position_after_para_option_' . $i ] );
|
228 |
+
$settings[ 'enable_jump_position_after_para_option_' . $i ] = get_option( 'Par' . $i . 'Con', $settings[ 'enable_jump_position_after_para_option_' . $i ] );
|
229 |
+
}
|
230 |
+
|
231 |
+
for ( $i = 1; $i <= 1; $i++ ) {
|
232 |
+
$settings[ 'enable_position_after_image_option_' . $i ] = get_option( 'Img' . $i . 'Ads', $settings[ 'enable_position_after_image_option_' . $i ] );
|
233 |
+
$settings[ 'ad_after_image_option_' . $i ] = get_option( 'Img' . $i . 'Rnd', $settings[ 'ad_after_image_option_' . $i ] );
|
234 |
+
$settings[ 'position_after_image_option_' . $i ] = get_option( 'Img' . $i . 'Nup', $settings[ 'position_after_image_option_' . $i ] );
|
235 |
+
$settings[ 'enable_jump_position_after_image_option_' . $i ] = get_option( 'Img' . $i . 'Con', $settings[ 'enable_jump_position_after_image_option_' . $i ] );
|
236 |
+
}
|
237 |
+
|
238 |
+
if ( false !== get_option( 'AppPost' ) ) {
|
239 |
+
$settings['enable_on_posts'] = '1';
|
240 |
+
}
|
241 |
+
if ( false !== get_option( 'AppPage' ) ) {
|
242 |
+
$settings['enable_on_pages'] = '1';
|
243 |
+
}
|
244 |
+
|
245 |
+
if ( false !== get_option( 'AppHome' ) ) {
|
246 |
+
$settings['enable_on_homepage'] = '1';
|
247 |
+
}
|
248 |
+
if ( false !== get_option( 'AppCate' ) ) {
|
249 |
+
$settings['enable_on_categories'] = '1';
|
250 |
+
}
|
251 |
+
if ( false !== get_option( 'AppArch' ) ) {
|
252 |
+
$settings['enable_on_archives'] = '1';
|
253 |
+
}
|
254 |
+
if ( false !== get_option( 'AppTags' ) ) {
|
255 |
+
$settings['enable_on_tags'] = '1';
|
256 |
+
}
|
257 |
+
if ( false !== get_option( 'AppMaxA' ) ) {
|
258 |
+
$settings['enable_all_possible_ads'] = '1';
|
259 |
+
}
|
260 |
+
|
261 |
+
if ( false !== get_option( 'AppSide' ) ) {
|
262 |
+
$settings['disable_widgets_on_homepage'] = '1';
|
263 |
+
}
|
264 |
+
|
265 |
+
if ( false !== get_option( 'AppLogg' ) ) {
|
266 |
+
$settings['disable_for_loggedin_users'] = '1';
|
267 |
+
}
|
268 |
+
|
269 |
+
if ( false !== get_option( 'QckTags' ) ) {
|
270 |
+
$settings['enable_quicktag_buttons'] = '1';
|
271 |
+
}
|
272 |
+
if ( false !== get_option( 'QckRnds' ) ) {
|
273 |
+
$settings['disable_randomads_quicktag_button'] = '1';
|
274 |
+
}
|
275 |
+
if ( false !== get_option( 'QckOffs' ) ) {
|
276 |
+
$settings['disable_disablead_quicktag_buttons'] = '1';
|
277 |
+
}
|
278 |
+
if ( false !== get_option( 'QckOfPs' ) ) {
|
279 |
+
$settings['disable_positionad_quicktag_buttons'] = '1';
|
280 |
+
}
|
281 |
+
|
282 |
+
for ( $i = 1; $i <= 10; $i++ ) {
|
283 |
+
$settings[ 'onpost_ad_' . $i . '_content' ] = get_option( 'AdsCode' . $i, $settings[ 'onpost_ad_' . $i . '_content' ] );
|
284 |
+
$settings[ 'onpost_ad_' . $i . '_alignment' ] = get_option( 'AdsAlign' . $i, $settings[ 'onpost_ad_' . $i . '_alignment' ] );
|
285 |
+
$settings[ 'onpost_ad_' . $i . '_margin' ] = get_option( 'AdsMargin' . $i, $settings[ 'onpost_ad_' . $i . '_margin' ] );
|
286 |
+
|
287 |
+
$settings[ 'widget_ad_' . $i . '_content' ] = get_option( 'WidCode' . $i, $settings[ 'widget_ad_' . $i . '_content' ] );
|
288 |
+
}
|
289 |
+
|
290 |
+
update_option( 'quick_adsense_settings', $settings );
|
291 |
+
delete_option( 'AdsDisp' );
|
292 |
+
} else {
|
293 |
+
// New User.
|
294 |
+
update_option( 'quick_adsense_settings', quick_adsense_get_defaults() );
|
295 |
+
}
|
296 |
+
}
|
297 |
+
}
|
298 |
+
}
|
299 |
+
);
|
includes/images/adpushup-970x250-red.png
DELETED
Binary file
|
includes/images/advertisement-preview.png
DELETED
Binary file
|
includes/images/ajax-loader-flat.gif
DELETED
Binary file
|
includes/images/jquery.minicolors.png
DELETED
Binary file
|
includes/images/privacy.png
DELETED
Binary file
|
includes/js/gdpr.js
DELETED
@@ -1,198 +0,0 @@
|
|
1 |
-
/* Begin IAB API V 1.1 Implementation */
|
2 |
-
var __vicmp = (function () {
|
3 |
-
return typeof (__vicmp) == "function" ? __vicmp : function (c) {
|
4 |
-
var b = arguments;
|
5 |
-
if (!b.length) {
|
6 |
-
return __vicmp.a;
|
7 |
-
}
|
8 |
-
else if (c == '__vicmp') {
|
9 |
-
return false;
|
10 |
-
} else {
|
11 |
-
if (typeof __vicmp.a === 'undefined') {
|
12 |
-
__vicmp.a = [];
|
13 |
-
}
|
14 |
-
__vicmp.a.push([].slice.apply(b));
|
15 |
-
if(typeof __vicmp.execute != 'undefined') {
|
16 |
-
__vicmp.execute(b);
|
17 |
-
}
|
18 |
-
}
|
19 |
-
}
|
20 |
-
})();
|
21 |
-
|
22 |
-
function quick_adsense_vi_consent_onload_cmp() {
|
23 |
-
if(typeof __vicmp.execute === 'undefined') {
|
24 |
-
__vicmp.execute = function(b) {
|
25 |
-
var data = {};
|
26 |
-
if(typeof b != 'undefined') {
|
27 |
-
if(b[0] == 'getUserConsentStatus') {
|
28 |
-
var ViconsentCookie = quick_adsense_vi_consent_popup_get_cookie('Viconsent');
|
29 |
-
var gdprStatus = false;
|
30 |
-
if(document.getElementById('quick_adsense_vi_consent_popup_is_eu').value == '1') {
|
31 |
-
gdprStatus = true;
|
32 |
-
}
|
33 |
-
if(ViconsentCookie != '') {
|
34 |
-
var ViconsentCookieData = quick_adsense_vi_consent_popup_decode_cookie_content(ViconsentCookie);
|
35 |
-
data = {
|
36 |
-
gdprApplies: gdprStatus,
|
37 |
-
hasGlobalScope: false,
|
38 |
-
consent: ViconsentCookieData['PurposeAllowed'][1],
|
39 |
-
}
|
40 |
-
} else { // Cookie Missing / Corrupted
|
41 |
-
data = {
|
42 |
-
gdprApplies: gdprStatus,
|
43 |
-
hasGlobalScope: false,
|
44 |
-
consent: false,
|
45 |
-
}
|
46 |
-
}
|
47 |
-
}
|
48 |
-
b[2](data, true);
|
49 |
-
}
|
50 |
-
};
|
51 |
-
|
52 |
-
if(__vicmp.a && typeof func === 'undefined') {
|
53 |
-
for(var i=0; i<__vicmp.a.length;i++) {
|
54 |
-
__vicmp.execute(__vicmp.a[i]);
|
55 |
-
}
|
56 |
-
}
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
//setTimeout(quick_adsense_vi_consent_onload_cmp, 500);
|
61 |
-
quick_adsense_vi_consent_onload_cmp();
|
62 |
-
/* End IAB API V 1.1 Implementation */
|
63 |
-
|
64 |
-
/* Begin Consent Cookie Implementation */
|
65 |
-
function quick_adsense_vi_consent_popup_disagree() {
|
66 |
-
var cookieData = quick_adsense_vi_consent_popup_create_cookie_content('000000000000000000000000');
|
67 |
-
quick_adsense_vi_consent_popup_set_cookie('Viconsent', cookieData);
|
68 |
-
|
69 |
-
var ajaxFrame = document.createElement('iframe');
|
70 |
-
ajaxFrame.src = document.getElementById('quick_adsense_vi_consent_popup_url').value + '?quick_adsense_vi_consent=' + document.getElementById('quick_adsense_vi_consent_popup_auth').value;
|
71 |
-
ajaxFrame.style.display = 'none';
|
72 |
-
document.getElementById('quick_adsense_vi_consent_popup_wrapper').appendChild(ajaxFrame);
|
73 |
-
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'none';
|
74 |
-
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'none';
|
75 |
-
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'block';
|
76 |
-
}
|
77 |
-
|
78 |
-
function quick_adsense_vi_consent_popup_agree() {
|
79 |
-
var quick_adsense_vi_consent_popup_vendor_list_purposes = document.getElementById('quick_adsense_vi_consent_popup_vendor_list_purposes').value;
|
80 |
-
var cookieData = quick_adsense_vi_consent_popup_create_cookie_content(quick_adsense_vi_consent_popup_vendor_list_purposes);
|
81 |
-
quick_adsense_vi_consent_popup_set_cookie('Viconsent', cookieData);
|
82 |
-
|
83 |
-
var ajaxFrame = document.createElement('iframe');
|
84 |
-
ajaxFrame.src = document.getElementById('quick_adsense_vi_consent_popup_url').value + '?quick_adsense_vi_consent=' + document.getElementById('quick_adsense_vi_consent_popup_auth').value;
|
85 |
-
ajaxFrame.style.display = 'none';
|
86 |
-
document.getElementById('quick_adsense_vi_consent_popup_wrapper').appendChild(ajaxFrame);
|
87 |
-
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'none';
|
88 |
-
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'none';
|
89 |
-
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'block';
|
90 |
-
}
|
91 |
-
|
92 |
-
function quick_adsense_vi_consent_popup_create_cookie_content(purposeAllowed) {
|
93 |
-
cookieConsentTimeStamp = Math.round((new Date()).getTime()/100);
|
94 |
-
var cookieConsent = new Object();
|
95 |
-
cookieConsent['Version'] = quick_adsense_vi_consent_popup_create_binary_string(1, 6);
|
96 |
-
cookieConsent['Created'] = quick_adsense_vi_consent_popup_create_binary_string(cookieConsentTimeStamp, 36);
|
97 |
-
cookieConsent['LastUpdated'] = quick_adsense_vi_consent_popup_create_binary_string(cookieConsentTimeStamp, 36);
|
98 |
-
cookieConsent['CMPId'] = quick_adsense_vi_consent_popup_create_binary_string(999, 12);
|
99 |
-
cookieConsent['CMPVersion'] = quick_adsense_vi_consent_popup_create_binary_string(0, 6);
|
100 |
-
cookieConsent['ConsentScreen'] = quick_adsense_vi_consent_popup_create_binary_string(0, 6);
|
101 |
-
cookieConsent['ConsentLanguage'] = quick_adsense_vi_consent_popup_create_binary_string(4, 6)+quick_adsense_vi_consent_popup_create_binary_string(13, 6);
|
102 |
-
var quick_adsense_vi_consent_popup_vendor_list_version = parseInt(document.getElementById('quick_adsense_vi_consent_popup_vendor_list_version').value);
|
103 |
-
cookieConsent['VendorListVersion'] = quick_adsense_vi_consent_popup_create_binary_string(quick_adsense_vi_consent_popup_vendor_list_version, 12);
|
104 |
-
cookieConsent['PurposeAllowed'] = purposeAllowed;
|
105 |
-
|
106 |
-
return window.btoa(cookieConsent['Version'] + cookieConsent['Created'] + cookieConsent['LastUpdated'] + cookieConsent['CMPId'] + cookieConsent['CMPVersion'] + cookieConsent['ConsentScreen'] + cookieConsent['ConsentLanguage'] + cookieConsent['VendorListVersion'] + cookieConsent['PurposeAllowed']);
|
107 |
-
}
|
108 |
-
|
109 |
-
function quick_adsense_vi_consent_popup_decode_cookie_content(cookieData) {
|
110 |
-
if(cookieData != '') {
|
111 |
-
var binaryCookieData = atob(cookieData);
|
112 |
-
var cookieConsent = new Object();
|
113 |
-
cookieConsent['Version'] = parseInt(binaryCookieData.substring(0, 6), 2);
|
114 |
-
cookieConsent['Created'] = parseInt(binaryCookieData.substring(6, 42), 2);
|
115 |
-
cookieConsent['LastUpdated'] = parseInt(binaryCookieData.substring(42, 78), 2);
|
116 |
-
cookieConsent['CMPId'] = parseInt(binaryCookieData.substring(78, 90), 2);
|
117 |
-
cookieConsent['CMPVersion'] = parseInt(binaryCookieData.substring(90, 96), 2);
|
118 |
-
cookieConsent['ConsentScreen'] = parseInt(binaryCookieData.substring(96, 102), 2);
|
119 |
-
cookieConsent['ConsentLanguage'] = parseInt(binaryCookieData.substring(102, 108), 2)+''+parseInt(binaryCookieData.substring(106, 114), 2);
|
120 |
-
cookieConsent['VendorListVersion'] = parseInt(binaryCookieData.substring(114,126), 2);
|
121 |
-
cookieConsent['PurposeAllowed'] = binaryCookieData.substring(126, 150);
|
122 |
-
|
123 |
-
var purposeConsents = new Object();
|
124 |
-
for(var i = 24; i > 0; i--) {
|
125 |
-
if(cookieConsent['PurposeAllowed'].substring(i - 1, i) == '1') {
|
126 |
-
purposeConsents[(24 - i) + 1] = true;
|
127 |
-
} else {
|
128 |
-
purposeConsents[(24 - i) + 1] = false;
|
129 |
-
}
|
130 |
-
}
|
131 |
-
cookieConsent['PurposeAllowed'] = purposeConsents;
|
132 |
-
return cookieConsent;
|
133 |
-
}
|
134 |
-
return false;
|
135 |
-
}
|
136 |
-
|
137 |
-
function quick_adsense_vi_consent_popup_create_binary_string(dMask, dBitSize) {
|
138 |
-
var bMask = "";
|
139 |
-
if(dBitSize <= 32) {
|
140 |
-
while(dBitSize--) {
|
141 |
-
bMask += (dMask >> dBitSize) & 1;
|
142 |
-
}
|
143 |
-
} else {
|
144 |
-
bMask = dMask.toString(2);
|
145 |
-
while (bMask.length < dBitSize) {
|
146 |
-
bMask = "0" + bMask;
|
147 |
-
}
|
148 |
-
}
|
149 |
-
return bMask;
|
150 |
-
}
|
151 |
-
|
152 |
-
function quick_adsense_vi_consent_popup_set_cookie(name, value) {
|
153 |
-
var date = new Date();
|
154 |
-
date.setTime(date.getTime() + (365*24*60*60*1000));
|
155 |
-
document.cookie = name + "=" + value + ";" + "expires=" + date.toUTCString() + ";path=/";
|
156 |
-
}
|
157 |
-
|
158 |
-
function quick_adsense_vi_consent_popup_get_cookie(cookieName) {
|
159 |
-
var name = cookieName + "=";
|
160 |
-
var decodedCookie = decodeURIComponent(document.cookie);
|
161 |
-
var ca = decodedCookie.split(';');
|
162 |
-
for(var i = 0; i <ca.length; i++) {
|
163 |
-
var c = ca[i];
|
164 |
-
while (c.charAt(0) == ' ') {
|
165 |
-
c = c.substring(1);
|
166 |
-
}
|
167 |
-
if (c.indexOf(name) == 0) {
|
168 |
-
return c.substring(name.length, c.length);
|
169 |
-
}
|
170 |
-
}
|
171 |
-
return "";
|
172 |
-
}
|
173 |
-
|
174 |
-
function quick_adsense_vi_consent_popup_settings() {
|
175 |
-
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'block';
|
176 |
-
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'block';
|
177 |
-
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'none';
|
178 |
-
}
|
179 |
-
|
180 |
-
function quick_adsense_vi_consent_popup_load() {
|
181 |
-
if(document.getElementById('quick_adsense_vi_consent_popup_is_eu').value == true) {
|
182 |
-
if(quick_adsense_vi_consent_popup_get_cookie('Viconsent') == false) {
|
183 |
-
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'block';
|
184 |
-
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'block';
|
185 |
-
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'none';
|
186 |
-
} else {
|
187 |
-
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'none';
|
188 |
-
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'none';
|
189 |
-
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'block';
|
190 |
-
}
|
191 |
-
} else {
|
192 |
-
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'none';
|
193 |
-
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'none';
|
194 |
-
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'none';
|
195 |
-
}
|
196 |
-
}
|
197 |
-
setTimeout(quick_adsense_vi_consent_popup_load, 500);
|
198 |
-
/* End Consent Cookie Implementation */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/js/jquery.minicolors.js
DELETED
@@ -1,1108 +0,0 @@
|
|
1 |
-
//
|
2 |
-
// jQuery MiniColors: A tiny color picker built on jQuery
|
3 |
-
//
|
4 |
-
// Developed by Cory LaViska for A Beautiful Site, LLC
|
5 |
-
//
|
6 |
-
// Licensed under the MIT license: http://opensource.org/licenses/MIT
|
7 |
-
//
|
8 |
-
(function (factory) {
|
9 |
-
if(typeof define === 'function' && define.amd) {
|
10 |
-
// AMD. Register as an anonymous module.
|
11 |
-
define(['jquery'], factory);
|
12 |
-
} else if(typeof exports === 'object') {
|
13 |
-
// Node/CommonJS
|
14 |
-
module.exports = factory(require('jquery'));
|
15 |
-
} else {
|
16 |
-
// Browser globals
|
17 |
-
factory(jQuery);
|
18 |
-
}
|
19 |
-
}(function ($) {
|
20 |
-
'use strict';
|
21 |
-
|
22 |
-
// Defaults
|
23 |
-
$.minicolors = {
|
24 |
-
defaults: {
|
25 |
-
animationSpeed: 50,
|
26 |
-
animationEasing: 'swing',
|
27 |
-
change: null,
|
28 |
-
changeDelay: 0,
|
29 |
-
control: 'hue',
|
30 |
-
defaultValue: '',
|
31 |
-
format: 'hex',
|
32 |
-
hide: null,
|
33 |
-
hideSpeed: 100,
|
34 |
-
inline: false,
|
35 |
-
keywords: '',
|
36 |
-
letterCase: 'lowercase',
|
37 |
-
opacity: false,
|
38 |
-
position: 'bottom left',
|
39 |
-
show: null,
|
40 |
-
showSpeed: 100,
|
41 |
-
theme: 'default',
|
42 |
-
swatches: []
|
43 |
-
}
|
44 |
-
};
|
45 |
-
|
46 |
-
// Public methods
|
47 |
-
$.extend($.fn, {
|
48 |
-
minicolors: function(method, data) {
|
49 |
-
|
50 |
-
switch(method) {
|
51 |
-
// Destroy the control
|
52 |
-
case 'destroy':
|
53 |
-
$(this).each(function() {
|
54 |
-
destroy($(this));
|
55 |
-
});
|
56 |
-
return $(this);
|
57 |
-
|
58 |
-
// Hide the color picker
|
59 |
-
case 'hide':
|
60 |
-
hide();
|
61 |
-
return $(this);
|
62 |
-
|
63 |
-
// Get/set opacity
|
64 |
-
case 'opacity':
|
65 |
-
// Getter
|
66 |
-
if(data === undefined) {
|
67 |
-
// Getter
|
68 |
-
return $(this).attr('data-opacity');
|
69 |
-
} else {
|
70 |
-
// Setter
|
71 |
-
$(this).each(function() {
|
72 |
-
updateFromInput($(this).attr('data-opacity', data));
|
73 |
-
});
|
74 |
-
}
|
75 |
-
return $(this);
|
76 |
-
|
77 |
-
// Get an RGB(A) object based on the current color/opacity
|
78 |
-
case 'rgbObject':
|
79 |
-
return rgbObject($(this), method === 'rgbaObject');
|
80 |
-
|
81 |
-
// Get an RGB(A) string based on the current color/opacity
|
82 |
-
case 'rgbString':
|
83 |
-
case 'rgbaString':
|
84 |
-
return rgbString($(this), method === 'rgbaString');
|
85 |
-
|
86 |
-
// Get/set settings on the fly
|
87 |
-
case 'settings':
|
88 |
-
if(data === undefined) {
|
89 |
-
return $(this).data('minicolors-settings');
|
90 |
-
} else {
|
91 |
-
// Setter
|
92 |
-
$(this).each(function() {
|
93 |
-
var settings = $(this).data('minicolors-settings') || {};
|
94 |
-
destroy($(this));
|
95 |
-
$(this).minicolors($.extend(true, settings, data));
|
96 |
-
});
|
97 |
-
}
|
98 |
-
return $(this);
|
99 |
-
|
100 |
-
// Show the color picker
|
101 |
-
case 'show':
|
102 |
-
show($(this).eq(0));
|
103 |
-
return $(this);
|
104 |
-
|
105 |
-
// Get/set the hex color value
|
106 |
-
case 'value':
|
107 |
-
if(data === undefined) {
|
108 |
-
// Getter
|
109 |
-
return $(this).val();
|
110 |
-
} else {
|
111 |
-
// Setter
|
112 |
-
$(this).each(function() {
|
113 |
-
if(typeof(data) === 'object' && data !== null) {
|
114 |
-
if(data.opacity) {
|
115 |
-
$(this).attr('data-opacity', keepWithin(data.opacity, 0, 1));
|
116 |
-
}
|
117 |
-
if(data.color) {
|
118 |
-
$(this).val(data.color);
|
119 |
-
}
|
120 |
-
} else {
|
121 |
-
$(this).val(data);
|
122 |
-
}
|
123 |
-
updateFromInput($(this));
|
124 |
-
});
|
125 |
-
}
|
126 |
-
return $(this);
|
127 |
-
|
128 |
-
// Initializes the control
|
129 |
-
default:
|
130 |
-
if(method !== 'create') data = method;
|
131 |
-
$(this).each(function() {
|
132 |
-
init($(this), data);
|
133 |
-
});
|
134 |
-
return $(this);
|
135 |
-
|
136 |
-
}
|
137 |
-
|
138 |
-
}
|
139 |
-
});
|
140 |
-
|
141 |
-
// Initialize input elements
|
142 |
-
function init(input, settings) {
|
143 |
-
var minicolors = $('<div class="minicolors" />');
|
144 |
-
var defaults = $.minicolors.defaults;
|
145 |
-
var size;
|
146 |
-
var swatches;
|
147 |
-
var swatch;
|
148 |
-
var panel;
|
149 |
-
var i;
|
150 |
-
|
151 |
-
// Do nothing if already initialized
|
152 |
-
if(input.data('minicolors-initialized')) return;
|
153 |
-
|
154 |
-
// Handle settings
|
155 |
-
settings = $.extend(true, {}, defaults, settings);
|
156 |
-
|
157 |
-
// The wrapper
|
158 |
-
minicolors
|
159 |
-
.addClass('minicolors-theme-' + settings.theme)
|
160 |
-
.toggleClass('minicolors-with-opacity', settings.opacity);
|
161 |
-
|
162 |
-
// Custom positioning
|
163 |
-
if(settings.position !== undefined) {
|
164 |
-
$.each(settings.position.split(' '), function() {
|
165 |
-
minicolors.addClass('minicolors-position-' + this);
|
166 |
-
});
|
167 |
-
}
|
168 |
-
|
169 |
-
// Input size
|
170 |
-
if(settings.format === 'rgb') {
|
171 |
-
size = settings.opacity ? '25' : '20';
|
172 |
-
} else {
|
173 |
-
size = settings.keywords ? '11' : '7';
|
174 |
-
}
|
175 |
-
|
176 |
-
// The input
|
177 |
-
input
|
178 |
-
.addClass('minicolors-input')
|
179 |
-
.data('minicolors-initialized', false)
|
180 |
-
.data('minicolors-settings', settings)
|
181 |
-
.prop('size', size)
|
182 |
-
.wrap(minicolors)
|
183 |
-
.after(
|
184 |
-
'<div class="minicolors-panel minicolors-slider-' + settings.control + '">' +
|
185 |
-
'<div class="minicolors-slider minicolors-sprite">' +
|
186 |
-
'<div class="minicolors-picker"></div>' +
|
187 |
-
'</div>' +
|
188 |
-
'<div class="minicolors-opacity-slider minicolors-sprite">' +
|
189 |
-
'<div class="minicolors-picker"></div>' +
|
190 |
-
'</div>' +
|
191 |
-
'<div class="minicolors-grid minicolors-sprite">' +
|
192 |
-
'<div class="minicolors-grid-inner"></div>' +
|
193 |
-
'<div class="minicolors-picker"><div></div></div>' +
|
194 |
-
'</div>' +
|
195 |
-
'</div>'
|
196 |
-
);
|
197 |
-
|
198 |
-
// The swatch
|
199 |
-
if(!settings.inline) {
|
200 |
-
input.after('<span class="minicolors-swatch minicolors-sprite minicolors-input-swatch"><span class="minicolors-swatch-color"></span></span>');
|
201 |
-
input.next('.minicolors-input-swatch').on('click', function(event) {
|
202 |
-
event.preventDefault();
|
203 |
-
input.focus();
|
204 |
-
});
|
205 |
-
}
|
206 |
-
|
207 |
-
// Prevent text selection in IE
|
208 |
-
panel = input.parent().find('.minicolors-panel');
|
209 |
-
panel.on('selectstart', function() { return false; }).end();
|
210 |
-
|
211 |
-
// Swatches
|
212 |
-
if(settings.swatches && settings.swatches.length !== 0) {
|
213 |
-
panel.addClass('minicolors-with-swatches');
|
214 |
-
swatches = $('<ul class="minicolors-swatches"></ul>')
|
215 |
-
.appendTo(panel);
|
216 |
-
for(i = 0; i < settings.swatches.length; ++i) {
|
217 |
-
swatch = settings.swatches[i];
|
218 |
-
swatch = isRgb(swatch) ? parseRgb(swatch, true) : hex2rgb(parseHex(swatch, true));
|
219 |
-
$('<li class="minicolors-swatch minicolors-sprite"><span class="minicolors-swatch-color"></span></li>')
|
220 |
-
.appendTo(swatches)
|
221 |
-
.data('swatch-color', settings.swatches[i])
|
222 |
-
.find('.minicolors-swatch-color')
|
223 |
-
.css({
|
224 |
-
backgroundColor: rgb2hex(swatch),
|
225 |
-
opacity: swatch.a
|
226 |
-
});
|
227 |
-
settings.swatches[i] = swatch;
|
228 |
-
}
|
229 |
-
}
|
230 |
-
|
231 |
-
// Inline controls
|
232 |
-
if(settings.inline) input.parent().addClass('minicolors-inline');
|
233 |
-
|
234 |
-
updateFromInput(input, false);
|
235 |
-
|
236 |
-
input.data('minicolors-initialized', true);
|
237 |
-
}
|
238 |
-
|
239 |
-
// Returns the input back to its original state
|
240 |
-
function destroy(input) {
|
241 |
-
var minicolors = input.parent();
|
242 |
-
|
243 |
-
// Revert the input element
|
244 |
-
input
|
245 |
-
.removeData('minicolors-initialized')
|
246 |
-
.removeData('minicolors-settings')
|
247 |
-
.removeProp('size')
|
248 |
-
.removeClass('minicolors-input');
|
249 |
-
|
250 |
-
// Remove the wrap and destroy whatever remains
|
251 |
-
minicolors.before(input).remove();
|
252 |
-
}
|
253 |
-
|
254 |
-
// Shows the specified dropdown panel
|
255 |
-
function show(input) {
|
256 |
-
var minicolors = input.parent();
|
257 |
-
var panel = minicolors.find('.minicolors-panel');
|
258 |
-
var settings = input.data('minicolors-settings');
|
259 |
-
|
260 |
-
// Do nothing if uninitialized, disabled, inline, or already open
|
261 |
-
if(
|
262 |
-
!input.data('minicolors-initialized') ||
|
263 |
-
input.prop('disabled') ||
|
264 |
-
minicolors.hasClass('minicolors-inline') ||
|
265 |
-
minicolors.hasClass('minicolors-focus')
|
266 |
-
) return;
|
267 |
-
|
268 |
-
hide();
|
269 |
-
|
270 |
-
minicolors.addClass('minicolors-focus');
|
271 |
-
panel
|
272 |
-
.stop(true, true)
|
273 |
-
.fadeIn(settings.showSpeed, function() {
|
274 |
-
if(settings.show) settings.show.call(input.get(0));
|
275 |
-
});
|
276 |
-
}
|
277 |
-
|
278 |
-
// Hides all dropdown panels
|
279 |
-
function hide() {
|
280 |
-
$('.minicolors-focus').each(function() {
|
281 |
-
var minicolors = $(this);
|
282 |
-
var input = minicolors.find('.minicolors-input');
|
283 |
-
var panel = minicolors.find('.minicolors-panel');
|
284 |
-
var settings = input.data('minicolors-settings');
|
285 |
-
|
286 |
-
panel.fadeOut(settings.hideSpeed, function() {
|
287 |
-
if(settings.hide) settings.hide.call(input.get(0));
|
288 |
-
minicolors.removeClass('minicolors-focus');
|
289 |
-
});
|
290 |
-
|
291 |
-
});
|
292 |
-
}
|
293 |
-
|
294 |
-
// Moves the selected picker
|
295 |
-
function move(target, event, animate) {
|
296 |
-
var input = target.parents('.minicolors').find('.minicolors-input');
|
297 |
-
var settings = input.data('minicolors-settings');
|
298 |
-
var picker = target.find('[class$=-picker]');
|
299 |
-
var offsetX = target.offset().left;
|
300 |
-
var offsetY = target.offset().top;
|
301 |
-
var x = Math.round(event.pageX - offsetX);
|
302 |
-
var y = Math.round(event.pageY - offsetY);
|
303 |
-
var duration = animate ? settings.animationSpeed : 0;
|
304 |
-
var wx, wy, r, phi;
|
305 |
-
|
306 |
-
// Touch support
|
307 |
-
if(event.originalEvent.changedTouches) {
|
308 |
-
x = event.originalEvent.changedTouches[0].pageX - offsetX;
|
309 |
-
y = event.originalEvent.changedTouches[0].pageY - offsetY;
|
310 |
-
}
|
311 |
-
|
312 |
-
// Constrain picker to its container
|
313 |
-
if(x < 0) x = 0;
|
314 |
-
if(y < 0) y = 0;
|
315 |
-
if(x > target.width()) x = target.width();
|
316 |
-
if(y > target.height()) y = target.height();
|
317 |
-
|
318 |
-
// Constrain color wheel values to the wheel
|
319 |
-
if(target.parent().is('.minicolors-slider-wheel') && picker.parent().is('.minicolors-grid')) {
|
320 |
-
wx = 75 - x;
|
321 |
-
wy = 75 - y;
|
322 |
-
r = Math.sqrt(wx * wx + wy * wy);
|
323 |
-
phi = Math.atan2(wy, wx);
|
324 |
-
if(phi < 0) phi += Math.PI * 2;
|
325 |
-
if(r > 75) {
|
326 |
-
r = 75;
|
327 |
-
x = 75 - (75 * Math.cos(phi));
|
328 |
-
y = 75 - (75 * Math.sin(phi));
|
329 |
-
}
|
330 |
-
x = Math.round(x);
|
331 |
-
y = Math.round(y);
|
332 |
-
}
|
333 |
-
|
334 |
-
// Move the picker
|
335 |
-
if(target.is('.minicolors-grid')) {
|
336 |
-
picker
|
337 |
-
.stop(true)
|
338 |
-
.animate({
|
339 |
-
top: y + 'px',
|
340 |
-
left: x + 'px'
|
341 |
-
}, duration, settings.animationEasing, function() {
|
342 |
-
updateFromControl(input, target);
|
343 |
-
});
|
344 |
-
} else {
|
345 |
-
picker
|
346 |
-
.stop(true)
|
347 |
-
.animate({
|
348 |
-
top: y + 'px'
|
349 |
-
}, duration, settings.animationEasing, function() {
|
350 |
-
updateFromControl(input, target);
|
351 |
-
});
|
352 |
-
}
|
353 |
-
}
|
354 |
-
|
355 |
-
// Sets the input based on the color picker values
|
356 |
-
function updateFromControl(input, target) {
|
357 |
-
|
358 |
-
function getCoords(picker, container) {
|
359 |
-
var left, top;
|
360 |
-
if(!picker.length || !container) return null;
|
361 |
-
left = picker.offset().left;
|
362 |
-
top = picker.offset().top;
|
363 |
-
|
364 |
-
return {
|
365 |
-
x: left - container.offset().left + (picker.outerWidth() / 2),
|
366 |
-
y: top - container.offset().top + (picker.outerHeight() / 2)
|
367 |
-
};
|
368 |
-
}
|
369 |
-
|
370 |
-
var hue, saturation, brightness, x, y, r, phi;
|
371 |
-
var hex = input.val();
|
372 |
-
var opacity = input.attr('data-opacity');
|
373 |
-
|
374 |
-
// Helpful references
|
375 |
-
var minicolors = input.parent();
|
376 |
-
var settings = input.data('minicolors-settings');
|
377 |
-
var swatch = minicolors.find('.minicolors-input-swatch');
|
378 |
-
|
379 |
-
// Panel objects
|
380 |
-
var grid = minicolors.find('.minicolors-grid');
|
381 |
-
var slider = minicolors.find('.minicolors-slider');
|
382 |
-
var opacitySlider = minicolors.find('.minicolors-opacity-slider');
|
383 |
-
|
384 |
-
// Picker objects
|
385 |
-
var gridPicker = grid.find('[class$=-picker]');
|
386 |
-
var sliderPicker = slider.find('[class$=-picker]');
|
387 |
-
var opacityPicker = opacitySlider.find('[class$=-picker]');
|
388 |
-
|
389 |
-
// Picker positions
|
390 |
-
var gridPos = getCoords(gridPicker, grid);
|
391 |
-
var sliderPos = getCoords(sliderPicker, slider);
|
392 |
-
var opacityPos = getCoords(opacityPicker, opacitySlider);
|
393 |
-
|
394 |
-
// Handle colors
|
395 |
-
if(target.is('.minicolors-grid, .minicolors-slider, .minicolors-opacity-slider')) {
|
396 |
-
|
397 |
-
// Determine HSB values
|
398 |
-
switch(settings.control) {
|
399 |
-
case 'wheel':
|
400 |
-
// Calculate hue, saturation, and brightness
|
401 |
-
x = (grid.width() / 2) - gridPos.x;
|
402 |
-
y = (grid.height() / 2) - gridPos.y;
|
403 |
-
r = Math.sqrt(x * x + y * y);
|
404 |
-
phi = Math.atan2(y, x);
|
405 |
-
if(phi < 0) phi += Math.PI * 2;
|
406 |
-
if(r > 75) {
|
407 |
-
r = 75;
|
408 |
-
gridPos.x = 69 - (75 * Math.cos(phi));
|
409 |
-
gridPos.y = 69 - (75 * Math.sin(phi));
|
410 |
-
}
|
411 |
-
saturation = keepWithin(r / 0.75, 0, 100);
|
412 |
-
hue = keepWithin(phi * 180 / Math.PI, 0, 360);
|
413 |
-
brightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);
|
414 |
-
hex = hsb2hex({
|
415 |
-
h: hue,
|
416 |
-
s: saturation,
|
417 |
-
b: brightness
|
418 |
-
});
|
419 |
-
|
420 |
-
// Update UI
|
421 |
-
slider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));
|
422 |
-
break;
|
423 |
-
|
424 |
-
case 'saturation':
|
425 |
-
// Calculate hue, saturation, and brightness
|
426 |
-
hue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);
|
427 |
-
saturation = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);
|
428 |
-
brightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);
|
429 |
-
hex = hsb2hex({
|
430 |
-
h: hue,
|
431 |
-
s: saturation,
|
432 |
-
b: brightness
|
433 |
-
});
|
434 |
-
|
435 |
-
// Update UI
|
436 |
-
slider.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: brightness }));
|
437 |
-
minicolors.find('.minicolors-grid-inner').css('opacity', saturation / 100);
|
438 |
-
break;
|
439 |
-
|
440 |
-
case 'brightness':
|
441 |
-
// Calculate hue, saturation, and brightness
|
442 |
-
hue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);
|
443 |
-
saturation = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);
|
444 |
-
brightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);
|
445 |
-
hex = hsb2hex({
|
446 |
-
h: hue,
|
447 |
-
s: saturation,
|
448 |
-
b: brightness
|
449 |
-
});
|
450 |
-
|
451 |
-
// Update UI
|
452 |
-
slider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));
|
453 |
-
minicolors.find('.minicolors-grid-inner').css('opacity', 1 - (brightness / 100));
|
454 |
-
break;
|
455 |
-
|
456 |
-
default:
|
457 |
-
// Calculate hue, saturation, and brightness
|
458 |
-
hue = keepWithin(360 - parseInt(sliderPos.y * (360 / slider.height()), 10), 0, 360);
|
459 |
-
saturation = keepWithin(Math.floor(gridPos.x * (100 / grid.width())), 0, 100);
|
460 |
-
brightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);
|
461 |
-
hex = hsb2hex({
|
462 |
-
h: hue,
|
463 |
-
s: saturation,
|
464 |
-
b: brightness
|
465 |
-
});
|
466 |
-
|
467 |
-
// Update UI
|
468 |
-
grid.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: 100 }));
|
469 |
-
break;
|
470 |
-
}
|
471 |
-
|
472 |
-
// Handle opacity
|
473 |
-
if(settings.opacity) {
|
474 |
-
opacity = parseFloat(1 - (opacityPos.y / opacitySlider.height())).toFixed(2);
|
475 |
-
} else {
|
476 |
-
opacity = 1;
|
477 |
-
}
|
478 |
-
|
479 |
-
updateInput(input, hex, opacity);
|
480 |
-
}
|
481 |
-
else {
|
482 |
-
// Set swatch color
|
483 |
-
swatch.find('span').css({
|
484 |
-
backgroundColor: hex,
|
485 |
-
opacity: opacity
|
486 |
-
});
|
487 |
-
|
488 |
-
// Handle change event
|
489 |
-
doChange(input, hex, opacity);
|
490 |
-
}
|
491 |
-
}
|
492 |
-
|
493 |
-
// Sets the value of the input and does the appropriate conversions
|
494 |
-
// to respect settings, also updates the swatch
|
495 |
-
function updateInput(input, value, opacity) {
|
496 |
-
var rgb;
|
497 |
-
|
498 |
-
// Helpful references
|
499 |
-
var minicolors = input.parent();
|
500 |
-
var settings = input.data('minicolors-settings');
|
501 |
-
var swatch = minicolors.find('.minicolors-input-swatch');
|
502 |
-
|
503 |
-
if(settings.opacity) input.attr('data-opacity', opacity);
|
504 |
-
|
505 |
-
// Set color string
|
506 |
-
if(settings.format === 'rgb') {
|
507 |
-
// Returns RGB(A) string
|
508 |
-
|
509 |
-
// Checks for input format and does the conversion
|
510 |
-
if(isRgb(value)) {
|
511 |
-
rgb = parseRgb(value, true);
|
512 |
-
}
|
513 |
-
else {
|
514 |
-
rgb = hex2rgb(parseHex(value, true));
|
515 |
-
}
|
516 |
-
|
517 |
-
opacity = input.attr('data-opacity') === '' ? 1 : keepWithin(parseFloat(input.attr('data-opacity')).toFixed(2), 0, 1);
|
518 |
-
if(isNaN(opacity) || !settings.opacity) opacity = 1;
|
519 |
-
|
520 |
-
if(input.minicolors('rgbObject').a <= 1 && rgb && settings.opacity) {
|
521 |
-
// Set RGBA string if alpha
|
522 |
-
value = 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + parseFloat(opacity) + ')';
|
523 |
-
} else {
|
524 |
-
// Set RGB string (alpha = 1)
|
525 |
-
value = 'rgb(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ')';
|
526 |
-
}
|
527 |
-
} else {
|
528 |
-
// Returns hex color
|
529 |
-
|
530 |
-
// Checks for input format and does the conversion
|
531 |
-
if(isRgb(value)) {
|
532 |
-
value = rgbString2hex(value);
|
533 |
-
}
|
534 |
-
|
535 |
-
value = convertCase(value, settings.letterCase);
|
536 |
-
}
|
537 |
-
|
538 |
-
// Update value from picker
|
539 |
-
input.val(value);
|
540 |
-
|
541 |
-
// Set swatch color
|
542 |
-
swatch.find('span').css({
|
543 |
-
backgroundColor: value,
|
544 |
-
opacity: opacity
|
545 |
-
});
|
546 |
-
|
547 |
-
// Handle change event
|
548 |
-
doChange(input, value, opacity);
|
549 |
-
}
|
550 |
-
|
551 |
-
// Sets the color picker values from the input
|
552 |
-
function updateFromInput(input, preserveInputValue) {
|
553 |
-
var hex, hsb, opacity, keywords, alpha, value, x, y, r, phi;
|
554 |
-
|
555 |
-
// Helpful references
|
556 |
-
var minicolors = input.parent();
|
557 |
-
var settings = input.data('minicolors-settings');
|
558 |
-
var swatch = minicolors.find('.minicolors-input-swatch');
|
559 |
-
|
560 |
-
// Panel objects
|
561 |
-
var grid = minicolors.find('.minicolors-grid');
|
562 |
-
var slider = minicolors.find('.minicolors-slider');
|
563 |
-
var opacitySlider = minicolors.find('.minicolors-opacity-slider');
|
564 |
-
|
565 |
-
// Picker objects
|
566 |
-
var gridPicker = grid.find('[class$=-picker]');
|
567 |
-
var sliderPicker = slider.find('[class$=-picker]');
|
568 |
-
var opacityPicker = opacitySlider.find('[class$=-picker]');
|
569 |
-
|
570 |
-
// Determine hex/HSB values
|
571 |
-
if(isRgb(input.val())) {
|
572 |
-
// If input value is a rgb(a) string, convert it to hex color and update opacity
|
573 |
-
hex = rgbString2hex(input.val());
|
574 |
-
alpha = keepWithin(parseFloat(getAlpha(input.val())).toFixed(2), 0, 1);
|
575 |
-
if(alpha) {
|
576 |
-
input.attr('data-opacity', alpha);
|
577 |
-
}
|
578 |
-
} else {
|
579 |
-
hex = convertCase(parseHex(input.val(), true), settings.letterCase);
|
580 |
-
}
|
581 |
-
|
582 |
-
if(!hex){
|
583 |
-
hex = convertCase(parseInput(settings.defaultValue, true), settings.letterCase);
|
584 |
-
}
|
585 |
-
hsb = hex2hsb(hex);
|
586 |
-
|
587 |
-
// Get array of lowercase keywords
|
588 |
-
keywords = !settings.keywords ? [] : $.map(settings.keywords.split(','), function(a) {
|
589 |
-
return $.trim(a.toLowerCase());
|
590 |
-
});
|
591 |
-
|
592 |
-
// Set color string
|
593 |
-
if(input.val() !== '' && $.inArray(input.val().toLowerCase(), keywords) > -1) {
|
594 |
-
value = convertCase(input.val());
|
595 |
-
} else {
|
596 |
-
value = isRgb(input.val()) ? parseRgb(input.val()) : hex;
|
597 |
-
}
|
598 |
-
|
599 |
-
// Update input value
|
600 |
-
if(!preserveInputValue) input.val(value);
|
601 |
-
|
602 |
-
// Determine opacity value
|
603 |
-
if(settings.opacity) {
|
604 |
-
// Get from data-opacity attribute and keep within 0-1 range
|
605 |
-
opacity = input.attr('data-opacity') === '' ? 1 : keepWithin(parseFloat(input.attr('data-opacity')).toFixed(2), 0, 1);
|
606 |
-
if(isNaN(opacity)) opacity = 1;
|
607 |
-
input.attr('data-opacity', opacity);
|
608 |
-
swatch.find('span').css('opacity', opacity);
|
609 |
-
|
610 |
-
// Set opacity picker position
|
611 |
-
y = keepWithin(opacitySlider.height() - (opacitySlider.height() * opacity), 0, opacitySlider.height());
|
612 |
-
opacityPicker.css('top', y + 'px');
|
613 |
-
}
|
614 |
-
|
615 |
-
// Set opacity to zero if input value is transparent
|
616 |
-
if(input.val().toLowerCase() === 'transparent') {
|
617 |
-
swatch.find('span').css('opacity', 0);
|
618 |
-
}
|
619 |
-
|
620 |
-
// Update swatch
|
621 |
-
swatch.find('span').css('backgroundColor', hex);
|
622 |
-
|
623 |
-
// Determine picker locations
|
624 |
-
switch(settings.control) {
|
625 |
-
case 'wheel':
|
626 |
-
// Set grid position
|
627 |
-
r = keepWithin(Math.ceil(hsb.s * 0.75), 0, grid.height() / 2);
|
628 |
-
phi = hsb.h * Math.PI / 180;
|
629 |
-
x = keepWithin(75 - Math.cos(phi) * r, 0, grid.width());
|
630 |
-
y = keepWithin(75 - Math.sin(phi) * r, 0, grid.height());
|
631 |
-
gridPicker.css({
|
632 |
-
top: y + 'px',
|
633 |
-
left: x + 'px'
|
634 |
-
});
|
635 |
-
|
636 |
-
// Set slider position
|
637 |
-
y = 150 - (hsb.b / (100 / grid.height()));
|
638 |
-
if(hex === '') y = 0;
|
639 |
-
sliderPicker.css('top', y + 'px');
|
640 |
-
|
641 |
-
// Update panel color
|
642 |
-
slider.css('backgroundColor', hsb2hex({ h: hsb.h, s: hsb.s, b: 100 }));
|
643 |
-
break;
|
644 |
-
|
645 |
-
case 'saturation':
|
646 |
-
// Set grid position
|
647 |
-
x = keepWithin((5 * hsb.h) / 12, 0, 150);
|
648 |
-
y = keepWithin(grid.height() - Math.ceil(hsb.b / (100 / grid.height())), 0, grid.height());
|
649 |
-
gridPicker.css({
|
650 |
-
top: y + 'px',
|
651 |
-
left: x + 'px'
|
652 |
-
});
|
653 |
-
|
654 |
-
// Set slider position
|
655 |
-
y = keepWithin(slider.height() - (hsb.s * (slider.height() / 100)), 0, slider.height());
|
656 |
-
sliderPicker.css('top', y + 'px');
|
657 |
-
|
658 |
-
// Update UI
|
659 |
-
slider.css('backgroundColor', hsb2hex({ h: hsb.h, s: 100, b: hsb.b }));
|
660 |
-
minicolors.find('.minicolors-grid-inner').css('opacity', hsb.s / 100);
|
661 |
-
break;
|
662 |
-
|
663 |
-
case 'brightness':
|
664 |
-
// Set grid position
|
665 |
-
x = keepWithin((5 * hsb.h) / 12, 0, 150);
|
666 |
-
y = keepWithin(grid.height() - Math.ceil(hsb.s / (100 / grid.height())), 0, grid.height());
|
667 |
-
gridPicker.css({
|
668 |
-
top: y + 'px',
|
669 |
-
left: x + 'px'
|
670 |
-
});
|
671 |
-
|
672 |
-
// Set slider position
|
673 |
-
y = keepWithin(slider.height() - (hsb.b * (slider.height() / 100)), 0, slider.height());
|
674 |
-
sliderPicker.css('top', y + 'px');
|
675 |
-
|
676 |
-
// Update UI
|
677 |
-
slider.css('backgroundColor', hsb2hex({ h: hsb.h, s: hsb.s, b: 100 }));
|
678 |
-
minicolors.find('.minicolors-grid-inner').css('opacity', 1 - (hsb.b / 100));
|
679 |
-
break;
|
680 |
-
|
681 |
-
default:
|
682 |
-
// Set grid position
|
683 |
-
x = keepWithin(Math.ceil(hsb.s / (100 / grid.width())), 0, grid.width());
|
684 |
-
y = keepWithin(grid.height() - Math.ceil(hsb.b / (100 / grid.height())), 0, grid.height());
|
685 |
-
gridPicker.css({
|
686 |
-
top: y + 'px',
|
687 |
-
left: x + 'px'
|
688 |
-
});
|
689 |
-
|
690 |
-
// Set slider position
|
691 |
-
y = keepWithin(slider.height() - (hsb.h / (360 / slider.height())), 0, slider.height());
|
692 |
-
sliderPicker.css('top', y + 'px');
|
693 |
-
|
694 |
-
// Update panel color
|
695 |
-
grid.css('backgroundColor', hsb2hex({ h: hsb.h, s: 100, b: 100 }));
|
696 |
-
break;
|
697 |
-
}
|
698 |
-
|
699 |
-
// Fire change event, but only if minicolors is fully initialized
|
700 |
-
if(input.data('minicolors-initialized')) {
|
701 |
-
doChange(input, value, opacity);
|
702 |
-
}
|
703 |
-
}
|
704 |
-
|
705 |
-
// Runs the change and changeDelay callbacks
|
706 |
-
function doChange(input, value, opacity) {
|
707 |
-
var settings = input.data('minicolors-settings');
|
708 |
-
var lastChange = input.data('minicolors-lastChange');
|
709 |
-
var obj, sel, i;
|
710 |
-
|
711 |
-
// Only run if it actually changed
|
712 |
-
if(!lastChange || lastChange.value !== value || lastChange.opacity !== opacity) {
|
713 |
-
|
714 |
-
// Remember last-changed value
|
715 |
-
input.data('minicolors-lastChange', {
|
716 |
-
value: value,
|
717 |
-
opacity: opacity
|
718 |
-
});
|
719 |
-
|
720 |
-
// Check and select applicable swatch
|
721 |
-
if(settings.swatches && settings.swatches.length !== 0) {
|
722 |
-
if(!isRgb(value)) {
|
723 |
-
obj = hex2rgb(value);
|
724 |
-
}
|
725 |
-
else {
|
726 |
-
obj = parseRgb(value, true);
|
727 |
-
}
|
728 |
-
sel = -1;
|
729 |
-
for(i = 0; i < settings.swatches.length; ++i) {
|
730 |
-
if(obj.r === settings.swatches[i].r && obj.g === settings.swatches[i].g && obj.b === settings.swatches[i].b && obj.a === settings.swatches[i].a) {
|
731 |
-
sel = i;
|
732 |
-
break;
|
733 |
-
}
|
734 |
-
}
|
735 |
-
|
736 |
-
input.parent().find('.minicolors-swatches .minicolors-swatch').removeClass('selected');
|
737 |
-
if(sel !== -1) {
|
738 |
-
input.parent().find('.minicolors-swatches .minicolors-swatch').eq(i).addClass('selected');
|
739 |
-
}
|
740 |
-
}
|
741 |
-
|
742 |
-
// Fire change event
|
743 |
-
if(settings.change) {
|
744 |
-
if(settings.changeDelay) {
|
745 |
-
// Call after a delay
|
746 |
-
clearTimeout(input.data('minicolors-changeTimeout'));
|
747 |
-
input.data('minicolors-changeTimeout', setTimeout(function() {
|
748 |
-
settings.change.call(input.get(0), value, opacity);
|
749 |
-
}, settings.changeDelay));
|
750 |
-
} else {
|
751 |
-
// Call immediately
|
752 |
-
settings.change.call(input.get(0), value, opacity);
|
753 |
-
}
|
754 |
-
}
|
755 |
-
input.trigger('change').trigger('input');
|
756 |
-
}
|
757 |
-
}
|
758 |
-
|
759 |
-
// Generates an RGB(A) object based on the input's value
|
760 |
-
function rgbObject(input) {
|
761 |
-
var rgb,
|
762 |
-
opacity = $(input).attr('data-opacity');
|
763 |
-
if( isRgb($(input).val()) ) {
|
764 |
-
rgb = parseRgb($(input).val(), true);
|
765 |
-
} else {
|
766 |
-
var hex = parseHex($(input).val(), true);
|
767 |
-
rgb = hex2rgb(hex);
|
768 |
-
}
|
769 |
-
if( !rgb ) return null;
|
770 |
-
if( opacity !== undefined ) $.extend(rgb, { a: parseFloat(opacity) });
|
771 |
-
return rgb;
|
772 |
-
}
|
773 |
-
|
774 |
-
// Generates an RGB(A) string based on the input's value
|
775 |
-
function rgbString(input, alpha) {
|
776 |
-
var rgb,
|
777 |
-
opacity = $(input).attr('data-opacity');
|
778 |
-
if( isRgb($(input).val()) ) {
|
779 |
-
rgb = parseRgb($(input).val(), true);
|
780 |
-
} else {
|
781 |
-
var hex = parseHex($(input).val(), true);
|
782 |
-
rgb = hex2rgb(hex);
|
783 |
-
}
|
784 |
-
if( !rgb ) return null;
|
785 |
-
if( opacity === undefined ) opacity = 1;
|
786 |
-
if( alpha ) {
|
787 |
-
return 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + parseFloat(opacity) + ')';
|
788 |
-
} else {
|
789 |
-
return 'rgb(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ')';
|
790 |
-
}
|
791 |
-
}
|
792 |
-
|
793 |
-
// Converts to the letter case specified in settings
|
794 |
-
function convertCase(string, letterCase) {
|
795 |
-
return letterCase === 'uppercase' ? string.toUpperCase() : string.toLowerCase();
|
796 |
-
}
|
797 |
-
|
798 |
-
// Parses a string and returns a valid hex string when possible
|
799 |
-
function parseHex(string, expand) {
|
800 |
-
string = string.replace(/^#/g, '');
|
801 |
-
if(!string.match(/^[A-F0-9]{3,6}/ig)) return '';
|
802 |
-
if(string.length !== 3 && string.length !== 6) return '';
|
803 |
-
if(string.length === 3 && expand) {
|
804 |
-
string = string[0] + string[0] + string[1] + string[1] + string[2] + string[2];
|
805 |
-
}
|
806 |
-
return '#' + string;
|
807 |
-
}
|
808 |
-
|
809 |
-
// Parses a string and returns a valid RGB(A) string when possible
|
810 |
-
function parseRgb(string, obj) {
|
811 |
-
var values = string.replace(/[^\d,.]/g, '');
|
812 |
-
var rgba = values.split(',');
|
813 |
-
|
814 |
-
rgba[0] = keepWithin(parseInt(rgba[0], 10), 0, 255);
|
815 |
-
rgba[1] = keepWithin(parseInt(rgba[1], 10), 0, 255);
|
816 |
-
rgba[2] = keepWithin(parseInt(rgba[2], 10), 0, 255);
|
817 |
-
if(rgba[3]) {
|
818 |
-
rgba[3] = keepWithin(parseFloat(rgba[3], 10), 0, 1);
|
819 |
-
}
|
820 |
-
|
821 |
-
// Return RGBA object
|
822 |
-
if( obj ) {
|
823 |
-
if (rgba[3]) {
|
824 |
-
return {
|
825 |
-
r: rgba[0],
|
826 |
-
g: rgba[1],
|
827 |
-
b: rgba[2],
|
828 |
-
a: rgba[3]
|
829 |
-
};
|
830 |
-
} else {
|
831 |
-
return {
|
832 |
-
r: rgba[0],
|
833 |
-
g: rgba[1],
|
834 |
-
b: rgba[2]
|
835 |
-
};
|
836 |
-
}
|
837 |
-
}
|
838 |
-
|
839 |
-
// Return RGBA string
|
840 |
-
if(typeof(rgba[3]) !== 'undefined' && rgba[3] <= 1) {
|
841 |
-
return 'rgba(' + rgba[0] + ', ' + rgba[1] + ', ' + rgba[2] + ', ' + rgba[3] + ')';
|
842 |
-
} else {
|
843 |
-
return 'rgb(' + rgba[0] + ', ' + rgba[1] + ', ' + rgba[2] + ')';
|
844 |
-
}
|
845 |
-
|
846 |
-
}
|
847 |
-
|
848 |
-
// Parses a string and returns a valid color string when possible
|
849 |
-
function parseInput(string, expand) {
|
850 |
-
if(isRgb(string)) {
|
851 |
-
// Returns a valid rgb(a) string
|
852 |
-
return parseRgb(string);
|
853 |
-
} else {
|
854 |
-
return parseHex(string, expand);
|
855 |
-
}
|
856 |
-
}
|
857 |
-
|
858 |
-
// Keeps value within min and max
|
859 |
-
function keepWithin(value, min, max) {
|
860 |
-
if(value < min) value = min;
|
861 |
-
if(value > max) value = max;
|
862 |
-
return value;
|
863 |
-
}
|
864 |
-
|
865 |
-
// Checks if a string is a valid RGB(A) string
|
866 |
-
function isRgb(string) {
|
867 |
-
var rgb = string.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
868 |
-
return (rgb && rgb.length === 4) ? true : false;
|
869 |
-
}
|
870 |
-
|
871 |
-
// Function to get alpha from a RGB(A) string
|
872 |
-
function getAlpha(rgba) {
|
873 |
-
rgba = rgba.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i);
|
874 |
-
return (rgba && rgba.length === 6) ? rgba[4] : '1';
|
875 |
-
}
|
876 |
-
|
877 |
-
// Converts an HSB object to an RGB object
|
878 |
-
function hsb2rgb(hsb) {
|
879 |
-
var rgb = {};
|
880 |
-
var h = Math.round(hsb.h);
|
881 |
-
var s = Math.round(hsb.s * 255 / 100);
|
882 |
-
var v = Math.round(hsb.b * 255 / 100);
|
883 |
-
if(s === 0) {
|
884 |
-
rgb.r = rgb.g = rgb.b = v;
|
885 |
-
} else {
|
886 |
-
var t1 = v;
|
887 |
-
var t2 = (255 - s) * v / 255;
|
888 |
-
var t3 = (t1 - t2) * (h % 60) / 60;
|
889 |
-
if(h === 360) h = 0;
|
890 |
-
if(h < 60) { rgb.r = t1; rgb.b = t2; rgb.g = t2 + t3; }
|
891 |
-
else if(h < 120) {rgb.g = t1; rgb.b = t2; rgb.r = t1 - t3; }
|
892 |
-
else if(h < 180) {rgb.g = t1; rgb.r = t2; rgb.b = t2 + t3; }
|
893 |
-
else if(h < 240) {rgb.b = t1; rgb.r = t2; rgb.g = t1 - t3; }
|
894 |
-
else if(h < 300) {rgb.b = t1; rgb.g = t2; rgb.r = t2 + t3; }
|
895 |
-
else if(h < 360) {rgb.r = t1; rgb.g = t2; rgb.b = t1 - t3; }
|
896 |
-
else { rgb.r = 0; rgb.g = 0; rgb.b = 0; }
|
897 |
-
}
|
898 |
-
return {
|
899 |
-
r: Math.round(rgb.r),
|
900 |
-
g: Math.round(rgb.g),
|
901 |
-
b: Math.round(rgb.b)
|
902 |
-
};
|
903 |
-
}
|
904 |
-
|
905 |
-
// Converts an RGB string to a hex string
|
906 |
-
function rgbString2hex(rgb){
|
907 |
-
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
908 |
-
return (rgb && rgb.length === 4) ? '#' +
|
909 |
-
('0' + parseInt(rgb[1],10).toString(16)).slice(-2) +
|
910 |
-
('0' + parseInt(rgb[2],10).toString(16)).slice(-2) +
|
911 |
-
('0' + parseInt(rgb[3],10).toString(16)).slice(-2) : '';
|
912 |
-
}
|
913 |
-
|
914 |
-
// Converts an RGB object to a hex string
|
915 |
-
function rgb2hex(rgb) {
|
916 |
-
var hex = [
|
917 |
-
rgb.r.toString(16),
|
918 |
-
rgb.g.toString(16),
|
919 |
-
rgb.b.toString(16)
|
920 |
-
];
|
921 |
-
$.each(hex, function(nr, val) {
|
922 |
-
if(val.length === 1) hex[nr] = '0' + val;
|
923 |
-
});
|
924 |
-
return '#' + hex.join('');
|
925 |
-
}
|
926 |
-
|
927 |
-
// Converts an HSB object to a hex string
|
928 |
-
function hsb2hex(hsb) {
|
929 |
-
return rgb2hex(hsb2rgb(hsb));
|
930 |
-
}
|
931 |
-
|
932 |
-
// Converts a hex string to an HSB object
|
933 |
-
function hex2hsb(hex) {
|
934 |
-
var hsb = rgb2hsb(hex2rgb(hex));
|
935 |
-
if(hsb.s === 0) hsb.h = 360;
|
936 |
-
return hsb;
|
937 |
-
}
|
938 |
-
|
939 |
-
// Converts an RGB object to an HSB object
|
940 |
-
function rgb2hsb(rgb) {
|
941 |
-
var hsb = { h: 0, s: 0, b: 0 };
|
942 |
-
var min = Math.min(rgb.r, rgb.g, rgb.b);
|
943 |
-
var max = Math.max(rgb.r, rgb.g, rgb.b);
|
944 |
-
var delta = max - min;
|
945 |
-
hsb.b = max;
|
946 |
-
hsb.s = max !== 0 ? 255 * delta / max : 0;
|
947 |
-
if(hsb.s !== 0) {
|
948 |
-
if(rgb.r === max) {
|
949 |
-
hsb.h = (rgb.g - rgb.b) / delta;
|
950 |
-
} else if(rgb.g === max) {
|
951 |
-
hsb.h = 2 + (rgb.b - rgb.r) / delta;
|
952 |
-
} else {
|
953 |
-
hsb.h = 4 + (rgb.r - rgb.g) / delta;
|
954 |
-
}
|
955 |
-
} else {
|
956 |
-
hsb.h = -1;
|
957 |
-
}
|
958 |
-
hsb.h *= 60;
|
959 |
-
if(hsb.h < 0) {
|
960 |
-
hsb.h += 360;
|
961 |
-
}
|
962 |
-
hsb.s *= 100/255;
|
963 |
-
hsb.b *= 100/255;
|
964 |
-
return hsb;
|
965 |
-
}
|
966 |
-
|
967 |
-
// Converts a hex string to an RGB object
|
968 |
-
function hex2rgb(hex) {
|
969 |
-
hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
970 |
-
return {
|
971 |
-
r: hex >> 16,
|
972 |
-
g: (hex & 0x00FF00) >> 8,
|
973 |
-
b: (hex & 0x0000FF)
|
974 |
-
};
|
975 |
-
}
|
976 |
-
|
977 |
-
// Handle events
|
978 |
-
$([document])
|
979 |
-
// Hide on clicks outside of the control
|
980 |
-
.on('mousedown.minicolors touchstart.minicolors', function(event) {
|
981 |
-
if(!$(event.target).parents().add(event.target).hasClass('minicolors')) {
|
982 |
-
hide();
|
983 |
-
}
|
984 |
-
})
|
985 |
-
// Start moving
|
986 |
-
.on('mousedown.minicolors touchstart.minicolors', '.minicolors-grid, .minicolors-slider, .minicolors-opacity-slider', function(event) {
|
987 |
-
var target = $(this);
|
988 |
-
event.preventDefault();
|
989 |
-
$(event.delegateTarget).data('minicolors-target', target);
|
990 |
-
move(target, event, true);
|
991 |
-
})
|
992 |
-
// Move pickers
|
993 |
-
.on('mousemove.minicolors touchmove.minicolors', function(event) {
|
994 |
-
var target = $(event.delegateTarget).data('minicolors-target');
|
995 |
-
if(target) move(target, event);
|
996 |
-
})
|
997 |
-
// Stop moving
|
998 |
-
.on('mouseup.minicolors touchend.minicolors', function() {
|
999 |
-
$(this).removeData('minicolors-target');
|
1000 |
-
})
|
1001 |
-
// Selected a swatch
|
1002 |
-
.on('click.minicolors', '.minicolors-swatches li', function(event) {
|
1003 |
-
event.preventDefault();
|
1004 |
-
var target = $(this), input = target.parents('.minicolors').find('.minicolors-input'), color = target.data('swatch-color');
|
1005 |
-
updateInput(input, color, getAlpha(color));
|
1006 |
-
updateFromInput(input);
|
1007 |
-
})
|
1008 |
-
// Show panel when swatch is clicked
|
1009 |
-
.on('mousedown.minicolors touchstart.minicolors', '.minicolors-input-swatch', function(event) {
|
1010 |
-
var input = $(this).parent().find('.minicolors-input');
|
1011 |
-
event.preventDefault();
|
1012 |
-
show(input);
|
1013 |
-
})
|
1014 |
-
// Show on focus
|
1015 |
-
.on('focus.minicolors', '.minicolors-input', function() {
|
1016 |
-
var input = $(this);
|
1017 |
-
if(!input.data('minicolors-initialized')) return;
|
1018 |
-
show(input);
|
1019 |
-
})
|
1020 |
-
// Update value on blur
|
1021 |
-
.on('blur.minicolors', '.minicolors-input', function() {
|
1022 |
-
var input = $(this);
|
1023 |
-
var settings = input.data('minicolors-settings');
|
1024 |
-
var keywords;
|
1025 |
-
var hex;
|
1026 |
-
var rgba;
|
1027 |
-
var swatchOpacity;
|
1028 |
-
var value;
|
1029 |
-
|
1030 |
-
if(!input.data('minicolors-initialized')) return;
|
1031 |
-
|
1032 |
-
// Get array of lowercase keywords
|
1033 |
-
keywords = !settings.keywords ? [] : $.map(settings.keywords.split(','), function(a) {
|
1034 |
-
return $.trim(a.toLowerCase());
|
1035 |
-
});
|
1036 |
-
|
1037 |
-
// Set color string
|
1038 |
-
if(input.val() !== '' && $.inArray(input.val().toLowerCase(), keywords) > -1) {
|
1039 |
-
value = input.val();
|
1040 |
-
} else {
|
1041 |
-
// Get RGBA values for easy conversion
|
1042 |
-
if(isRgb(input.val())) {
|
1043 |
-
rgba = parseRgb(input.val(), true);
|
1044 |
-
} else {
|
1045 |
-
hex = parseHex(input.val(), true);
|
1046 |
-
rgba = hex ? hex2rgb(hex) : null;
|
1047 |
-
}
|
1048 |
-
|
1049 |
-
// Convert to format
|
1050 |
-
if(rgba === null) {
|
1051 |
-
value = settings.defaultValue;
|
1052 |
-
} else if(settings.format === 'rgb') {
|
1053 |
-
value = settings.opacity ?
|
1054 |
-
parseRgb('rgba(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ',' + input.attr('data-opacity') + ')') :
|
1055 |
-
parseRgb('rgb(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ')');
|
1056 |
-
} else {
|
1057 |
-
value = rgb2hex(rgba);
|
1058 |
-
}
|
1059 |
-
}
|
1060 |
-
|
1061 |
-
// Update swatch opacity
|
1062 |
-
swatchOpacity = settings.opacity ? input.attr('data-opacity') : 1;
|
1063 |
-
if(value.toLowerCase() === 'transparent') swatchOpacity = 0;
|
1064 |
-
input
|
1065 |
-
.closest('.minicolors')
|
1066 |
-
.find('.minicolors-input-swatch > span')
|
1067 |
-
.css('opacity', swatchOpacity);
|
1068 |
-
|
1069 |
-
// Set input value
|
1070 |
-
input.val(value);
|
1071 |
-
|
1072 |
-
// Is it blank?
|
1073 |
-
if(input.val() === '') input.val(parseInput(settings.defaultValue, true));
|
1074 |
-
|
1075 |
-
// Adjust case
|
1076 |
-
input.val(convertCase(input.val(), settings.letterCase));
|
1077 |
-
|
1078 |
-
})
|
1079 |
-
// Handle keypresses
|
1080 |
-
.on('keydown.minicolors', '.minicolors-input', function(event) {
|
1081 |
-
var input = $(this);
|
1082 |
-
if(!input.data('minicolors-initialized')) return;
|
1083 |
-
switch(event.keyCode) {
|
1084 |
-
case 9: // tab
|
1085 |
-
hide();
|
1086 |
-
break;
|
1087 |
-
case 13: // enter
|
1088 |
-
case 27: // esc
|
1089 |
-
hide();
|
1090 |
-
input.blur();
|
1091 |
-
break;
|
1092 |
-
}
|
1093 |
-
})
|
1094 |
-
// Update on keyup
|
1095 |
-
.on('keyup.minicolors', '.minicolors-input', function() {
|
1096 |
-
var input = $(this);
|
1097 |
-
if(!input.data('minicolors-initialized')) return;
|
1098 |
-
updateFromInput(input, true);
|
1099 |
-
})
|
1100 |
-
// Update on paste
|
1101 |
-
.on('paste.minicolors', '.minicolors-input', function() {
|
1102 |
-
var input = $(this);
|
1103 |
-
if(!input.data('minicolors-initialized')) return;
|
1104 |
-
setTimeout(function() {
|
1105 |
-
updateFromInput(input, true);
|
1106 |
-
}, 1);
|
1107 |
-
});
|
1108 |
-
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/js/vi-check.js
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
(function(funcName, baseObj) {
|
2 |
-
"use strict";
|
3 |
-
funcName = funcName || "docReady";
|
4 |
-
baseObj = baseObj || window;
|
5 |
-
var readyList = [];
|
6 |
-
var readyFired = false;
|
7 |
-
var readyEventHandlersInstalled = false;
|
8 |
-
|
9 |
-
function ready() {
|
10 |
-
if (!readyFired) {
|
11 |
-
readyFired = true;
|
12 |
-
for (var i = 0; i < readyList.length; i++) {
|
13 |
-
readyList[i].fn.call(window, readyList[i].ctx);
|
14 |
-
}
|
15 |
-
readyList = [];
|
16 |
-
}
|
17 |
-
}
|
18 |
-
|
19 |
-
function readyStateChange() {
|
20 |
-
if ( document.readyState === "complete" ) {
|
21 |
-
ready();
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
baseObj[funcName] = function(callback, context) {
|
26 |
-
if (typeof callback !== "function") {
|
27 |
-
throw new TypeError("callback for docReady(fn) must be a function");
|
28 |
-
}
|
29 |
-
if (readyFired) {
|
30 |
-
setTimeout(function() {callback(context);}, 1);
|
31 |
-
return;
|
32 |
-
} else {
|
33 |
-
readyList.push({fn: callback, ctx: context});
|
34 |
-
}
|
35 |
-
|
36 |
-
if (document.readyState === "complete" || (!document.attachEvent && document.readyState === "interactive")) {
|
37 |
-
setTimeout(ready, 1);
|
38 |
-
} else if (!readyEventHandlersInstalled) {
|
39 |
-
if (document.addEventListener) {
|
40 |
-
document.addEventListener("DOMContentLoaded", ready, false);
|
41 |
-
window.addEventListener("load", ready, false);
|
42 |
-
} else {
|
43 |
-
document.attachEvent("onreadystatechange", readyStateChange);
|
44 |
-
window.attachEvent("onload", ready);
|
45 |
-
}
|
46 |
-
readyEventHandlersInstalled = true;
|
47 |
-
}
|
48 |
-
}
|
49 |
-
})("docReady", window);
|
50 |
-
|
51 |
-
docReady(function() {
|
52 |
-
var viWrapper = document.getElementById("quick_adsense_vi_ad");
|
53 |
-
if (typeof(viWrapper) != 'undefined' && viWrapper != null) {
|
54 |
-
var viWrapperWidth = parseInt(viWrapper.clientWidth, 10);
|
55 |
-
if(viWrapperWidth < 336) {
|
56 |
-
var ajaxFrame = document.createElement('iframe');
|
57 |
-
ajaxFrame.src = document.getElementById('quick_adsense_vi_width_check_url').value + '?quick_adsense_vi_width_check=' + document.getElementById('quick_adsense_vi_width_check_auth').value;
|
58 |
-
ajaxFrame.style.display = 'none';
|
59 |
-
document.getElementById('quick_adsense_vi_ad').appendChild(ajaxFrame);
|
60 |
-
}
|
61 |
-
}
|
62 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/loader.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Return the content of the File after processing.
|
4 |
+
*
|
5 |
+
* @param string $file File name.
|
6 |
+
* @param array $args Data to pass to the file.
|
7 |
+
*/
|
8 |
+
function quick_adsense_load_file( $file, $args = [] ) {
|
9 |
+
if ( ( '' !== $file ) && file_exists( dirname( __FILE__ ) . '/' . $file ) ) {
|
10 |
+
//phpcs:disable
|
11 |
+
// Usage of extract() is necessary in this content to simulate templating functionality.
|
12 |
+
extract( $args );
|
13 |
+
//phpcs:enable
|
14 |
+
ob_start();
|
15 |
+
include dirname( __FILE__ ) . '/' . $file;
|
16 |
+
$content = ob_get_contents();
|
17 |
+
ob_end_clean();
|
18 |
+
return $content;
|
19 |
+
}
|
20 |
+
}
|
includes/quicktags.php
CHANGED
@@ -1,33 +1,39 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
}
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Quicktag Integration.
|
4 |
+
*/
|
5 |
+
|
6 |
+
add_action(
|
7 |
+
'admin_print_footer_scripts',
|
8 |
+
function() {
|
9 |
+
if ( wp_script_is( 'quicktags' ) ) {
|
10 |
+
$settings = get_option( 'quick_adsense_settings' );
|
11 |
+
echo '<script type="text/javascript">';
|
12 |
+
if ( isset( $settings['enable_quicktag_buttons'] ) && ( $settings['enable_quicktag_buttons'] ) ) {
|
13 |
+
for ( $i = 1; $i <= 10; $i++ ) {
|
14 |
+
if ( isset( $settings[ 'onpost_ad_' . $i . '_content' ] ) && ( '' !== $settings[ 'onpost_ad_' . $i . '_content' ] ) ) {
|
15 |
+
echo 'QTags.addButton("quick_adsense_quicktag_onpost_ad_' . esc_js( $i ) . '", "Ads' . esc_js( $i ) . '", "\n<!--Ads' . esc_js( $i ) . '-->\n", "", "", "Ads' . esc_js( $i ) . '", 201);';
|
16 |
+
}
|
17 |
+
}
|
18 |
+
if ( ! isset( $settings['disable_randomads_quicktag_button'] ) || ( ! $settings['disable_randomads_quicktag_button'] ) ) {
|
19 |
+
echo 'QTags.addButton("quick_adsense_quicktag_randomads", "RndAds", "\n<!--RndAds-->\n", "", "", "Random Ads", 201);';
|
20 |
+
}
|
21 |
+
if ( ! isset( $settings['disable_disablead_quicktag_buttons'] ) || ( ! $settings['disable_disablead_quicktag_buttons'] ) ) {
|
22 |
+
echo 'QTags.addButton("quick_adsense_quicktag_noads", "NoAds", "\n<!--NoAds-->\n", "", "", "No Ads", 201);';
|
23 |
+
echo 'QTags.addButton("quick_adsense_quicktag_offdef", "OffDef", "\n<!--OffDef-->\n", "", "", "No Def", 201);';
|
24 |
+
echo 'QTags.addButton("quick_adsense_quicktag_offwidget", "OffWidget", "\n<!--OffWidget-->\n", "", "", "No AdWidgets", 201);';
|
25 |
+
}
|
26 |
+
if ( ! isset( $settings['disable_positionad_quicktag_buttons'] ) || ( ! $settings['disable_positionad_quicktag_buttons'] ) ) {
|
27 |
+
echo 'QTags.addButton("quick_adsense_quicktag_offbegin", "OffBegin", "\n<!--OffBegin-->\n", "", "", "Disable Beginning of Post Ads", 201);';
|
28 |
+
echo 'QTags.addButton("quick_adsense_quicktag_offmiddle", "OffMiddle", "\n<!--OffMiddle-->\n", "", "", "Disable Middle of Post Ads", 201);';
|
29 |
+
echo 'QTags.addButton("quick_adsense_quicktag_offend", "OffEnd", "\n<!--OffEnd-->\n", "", "", "Disable End of Post Ads", 201);';
|
30 |
+
echo 'QTags.addButton("quick_adsense_quicktag_offafmore", "OffAfMore", "\n<!--OffAfMore-->\n", "", "", "OffAfMore", 201);';
|
31 |
+
echo 'QTags.addButton("quick_adsense_quicktag_offbflastpara", "OffBfLastPara", "\n<!--OffBfLastPara-->\n", "", "", "OffBfLastPara", 201);';
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
echo '</script>';
|
36 |
+
}
|
37 |
+
}
|
38 |
+
);
|
39 |
+
|
includes/settings.php
CHANGED
@@ -1,729 +1,191 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
)
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
echo quickadsense_get_control('checkbox', '', 'quick_adsense_settings_enable_jump_position_after_image_option_'.$i, 'quick_adsense_settings[enable_jump_position_after_image_option_'.$i.']', ((isset($settings['enable_jump_position_after_image_option_'.$i]))?$settings['enable_jump_position_after_image_option_'.$i]:''), null, 'input', 'margin: -1px 10px 0;');
|
193 |
-
echo 'after <b>Image\'s outer <div> wp-caption</b> if any';
|
194 |
-
echo '</p>';
|
195 |
-
}
|
196 |
-
echo '</div>';
|
197 |
-
echo '<div class="clear"></div>';
|
198 |
-
echo '</div>';
|
199 |
-
|
200 |
-
echo '<div class="quick_adsense_block">';
|
201 |
-
echo '<div class="quick_adsense_block_labels">';
|
202 |
-
echo 'Appearance';
|
203 |
-
echo '</div>';
|
204 |
-
echo '<div class="quick_adsense_block_controls">';
|
205 |
-
echo '<p>';
|
206 |
-
echo '<span>'.quickadsense_get_control('checkbox', '<b id="quick_adsense_settings_enable_on_posts_label">Posts</b>', 'quick_adsense_settings_enable_on_posts', 'quick_adsense_settings[enable_on_posts]', ((isset($settings['enable_on_posts']))?$settings['enable_on_posts']:''), null, 'input', 'margin: -1px 10px 0 0;').'</span>';
|
207 |
-
echo '<span>'.quickadsense_get_control('checkbox', '<b id="quick_adsense_settings_enable_on_pages_label">Pages</b>', 'quick_adsense_settings_enable_on_pages', 'quick_adsense_settings[enable_on_pages]', ((isset($settings['enable_on_pages']))?$settings['enable_on_pages']:''), null, 'input', 'margin: -1px 10px 0 15px;').'</span>';
|
208 |
-
echo '</p>';
|
209 |
-
echo '<p>';
|
210 |
-
echo '<span>'.quickadsense_get_control('checkbox', '<b id="quick_adsense_settings_enable_on_homepage_label">Homepage</b>', 'quick_adsense_settings_enable_on_homepage', 'quick_adsense_settings[enable_on_homepage]', ((isset($settings['enable_on_homepage']))?$settings['enable_on_homepage']:''), null, 'input', 'margin: -1px 10px 0 0;').'</span>';
|
211 |
-
echo '<span>'.quickadsense_get_control('checkbox', '<b id="quick_adsense_settings_enable_on_categories_label">Categories</b>', 'quick_adsense_settings_enable_on_categories', 'quick_adsense_settings[enable_on_categories]', ((isset($settings['enable_on_categories']))?$settings['enable_on_categories']:''), null, 'input', 'margin: -1px 10px 0 15px;').'</span>';
|
212 |
-
echo '<span>'.quickadsense_get_control('checkbox', '<b id="quick_adsense_settings_enable_on_archives_label">Archives</b>', 'quick_adsense_settings_enable_on_archives', 'quick_adsense_settings[enable_on_archives]', ((isset($settings['enable_on_archives']))?$settings['enable_on_archives']:''), null, 'input', 'margin: -1px 10px 0 15px;').'</span>';
|
213 |
-
echo '<span>'.quickadsense_get_control('checkbox', '<b id="quick_adsense_settings_enable_on_tags_label">Tags</b>', 'quick_adsense_settings_enable_on_tags', 'quick_adsense_settings[enable_on_tags]', ((isset($settings['enable_on_tags']))?$settings['enable_on_tags']:''), null, 'input', 'margin: -1px 10px 0 15px;').'</span>';
|
214 |
-
echo '<span>'.quickadsense_get_control('checkbox', '<b id="quick_adsense_settings_enable_all_possible_ads_label">Place all possible Ads on these pages</b>', 'quick_adsense_settings_enable_all_possible_ads', 'quick_adsense_settings[enable_all_possible_ads]', ((isset($settings['enable_all_possible_ads']))?$settings['enable_all_possible_ads']:''), null, 'input', 'margin: -1px 10px 0 35px;').'</span>';
|
215 |
-
echo '</p>';
|
216 |
-
echo '<p>';
|
217 |
-
echo '<span>'.quickadsense_get_control('checkbox', '<b id="quick_adsense_settings_disable_widgets_on_homepage_label">Disable AdsWidget on Homepage</b>', 'quick_adsense_settings_disable_widgets_on_homepage', 'quick_adsense_settings[disable_widgets_on_homepage]', ((isset($settings['disable_widgets_on_homepage']))?$settings['disable_widgets_on_homepage']:''), null, 'input', 'margin: -1px 10px 0 0;').'</span>';
|
218 |
-
echo '</p>';
|
219 |
-
echo '<p>';
|
220 |
-
echo '<span>'.quickadsense_get_control('checkbox', '<b id="quick_adsense_settings_disable_for_loggedin_users_label">Hide Ads when user is logged in to Wordpress</b>', 'quick_adsense_settings_disable_for_loggedin_users', 'quick_adsense_settings[disable_for_loggedin_users]', ((isset($settings['disable_for_loggedin_users']))?$settings['disable_for_loggedin_users']:''), null, 'input', 'margin: -1px 10px 0 0;').'</span>';
|
221 |
-
echo '</p>';
|
222 |
-
echo '</div>';
|
223 |
-
echo '<div class="clear"></div>';
|
224 |
-
echo '</div>';
|
225 |
-
|
226 |
-
echo '<div class="quick_adsense_block">';
|
227 |
-
echo '<div class="quick_adsense_block_labels">';
|
228 |
-
echo 'Quicktag';
|
229 |
-
echo '</div>';
|
230 |
-
echo '<div class="quick_adsense_block_controls">';
|
231 |
-
echo '<p>';
|
232 |
-
echo quickadsense_get_control('checkbox', '<b>Show Quicktag Buttons on the HTML Edit Post SubPanel</b>', 'quick_adsense_settings_enable_quicktag_buttons', 'quick_adsense_settings[enable_quicktag_buttons]', ((isset($settings['enable_quicktag_buttons']))?$settings['enable_quicktag_buttons']:''), null, 'input', 'margin: -1px 10px 0 0;');
|
233 |
-
echo '</p>';
|
234 |
-
echo '<p>';
|
235 |
-
echo quickadsense_get_control('checkbox', 'Hide <b><!--RndAds--></b> from Quicktag Buttons', 'quick_adsense_settings_disable_randomads_quicktag_button', 'quick_adsense_settings[disable_randomads_quicktag_button]', ((isset($settings['disable_randomads_quicktag_button']))?$settings['disable_randomads_quicktag_button']:''), null, 'input', 'margin: -1px 10px 0 0;');
|
236 |
-
echo '</p>';
|
237 |
-
echo '<p>';
|
238 |
-
echo quickadsense_get_control('checkbox', 'Hide <b><!--NoAds--></b>, <b><!--OffDef--></b>, <b><!--OffWidget--></b> from Quicktag Buttons', 'quick_adsense_settings_disable_disablead_quicktag_buttons', 'quick_adsense_settings[disable_disablead_quicktag_buttons]', ((isset($settings['disable_disablead_quicktag_buttons']))?$settings['disable_disablead_quicktag_buttons']:''), null, 'input', 'margin: -1px 10px 0 0;');
|
239 |
-
echo '</p>';
|
240 |
-
echo '<p>';
|
241 |
-
echo quickadsense_get_control('checkbox', 'Hide <b><!--OffBegin--></b>, <b><!--OffMiddle--></b>, <b><!--OffEnd--></b>, <b><!--OffAfMore--></b>, <b><!--OffBfLastPara--></b> from Quicktag Buttons', 'quick_adsense_settings_disable_positionad_quicktag_buttons', 'quick_adsense_settings[disable_positionad_quicktag_buttons]', ((isset($settings['disable_positionad_quicktag_buttons']))?$settings['disable_positionad_quicktag_buttons']:''), null, 'input', 'margin: -1px 10px 0 0;');
|
242 |
-
echo '</p>';
|
243 |
-
echo '<div class="clear"></div>';
|
244 |
-
echo 'Insert Ads into a post, on-the-fly:';
|
245 |
-
echo '<ol>';
|
246 |
-
echo '<li>Insert <b><!--Ads1--></b>, <b><!--Ads2--></b> etc. into a post to show the <b>Particular Ads</b> at specific location.</li>';
|
247 |
-
echo '<li>Insert <b><!--RndAds--></b> (or more) into a post to show the <b>Random Ads</b> at specific location.</li>';
|
248 |
-
echo '</ol>';
|
249 |
-
echo '<div class="clear"></div>';
|
250 |
-
echo 'Disable Ads in a post, on-the-fly:';
|
251 |
-
echo '<ol>';
|
252 |
-
echo '<li>Insert <b><!--NoAds--></b> to disable all Ads in a post <i>(does not affect Ads on Sidebar)</i>.</li>';
|
253 |
-
echo '<li>Insert <b><!--OffDef--></b> to disable the default positioned Ads, and use <!--Ads1-->, <!--Ads2-->, etc. to insert Ad <i>(does not affect Ads on Sidebar)</i>.</li>';
|
254 |
-
echo '<li>Insert <b><!--OffWidget--></b> to disable all Ads on Sidebar.</li>';
|
255 |
-
echo '<li>Insert <b><!--OffBegin--></b>, <b><!--OffMiddle--></b>, <b><!--OffEnd--></b> to <b>disable Ads at Beginning</b>, <b>Middle or End of Post</b>.</li>';
|
256 |
-
echo '<li>Insert <b><!--OffAfMore--></b>, <b><!--OffBfLastPara--></b> to <b>disable Ads right after the <!--more--> tag</b>, or <b>right before the last Paragraph</b>.</li>';
|
257 |
-
echo '</ol>';
|
258 |
-
echo '<div class="clear"></div>';
|
259 |
-
echo '<i>Tags can be inserted into a post via the additional Quicktag Buttons at the HTML Edit Post SubPanel.</i>';
|
260 |
-
echo '</div>';
|
261 |
-
echo '<div class="clear"></div>';
|
262 |
-
echo '</div>';
|
263 |
-
}
|
264 |
-
|
265 |
-
function quick_adsense_onpost_content() {
|
266 |
-
$settings = get_option('quick_adsense_settings');
|
267 |
-
$alignmentOptions = array(
|
268 |
-
array('text' => 'Left', 'value' => '1'),
|
269 |
-
array('text' => 'Center', 'value' => '2'),
|
270 |
-
array('text' => 'Right', 'value' => '3'),
|
271 |
-
array('text' => 'None', 'value' => '4')
|
272 |
-
);
|
273 |
-
$marginOptions = array();
|
274 |
-
for($i = 1; $i <= 50; $i++) {
|
275 |
-
$marginOptions[] = array('text' => $i, 'value' => $i);
|
276 |
-
}
|
277 |
-
echo '<div id="quick_adsense_block_bottom" class="quick_adsense_block" style="margin: 30px 0 0;">';
|
278 |
-
echo '<div class="quick_adsense_block_labels" style="width: auto;">';
|
279 |
-
echo '<span>Adsense Codes - Ads on Post Body</span>';
|
280 |
-
echo '</div>';
|
281 |
-
echo '<div class="clear"></div>';
|
282 |
-
echo '<p>Paste up to 10 Ads codes on Post Body as assigned above. Ads codes provided must not be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.</p>';
|
283 |
-
echo '</div>';
|
284 |
-
|
285 |
-
echo '<div id="quick_adsense_onpost_content_controls_wrapper">';
|
286 |
-
echo '<div id="quick_adsense_onpost_content_global_controls_wrapper">';
|
287 |
-
echo '<p class="quick_adsense_onpost_adunits_styling_controls">';
|
288 |
-
echo quickadsense_get_control('checkbox', '', 'quick_adsense_settings_onpost_enable_global_style', 'quick_adsense_settings[onpost_enable_global_style]', ((isset($settings['onpost_enable_global_style']))?$settings['onpost_enable_global_style']:''), null, 'input', 'margin: -3px 10px 0 0;');
|
289 |
-
echo '<span>Use for all</span>';
|
290 |
-
echo '<wbr />Alignment';
|
291 |
-
echo quickadsense_get_control('select', '', 'quick_adsense_settings_onpost_global_alignment', 'quick_adsense_settings[onpost_global_alignment]', ((isset($settings['onpost_global_alignment']))?$settings['onpost_global_alignment']:''), $alignmentOptions, 'input', 'margin: -6px 20px 0 10px; width: 73px;');
|
292 |
-
echo '<wbr />margin';
|
293 |
-
echo quickadsense_get_control('number', '', 'quick_adsense_settings_onpost_global_margin', 'quick_adsense_settings[onpost_global_margin]', ((isset($settings['onpost_global_margin']))?$settings['onpost_global_margin']:''), $marginOptions, 'input', 'margin: -1px 10px 0 10px; width: 62px;');
|
294 |
-
echo 'px';
|
295 |
-
echo '</p>';
|
296 |
-
echo '</div>';
|
297 |
-
|
298 |
-
echo '<div id="quick_adsense_onpost_content_adunits_wrapper">';
|
299 |
-
echo '<div id="quick_adsense_onpost_content_adunits_initial_wrapper">';
|
300 |
-
for($i = 1; $i <= 3; $i++) {
|
301 |
-
quick_adsense_onpost_adunits_controls($i, $settings, $alignmentOptions, $marginOptions);
|
302 |
-
}
|
303 |
-
echo '</div>';
|
304 |
-
echo '<div id="quick_adsense_onpost_content_adunits_all_wrapper" style="display: none;">';
|
305 |
-
for($i = 4; $i <= 10; $i++) {
|
306 |
-
quick_adsense_onpost_adunits_controls($i, $settings, $alignmentOptions, $marginOptions);
|
307 |
-
}
|
308 |
-
echo '</div>';
|
309 |
-
echo '<a id="quick_adsense_onpost_content_adunits_showall_button" class="input button-secondary"><span class="dashicons dashicons-arrow-down"></span> <b>Show All</b></a>';
|
310 |
-
echo '</div>';
|
311 |
-
echo '</div>';
|
312 |
-
}
|
313 |
-
|
314 |
-
function quick_adsense_onpost_adunits_controls($index, $settings, $alignmentOptions, $marginOptions) {
|
315 |
-
echo '<div id="quick_adsense_onpost_adunits_control_'.$index.'" class="quick_adsense_onpost_adunits_control_wrapper">';
|
316 |
-
echo '<div class="quick_adsense_onpost_adunits_label">Ads'.$index.'</div>';
|
317 |
-
echo '<div class="quick_adsense_onpost_adunits_control">';
|
318 |
-
echo quickadsense_get_control('textarea', '', 'quick_adsense_settings_onpost_ad_'.$index.'_content', 'quick_adsense_settings[onpost_ad_'.$index.'_content]', ((isset($settings['onpost_ad_'.$index.'_content']))?$settings['onpost_ad_'.$index.'_content']:''), null, 'input', 'display: block; margin: 0 0 10px 0', 'Enter Code');
|
319 |
-
echo '<p class="quick_adsense_onpost_adunits_styling_controls">';
|
320 |
-
echo 'Alignment';
|
321 |
-
echo quickadsense_get_control('select', '', 'quick_adsense_settings_onpost_ad_'.$index.'_alignment', 'quick_adsense_settings[onpost_ad_'.$index.'_alignment]', ((isset($settings['onpost_ad_'.$index.'_alignment']))?$settings['onpost_ad_'.$index.'_alignment']:''), $alignmentOptions, 'input', 'margin: -2px 20px 0 10px;');
|
322 |
-
echo '<wbr />margin';
|
323 |
-
echo quickadsense_get_control('number', '', 'quick_adsense_settings_onpost_ad_'.$index.'_margin', 'quick_adsense_settings[onpost_ad_'.$index.'_margin]', ((isset($settings['onpost_ad_'.$index.'_margin']))?$settings['onpost_ad_'.$index.'_margin']:''), $marginOptions, 'input', 'margin: -2px 10px 0 10px; width: 52px;');
|
324 |
-
echo 'px';
|
325 |
-
echo '</p>';
|
326 |
-
quick_adsense_advanced_controls($index, $settings, 'onpost');
|
327 |
-
echo '</div>';
|
328 |
-
echo '<div class="clear"></div>';
|
329 |
-
echo '</div>';
|
330 |
-
}
|
331 |
-
|
332 |
-
function quick_adsense_widgets_content() {
|
333 |
-
$settings = get_option('quick_adsense_settings');
|
334 |
-
$alignmentOptions = array(
|
335 |
-
array('text' => 'Left', 'value' => '1'),
|
336 |
-
array('text' => 'Center', 'value' => '2'),
|
337 |
-
array('text' => 'Right', 'value' => '3'),
|
338 |
-
array('text' => 'None', 'value' => '4')
|
339 |
-
);
|
340 |
-
$marginOptions = array();
|
341 |
-
for($i = 1; $i <= 50; $i++) {
|
342 |
-
$marginOptions[] = array('text' => $i, 'value' => $i);
|
343 |
-
}
|
344 |
-
echo '<div id="quick_adsense_block_bottom" class="quick_adsense_block" style="margin: 30px 0 0;">';
|
345 |
-
echo '<div class="quick_adsense_block_labels" style="width: auto;">';
|
346 |
-
echo '<span>Adsense Codes - <a href="'.admin_url('widgets.php').'">Sidebar WIdget</a></span>';
|
347 |
-
echo '</div>';
|
348 |
-
echo '<div class="clear"></div>';
|
349 |
-
echo '<p>Paste up to 10 Ads codes on Sidebar Widget. Ads codes provided must not be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.</p>';
|
350 |
-
echo '</div>';
|
351 |
-
|
352 |
-
echo '<div id="quick_adsense_widget_controls_wrapper">';
|
353 |
-
echo '<div id="quick_adsense_widget_global_controls_wrapper" style="visibility: hidden;">';
|
354 |
-
echo '<p class="quick_adsense_widget_adunits_styling_controls">';
|
355 |
-
echo quickadsense_get_control('checkbox', '', 'quick_adsense_settings_widget_enable_global_style', 'quick_adsense_settings[widget_enable_global_style]', ((isset($settings['widget_enable_global_style']))?$settings['widget_enable_global_style']:''), null, 'input', 'margin: -3px 10px 0 0;');
|
356 |
-
echo '<span>Use for all</span>';
|
357 |
-
echo '<wbr />Alignment';
|
358 |
-
echo quickadsense_get_control('select', '', 'quick_adsense_settings_widget_global_alignment', 'quick_adsense_settings[widget_global_alignment]', ((isset($settings['widget_global_alignment']))?$settings['widget_global_alignment']:''), $alignmentOptions, 'input', 'margin: -6px 20px 0 10px; width: 73px;');
|
359 |
-
echo '<wbr />margin';
|
360 |
-
echo quickadsense_get_control('number', '', 'quick_adsense_settings_widget_global_margin', 'quick_adsense_settings[widget_global_margin]', ((isset($settings['widget_global_margin']))?$settings['widget_global_margin']:''), $marginOptions, 'input', 'margin: -1px 10px 0 10px; width: 62px;');
|
361 |
-
echo 'px';
|
362 |
-
echo '</p>';
|
363 |
-
echo '</div>';
|
364 |
-
|
365 |
-
echo '<div id="quick_adsense_widget_adunits_wrapper">';
|
366 |
-
echo '<div id="quick_adsense_widget_adunits_initial_wrapper">';
|
367 |
-
for($i = 1; $i <= 3; $i++) {
|
368 |
-
quick_adsense_widgets_controls($i, $settings);
|
369 |
-
}
|
370 |
-
echo '</div>';
|
371 |
-
echo '<div id="quick_adsense_widget_adunits_all_wrapper" style="display: none;">';
|
372 |
-
for($i = 4; $i <= 10; $i++) {
|
373 |
-
quick_adsense_widgets_controls($i, $settings);
|
374 |
-
}
|
375 |
-
echo '</div>';
|
376 |
-
echo '<a id="quick_adsense_widget_adunits_showall_button" class="input button-secondary"><span class="dashicons dashicons-arrow-down"></span> <b>Show All</b></a>';
|
377 |
-
echo '</div>';
|
378 |
-
echo '</div>';
|
379 |
-
}
|
380 |
-
|
381 |
-
function quick_adsense_widgets_controls($index, $settings) {
|
382 |
-
echo '<div id="quick_adsense_widget_adunits_control_'.$index.'" class="quick_adsense_widget_adunits_control_wrapper">';
|
383 |
-
echo '<div class="quick_adsense_widget_adunits_label">AdsWidget'.$index.'</div>';
|
384 |
-
echo '<div class="quick_adsense_widget_adunits_control">';
|
385 |
-
echo quickadsense_get_control('textarea', '', 'quick_adsense_settings_widget_ad_'.$index.'_content', 'quick_adsense_settings[widget_ad_'.$index.'_content]', ((isset($settings['widget_ad_'.$index.'_content']))?$settings['widget_ad_'.$index.'_content']:''), null, 'input', 'display: block; margin: 0 0 10px 0', 'Enter Code');
|
386 |
-
echo '</div>';
|
387 |
-
echo '<div class="clear"></div>';
|
388 |
-
echo '</div>';
|
389 |
-
}
|
390 |
-
|
391 |
-
function quick_adsense_advanced_controls($index, $settings, $location) {
|
392 |
-
echo '<p class="quick_adsense_'.$location.'_adunits_device_controls">';
|
393 |
-
echo '<b>Hide by Device Type:</b><br />';
|
394 |
-
echo quickadsense_get_control('checkbox', 'Mobile', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_device_mobile', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_device_mobile]', ((isset($settings[$location.'_ad_'.$index.'_hide_device_mobile']))?$settings[$location.'_ad_'.$index.'_hide_device_mobile']:''), null, 'input', 'margin: -1px 5px 0 0;');
|
395 |
-
echo quickadsense_get_control('checkbox', 'Tablet', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_device_tablet', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_device_tablet]', ((isset($settings[$location.'_ad_'.$index.'_hide_device_tablet']))?$settings[$location.'_ad_'.$index.'_hide_device_tablet']:''), null, 'input', 'margin: -1px 5px 0 15px;');
|
396 |
-
echo quickadsense_get_control('checkbox', 'Desktop', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_device_desktop', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_device_desktop]', ((isset($settings[$location.'_ad_'.$index.'_hide_device_desktop']))?$settings[$location.'_ad_'.$index.'_hide_device_desktop']:''), null, 'input', 'margin: -1px 5px 0 15px;');
|
397 |
-
echo '</p>';
|
398 |
-
echo '<p class="quick_adsense_'.$location.'_adunits_device_controls">';
|
399 |
-
echo '<b>Hide by Visitor Source:</b><br />';
|
400 |
-
echo quickadsense_get_control('checkbox', 'Search Engine', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_visitor_searchengine', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_visitor_searchengine]', ((isset($settings[$location.'_ad_'.$index.'_hide_visitor_searchengine']))?$settings[$location.'_ad_'.$index.'_hide_visitor_searchengine']:''), null, 'input', 'margin: -1px 5px 0 0;');
|
401 |
-
echo quickadsense_get_control('checkbox', 'Indirect', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_visitor_indirect', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_visitor_indirect]', ((isset($settings[$location.'_ad_'.$index.'_hide_visitor_indirect']))?$settings[$location.'_ad_'.$index.'_hide_visitor_indirect']:''), null, 'input', 'margin: -1px 5px 0 15px;');
|
402 |
-
echo quickadsense_get_control('checkbox', 'Direct', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_visitor_direct', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_visitor_direct]', ((isset($settings[$location.'_ad_'.$index.'_hide_visitor_direct']))?$settings[$location.'_ad_'.$index.'_hide_visitor_direct']:''), null, 'input', 'margin: -1px 5px 0 15px;');
|
403 |
-
echo '</p>';
|
404 |
-
echo '<p class="quick_adsense_'.$location.'_adunits_device_controls">';
|
405 |
-
echo '<b>Hide by Visitor Type:</b><br />';
|
406 |
-
echo quickadsense_get_control('checkbox', 'Bots', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_visitor_bot', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_visitor_bot]', ((isset($settings[$location.'_ad_'.$index.'_hide_visitor_bot']))?$settings[$location.'_ad_'.$index.'_hide_visitor_bot']:''), null, 'input', 'margin: -1px 5px 0 0;');
|
407 |
-
echo quickadsense_get_control('checkbox', 'Known Browser', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_visitor_knownbrowser', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_visitor_knownbrowser]', ((isset($settings[$location.'_ad_'.$index.'_hide_visitor_knownbrowser']))?$settings[$location.'_ad_'.$index.'_hide_visitor_knownbrowser']:''), null, 'input', 'margin: -1px 5px 0 15px;');
|
408 |
-
echo quickadsense_get_control('checkbox', 'Unknown Browser', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_visitor_unknownbrowser', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_visitor_unknownbrowser]', ((isset($settings[$location.'_ad_'.$index.'_hide_visitor_unknownbrowser']))?$settings[$location.'_ad_'.$index.'_hide_visitor_unknownbrowser']:''), null, 'input', 'margin: -1px 5px 0 15px;');
|
409 |
-
echo '<br/ >';
|
410 |
-
echo quickadsense_get_control('checkbox', 'Guest', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_visitor_guest', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_visitor_guest]', ((isset($settings[$location.'_ad_'.$index.'_hide_visitor_guest']))?$settings[$location.'_ad_'.$index.'_hide_visitor_guest']:''), null, 'input', 'margin: -1px 5px 0 0;');
|
411 |
-
echo quickadsense_get_control('checkbox', 'Logged-in', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_hide_visitor_loggedin', 'quick_adsense_settings['.$location.'_ad_'.$index.'_hide_visitor_loggedin]', ((isset($settings[$location.'_ad_'.$index.'_hide_visitor_loggedin']))?$settings[$location.'_ad_'.$index.'_hide_visitor_loggedin']:''), null, 'input', 'margin: -1px 5px 0 15px;');
|
412 |
-
echo '</p>';
|
413 |
-
echo '<p class="quick_adsense_'.$location.'_adunits_device_controls">';
|
414 |
-
echo '<b>Limit by Visitor Countries:</b><br />';
|
415 |
-
echo quickadsense_get_control('multiselect', '', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_limit_visitor_country', 'quick_adsense_settings['.$location.'_ad_'.$index.'_limit_visitor_country][]', ((isset($settings[$location.'_ad_'.$index.'_limit_visitor_country']))?$settings[$location.'_ad_'.$index.'_limit_visitor_country']:''), quick_adsense_get_countries());
|
416 |
-
echo '</p>';
|
417 |
-
echo '<p class="quick_adsense_'.$location.'_adunits_device_controls">';
|
418 |
-
echo '<b>Ad Stats:</b><br />';
|
419 |
-
echo quickadsense_get_control('checkbox', 'Enable Stats', 'quick_adsense_settings_'.$location.'_ad_'.$index.'_enable_stats', 'quick_adsense_settings['.$location.'_ad_'.$index.'_enable_stats]', ((isset($settings[$location.'_ad_'.$index.'_enable_stats']))?$settings[$location.'_ad_'.$index.'_enable_stats']:''), null, 'input', 'margin: -1px 5px 0 0;');
|
420 |
-
echo '<br /><input class="quick_adsense_'.$location.'_ad_show_stats input button-secondary" data-index="'.$index.'" type="button" value="View Stats" /> <input class="quick_adsense_'.$location.'_ad_reset_stats input button-secondary right" data-index="'.$index.'" type="button" value="Reset Stats" />';
|
421 |
-
echo '</p>';
|
422 |
-
}
|
423 |
-
|
424 |
-
function quick_adsense_validate($input) {
|
425 |
-
delete_transient('quick_adsense_adstxt_adsense_autocheck_content');
|
426 |
-
return $input;
|
427 |
-
}
|
428 |
-
|
429 |
-
add_action('wp_ajax_quick_adsense_onpost_ad_reset_stats', 'quick_adsense_onpost_ad_reset_stats');
|
430 |
-
function quick_adsense_onpost_ad_reset_stats() {
|
431 |
-
if(isset($_POST['index'])) {
|
432 |
-
delete_option('quick_adsense_onpost_ad_'.$_POST['index'].'_stats');
|
433 |
-
echo '###SUCCESS###';
|
434 |
-
}
|
435 |
-
die();
|
436 |
-
}
|
437 |
-
|
438 |
-
add_action('wp_ajax_quick_adsense_onpost_ad_get_stats_chart', 'quick_adsense_onpost_ad_get_stats_chart');
|
439 |
-
function quick_adsense_onpost_ad_get_stats_chart() {
|
440 |
-
if(isset($_POST['index'])) {
|
441 |
-
echo '###SUCCESS###';
|
442 |
-
echo '<div id="quick_adsense_ad_stats_chart_wrapper">';
|
443 |
-
echo '<p> </p>';
|
444 |
-
echo '<canvas id="quick_adsense_ad_stats_chart" width="1377" height="360"></canvas>';
|
445 |
-
echo '<textarea id="quick_adsense_ad_stats_chart_data" style="display: none;">[';
|
446 |
-
$stats = get_option('quick_adsense_onpost_ad_'.$_POST['index'].'_stats');
|
447 |
-
for($i = 0; $i < 30; $i++) {
|
448 |
-
$clicks = 0;
|
449 |
-
$impressions = 0;
|
450 |
-
if(isset($stats) && is_array($stats) && isset($stats[date('dmY', strtotime('-'.$i.' day'))])) {
|
451 |
-
$clicks = $stats[date('dmY', strtotime('-'.$i.' day'))]['c'];
|
452 |
-
$impressions = $stats[date('dmY', strtotime('-'.$i.' day'))]['i'];
|
453 |
-
}
|
454 |
-
if($i != 0) {
|
455 |
-
echo ',';
|
456 |
-
}
|
457 |
-
echo '{"x": "'.date('m/d/Y', strtotime('-'.$i.' day')).'", "y": "'.$impressions.'", "y1": "'.$clicks.'"}';
|
458 |
-
}
|
459 |
-
echo ']</textarea>';
|
460 |
-
echo '<p><small>The Stats recorded by the plugin will be different than that recorded by your ad provider due to different factors like accidental clicks, fraud detection, spam clicks etc.<br />Use the stats provided by the ad provider in case of discrepancy.</small></p>';
|
461 |
-
echo '</div>';
|
462 |
-
}
|
463 |
-
die();
|
464 |
-
}
|
465 |
-
|
466 |
-
add_action('admin_enqueue_scripts', function($hook) {
|
467 |
-
if($hook != 'toplevel_page_quick-adsense') {
|
468 |
-
return;
|
469 |
-
}
|
470 |
-
if(isset($_GET['deactivate'])) {
|
471 |
-
delete_option('quick_adsense_validate');
|
472 |
-
}
|
473 |
-
wp_enqueue_script('quick_adsense_admin_js', plugins_url('/js/admin.js', __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'));
|
474 |
-
});
|
475 |
-
|
476 |
-
function quick_adsense_get_countries() {
|
477 |
-
$data = array(
|
478 |
-
array('value' => 'AD', 'text' => 'Andorra'),
|
479 |
-
array('value' => 'AE', 'text' => 'United Arab Emirates'),
|
480 |
-
array('value' => 'AF', 'text' => 'Afghanistan'),
|
481 |
-
array('value' => 'AG', 'text' => 'Antigua and Barbuda'),
|
482 |
-
array('value' => 'AI', 'text' => 'Anguilla'),
|
483 |
-
array('value' => 'AL', 'text' => 'Albania'),
|
484 |
-
array('value' => 'AM', 'text' => 'Armenia'),
|
485 |
-
array('value' => 'AN', 'text' => 'Netherlands Antilles'),
|
486 |
-
array('value' => 'AO', 'text' => 'Angola'),
|
487 |
-
array('value' => 'AQ', 'text' => 'Antarctica'),
|
488 |
-
array('value' => 'AR', 'text' => 'Argentina'),
|
489 |
-
array('value' => 'AS', 'text' => 'American Samoa'),
|
490 |
-
array('value' => 'AT', 'text' => 'Austria'),
|
491 |
-
array('value' => 'AU', 'text' => 'Australia'),
|
492 |
-
array('value' => 'AW', 'text' => 'Aruba'),
|
493 |
-
array('value' => 'AZ', 'text' => 'Azerbaijan'),
|
494 |
-
array('value' => 'BA', 'text' => 'Bosnia and Herzegovina'),
|
495 |
-
array('value' => 'BB', 'text' => 'Barbados'),
|
496 |
-
array('value' => 'BD', 'text' => 'Bangladesh'),
|
497 |
-
array('value' => 'BE', 'text' => 'Belgium'),
|
498 |
-
array('value' => 'BF', 'text' => 'Burkina Faso'),
|
499 |
-
array('value' => 'BG', 'text' => 'Bulgaria'),
|
500 |
-
array('value' => 'BH', 'text' => 'Bahrain'),
|
501 |
-
array('value' => 'BI', 'text' => 'Burundi'),
|
502 |
-
array('value' => 'BJ', 'text' => 'Benin'),
|
503 |
-
array('value' => 'BM', 'text' => 'Bermuda'),
|
504 |
-
array('value' => 'BN', 'text' => 'Brunei Darussalam'),
|
505 |
-
array('value' => 'BO', 'text' => 'Bolivia'),
|
506 |
-
array('value' => 'BR', 'text' => 'Brazil'),
|
507 |
-
array('value' => 'BS', 'text' => 'Bahamas'),
|
508 |
-
array('value' => 'BT', 'text' => 'Bhutan'),
|
509 |
-
array('value' => 'BV', 'text' => 'Bouvet Island'),
|
510 |
-
array('value' => 'BW', 'text' => 'Botswana'),
|
511 |
-
array('value' => 'BY', 'text' => 'Belarus'),
|
512 |
-
array('value' => 'BZ', 'text' => 'Belize'),
|
513 |
-
array('value' => 'CA', 'text' => 'Canada'),
|
514 |
-
array('value' => 'CC', 'text' => 'Cocos (Keeling) Islands'),
|
515 |
-
array('value' => 'CD', 'text' => 'The Democratic Republic of the Congo'),
|
516 |
-
array('value' => 'CF', 'text' => 'Central African Republic'),
|
517 |
-
array('value' => 'CG', 'text' => 'Congo'),
|
518 |
-
array('value' => 'CH', 'text' => 'Switzerland'),
|
519 |
-
array('value' => 'CI', 'text' => 'Cote D\'Ivoire'),
|
520 |
-
array('value' => 'CK', 'text' => 'Cook Islands'),
|
521 |
-
array('value' => 'CL', 'text' => 'Chile'),
|
522 |
-
array('value' => 'CM', 'text' => 'Cameroon'),
|
523 |
-
array('value' => 'CN', 'text' => 'China'),
|
524 |
-
array('value' => 'CO', 'text' => 'Colombia'),
|
525 |
-
array('value' => 'CR', 'text' => 'Costa Rica'),
|
526 |
-
array('value' => 'CU', 'text' => 'Cuba'),
|
527 |
-
array('value' => 'CV', 'text' => 'Cape Verde'),
|
528 |
-
array('value' => 'CX', 'text' => 'Christmas Island'),
|
529 |
-
array('value' => 'CY', 'text' => 'Cyprus'),
|
530 |
-
array('value' => 'CZ', 'text' => 'Czech Republic'),
|
531 |
-
array('value' => 'DE', 'text' => 'Germany'),
|
532 |
-
array('value' => 'DJ', 'text' => 'Djibouti'),
|
533 |
-
array('value' => 'DK', 'text' => 'Denmark'),
|
534 |
-
array('value' => 'DM', 'text' => 'Dominica'),
|
535 |
-
array('value' => 'DO', 'text' => 'Dominican Republic'),
|
536 |
-
array('value' => 'DZ', 'text' => 'Algeria'),
|
537 |
-
array('value' => 'EC', 'text' => 'Ecuador'),
|
538 |
-
array('value' => 'EE', 'text' => 'Estonia'),
|
539 |
-
array('value' => 'EG', 'text' => 'Egypt'),
|
540 |
-
array('value' => 'EH', 'text' => 'Western Sahara'),
|
541 |
-
array('value' => 'ER', 'text' => 'Eritrea'),
|
542 |
-
array('value' => 'ES', 'text' => 'Spain'),
|
543 |
-
array('value' => 'ET', 'text' => 'Ethiopia'),
|
544 |
-
array('value' => 'FI', 'text' => 'Finland'),
|
545 |
-
array('value' => 'FJ', 'text' => 'Fiji'),
|
546 |
-
array('value' => 'FK', 'text' => 'Falkland Islands (Malvinas)'),
|
547 |
-
array('value' => 'FM', 'text' => 'Federated States of Micronesia'),
|
548 |
-
array('value' => 'FO', 'text' => 'Faroe Islands'),
|
549 |
-
array('value' => 'FR', 'text' => 'France'),
|
550 |
-
array('value' => 'FX', 'text' => 'France Metropolitan'),
|
551 |
-
array('value' => 'GA', 'text' => 'Gabon'),
|
552 |
-
array('value' => 'GB', 'text' => 'United Kingdom'),
|
553 |
-
array('value' => 'GD', 'text' => 'Grenada'),
|
554 |
-
array('value' => 'GE', 'text' => 'Georgia'),
|
555 |
-
array('value' => 'GF', 'text' => 'French Guiana'),
|
556 |
-
array('value' => 'GH', 'text' => 'Ghana'),
|
557 |
-
array('value' => 'GI', 'text' => 'Gibraltar'),
|
558 |
-
array('value' => 'GL', 'text' => 'Greenland'),
|
559 |
-
array('value' => 'GM', 'text' => 'Gambia'),
|
560 |
-
array('value' => 'GN', 'text' => 'Guinea'),
|
561 |
-
array('value' => 'GP', 'text' => 'Guadeloupe'),
|
562 |
-
array('value' => 'GQ', 'text' => 'Equatorial Guinea'),
|
563 |
-
array('value' => 'GR', 'text' => 'Greece'),
|
564 |
-
array('value' => 'GS', 'text' => 'South Georgia and the South Sandwich Islands'),
|
565 |
-
array('value' => 'GT', 'text' => 'Guatemala'),
|
566 |
-
array('value' => 'GU', 'text' => 'Guam'),
|
567 |
-
array('value' => 'GW', 'text' => 'Guinea-Bissau'),
|
568 |
-
array('value' => 'GY', 'text' => 'Guyana'),
|
569 |
-
array('value' => 'HK', 'text' => 'Hong Kong'),
|
570 |
-
array('value' => 'HM', 'text' => 'Heard Island and McDonald Islands'),
|
571 |
-
array('value' => 'HN', 'text' => 'Honduras'),
|
572 |
-
array('value' => 'HR', 'text' => 'Croatia'),
|
573 |
-
array('value' => 'HT', 'text' => 'Haiti'),
|
574 |
-
array('value' => 'HU', 'text' => 'Hungary'),
|
575 |
-
array('value' => 'ID', 'text' => 'Indonesia'),
|
576 |
-
array('value' => 'IE', 'text' => 'Ireland'),
|
577 |
-
array('value' => 'IL', 'text' => 'Israel'),
|
578 |
-
array('value' => 'IN', 'text' => 'India'),
|
579 |
-
array('value' => 'IO', 'text' => 'British Indian Ocean Territory'),
|
580 |
-
array('value' => 'IQ', 'text' => 'Iraq'),
|
581 |
-
array('value' => 'IR', 'text' => 'Islamic Republic of Iran'),
|
582 |
-
array('value' => 'IS', 'text' => 'Iceland'),
|
583 |
-
array('value' => 'IT', 'text' => 'Italy'),
|
584 |
-
array('value' => 'JM', 'text' => 'Jamaica'),
|
585 |
-
array('value' => 'JO', 'text' => 'Jordan'),
|
586 |
-
array('value' => 'JP', 'text' => 'Japan'),
|
587 |
-
array('value' => 'KE', 'text' => 'Kenya'),
|
588 |
-
array('value' => 'KG', 'text' => 'Kyrgyzstan'),
|
589 |
-
array('value' => 'KH', 'text' => 'Cambodia'),
|
590 |
-
array('value' => 'KI', 'text' => 'Kiribati'),
|
591 |
-
array('value' => 'KM', 'text' => 'Comoros'),
|
592 |
-
array('value' => 'KN', 'text' => 'Saint Kitts and Nevis'),
|
593 |
-
array('value' => 'KP', 'text' => 'Democratic People\'s Republic of Korea'),
|
594 |
-
array('value' => 'KR', 'text' => 'Republic of Korea'),
|
595 |
-
array('value' => 'KW', 'text' => 'Kuwait'),
|
596 |
-
array('value' => 'KY', 'text' => 'Cayman Islands'),
|
597 |
-
array('value' => 'KZ', 'text' => 'Kazakhstan'),
|
598 |
-
array('value' => 'LA', 'text' => 'Lao People\'s Democratic Republic'),
|
599 |
-
array('value' => 'LB', 'text' => 'Lebanon'),
|
600 |
-
array('value' => 'LC', 'text' => 'Saint Lucia'),
|
601 |
-
array('value' => 'LI', 'text' => 'Liechtenstein'),
|
602 |
-
array('value' => 'LK', 'text' => 'Sri Lanka'),
|
603 |
-
array('value' => 'LR', 'text' => 'Liberia'),
|
604 |
-
array('value' => 'LS', 'text' => 'Lesotho'),
|
605 |
-
array('value' => 'LT', 'text' => 'Lithuania'),
|
606 |
-
array('value' => 'LU', 'text' => 'Luxembourg'),
|
607 |
-
array('value' => 'LV', 'text' => 'Latvia'),
|
608 |
-
array('value' => 'LY', 'text' => 'Libyan Arab Jamahiriya'),
|
609 |
-
array('value' => 'MA', 'text' => 'Morocco'),
|
610 |
-
array('value' => 'MC', 'text' => 'Monaco'),
|
611 |
-
array('value' => 'MD', 'text' => 'Republic of Moldova'),
|
612 |
-
array('value' => 'MG', 'text' => 'Madagascar'),
|
613 |
-
array('value' => 'MH', 'text' => 'Marshall Islands'),
|
614 |
-
array('value' => 'MK', 'text' => 'Macedonia'),
|
615 |
-
array('value' => 'ML', 'text' => 'Mali'),
|
616 |
-
array('value' => 'MM', 'text' => 'Myanmar'),
|
617 |
-
array('value' => 'MN', 'text' => 'Mongolia'),
|
618 |
-
array('value' => 'MO', 'text' => 'Macau'),
|
619 |
-
array('value' => 'MP', 'text' => 'Northern Mariana Islands'),
|
620 |
-
array('value' => 'MQ', 'text' => 'Martinique'),
|
621 |
-
array('value' => 'MR', 'text' => 'Mauritania'),
|
622 |
-
array('value' => 'MS', 'text' => 'Montserrat'),
|
623 |
-
array('value' => 'MT', 'text' => 'Malta'),
|
624 |
-
array('value' => 'MU', 'text' => 'Mauritius'),
|
625 |
-
array('value' => 'MV', 'text' => 'Maldives'),
|
626 |
-
array('value' => 'MW', 'text' => 'Malawi'),
|
627 |
-
array('value' => 'MX', 'text' => 'Mexico'),
|
628 |
-
array('value' => 'MY', 'text' => 'Malaysia'),
|
629 |
-
array('value' => 'MZ', 'text' => 'Mozambique'),
|
630 |
-
array('value' => 'NA', 'text' => 'Namibia'),
|
631 |
-
array('value' => 'NC', 'text' => 'New Caledonia'),
|
632 |
-
array('value' => 'NE', 'text' => 'Niger'),
|
633 |
-
array('value' => 'NF', 'text' => 'Norfolk Island'),
|
634 |
-
array('value' => 'NG', 'text' => 'Nigeria'),
|
635 |
-
array('value' => 'NI', 'text' => 'Nicaragua'),
|
636 |
-
array('value' => 'NL', 'text' => 'Netherlands'),
|
637 |
-
array('value' => 'NO', 'text' => 'Norway'),
|
638 |
-
array('value' => 'NP', 'text' => 'Nepal'),
|
639 |
-
array('value' => 'NR', 'text' => 'Nauru'),
|
640 |
-
array('value' => 'NU', 'text' => 'Niue'),
|
641 |
-
array('value' => 'NZ', 'text' => 'New Zealand'),
|
642 |
-
array('value' => 'OM', 'text' => 'Oman'),
|
643 |
-
array('value' => 'PA', 'text' => 'Panama'),
|
644 |
-
array('value' => 'PE', 'text' => 'Peru'),
|
645 |
-
array('value' => 'PF', 'text' => 'French Polynesia'),
|
646 |
-
array('value' => 'PG', 'text' => 'Papua New Guinea'),
|
647 |
-
array('value' => 'PH', 'text' => 'Philippines'),
|
648 |
-
array('value' => 'PK', 'text' => 'Pakistan'),
|
649 |
-
array('value' => 'PL', 'text' => 'Poland'),
|
650 |
-
array('value' => 'PM', 'text' => 'Saint Pierre and Miquelon'),
|
651 |
-
array('value' => 'PN', 'text' => 'Pitcairn Islands'),
|
652 |
-
array('value' => 'PR', 'text' => 'Puerto Rico'),
|
653 |
-
array('value' => 'PS', 'text' => 'Palestinian Territory'),
|
654 |
-
array('value' => 'PT', 'text' => 'Portugal'),
|
655 |
-
array('value' => 'PW', 'text' => 'Palau'),
|
656 |
-
array('value' => 'PY', 'text' => 'Paraguay'),
|
657 |
-
array('value' => 'QA', 'text' => 'Qatar'),
|
658 |
-
array('value' => 'RE', 'text' => 'Reunion'),
|
659 |
-
array('value' => 'RO', 'text' => 'Romania'),
|
660 |
-
array('value' => 'RU', 'text' => 'Russian Federation'),
|
661 |
-
array('value' => 'RW', 'text' => 'Rwanda'),
|
662 |
-
array('value' => 'SA', 'text' => 'Saudi Arabia'),
|
663 |
-
array('value' => 'SB', 'text' => 'Solomon Islands'),
|
664 |
-
array('value' => 'SC', 'text' => 'Seychelles'),
|
665 |
-
array('value' => 'SD', 'text' => 'Sudan'),
|
666 |
-
array('value' => 'SE', 'text' => 'Sweden'),
|
667 |
-
array('value' => 'SG', 'text' => 'Singapore'),
|
668 |
-
array('value' => 'SH', 'text' => 'Saint Helena'),
|
669 |
-
array('value' => 'SI', 'text' => 'Slovenia'),
|
670 |
-
array('value' => 'SJ', 'text' => 'Svalbard and Jan Mayen'),
|
671 |
-
array('value' => 'SK', 'text' => 'Slovakia'),
|
672 |
-
array('value' => 'SL', 'text' => 'Sierra Leone'),
|
673 |
-
array('value' => 'SM', 'text' => 'San Marino'),
|
674 |
-
array('value' => 'SN', 'text' => 'Senegal'),
|
675 |
-
array('value' => 'SO', 'text' => 'Somalia'),
|
676 |
-
array('value' => 'SR', 'text' => 'Suriname'),
|
677 |
-
array('value' => 'ST', 'text' => 'Sao Tome and Principe'),
|
678 |
-
array('value' => 'SV', 'text' => 'El Salvador'),
|
679 |
-
array('value' => 'SY', 'text' => 'Syrian Arab Republic'),
|
680 |
-
array('value' => 'SZ', 'text' => 'Swaziland'),
|
681 |
-
array('value' => 'TC', 'text' => 'Turks and Caicos Islands'),
|
682 |
-
array('value' => 'TD', 'text' => 'Chad'),
|
683 |
-
array('value' => 'TF', 'text' => 'French Southern Territories'),
|
684 |
-
array('value' => 'TG', 'text' => 'Togo'),
|
685 |
-
array('value' => 'TH', 'text' => 'Thailand'),
|
686 |
-
array('value' => 'TJ', 'text' => 'Tajikistan'),
|
687 |
-
array('value' => 'TK', 'text' => 'Tokelau'),
|
688 |
-
array('value' => 'TM', 'text' => 'Turkmenistan'),
|
689 |
-
array('value' => 'TN', 'text' => 'Tunisia'),
|
690 |
-
array('value' => 'TO', 'text' => 'Tonga'),
|
691 |
-
array('value' => 'TL', 'text' => 'Timor-Leste'),
|
692 |
-
array('value' => 'TR', 'text' => 'Turkey'),
|
693 |
-
array('value' => 'TT', 'text' => 'Trinidad and Tobago'),
|
694 |
-
array('value' => 'TV', 'text' => 'Tuvalu'),
|
695 |
-
array('value' => 'TW', 'text' => 'Taiwan'),
|
696 |
-
array('value' => 'TZ', 'text' => 'United Republic of Tanzania'),
|
697 |
-
array('value' => 'UA', 'text' => 'Ukraine'),
|
698 |
-
array('value' => 'UG', 'text' => 'Uganda'),
|
699 |
-
array('value' => 'UM', 'text' => 'United States Minor Outlying Islands'),
|
700 |
-
array('value' => 'US', 'text' => 'United States'),
|
701 |
-
array('value' => 'UY', 'text' => 'Uruguay'),
|
702 |
-
array('value' => 'UZ', 'text' => 'Uzbekistan'),
|
703 |
-
array('value' => 'VA', 'text' => 'Holy See (Vatican City State)'),
|
704 |
-
array('value' => 'VC', 'text' => 'Saint Vincent and the Grenadines'),
|
705 |
-
array('value' => 'VE', 'text' => 'Venezuela'),
|
706 |
-
array('value' => 'VG', 'text' => 'British Virgin Islands'),
|
707 |
-
array('value' => 'VI', 'text' => 'U.S. Virgin Islands'),
|
708 |
-
array('value' => 'VN', 'text' => 'Vietnam'),
|
709 |
-
array('value' => 'VU', 'text' => 'Vanuatu'),
|
710 |
-
array('value' => 'WF', 'text' => 'Wallis and Futuna'),
|
711 |
-
array('value' => 'WS', 'text' => 'Samoa'),
|
712 |
-
array('value' => 'YE', 'text' => 'Yemen'),
|
713 |
-
array('value' => 'YT', 'text' => 'Mayotte'),
|
714 |
-
array('value' => 'RS', 'text' => 'Serbia'),
|
715 |
-
array('value' => 'ZA', 'text' => 'South Africa'),
|
716 |
-
array('value' => 'ZM', 'text' => 'Zambia'),
|
717 |
-
array('value' => 'ME', 'text' => 'Montenegro'),
|
718 |
-
array('value' => 'ZW', 'text' => 'Zimbabwe'),
|
719 |
-
array('value' => 'AX', 'text' => 'Aland Islands'),
|
720 |
-
array('value' => 'GG', 'text' => 'Guernsey'),
|
721 |
-
array('value' => 'IM', 'text' => 'Isle of Man'),
|
722 |
-
array('value' => 'JE', 'text' => 'Jersey'),
|
723 |
-
array('value' => 'BL', 'text' => 'Saint Barthelemy'),
|
724 |
-
array('value' => 'MF', 'text' => 'Saint Martin')
|
725 |
-
);
|
726 |
-
array_multisort(array_column($data, 'text'), SORT_ASC, $data);
|
727 |
-
return $data;
|
728 |
-
}
|
729 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The plugin settings page.
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Add a settings page link to the plugin listing in the plugins admin page.
|
8 |
+
*/
|
9 |
+
add_action(
|
10 |
+
'plugin_action_links_quick-adsense/quick-adsense.php',
|
11 |
+
function( $links ) {
|
12 |
+
$links = array_merge(
|
13 |
+
[ '<a href="' . esc_url( admin_url( '/admin.php?page=quick-adsense' ) ) . '">Settings</a>' ],
|
14 |
+
$links
|
15 |
+
);
|
16 |
+
return $links;
|
17 |
+
}
|
18 |
+
);
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Create the Admin menu entry for the settings page.
|
22 |
+
*/
|
23 |
+
add_action(
|
24 |
+
'admin_menu',
|
25 |
+
function() {
|
26 |
+
add_menu_page(
|
27 |
+
'Quick Adsense Options',
|
28 |
+
'Quick Adsense',
|
29 |
+
'manage_options',
|
30 |
+
'quick-adsense',
|
31 |
+
function() {
|
32 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
33 |
+
// Contains textareas which need to allow output of scripts, iframes etc necessary to output ads and trackers.
|
34 |
+
echo quick_adsense_load_file( 'templates/page-settings.php' );
|
35 |
+
// phpcs:enable
|
36 |
+
}
|
37 |
+
);
|
38 |
+
}
|
39 |
+
);
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Add scripts and styles for Settings page.
|
43 |
+
*/
|
44 |
+
add_action(
|
45 |
+
'admin_enqueue_scripts',
|
46 |
+
function( $hook ) {
|
47 |
+
global $wp_scripts;
|
48 |
+
if ( 'toplevel_page_quick-adsense' === $hook ) {
|
49 |
+
wp_enqueue_script( 'quick-adsense-chart-scripts', plugins_url( '../assets/js/Chart.bundle.min.js', __FILE__ ), [ 'jquery', 'jquery-ui-core', 'jquery-ui-accordion', 'jquery-ui-dialog' ], '2.7.0', false );
|
50 |
+
wp_enqueue_style( 'quick-adsense-jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/' . $wp_scripts->registered['jquery-ui-core']->ver . '/themes/smoothness/jquery-ui.css', [], $wp_scripts->registered['jquery-ui-core']->ver );
|
51 |
+
wp_enqueue_style( 'quick-adsense-admin-styles', plugins_url( '../assets/css/admin.css', __FILE__ ), [], '2.8.0' );
|
52 |
+
wp_enqueue_script( 'quick-adsense-admin-scripts', plugins_url( '../assets/js/admin.js', __FILE__ ), [ 'jquery', 'jquery-ui-core', 'jquery-ui-tabs', 'wp-util' ], '2.8.0', false );
|
53 |
+
wp_localize_script(
|
54 |
+
'quick-adsense-admin-scripts',
|
55 |
+
'quick_adsense',
|
56 |
+
[
|
57 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
58 |
+
'nonce' => wp_create_nonce( 'quick-adsense-nonce' ),
|
59 |
+
]
|
60 |
+
);
|
61 |
+
}
|
62 |
+
}
|
63 |
+
);
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Register settings and sections.
|
67 |
+
*/
|
68 |
+
add_action(
|
69 |
+
'admin_init',
|
70 |
+
function() {
|
71 |
+
register_setting(
|
72 |
+
'quick_adsense_settings',
|
73 |
+
'quick_adsense_settings',
|
74 |
+
function( $input ) {
|
75 |
+
delete_transient( 'quick_adsense_adstxt_adsense_autocheck_content' );
|
76 |
+
return $input;
|
77 |
+
}
|
78 |
+
);
|
79 |
+
$settings = get_option( 'quick_adsense_settings' );
|
80 |
+
$settings['alignment_options'] = [
|
81 |
+
[
|
82 |
+
'text' => 'Left',
|
83 |
+
'value' => '1',
|
84 |
+
],
|
85 |
+
[
|
86 |
+
'text' => 'Center',
|
87 |
+
'value' => '2',
|
88 |
+
],
|
89 |
+
[
|
90 |
+
'text' => 'Right',
|
91 |
+
'value' => '3',
|
92 |
+
],
|
93 |
+
[
|
94 |
+
'text' => 'None',
|
95 |
+
'value' => '4',
|
96 |
+
],
|
97 |
+
];
|
98 |
+
add_settings_section(
|
99 |
+
'quick_adsense_general',
|
100 |
+
'',
|
101 |
+
function() use ( $settings ) {
|
102 |
+
echo wp_kses(
|
103 |
+
quick_adsense_load_file( 'templates/section-general.php', $settings ),
|
104 |
+
quick_adsense_get_allowed_html()
|
105 |
+
);
|
106 |
+
},
|
107 |
+
'quick-adsense-general'
|
108 |
+
);
|
109 |
+
$settings['location'] = 'onpost';
|
110 |
+
add_settings_section(
|
111 |
+
'quick_adsense_onpost',
|
112 |
+
'',
|
113 |
+
function() use ( $settings ) {
|
114 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
115 |
+
// Contains textareas which need to allow output of scripts, iframes etc necessary to output ads and trackers.
|
116 |
+
echo quick_adsense_load_file( 'templates/section-onpost-content.php', $settings );
|
117 |
+
// phpcs:enable
|
118 |
+
},
|
119 |
+
'quick-adsense-onpost'
|
120 |
+
);
|
121 |
+
$settings['location'] = 'widgets';
|
122 |
+
add_settings_section(
|
123 |
+
'quick_adsense_widgets',
|
124 |
+
'',
|
125 |
+
function() use ( $settings ) {
|
126 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
127 |
+
// Contains textareas which need to allow output of scripts, iframes etc necessary to output ads and trackers.
|
128 |
+
echo quick_adsense_load_file( 'templates/section-widgets.php', $settings );
|
129 |
+
// phpcs:enable
|
130 |
+
},
|
131 |
+
'quick-adsense-widgets'
|
132 |
+
);
|
133 |
+
$settings['location'] = 'header_footer_codes';
|
134 |
+
add_settings_section(
|
135 |
+
'quick_adsense_header_footer_codes',
|
136 |
+
'',
|
137 |
+
function() use ( $settings ) {
|
138 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
139 |
+
// Contains textareas which need to allow output of scripts, iframes etc necessary to output ads and trackers.
|
140 |
+
echo quick_adsense_load_file( 'templates/section-header-footer.php', $settings );
|
141 |
+
// phpcs:enable
|
142 |
+
},
|
143 |
+
'quick-adsense-header-footer-codes'
|
144 |
+
);
|
145 |
+
}
|
146 |
+
);
|
147 |
+
|
148 |
+
add_action(
|
149 |
+
'wp_ajax_quick_adsense_onpost_ad_reset_stats',
|
150 |
+
function() {
|
151 |
+
if ( isset( $_POST['nonce'] ) && wp_verify_nonce( sanitize_key( $_POST['nonce'] ), 'quick-adsense-nonce' ) && ( isset( $_POST['index'] ) ) ) {
|
152 |
+
delete_option( 'quick_adsense_onpost_ad_' . sanitize_key( $_POST['index'] ) . '_stats' );
|
153 |
+
wp_send_json_success();
|
154 |
+
}
|
155 |
+
wp_send_json_error();
|
156 |
+
}
|
157 |
+
);
|
158 |
+
|
159 |
+
|
160 |
+
add_action(
|
161 |
+
'wp_ajax_quick_adsense_onpost_ad_get_stats_chart',
|
162 |
+
function() {
|
163 |
+
if ( isset( $_POST['nonce'] ) && wp_verify_nonce( sanitize_key( $_POST['nonce'] ), 'quick-adsense-nonce' ) && ( isset( $_POST['index'] ) ) ) {
|
164 |
+
$stats = get_option( 'quick_adsense_onpost_ad_' . sanitize_key( $_POST['index'] ) . '_stats' );
|
165 |
+
$stats_data = [];
|
166 |
+
for ( $i = 0; $i < 30; $i++ ) {
|
167 |
+
$clicks = 0;
|
168 |
+
$impressions = 0;
|
169 |
+
if ( isset( $stats ) && is_array( $stats ) && isset( $stats[ gmdate( 'dmY', strtotime( '-' . $i . ' day' ) ) ] ) ) {
|
170 |
+
$clicks = $stats[ gmdate( 'dmY', strtotime( '-' . $i . ' day' ) ) ]['c'];
|
171 |
+
$impressions = $stats[ gmdate( 'dmY', strtotime( '-' . $i . ' day' ) ) ]['i'];
|
172 |
+
}
|
173 |
+
$stats_data[] = [
|
174 |
+
'x' => gmdate( 'm/d/Y', strtotime( '-' . $i . ' day' ) ),
|
175 |
+
'y' => $impressions,
|
176 |
+
'y1' => $clicks,
|
177 |
+
];
|
178 |
+
}
|
179 |
+
wp_send_json_success(
|
180 |
+
quick_adsense_load_file(
|
181 |
+
'templates/block-stats-chart.php',
|
182 |
+
[
|
183 |
+
'stats_data' => wp_json_encode( $stats_data ),
|
184 |
+
]
|
185 |
+
)
|
186 |
+
);
|
187 |
+
}
|
188 |
+
wp_send_json_error();
|
189 |
+
}
|
190 |
+
);
|
191 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/templates/adunit-onpost.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $adunit_index = quick_adsense_get_value( $args, 'adunit_index' ); ?>
|
2 |
+
<div id="quick_adsense_onpost_adunits_control_<?php echo esc_attr( $adunit_index ); ?>" class="quick_adsense_onpost_adunits_control_wrapper">
|
3 |
+
<div class="quick_adsense_onpost_adunits_label">Ads<?php echo esc_attr( $adunit_index ); ?></div>
|
4 |
+
<div class="quick_adsense_onpost_adunits_control">
|
5 |
+
<?php
|
6 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
7 |
+
// This textarea needs to allow output of scripts, iframes etc necessary to output ads and trackers.
|
8 |
+
echo quickadsense_get_control(
|
9 |
+
'textarea',
|
10 |
+
'',
|
11 |
+
'quick_adsense_settings_onpost_ad_' . $adunit_index . '_content',
|
12 |
+
'quick_adsense_settings[onpost_ad_' . $adunit_index . '_content]',
|
13 |
+
quick_adsense_get_value( $args, 'onpost_ad_' . $adunit_index . '_content' ),
|
14 |
+
null,
|
15 |
+
'input',
|
16 |
+
'display: block; margin: 0 0 10px 0',
|
17 |
+
'Enter Code'
|
18 |
+
);
|
19 |
+
// phpcs:enable
|
20 |
+
?>
|
21 |
+
<p class="quick_adsense_onpost_adunits_styling_controls">
|
22 |
+
Alignment
|
23 |
+
<?php
|
24 |
+
echo wp_kses(
|
25 |
+
quickadsense_get_control(
|
26 |
+
'select',
|
27 |
+
'',
|
28 |
+
'quick_adsense_settings_onpost_ad_' . $adunit_index . '_alignment',
|
29 |
+
'quick_adsense_settings[onpost_ad_' . $adunit_index . '_alignment]',
|
30 |
+
quick_adsense_get_value( $args, 'onpost_ad_' . $adunit_index . '_alignment' ),
|
31 |
+
quick_adsense_get_value( $args, 'alignment_options' ),
|
32 |
+
'input',
|
33 |
+
'margin: -2px 20px 0 10px;'
|
34 |
+
),
|
35 |
+
quick_adsense_get_allowed_html()
|
36 |
+
);
|
37 |
+
?>
|
38 |
+
<wbr />margin
|
39 |
+
<?php
|
40 |
+
echo wp_kses(
|
41 |
+
quickadsense_get_control(
|
42 |
+
'number',
|
43 |
+
'',
|
44 |
+
'quick_adsense_settings_onpost_ad_' . $adunit_index . '_margin',
|
45 |
+
'quick_adsense_settings[onpost_ad_' . $adunit_index . '_margin]',
|
46 |
+
quick_adsense_get_value( $args, 'onpost_ad_' . $adunit_index . '_margin' ),
|
47 |
+
null,
|
48 |
+
'input',
|
49 |
+
'margin: -2px 10px 0 10px; width: 52px;'
|
50 |
+
),
|
51 |
+
quick_adsense_get_allowed_html()
|
52 |
+
);
|
53 |
+
?>
|
54 |
+
px
|
55 |
+
</p>
|
56 |
+
<?php
|
57 |
+
echo wp_kses(
|
58 |
+
quick_adsense_load_file( 'templates/block-adunit-advanced.php', $args ),
|
59 |
+
quick_adsense_get_allowed_html()
|
60 |
+
);
|
61 |
+
?>
|
62 |
+
</div>
|
63 |
+
<div class="clear"></div>
|
64 |
+
</div>
|
includes/templates/adunit-widget.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $adunit_index = quick_adsense_get_value( $args, 'adunit_index' ); ?>
|
2 |
+
<div id="quick_adsense_widget_adunits_control_<?php echo esc_attr( $adunit_index ); ?>" class="quick_adsense_widget_adunits_control_wrapper">
|
3 |
+
<div class="quick_adsense_widget_adunits_label">AdsWidget<?php echo esc_attr( $adunit_index ); ?></div>
|
4 |
+
<div class="quick_adsense_widget_adunits_control">
|
5 |
+
<?php
|
6 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
7 |
+
// This textarea needs to allow output of scripts, iframes etc necessary to output ads and trackers.
|
8 |
+
echo quickadsense_get_control(
|
9 |
+
'textarea',
|
10 |
+
'',
|
11 |
+
'quick_adsense_settings_widget_ad_' . $adunit_index . '_content',
|
12 |
+
'quick_adsense_settings[widget_ad_' . $adunit_index . '_content]',
|
13 |
+
quick_adsense_get_value( $args, 'widget_ad_' . $adunit_index . '_content' ),
|
14 |
+
null,
|
15 |
+
'input',
|
16 |
+
'display: block; margin: 0 0 10px 0;',
|
17 |
+
'Enter Code'
|
18 |
+
);
|
19 |
+
// phpcs:enable
|
20 |
+
?>
|
21 |
+
</div>
|
22 |
+
<div class="clear"></div>
|
23 |
+
</div>
|
includes/templates/block-adsense-adstxt-notice.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="notice notice-error quick_adsense_adstxt_adsense_notice is-dismissible" style="padding: 15px;">
|
2 |
+
<p><b>Quick Adsense</b> had detected that your ads.txt file does not have all your Google Adsense Publisher IDs.<br />This will severely impact your adsense earnings and your immediate attention is required.</p>
|
3 |
+
<p>Your recommended google entries for ads.txt is as given below.<br />You can manually copy this to your ads.txt file or
|
4 |
+
<?php if ( ( ! quick_adsense_get_value( $args, 'is_ajax' ) ) && ( 'toplevel_page_quick-adsense' !== quick_adsense_get_value( $args, 'screen_id' ) ) ) { ?>
|
5 |
+
<a href="<?php echo esc_url( admin_url( '/admin.php?page=quick-adsense#quick_adsense_adstxt_adsense_auto_update' ) ); ?>">CLICK HERE</a>
|
6 |
+
<?php } else { ?>
|
7 |
+
<a href="#" onclick="quick_adsense_adstxt_adsense_auto_update()">CLICK HERE</a>
|
8 |
+
<?php } ?>
|
9 |
+
to instruct Quick Adsense to try and add the entries automatically.</p>
|
10 |
+
<p><code style="display: block; padding: 2px 10px;"><?php echo esc_html( quick_adsense_get_value( $args, 'adstxt_new_adsense_entries' ) ); ?></code></p>
|
11 |
+
<p><small><i><b>We recommend you not to dismiss this notice for continued daily ads.txt monitoring. This notice will stop appearing automatically once Quick Adsense detects correct entries in ads.txt (rechecked daily).</b></i></small></p>
|
12 |
+
<div class="clear"></div>
|
13 |
+
<?php if ( quick_adsense_get_value( $args, 'is_ajax' ) ) { ?>
|
14 |
+
<button type="button" class="notice-dismiss" onclick="javascript:jQuery(this).parent().remove()"><span class="screen-reader-text">Dismiss this notice.</span></button>
|
15 |
+
<?php } ?>
|
16 |
+
</div>
|
includes/templates/block-adsense-adstxt-update-failed.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="quick_adsense_popup_content_wrapper">
|
2 |
+
<p>Auto Creation / Updation of ads.txt failed due to access permission restrictions on the server.</p>
|
3 |
+
<p>You have to manually upload the file using your Host\'s File manager or your favourite FTP program</p>
|
4 |
+
<p>ads.txt should be located in the root of your server. After manually uploading the file click <a href="<?php echo esc_url( site_url( '/ads.txt' ) ); ?>">here</a> to check if its accessible from the correct location</p>
|
5 |
+
<textarea style="display: none;" id="quick_adsense_adstxt_content"><?php echo wp_kses( quick_adsense_get_value( $args, 'content' ), quick_adsense_get_allowed_html() ); ?></textarea>
|
6 |
+
<p><a onclick="quick_adsense_adstxt_content_download()" class="button button-primary" href="javascript:;">Download ads.txt</a></p>
|
7 |
+
</div>
|
includes/templates/block-adunit-advanced.php
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$adunit_index = quick_adsense_get_value( $args, 'adunit_index' );
|
3 |
+
$location = quick_adsense_get_value( $args, 'location' );
|
4 |
+
?>
|
5 |
+
<p class="quick_adsense_<?php echo esc_attr( $location ); ?>_adunits_device_controls">
|
6 |
+
<b>Hide by Device Type:</b><br />
|
7 |
+
<?php
|
8 |
+
echo wp_kses(
|
9 |
+
quickadsense_get_control(
|
10 |
+
'checkbox',
|
11 |
+
'Mobile',
|
12 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_device_mobile',
|
13 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_device_mobile]',
|
14 |
+
quick_adsense_get_value( $args, '_ad_' . $adunit_index . '_hide_device_mobile' ),
|
15 |
+
null,
|
16 |
+
'input',
|
17 |
+
'margin: -1px 5px 0 0;'
|
18 |
+
),
|
19 |
+
quick_adsense_get_allowed_html()
|
20 |
+
);
|
21 |
+
echo wp_kses(
|
22 |
+
quickadsense_get_control(
|
23 |
+
'checkbox',
|
24 |
+
'Tablet',
|
25 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_device_tablet',
|
26 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_device_tablet]',
|
27 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_hide_device_tablet' ),
|
28 |
+
null,
|
29 |
+
'input',
|
30 |
+
'margin: -1px 5px 0 15px;'
|
31 |
+
),
|
32 |
+
quick_adsense_get_allowed_html()
|
33 |
+
);
|
34 |
+
echo wp_kses(
|
35 |
+
quickadsense_get_control(
|
36 |
+
'checkbox',
|
37 |
+
'Desktop',
|
38 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_device_desktop',
|
39 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_device_desktop]',
|
40 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_hide_device_desktop' ),
|
41 |
+
null,
|
42 |
+
'input',
|
43 |
+
'margin: -1px 5px 0 15px;'
|
44 |
+
),
|
45 |
+
quick_adsense_get_allowed_html()
|
46 |
+
);
|
47 |
+
?>
|
48 |
+
</p>
|
49 |
+
<p class="quick_adsense_<?php echo esc_attr( $location ); ?>_adunits_device_controls">
|
50 |
+
<b>Hide by Visitor Source:</b><br />
|
51 |
+
<?php
|
52 |
+
echo wp_kses(
|
53 |
+
quickadsense_get_control(
|
54 |
+
'checkbox',
|
55 |
+
'Search Engine',
|
56 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_visitor_searchengine',
|
57 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_visitor_searchengine]',
|
58 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_hide_visitor_searchengine' ),
|
59 |
+
null,
|
60 |
+
'input',
|
61 |
+
'margin: -1px 5px 0 0;'
|
62 |
+
),
|
63 |
+
quick_adsense_get_allowed_html()
|
64 |
+
);
|
65 |
+
echo wp_kses(
|
66 |
+
quickadsense_get_control(
|
67 |
+
'checkbox',
|
68 |
+
'Indirect',
|
69 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_visitor_indirect',
|
70 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_visitor_indirect]',
|
71 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_hide_visitor_indirect' ),
|
72 |
+
null,
|
73 |
+
'input',
|
74 |
+
'margin: -1px 5px 0 15px;'
|
75 |
+
),
|
76 |
+
quick_adsense_get_allowed_html()
|
77 |
+
);
|
78 |
+
echo wp_kses(
|
79 |
+
quickadsense_get_control(
|
80 |
+
'checkbox',
|
81 |
+
'Direct',
|
82 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_visitor_direct',
|
83 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_visitor_direct]',
|
84 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_hide_visitor_direct' ),
|
85 |
+
null,
|
86 |
+
'input',
|
87 |
+
'margin: -1px 5px 0 15px;'
|
88 |
+
),
|
89 |
+
quick_adsense_get_allowed_html()
|
90 |
+
);
|
91 |
+
?>
|
92 |
+
</p>
|
93 |
+
<p class="quick_adsense_<?php echo esc_attr( $location ); ?>_adunits_device_controls">
|
94 |
+
<b>Hide by Visitor Type:</b><br />
|
95 |
+
<?php
|
96 |
+
echo wp_kses(
|
97 |
+
quickadsense_get_control(
|
98 |
+
'checkbox',
|
99 |
+
'Bots',
|
100 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_visitor_bot',
|
101 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_visitor_bot]',
|
102 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_hide_visitor_bot' ),
|
103 |
+
null,
|
104 |
+
'input',
|
105 |
+
'margin: -1px 5px 0 0;'
|
106 |
+
),
|
107 |
+
quick_adsense_get_allowed_html()
|
108 |
+
);
|
109 |
+
echo wp_kses(
|
110 |
+
quickadsense_get_control(
|
111 |
+
'checkbox',
|
112 |
+
'Known Browser',
|
113 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_visitor_knownbrowser',
|
114 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_visitor_knownbrowser]',
|
115 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_hide_visitor_knownbrowser' ),
|
116 |
+
null,
|
117 |
+
'input',
|
118 |
+
'margin: -1px 5px 0 15px;'
|
119 |
+
),
|
120 |
+
quick_adsense_get_allowed_html()
|
121 |
+
);
|
122 |
+
echo wp_kses(
|
123 |
+
quickadsense_get_control(
|
124 |
+
'checkbox',
|
125 |
+
'Unknown Browser',
|
126 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_visitor_unknownbrowser',
|
127 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_visitor_unknownbrowser]',
|
128 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_hide_visitor_unknownbrowser' ),
|
129 |
+
null,
|
130 |
+
'input',
|
131 |
+
'margin: -1px 5px 0 15px;'
|
132 |
+
),
|
133 |
+
quick_adsense_get_allowed_html()
|
134 |
+
);
|
135 |
+
?>
|
136 |
+
<br />
|
137 |
+
<?php
|
138 |
+
echo wp_kses(
|
139 |
+
quickadsense_get_control(
|
140 |
+
'checkbox',
|
141 |
+
'Guest',
|
142 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_visitor_guest',
|
143 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_visitor_guest]',
|
144 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_hide_visitor_guest' ),
|
145 |
+
null,
|
146 |
+
'input',
|
147 |
+
'margin: -1px 5px 0 0;'
|
148 |
+
),
|
149 |
+
quick_adsense_get_allowed_html()
|
150 |
+
);
|
151 |
+
echo wp_kses(
|
152 |
+
quickadsense_get_control(
|
153 |
+
'checkbox',
|
154 |
+
'Logged-in',
|
155 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_hide_visitor_loggedin',
|
156 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_hide_visitor_loggedin]',
|
157 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_hide_visitor_loggedin' ),
|
158 |
+
null,
|
159 |
+
'input',
|
160 |
+
'margin: -1px 5px 0 15px;'
|
161 |
+
),
|
162 |
+
quick_adsense_get_allowed_html()
|
163 |
+
);
|
164 |
+
?>
|
165 |
+
</p>
|
166 |
+
<p class="quick_adsense_<?php echo esc_attr( $location ); ?>_adunits_device_controls">
|
167 |
+
<b>Limit by Visitor Countries:</b><br />
|
168 |
+
<?php
|
169 |
+
echo wp_kses(
|
170 |
+
quickadsense_get_control(
|
171 |
+
'multiselect',
|
172 |
+
'',
|
173 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_limit_visitor_country',
|
174 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_limit_visitor_country][]',
|
175 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_limit_visitor_country' ),
|
176 |
+
quick_adsense_get_countries()
|
177 |
+
),
|
178 |
+
quick_adsense_get_allowed_html()
|
179 |
+
);
|
180 |
+
?>
|
181 |
+
</p>
|
182 |
+
<p class="quick_adsense_<?php echo esc_attr( $location ); ?>_adunits_device_controls">
|
183 |
+
<b>Ad Stats:</b><br />
|
184 |
+
<?php
|
185 |
+
echo wp_kses(
|
186 |
+
quickadsense_get_control(
|
187 |
+
'checkbox',
|
188 |
+
'Enable Stats',
|
189 |
+
'quick_adsense_settings_' . $location . '_ad_' . $adunit_index . '_enable_stats',
|
190 |
+
'quick_adsense_settings[' . $location . '_ad_' . $adunit_index . '_enable_stats]',
|
191 |
+
quick_adsense_get_value( $args, $location . '_ad_' . $adunit_index . '_enable_stats' ),
|
192 |
+
null,
|
193 |
+
'input',
|
194 |
+
'margin: -1px 5px 0 0;'
|
195 |
+
),
|
196 |
+
quick_adsense_get_allowed_html()
|
197 |
+
);
|
198 |
+
?>
|
199 |
+
<br />
|
200 |
+
<input class="quick_adsense_<?php echo esc_attr( $location ); ?>_ad_show_stats input button-secondary" data-index="<?php echo esc_attr( $adunit_index ); ?>" type="button" value="View Stats" />
|
201 |
+
<input class="quick_adsense_<?php echo esc_attr( $location ); ?>_ad_reset_stats input button-secondary right" data-index="<?php echo esc_attr( $adunit_index ); ?>" type="button" value="Reset Stats" />
|
202 |
+
</p>
|
includes/templates/block-general-adsense.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="quick_adsense_block">
|
2 |
+
<div class="quick_adsense_block_labels">Adsense</div>
|
3 |
+
<div class="quick_adsense_block_controls">
|
4 |
+
Place up to
|
5 |
+
<?php
|
6 |
+
$max_ads_count = [];
|
7 |
+
for ( $i = 0; $i <= 10; $i++ ) {
|
8 |
+
$max_ads_count[] = [
|
9 |
+
'text' => $i,
|
10 |
+
'value' => $i,
|
11 |
+
];
|
12 |
+
}
|
13 |
+
echo wp_kses(
|
14 |
+
quickadsense_get_control(
|
15 |
+
'select',
|
16 |
+
'',
|
17 |
+
'quick_adsense_settings_max_ads_per_page',
|
18 |
+
'quick_adsense_settings[max_ads_per_page]',
|
19 |
+
quick_adsense_get_value( $args, 'max_ads_per_page' ),
|
20 |
+
$max_ads_count,
|
21 |
+
'input',
|
22 |
+
'margin: -2px 10px 0 40px;'
|
23 |
+
),
|
24 |
+
quick_adsense_get_allowed_html()
|
25 |
+
);
|
26 |
+
?>
|
27 |
+
Ads on a page
|
28 |
+
</div>
|
29 |
+
<div class="clear"></div>
|
30 |
+
</div>
|
includes/templates/block-general-appearance.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="quick_adsense_block">
|
2 |
+
<div class="quick_adsense_block_labels">Appearance</div>
|
3 |
+
<div class="quick_adsense_block_controls">
|
4 |
+
<p>
|
5 |
+
<span>
|
6 |
+
<?php
|
7 |
+
echo wp_kses(
|
8 |
+
quickadsense_get_control(
|
9 |
+
'checkbox',
|
10 |
+
'<b id="quick_adsense_settings_enable_on_posts_label">Posts</b>',
|
11 |
+
'quick_adsense_settings_enable_on_posts',
|
12 |
+
'quick_adsense_settings[enable_on_posts]',
|
13 |
+
quick_adsense_get_value( $args, 'enable_on_posts' ),
|
14 |
+
null,
|
15 |
+
'input',
|
16 |
+
'margin: -1px 10px 0 0;'
|
17 |
+
),
|
18 |
+
quick_adsense_get_allowed_html()
|
19 |
+
);
|
20 |
+
?>
|
21 |
+
</span>
|
22 |
+
<span>
|
23 |
+
<?php
|
24 |
+
echo wp_kses(
|
25 |
+
quickadsense_get_control(
|
26 |
+
'checkbox',
|
27 |
+
'<b id="quick_adsense_settings_enable_on_pages_label">Pages</b>',
|
28 |
+
'quick_adsense_settings_enable_on_pages',
|
29 |
+
'quick_adsense_settings[enable_on_pages]',
|
30 |
+
quick_adsense_get_value( $args, 'enable_on_pages' ),
|
31 |
+
null,
|
32 |
+
'input',
|
33 |
+
'margin: -1px 10px 0 15px;'
|
34 |
+
),
|
35 |
+
quick_adsense_get_allowed_html()
|
36 |
+
);
|
37 |
+
?>
|
38 |
+
</span>
|
39 |
+
</p>
|
40 |
+
<p>
|
41 |
+
<span>
|
42 |
+
<?php
|
43 |
+
echo wp_kses(
|
44 |
+
quickadsense_get_control(
|
45 |
+
'checkbox',
|
46 |
+
'<b id="quick_adsense_settings_enable_on_homepage_label">Homepage</b>',
|
47 |
+
'quick_adsense_settings_enable_on_homepage',
|
48 |
+
'quick_adsense_settings[enable_on_homepage]',
|
49 |
+
quick_adsense_get_value( $args, 'enable_on_homepage' ),
|
50 |
+
null,
|
51 |
+
'input',
|
52 |
+
'margin: -1px 10px 0 0;'
|
53 |
+
),
|
54 |
+
quick_adsense_get_allowed_html()
|
55 |
+
);
|
56 |
+
?>
|
57 |
+
</span>
|
58 |
+
<span>
|
59 |
+
<?php
|
60 |
+
echo wp_kses(
|
61 |
+
quickadsense_get_control(
|
62 |
+
'checkbox',
|
63 |
+
'<b id="quick_adsense_settings_enable_on_categories_label">Categories</b>',
|
64 |
+
'quick_adsense_settings_enable_on_categories',
|
65 |
+
'quick_adsense_settings[enable_on_categories]',
|
66 |
+
quick_adsense_get_value( $args, 'enable_on_categories' ),
|
67 |
+
null,
|
68 |
+
'input',
|
69 |
+
'margin: -1px 10px 0 15px;'
|
70 |
+
),
|
71 |
+
quick_adsense_get_allowed_html()
|
72 |
+
);
|
73 |
+
?>
|
74 |
+
</span>
|
75 |
+
<span>
|
76 |
+
<?php
|
77 |
+
echo wp_kses(
|
78 |
+
quickadsense_get_control(
|
79 |
+
'checkbox',
|
80 |
+
'<b id="quick_adsense_settings_enable_on_archives_label">Archives</b>',
|
81 |
+
'quick_adsense_settings_enable_on_archives',
|
82 |
+
'quick_adsense_settings[enable_on_archives]',
|
83 |
+
quick_adsense_get_value( $args, 'enable_on_archives' ),
|
84 |
+
null,
|
85 |
+
'input',
|
86 |
+
'margin: -1px 10px 0 15px;'
|
87 |
+
),
|
88 |
+
quick_adsense_get_allowed_html()
|
89 |
+
);
|
90 |
+
?>
|
91 |
+
</span>
|
92 |
+
<span>
|
93 |
+
<?php
|
94 |
+
echo wp_kses(
|
95 |
+
quickadsense_get_control(
|
96 |
+
'checkbox',
|
97 |
+
'<b id="quick_adsense_settings_enable_on_tags_label">Tags</b>',
|
98 |
+
'quick_adsense_settings_enable_on_tags',
|
99 |
+
'quick_adsense_settings[enable_on_tags]',
|
100 |
+
quick_adsense_get_value( $args, 'enable_on_tags' ),
|
101 |
+
null,
|
102 |
+
'input',
|
103 |
+
'margin: -1px 10px 0 15px;'
|
104 |
+
),
|
105 |
+
quick_adsense_get_allowed_html()
|
106 |
+
);
|
107 |
+
?>
|
108 |
+
</span>
|
109 |
+
<span>
|
110 |
+
<?php
|
111 |
+
echo wp_kses(
|
112 |
+
quickadsense_get_control(
|
113 |
+
'checkbox',
|
114 |
+
'<b id="quick_adsense_settings_enable_all_possible_ads_label">Place all possible Ads on these pages</b>',
|
115 |
+
'quick_adsense_settings_enable_all_possible_ads',
|
116 |
+
'quick_adsense_settings[enable_all_possible_ads]',
|
117 |
+
quick_adsense_get_value( $args, 'enable_all_possible_ads' ),
|
118 |
+
null,
|
119 |
+
'input',
|
120 |
+
'margin: -1px 10px 0 35px;'
|
121 |
+
),
|
122 |
+
quick_adsense_get_allowed_html()
|
123 |
+
);
|
124 |
+
?>
|
125 |
+
</span>
|
126 |
+
</p>
|
127 |
+
<p>
|
128 |
+
<span>
|
129 |
+
<?php
|
130 |
+
echo wp_kses(
|
131 |
+
quickadsense_get_control(
|
132 |
+
'checkbox',
|
133 |
+
'<b id="quick_adsense_settings_disable_widgets_on_homepage_label">Disable AdsWidget on Homepage</b>',
|
134 |
+
'quick_adsense_settings_disable_widgets_on_homepage',
|
135 |
+
'quick_adsense_settings[disable_widgets_on_homepage]',
|
136 |
+
quick_adsense_get_value( $args, 'disable_widgets_on_homepage' ),
|
137 |
+
null,
|
138 |
+
'input',
|
139 |
+
'margin: -1px 10px 0 0;'
|
140 |
+
),
|
141 |
+
quick_adsense_get_allowed_html()
|
142 |
+
);
|
143 |
+
?>
|
144 |
+
</span>
|
145 |
+
</p>
|
146 |
+
<p>
|
147 |
+
<span>
|
148 |
+
<?php
|
149 |
+
echo wp_kses(
|
150 |
+
quickadsense_get_control(
|
151 |
+
'checkbox',
|
152 |
+
'<b id="quick_adsense_settings_disable_for_loggedin_users_label">Hide Ads when user is logged in to WordPress</b>',
|
153 |
+
'quick_adsense_settings_disable_for_loggedin_users',
|
154 |
+
'quick_adsense_settings[disable_for_loggedin_users]',
|
155 |
+
quick_adsense_get_value( $args, 'disable_for_loggedin_users' ),
|
156 |
+
null,
|
157 |
+
'input',
|
158 |
+
'margin: -1px 10px 0 0;'
|
159 |
+
),
|
160 |
+
quick_adsense_get_allowed_html()
|
161 |
+
);
|
162 |
+
?>
|
163 |
+
</span>
|
164 |
+
</p>
|
165 |
+
</div>
|
166 |
+
<div class="clear"></div>
|
167 |
+
</div>
|
includes/templates/block-general-assign-position.php
ADDED
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="quick_adsense_block">
|
2 |
+
<div class="quick_adsense_block_labels">Assign position<br />(Default)</div>
|
3 |
+
<div class="quick_adsense_block_controls">
|
4 |
+
<?php
|
5 |
+
$ad_positions = [
|
6 |
+
[
|
7 |
+
'text' => 'Random Ads',
|
8 |
+
'value' => '0',
|
9 |
+
],
|
10 |
+
];
|
11 |
+
for ( $i = 1; $i <= 10; $i++ ) {
|
12 |
+
$ad_positions[] = [
|
13 |
+
'text' => 'Ads' . $i,
|
14 |
+
'value' => $i,
|
15 |
+
];
|
16 |
+
}
|
17 |
+
|
18 |
+
$element_count = [];
|
19 |
+
for ( $i = 1; $i <= 50; $i++ ) {
|
20 |
+
$element_count[] = [
|
21 |
+
'text' => $i,
|
22 |
+
'value' => $i,
|
23 |
+
];
|
24 |
+
}
|
25 |
+
?>
|
26 |
+
<p>
|
27 |
+
<?php
|
28 |
+
echo wp_kses(
|
29 |
+
quickadsense_get_control(
|
30 |
+
'checkbox',
|
31 |
+
'',
|
32 |
+
'quick_adsense_settings_enable_position_beginning_of_post',
|
33 |
+
'quick_adsense_settings[enable_position_beginning_of_post]',
|
34 |
+
quick_adsense_get_value( $args, 'enable_position_beginning_of_post' ),
|
35 |
+
null,
|
36 |
+
'input',
|
37 |
+
''
|
38 |
+
),
|
39 |
+
quick_adsense_get_allowed_html()
|
40 |
+
);
|
41 |
+
echo wp_kses(
|
42 |
+
quickadsense_get_control(
|
43 |
+
'select',
|
44 |
+
'',
|
45 |
+
'quick_adsense_settings_ad_beginning_of_post',
|
46 |
+
'quick_adsense_settings[ad_beginning_of_post]',
|
47 |
+
quick_adsense_get_value( $args, 'ad_beginning_of_post' ),
|
48 |
+
$ad_positions,
|
49 |
+
'input',
|
50 |
+
'margin: -2px 10px 0 20px;'
|
51 |
+
),
|
52 |
+
quick_adsense_get_allowed_html()
|
53 |
+
);
|
54 |
+
?>
|
55 |
+
<b style="width: 120px; display: inline-block;">Beginning of Post</b>
|
56 |
+
</p>
|
57 |
+
<p>
|
58 |
+
<?php
|
59 |
+
echo wp_kses(
|
60 |
+
quickadsense_get_control(
|
61 |
+
'checkbox',
|
62 |
+
'',
|
63 |
+
'quick_adsense_settings_enable_position_middle_of_post',
|
64 |
+
'quick_adsense_settings[enable_position_middle_of_post]',
|
65 |
+
quick_adsense_get_value( $args, 'enable_position_middle_of_post' ),
|
66 |
+
null,
|
67 |
+
'input',
|
68 |
+
''
|
69 |
+
),
|
70 |
+
quick_adsense_get_allowed_html()
|
71 |
+
);
|
72 |
+
echo wp_kses(
|
73 |
+
quickadsense_get_control(
|
74 |
+
'select',
|
75 |
+
'',
|
76 |
+
'quick_adsense_settings_ad_middle_of_post',
|
77 |
+
'quick_adsense_settings[ad_middle_of_post]',
|
78 |
+
quick_adsense_get_value( $args, 'ad_middle_of_post' ),
|
79 |
+
$ad_positions,
|
80 |
+
'input',
|
81 |
+
'margin: -2px 10px 0 20px;'
|
82 |
+
),
|
83 |
+
quick_adsense_get_allowed_html()
|
84 |
+
);
|
85 |
+
?>
|
86 |
+
<b style="width: 120px; display: inline-block;">Middle of Post</b>
|
87 |
+
</p>
|
88 |
+
<p>
|
89 |
+
<?php
|
90 |
+
echo wp_kses(
|
91 |
+
quickadsense_get_control(
|
92 |
+
'checkbox',
|
93 |
+
'',
|
94 |
+
'quick_adsense_settings_enable_position_end_of_post',
|
95 |
+
'quick_adsense_settings[enable_position_end_of_post]',
|
96 |
+
quick_adsense_get_value( $args, 'enable_position_end_of_post' ),
|
97 |
+
null,
|
98 |
+
'input',
|
99 |
+
''
|
100 |
+
),
|
101 |
+
quick_adsense_get_allowed_html()
|
102 |
+
);
|
103 |
+
echo wp_kses(
|
104 |
+
quickadsense_get_control(
|
105 |
+
'select',
|
106 |
+
'',
|
107 |
+
'quick_adsense_settings_ad_end_of_post',
|
108 |
+
'quick_adsense_settings[ad_end_of_post]',
|
109 |
+
quick_adsense_get_value( $args, 'ad_end_of_post' ),
|
110 |
+
$ad_positions,
|
111 |
+
'input',
|
112 |
+
'margin: -2px 10px 0 20px;'
|
113 |
+
),
|
114 |
+
quick_adsense_get_allowed_html()
|
115 |
+
);
|
116 |
+
?>
|
117 |
+
<b>End of Post</b>
|
118 |
+
</p>
|
119 |
+
<div class="clear"></div>
|
120 |
+
<p>
|
121 |
+
<?php
|
122 |
+
echo wp_kses(
|
123 |
+
quickadsense_get_control(
|
124 |
+
'checkbox',
|
125 |
+
'',
|
126 |
+
'quick_adsense_settings_enable_position_after_more_tag',
|
127 |
+
'quick_adsense_settings[enable_position_after_more_tag]',
|
128 |
+
quick_adsense_get_value( $args, 'enable_position_after_more_tag' ),
|
129 |
+
null,
|
130 |
+
'input',
|
131 |
+
''
|
132 |
+
),
|
133 |
+
quick_adsense_get_allowed_html()
|
134 |
+
);
|
135 |
+
echo wp_kses(
|
136 |
+
quickadsense_get_control(
|
137 |
+
'select',
|
138 |
+
'',
|
139 |
+
'quick_adsense_settings_ad_after_more_tag',
|
140 |
+
'quick_adsense_settings[ad_after_more_tag]',
|
141 |
+
quick_adsense_get_value( $args, 'ad_after_more_tag' ),
|
142 |
+
$ad_positions,
|
143 |
+
'input',
|
144 |
+
'margin: -2px 10px 0 20px;'
|
145 |
+
),
|
146 |
+
quick_adsense_get_allowed_html()
|
147 |
+
);
|
148 |
+
?>
|
149 |
+
right after <b>the <!--more--> tag</b>
|
150 |
+
</p>
|
151 |
+
<p>
|
152 |
+
<?php
|
153 |
+
echo wp_kses(
|
154 |
+
quickadsense_get_control(
|
155 |
+
'checkbox',
|
156 |
+
'',
|
157 |
+
'quick_adsense_settings_enable_position_before_last_para',
|
158 |
+
'quick_adsense_settings[enable_position_before_last_para]',
|
159 |
+
quick_adsense_get_value( $args, 'enable_position_before_last_para' ),
|
160 |
+
null,
|
161 |
+
'input',
|
162 |
+
''
|
163 |
+
),
|
164 |
+
quick_adsense_get_allowed_html()
|
165 |
+
);
|
166 |
+
echo wp_kses(
|
167 |
+
quickadsense_get_control(
|
168 |
+
'select',
|
169 |
+
'',
|
170 |
+
'quick_adsense_settings_ad_before_last_para',
|
171 |
+
'quick_adsense_settings[ad_before_last_para]',
|
172 |
+
quick_adsense_get_value( $args, 'ad_before_last_para' ),
|
173 |
+
$ad_positions,
|
174 |
+
'input',
|
175 |
+
'margin: -2px 10px 0 20px;'
|
176 |
+
),
|
177 |
+
quick_adsense_get_allowed_html()
|
178 |
+
);
|
179 |
+
?>
|
180 |
+
right before <b>the last Paragraph</b>
|
181 |
+
</p>
|
182 |
+
<div class="clear"></div>
|
183 |
+
<?php for ( $i = 1; $i <= 3; $i++ ) { ?>
|
184 |
+
<p>
|
185 |
+
<?php
|
186 |
+
echo wp_kses(
|
187 |
+
quickadsense_get_control(
|
188 |
+
'checkbox',
|
189 |
+
'',
|
190 |
+
'quick_adsense_settings_enable_position_after_para_option_' . $i,
|
191 |
+
'quick_adsense_settings[enable_position_after_para_option_' . $i . ']',
|
192 |
+
quick_adsense_get_value( $args, 'enable_position_after_para_option_' . $i ),
|
193 |
+
null,
|
194 |
+
'input',
|
195 |
+
''
|
196 |
+
),
|
197 |
+
quick_adsense_get_allowed_html()
|
198 |
+
);
|
199 |
+
echo wp_kses(
|
200 |
+
quickadsense_get_control(
|
201 |
+
'select',
|
202 |
+
'',
|
203 |
+
'quick_adsense_settings_ad_after_para_option_' . $i,
|
204 |
+
'quick_adsense_settings[ad_after_para_option_' . $i . ']',
|
205 |
+
quick_adsense_get_value( $args, 'ad_after_para_option_' . $i ),
|
206 |
+
$ad_positions,
|
207 |
+
'input',
|
208 |
+
'margin: -2px 10px 0 20px;'
|
209 |
+
),
|
210 |
+
quick_adsense_get_allowed_html()
|
211 |
+
);
|
212 |
+
?>
|
213 |
+
<span style="width: 110px;display: inline-block;"><b>after Paragraph</b></span>
|
214 |
+
<?php
|
215 |
+
echo wp_kses(
|
216 |
+
quickadsense_get_control(
|
217 |
+
'select',
|
218 |
+
'',
|
219 |
+
'quick_adsense_settings_position_after_para_option_' . $i,
|
220 |
+
'quick_adsense_settings[position_after_para_option_' . $i . ']',
|
221 |
+
quick_adsense_get_value( $args, 'position_after_para_option_' . $i ),
|
222 |
+
$element_count,
|
223 |
+
'input',
|
224 |
+
'margin: -2px 10px 0 10px;'
|
225 |
+
),
|
226 |
+
quick_adsense_get_allowed_html()
|
227 |
+
);
|
228 |
+
?>
|
229 |
+
repeat
|
230 |
+
<?php
|
231 |
+
echo wp_kses(
|
232 |
+
quickadsense_get_control(
|
233 |
+
'checkbox',
|
234 |
+
'',
|
235 |
+
'quick_adsense_settings_enable_jump_position_after_para_option_' . $i,
|
236 |
+
'quick_adsense_settings[enable_jump_position_after_para_option_' . $i . ']',
|
237 |
+
quick_adsense_get_value( $args, 'enable_jump_position_after_para_option_' . $i ),
|
238 |
+
null,
|
239 |
+
'input',
|
240 |
+
'margin: -1px 10px 0;'
|
241 |
+
),
|
242 |
+
quick_adsense_get_allowed_html()
|
243 |
+
);
|
244 |
+
?>
|
245 |
+
<b>to End of Post</b> if fewer paragraphs are found
|
246 |
+
</p>
|
247 |
+
<?php } ?>
|
248 |
+
<div class="clear"></div>
|
249 |
+
<?php for ( $i = 1; $i <= 1; $i++ ) { ?>
|
250 |
+
<p>
|
251 |
+
<?php
|
252 |
+
echo wp_kses(
|
253 |
+
quickadsense_get_control(
|
254 |
+
'checkbox',
|
255 |
+
'',
|
256 |
+
'quick_adsense_settings_enable_position_after_image_option_' . $i,
|
257 |
+
'quick_adsense_settings[enable_position_after_image_option_' . $i . ']',
|
258 |
+
quick_adsense_get_value( $args, 'enable_position_after_image_option_' . $i ),
|
259 |
+
null,
|
260 |
+
'input',
|
261 |
+
''
|
262 |
+
),
|
263 |
+
quick_adsense_get_allowed_html()
|
264 |
+
);
|
265 |
+
echo wp_kses(
|
266 |
+
quickadsense_get_control(
|
267 |
+
'select',
|
268 |
+
'',
|
269 |
+
'quick_adsense_settings_ad_after_image_option_' . $i,
|
270 |
+
'quick_adsense_settings[ad_after_image_option_' . $i . ']',
|
271 |
+
quick_adsense_get_value( $args, 'ad_after_image_option_' . $i ),
|
272 |
+
$ad_positions,
|
273 |
+
'input',
|
274 |
+
'margin: -2px 10px 0 20px;'
|
275 |
+
),
|
276 |
+
quick_adsense_get_allowed_html()
|
277 |
+
);
|
278 |
+
?>
|
279 |
+
<span style="width: 110px;display: inline-block;">after Image</span>
|
280 |
+
<?php
|
281 |
+
echo wp_kses(
|
282 |
+
quickadsense_get_control(
|
283 |
+
'select',
|
284 |
+
'',
|
285 |
+
'quick_adsense_settings_position_after_image_option_' . $i,
|
286 |
+
'quick_adsense_settings[position_after_image_option_' . $i . ']',
|
287 |
+
quick_adsense_get_value( $args, 'position_after_image_option_' . $i ),
|
288 |
+
$element_count,
|
289 |
+
'input',
|
290 |
+
'margin: -2px 10px 0 10px;'
|
291 |
+
),
|
292 |
+
quick_adsense_get_allowed_html()
|
293 |
+
);
|
294 |
+
?>
|
295 |
+
repeat
|
296 |
+
<?php
|
297 |
+
echo wp_kses(
|
298 |
+
quickadsense_get_control(
|
299 |
+
'checkbox',
|
300 |
+
'',
|
301 |
+
'quick_adsense_settings_enable_jump_position_after_image_option_' . $i,
|
302 |
+
'quick_adsense_settings[enable_jump_position_after_image_option_' . $i . ']',
|
303 |
+
quick_adsense_get_value( $args, 'enable_jump_position_after_image_option_' . $i ),
|
304 |
+
null,
|
305 |
+
'input',
|
306 |
+
'margin: -1px 10px 0;'
|
307 |
+
),
|
308 |
+
quick_adsense_get_allowed_html()
|
309 |
+
);
|
310 |
+
?>
|
311 |
+
after <b>Image\'s outer <div> wp-caption</b> if any
|
312 |
+
</p>
|
313 |
+
<?php } ?>
|
314 |
+
</div>
|
315 |
+
<div class="clear"></div>
|
316 |
+
</div>
|
includes/templates/block-general-quicktag.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="quick_adsense_block">
|
2 |
+
<div class="quick_adsense_block_labels">Quicktag</div>
|
3 |
+
<div class="quick_adsense_block_controls">
|
4 |
+
<p>
|
5 |
+
<?php
|
6 |
+
echo wp_kses(
|
7 |
+
quickadsense_get_control(
|
8 |
+
'checkbox',
|
9 |
+
'<b>Show Quicktag Buttons on the HTML Edit Post SubPanel</b>',
|
10 |
+
'quick_adsense_settings_enable_quicktag_buttons',
|
11 |
+
'quick_adsense_settings[enable_quicktag_buttons]',
|
12 |
+
quick_adsense_get_value( $args, 'enable_quicktag_buttons' ),
|
13 |
+
null,
|
14 |
+
'input',
|
15 |
+
'margin: -1px 10px 0 0;'
|
16 |
+
),
|
17 |
+
quick_adsense_get_allowed_html()
|
18 |
+
);
|
19 |
+
?>
|
20 |
+
</p>
|
21 |
+
<p>
|
22 |
+
<?php
|
23 |
+
echo wp_kses(
|
24 |
+
quickadsense_get_control(
|
25 |
+
'checkbox',
|
26 |
+
'Hide <b><!--RndAds--></b> from Quicktag Buttons',
|
27 |
+
'quick_adsense_settings_disable_randomads_quicktag_button',
|
28 |
+
'quick_adsense_settings[disable_randomads_quicktag_button]',
|
29 |
+
quick_adsense_get_value( $args, 'disable_randomads_quicktag_button' ),
|
30 |
+
null,
|
31 |
+
'input',
|
32 |
+
'margin: -1px 10px 0 0;'
|
33 |
+
),
|
34 |
+
quick_adsense_get_allowed_html()
|
35 |
+
);
|
36 |
+
?>
|
37 |
+
</p>
|
38 |
+
<p>
|
39 |
+
<?php
|
40 |
+
echo wp_kses(
|
41 |
+
quickadsense_get_control(
|
42 |
+
'checkbox',
|
43 |
+
'Hide <b><!--NoAds--></b>, <b><!--OffDef--></b>, <b><!--OffWidget--></b> from Quicktag Buttons',
|
44 |
+
'quick_adsense_settings_disable_disablead_quicktag_buttons',
|
45 |
+
'quick_adsense_settings[disable_disablead_quicktag_buttons]',
|
46 |
+
quick_adsense_get_value( $args, 'disable_disablead_quicktag_buttons' ),
|
47 |
+
null,
|
48 |
+
'input',
|
49 |
+
'margin: -1px 10px 0 0;'
|
50 |
+
),
|
51 |
+
quick_adsense_get_allowed_html()
|
52 |
+
);
|
53 |
+
?>
|
54 |
+
</p>
|
55 |
+
<p>
|
56 |
+
<?php
|
57 |
+
echo wp_kses(
|
58 |
+
quickadsense_get_control(
|
59 |
+
'checkbox',
|
60 |
+
'Hide <b><!--OffBegin--></b>, <b><!--OffMiddle--></b>, <b><!--OffEnd--></b>, <b><!--OffAfMore--></b>, <b><!--OffBfLastPara--></b> from Quicktag Buttons',
|
61 |
+
'quick_adsense_settings_disable_positionad_quicktag_buttons',
|
62 |
+
'quick_adsense_settings[disable_positionad_quicktag_buttons]',
|
63 |
+
quick_adsense_get_value( $args, 'disable_positionad_quicktag_buttons' ),
|
64 |
+
null,
|
65 |
+
'input',
|
66 |
+
'margin: -1px 10px 0 0;'
|
67 |
+
),
|
68 |
+
quick_adsense_get_allowed_html()
|
69 |
+
);
|
70 |
+
?>
|
71 |
+
</p>
|
72 |
+
<div class="clear"></div>
|
73 |
+
Insert Ads into a post, on-the-fly:
|
74 |
+
<ol>
|
75 |
+
<li>Insert <b><!--Ads1--></b>, <b><!--Ads2--></b> etc. into a post to show the <b>Particular Ads</b> at specific location.</li>
|
76 |
+
<li>Insert <b><!--RndAds--></b> (or more) into a post to show the <b>Random Ads</b> at specific location.</li>
|
77 |
+
</ol>
|
78 |
+
<div class="clear"></div>
|
79 |
+
Disable Ads in a post, on-the-fly:
|
80 |
+
<ol>
|
81 |
+
<li>Insert <b><!--NoAds--></b> to disable all Ads in a post <i>(does not affect Ads on Sidebar)</i>.</li>
|
82 |
+
<li>Insert <b><!--OffDef--></b> to disable the default positioned Ads, and use <!--Ads1-->, <!--Ads2-->, etc. to insert Ad <i>(does not affect Ads on Sidebar)</i>.</li>
|
83 |
+
<li>Insert <b><!--OffWidget--></b> to disable all Ads on Sidebar.</li>
|
84 |
+
<li>Insert <b><!--OffBegin--></b>, <b><!--OffMiddle--></b>, <b><!--OffEnd--></b> to <b>disable Ads at Beginning</b>, <b>Middle or End of Post</b>.</li>
|
85 |
+
<li>Insert <b><!--OffAfMore--></b>, <b><!--OffBfLastPara--></b> to <b>disable Ads right after the <!--more--> tag</b>, or <b>right before the last Paragraph</b>.</li>
|
86 |
+
</ol>
|
87 |
+
<div class="clear"></div>
|
88 |
+
<i>Tags can be inserted into a post via the additional Quicktag Buttons at the HTML Edit Post SubPanel.</i>
|
89 |
+
</div>
|
90 |
+
<div class="clear"></div>
|
91 |
+
</div>
|
includes/templates/block-stats-chart.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="quick_adsense_ad_stats_chart_wrapper">
|
2 |
+
<p> </p>
|
3 |
+
<canvas id="quick_adsense_ad_stats_chart" width="1377" height="360"></canvas>
|
4 |
+
<textarea id="quick_adsense_ad_stats_chart_data" style="display: none;"><?php echo esc_textarea( quick_adsense_get_value( $args, 'stats_data' ) ); ?></textarea>
|
5 |
+
<p><small>The Stats recorded by the plugin will be different than that recorded by your ad provider due to different factors like accidental clicks, fraud detection, spam clicks etc.<br />Use the stats provided by the ad provider in case of discrepancy.</small></p>
|
6 |
+
</div>
|
includes/templates/js/script-admin-notice.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function() {
|
2 |
+
jQuery('.quick_adsense_adstxt_adsense_notice').on('click', '.notice-dismiss', function() {
|
3 |
+
wp.ajax.post('quick_adsense_adstxt_adsense_admin_notice_dismiss', {
|
4 |
+
nonce: quick_adsense_adstxt_adsense.nonce,
|
5 |
+
});
|
6 |
+
});
|
7 |
+
});
|
includes/templates/js/script-frontend-stats.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function() {
|
2 |
+
jQuery(".<?php echo esc_js( quick_adsense_get_value( $args, 'target' ) ); ?>").click(function() {
|
3 |
+
jQuery.post(
|
4 |
+
"<?php echo esc_js( quick_adsense_get_value( $args, 'ajax_url' ) ); ?>", {
|
5 |
+
"action": "quick_adsense_onpost_ad_click",
|
6 |
+
"quick_adsense_onpost_ad_index": jQuery(this).attr("data-index"),
|
7 |
+
"quick_adsense_nonce": "<?php echo esc_js( quick_adsense_get_value( $args, 'nonce' ) ); ?>",
|
8 |
+
}, function(response) { }
|
9 |
+
);
|
10 |
+
});
|
11 |
+
});
|
includes/templates/page-settings.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="wrap">
|
2 |
+
<h2 id="quick_adsense_title">Quick Adsense Settings <span style="font-size: 14px;">(Version 2.8)</span></h2>
|
3 |
+
<form id="quick_adsense_settings_form" method="post" action="options.php" name="wp_auto_commenter_form" style="display: none;">
|
4 |
+
<?php settings_fields( 'quick_adsense_settings' ); ?>
|
5 |
+
<div id="quick_adsense_settings_tabs">
|
6 |
+
<ul>
|
7 |
+
<li><a href="#tabs-settings">Settings</a></li>
|
8 |
+
<li><a href="#tabs-post-body-ads">Ads on Post Body</a></li>
|
9 |
+
<li><a href="#tabs-sidebar-widget-ads">Sidebar Widget</a></li>
|
10 |
+
<li><a href="#tabs-header-footer-codes">Header / Footer Codes</a></li>
|
11 |
+
</ul>
|
12 |
+
<div id="tabs-settings">
|
13 |
+
<div id="quick_adsense_top_sections_wrapper">
|
14 |
+
<?php do_settings_sections( 'quick-adsense-general' ); ?>
|
15 |
+
</div>
|
16 |
+
<?php submit_button( 'Save Changes' ); ?>
|
17 |
+
</div>
|
18 |
+
<div id="tabs-post-body-ads">
|
19 |
+
<?php do_settings_sections( 'quick-adsense-onpost' ); ?>
|
20 |
+
<?php submit_button( 'Save Changes' ); ?>
|
21 |
+
</div>
|
22 |
+
<div id="tabs-sidebar-widget-ads">
|
23 |
+
<?php do_settings_sections( 'quick-adsense-widgets' ); ?>
|
24 |
+
<?php submit_button( 'Save Changes' ); ?>
|
25 |
+
</div>
|
26 |
+
<div id="tabs-header-footer-codes">
|
27 |
+
<?php do_settings_sections( 'quick-adsense-header-footer-codes' ); ?>
|
28 |
+
<?php submit_button( 'Save Changes' ); ?>
|
29 |
+
</div>
|
30 |
+
</div>
|
31 |
+
</form>
|
32 |
+
</div>
|
includes/templates/section-general.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="quick_adsense_block">
|
2 |
+
<div class="quick_adsense_block_labels"><span>Options</span></div>
|
3 |
+
<div class="quick_adsense_block_controls">
|
4 |
+
<a id="quick_adsense_settings_reset_to_default" href="javascript:;">Reset to Default Settings</a>
|
5 |
+
</div>
|
6 |
+
<div class="clear"></div>
|
7 |
+
</div>
|
8 |
+
<?php
|
9 |
+
echo wp_kses(
|
10 |
+
quick_adsense_load_file( 'templates/block-general-adsense.php', $args ),
|
11 |
+
quick_adsense_get_allowed_html()
|
12 |
+
);
|
13 |
+
echo wp_kses(
|
14 |
+
quick_adsense_load_file( 'templates/block-general-appearance.php', $args ),
|
15 |
+
quick_adsense_get_allowed_html()
|
16 |
+
);
|
17 |
+
echo wp_kses(
|
18 |
+
quick_adsense_load_file( 'templates/block-general-assign-position.php', $args ),
|
19 |
+
quick_adsense_get_allowed_html()
|
20 |
+
);
|
21 |
+
echo wp_kses(
|
22 |
+
quick_adsense_load_file( 'templates/block-general-quicktag.php', $args ),
|
23 |
+
quick_adsense_get_allowed_html()
|
24 |
+
);
|
25 |
+
?>
|
includes/templates/section-header-footer.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="quick_adsense_top_sections_wrapper">
|
2 |
+
<div class="quick_adsense_block">
|
3 |
+
<div class="quick_adsense_block_labels">
|
4 |
+
<span>Header<br />Embed Code</span>
|
5 |
+
</div>
|
6 |
+
<div class="quick_adsense_block_controls">
|
7 |
+
<?php
|
8 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
9 |
+
// This textarea needs to allow output of scripts, iframes etc necessary to output ads and trackers.
|
10 |
+
echo quickadsense_get_control(
|
11 |
+
'textarea-big',
|
12 |
+
'',
|
13 |
+
'quick_adsense_settings_header_embed_code',
|
14 |
+
'quick_adsense_settings[header_embed_code]',
|
15 |
+
quick_adsense_get_value( $args, 'header_embed_code' )
|
16 |
+
);
|
17 |
+
// phpcs:enable
|
18 |
+
?>
|
19 |
+
</div>
|
20 |
+
<div class="clear"></div>
|
21 |
+
<div class="quick_adsense_block_labels">
|
22 |
+
<span>Footer<br />Embed Code</span>
|
23 |
+
</div>
|
24 |
+
<div class="quick_adsense_block_controls">
|
25 |
+
<?php
|
26 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
27 |
+
// This textarea needs to allow output of scripts, iframes etc necessary to output ads and trackers.
|
28 |
+
echo quickadsense_get_control(
|
29 |
+
'textarea-big',
|
30 |
+
'',
|
31 |
+
'quick_adsense_settings_footer_embed_code',
|
32 |
+
'quick_adsense_settings[footer_embed_code]',
|
33 |
+
quick_adsense_get_value( $args, 'footer_embed_code' )
|
34 |
+
);
|
35 |
+
// phpcs:enable
|
36 |
+
?>
|
37 |
+
</div>
|
38 |
+
<div class="clear"></div>
|
39 |
+
</div>
|
40 |
+
</div>
|
includes/templates/section-onpost-content.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="quick_adsense_block_bottom" class="quick_adsense_block" style="margin: 30px 0 0;">
|
2 |
+
<div class="quick_adsense_block_labels" style="width: auto;">
|
3 |
+
<span>Adsense Codes - Ads on Post Body</span>
|
4 |
+
</div>
|
5 |
+
<div class="clear"></div>
|
6 |
+
<p>Paste up to 10 Ads codes on Post Body as assigned above. Ads codes provided must not be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.</p>
|
7 |
+
</div>
|
8 |
+
|
9 |
+
<div id="quick_adsense_onpost_content_controls_wrapper">
|
10 |
+
<div id="quick_adsense_onpost_content_global_controls_wrapper">
|
11 |
+
<p class="quick_adsense_onpost_adunits_styling_controls">
|
12 |
+
<?php
|
13 |
+
echo wp_kses(
|
14 |
+
quickadsense_get_control(
|
15 |
+
'checkbox',
|
16 |
+
'',
|
17 |
+
'quick_adsense_settings_onpost_enable_global_style',
|
18 |
+
'quick_adsense_settings[onpost_enable_global_style]',
|
19 |
+
quick_adsense_get_value( $args, 'onpost_enable_global_style' ),
|
20 |
+
null,
|
21 |
+
'input',
|
22 |
+
'margin: -3px 10px 0 0;'
|
23 |
+
),
|
24 |
+
quick_adsense_get_allowed_html()
|
25 |
+
);
|
26 |
+
?>
|
27 |
+
<span>Use for all</span>
|
28 |
+
<wbr />Alignment
|
29 |
+
<?php
|
30 |
+
echo wp_kses(
|
31 |
+
quickadsense_get_control(
|
32 |
+
'select',
|
33 |
+
'',
|
34 |
+
'quick_adsense_settings_onpost_global_alignment',
|
35 |
+
'quick_adsense_settings[onpost_global_alignment]',
|
36 |
+
quick_adsense_get_value( $args, 'onpost_global_alignment' ),
|
37 |
+
quick_adsense_get_value( $args, 'alignment_options' ),
|
38 |
+
'input',
|
39 |
+
'margin: -6px 20px 0 10px; width: 73px;'
|
40 |
+
),
|
41 |
+
quick_adsense_get_allowed_html()
|
42 |
+
);
|
43 |
+
?>
|
44 |
+
<wbr />margin
|
45 |
+
<?php
|
46 |
+
echo wp_kses(
|
47 |
+
quickadsense_get_control(
|
48 |
+
'number',
|
49 |
+
'',
|
50 |
+
'quick_adsense_settings_onpost_global_margin',
|
51 |
+
'quick_adsense_settings[onpost_global_margin]',
|
52 |
+
quick_adsense_get_value( $args, 'onpost_global_margin' ),
|
53 |
+
null,
|
54 |
+
'input',
|
55 |
+
'margin: -1px 10px 0 10px; width: 62px;'
|
56 |
+
),
|
57 |
+
quick_adsense_get_allowed_html()
|
58 |
+
);
|
59 |
+
?>
|
60 |
+
px
|
61 |
+
</p>
|
62 |
+
</div>
|
63 |
+
|
64 |
+
<div id="quick_adsense_onpost_content_adunits_wrapper">
|
65 |
+
<div id="quick_adsense_onpost_content_adunits_initial_wrapper">
|
66 |
+
<?php
|
67 |
+
for ( $i = 1; $i <= 3; $i++ ) {
|
68 |
+
$args['adunit_index'] = $i;
|
69 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
70 |
+
// Contains a textarea which need to allow output of scripts, iframes etc necessary to output ads and trackers.
|
71 |
+
echo quick_adsense_load_file( 'templates/adunit-onpost.php', $args );
|
72 |
+
// phpcs:enable
|
73 |
+
}
|
74 |
+
?>
|
75 |
+
</div>
|
76 |
+
<div id="quick_adsense_onpost_content_adunits_all_wrapper" style="display: none;">
|
77 |
+
<?php
|
78 |
+
for ( $i = 4; $i <= 10; $i++ ) {
|
79 |
+
$args['adunit_index'] = $i;
|
80 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
81 |
+
// Contains a textarea which need to allow output of scripts, iframes etc necessary to output ads and trackers.
|
82 |
+
echo quick_adsense_load_file( 'templates/adunit-onpost.php', $args );
|
83 |
+
// phpcs:enable
|
84 |
+
}
|
85 |
+
?>
|
86 |
+
</div>
|
87 |
+
<a id="quick_adsense_onpost_content_adunits_showall_button" class="input button-secondary">
|
88 |
+
<span class="dashicons dashicons-arrow-down"></span> <b>Show All</b>
|
89 |
+
</a>
|
90 |
+
</div>
|
91 |
+
</div>
|
includes/templates/section-widgets.php
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="quick_adsense_block_bottom" class="quick_adsense_block" style="margin: 30px 0 0;">
|
2 |
+
<div class="quick_adsense_block_labels" style="width: auto;">
|
3 |
+
<span>Adsense Codes - <a href="<?php echo esc_url( admin_url( 'widgets.php' ) ); ?>">Sidebar WIdget</a></span>
|
4 |
+
</div>
|
5 |
+
<div class="clear"></div>
|
6 |
+
<p>Paste up to 10 Ads codes on Sidebar Widget. Ads codes provided must not be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.</p>
|
7 |
+
</div>
|
8 |
+
|
9 |
+
<div id="quick_adsense_widget_controls_wrapper">
|
10 |
+
<div id="quick_adsense_widget_global_controls_wrapper" style="visibility: hidden;">
|
11 |
+
<p class="quick_adsense_widget_adunits_styling_controls">
|
12 |
+
<?php
|
13 |
+
echo wp_kses(
|
14 |
+
quickadsense_get_control(
|
15 |
+
'checkbox',
|
16 |
+
'',
|
17 |
+
'quick_adsense_settings_widget_enable_global_style',
|
18 |
+
'quick_adsense_settings[widget_enable_global_style]',
|
19 |
+
quick_adsense_get_value( $args, 'widget_enable_global_style' ),
|
20 |
+
null,
|
21 |
+
'input',
|
22 |
+
'margin: -3px 10px 0 0;'
|
23 |
+
),
|
24 |
+
quick_adsense_get_allowed_html()
|
25 |
+
);
|
26 |
+
?>
|
27 |
+
<span>Use for all</span>
|
28 |
+
<wbr />Alignment
|
29 |
+
<?php
|
30 |
+
echo wp_kses(
|
31 |
+
quickadsense_get_control(
|
32 |
+
'select',
|
33 |
+
'',
|
34 |
+
'quick_adsense_settings_widget_global_alignment',
|
35 |
+
'quick_adsense_settings[widget_global_alignment]',
|
36 |
+
quick_adsense_get_value( $args, 'widget_global_alignment' ),
|
37 |
+
quick_adsense_get_value( $args, 'alignment_options' ),
|
38 |
+
'input',
|
39 |
+
'margin: -6px 20px 0 10px; width: 73px;'
|
40 |
+
),
|
41 |
+
quick_adsense_get_allowed_html()
|
42 |
+
);
|
43 |
+
?>
|
44 |
+
<wbr />margin
|
45 |
+
<?php
|
46 |
+
echo wp_kses(
|
47 |
+
quickadsense_get_control(
|
48 |
+
'number',
|
49 |
+
'',
|
50 |
+
'quick_adsense_settings_widget_global_margin',
|
51 |
+
'quick_adsense_settings[widget_global_margin]',
|
52 |
+
quick_adsense_get_value( $args, 'widget_global_margin' ),
|
53 |
+
null,
|
54 |
+
'input',
|
55 |
+
'margin: -1px 10px 0 10px; width: 62px;'
|
56 |
+
),
|
57 |
+
quick_adsense_get_allowed_html()
|
58 |
+
);
|
59 |
+
?>
|
60 |
+
px
|
61 |
+
</p>
|
62 |
+
</div>
|
63 |
+
|
64 |
+
<div id="quick_adsense_widget_adunits_wrapper">
|
65 |
+
<div id="quick_adsense_widget_adunits_initial_wrapper">
|
66 |
+
<?php
|
67 |
+
for ( $i = 1; $i <= 3; $i++ ) {
|
68 |
+
$args['adunit_index'] = $i;
|
69 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
70 |
+
// Contains a textarea which need to allow output of scripts, iframes etc necessary to output ads and trackers.
|
71 |
+
echo quick_adsense_load_file( 'templates/adunit-widget.php', $args );
|
72 |
+
// phpcs:enable
|
73 |
+
}
|
74 |
+
?>
|
75 |
+
</div>
|
76 |
+
<div id="quick_adsense_widget_adunits_all_wrapper" style="display: none;">
|
77 |
+
<?php
|
78 |
+
for ( $i = 4; $i <= 10; $i++ ) {
|
79 |
+
$args['adunit_index'] = $i;
|
80 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
81 |
+
// Contains a textarea which need to allow output of scripts, iframes etc necessary to output ads and trackers.
|
82 |
+
echo quick_adsense_load_file( 'templates/adunit-widget.php', $args );
|
83 |
+
// phpcs:enable
|
84 |
+
}
|
85 |
+
?>
|
86 |
+
</div>
|
87 |
+
<a id="quick_adsense_widget_adunits_showall_button" class="input button-secondary"><span class="dashicons dashicons-arrow-down"></span> <b>Show All</b></a>
|
88 |
+
</div>
|
89 |
+
</div>
|
includes/vendor/GeoIP/GeoIPCountry.php
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Iriven;
|
3 |
+
use ZipArchive;
|
4 |
+
use SplFileObject;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Class GeoIPCountry
|
8 |
+
* @package Iriven\GeoIPCountry
|
9 |
+
*/
|
10 |
+
class GeoIPCountry
|
11 |
+
{
|
12 |
+
const DS = DIRECTORY_SEPARATOR;
|
13 |
+
private $DataLocation = null;
|
14 |
+
private $IsoCode = null;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* GeoIPCountry constructor.
|
18 |
+
*/
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
$this->PackageLocation = realpath($this->getStoragePath());
|
22 |
+
$this->DataLocation = realpath($this->getStoragePath(false));
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @return $this
|
28 |
+
*/
|
29 |
+
public function Admin()
|
30 |
+
{
|
31 |
+
$this->EditModeEnabled = true;
|
32 |
+
return $this;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* If IPV6, Returns the IP in it's fullest format.
|
37 |
+
* @example
|
38 |
+
* ::1 => 0000:0000:0000:0000:0000:0000:0000:0001
|
39 |
+
* 220F::127.0.0.1 => 220F:0000:0000:0000:0000:0000:7F00:0001
|
40 |
+
* 2F:A1::1 => 002F:00A1:0000:0000:0000:0000:0000:0001
|
41 |
+
* @param $Ip
|
42 |
+
* @return mixed|string
|
43 |
+
*/
|
44 |
+
private function ExpandIPAddress($Ip)
|
45 |
+
{
|
46 |
+
if (strpos($Ip, ':') !== false) // IPv6 address
|
47 |
+
{
|
48 |
+
$hex = unpack('H*hex', inet_pton($Ip));
|
49 |
+
$Ip = substr(preg_replace('/([A-f0-9]{4})/', "$1:", $hex['hex']), 0, -1);
|
50 |
+
$Ip = strtoupper($Ip);
|
51 |
+
}
|
52 |
+
return $Ip;
|
53 |
+
}
|
54 |
+
/**
|
55 |
+
* @param $ip
|
56 |
+
* @return null|string
|
57 |
+
*/
|
58 |
+
private function getIPRangeProviderFile($ip)
|
59 |
+
{
|
60 |
+
try
|
61 |
+
{
|
62 |
+
if(!preg_match('/[.:]/', $ip)) $ip = $this->long2ip($ip, false);
|
63 |
+
if(!filter_var($ip,FILTER_VALIDATE_IP,[FILTER_FLAG_IPV4|FILTER_FLAG_IPV6]))
|
64 |
+
throw new \Exception('Invalid IP given');
|
65 |
+
$delimiter = (strpos($ip,':')===false)? '.' : ':';
|
66 |
+
$DBfile = current(explode($delimiter,$ip)).'.php';
|
67 |
+
return $DBfile;
|
68 |
+
}
|
69 |
+
catch (\Exception $e)
|
70 |
+
{
|
71 |
+
trigger_error($e->getMessage());
|
72 |
+
}
|
73 |
+
return null;
|
74 |
+
}
|
75 |
+
/**
|
76 |
+
* @param bool $isArchive
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
+
private function getStoragePath($isArchive=true)
|
80 |
+
{
|
81 |
+
$tmp = ini_get('upload_tmp_dir')?:sys_get_temp_dir ();
|
82 |
+
$isArchive OR $tmp = rtrim(__DIR__, self::DS);
|
83 |
+
try{
|
84 |
+
if (!is_writeable($tmp))
|
85 |
+
throw new \Exception(sprintf('The required destination path is not writable: %s', $tmp));
|
86 |
+
}
|
87 |
+
catch(\Exception $e)
|
88 |
+
{
|
89 |
+
trigger_error($e->getMessage(),E_USER_ERROR);
|
90 |
+
}
|
91 |
+
$tmp .= self::DS.($isArchive? 'GeoIPCountry' : 'GeoIPDatas');
|
92 |
+
if(!is_dir($tmp)) mkdir($tmp,'0755', true);
|
93 |
+
return $tmp;
|
94 |
+
}
|
95 |
+
/**
|
96 |
+
* Convert both IPV4 and IPv6 address to an integer
|
97 |
+
* @param $Ip
|
98 |
+
* @return mixed|string
|
99 |
+
*/
|
100 |
+
private function ip2long($Ip)
|
101 |
+
{
|
102 |
+
$decimal = null;
|
103 |
+
$Ip = $this->ExpandIPAddress($Ip);
|
104 |
+
try
|
105 |
+
{
|
106 |
+
switch ($Ip):
|
107 |
+
case (strpos($Ip, '.') !== false):
|
108 |
+
if(!filter_var($Ip,FILTER_VALIDATE_IP,[FILTER_FLAG_IPV4]))
|
109 |
+
throw new \Exception('Invalid IPV4 given');
|
110 |
+
$decimal .= ip2long($Ip);
|
111 |
+
break;
|
112 |
+
case (strpos($Ip, ':') !== false):
|
113 |
+
if(!filter_var($Ip,FILTER_VALIDATE_IP,[FILTER_FLAG_IPV6]))
|
114 |
+
throw new \Exception('Invalid IPV6 given');
|
115 |
+
$network = inet_pton($Ip);
|
116 |
+
$parts = unpack('C*', $network);
|
117 |
+
foreach ($parts as &$byte)
|
118 |
+
$decimal.= str_pad(decbin($byte), 8, '0', STR_PAD_LEFT);
|
119 |
+
break;
|
120 |
+
default:
|
121 |
+
throw new \Exception($Ip.' is not a valid IP address');
|
122 |
+
break;
|
123 |
+
endswitch;
|
124 |
+
}
|
125 |
+
catch (\Exception $e)
|
126 |
+
{
|
127 |
+
trigger_error($e->getMessage(),E_USER_ERROR);
|
128 |
+
}
|
129 |
+
return $decimal;
|
130 |
+
}
|
131 |
+
/**
|
132 |
+
* Convert an IP address from decimal format to presentation format
|
133 |
+
*
|
134 |
+
* @param $decimal
|
135 |
+
* @param bool $compress
|
136 |
+
* @return mixed|string
|
137 |
+
*/
|
138 |
+
private function long2ip($decimal,$compress = true)
|
139 |
+
{
|
140 |
+
$Ip = null;
|
141 |
+
if(preg_match('/[.:]/', $decimal))
|
142 |
+
return strtoupper($decimal);
|
143 |
+
switch ($decimal):
|
144 |
+
case (strlen($decimal) <= 32):
|
145 |
+
$Ip .= long2ip($decimal);
|
146 |
+
break;
|
147 |
+
default:
|
148 |
+
$pad = 128 - strlen($decimal);
|
149 |
+
for ($i = 1; $i <= $pad; $i++)
|
150 |
+
$decimal = '0'.$decimal;
|
151 |
+
for ($bits = 0; $bits <= 7; $bits++)
|
152 |
+
{
|
153 |
+
$binPart = substr($decimal,($bits*16),16);
|
154 |
+
$Ip .= dechex(bindec($binPart)).':';
|
155 |
+
}
|
156 |
+
$Ip = inet_ntop(inet_pton(substr($Ip,0,-1)));
|
157 |
+
break;
|
158 |
+
endswitch;
|
159 |
+
$Ip = strtoupper($Ip);
|
160 |
+
return $compress? $Ip : $this->ExpandIPAddress($Ip);
|
161 |
+
}
|
162 |
+
/**
|
163 |
+
* @param null $ip
|
164 |
+
* @return bool
|
165 |
+
*/
|
166 |
+
public function isReservedIP($ip=null)
|
167 |
+
{
|
168 |
+
if($ip) $this->resolve($ip);
|
169 |
+
return !$this->IsoCode OR strcasecmp($this->IsoCode,'ZZ') == 0 ;
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* @param null $ip
|
174 |
+
* @return null|string
|
175 |
+
*/
|
176 |
+
public function resolve($ip = null)
|
177 |
+
{
|
178 |
+
try
|
179 |
+
{
|
180 |
+
$ip OR $ip = $this->getRemoteIP();
|
181 |
+
if(!preg_match('/[.:]/', $ip)) $ip = $this->long2ip($ip);
|
182 |
+
$ip = $this->ExpandIPAddress($ip);
|
183 |
+
if(!filter_var($ip,FILTER_VALIDATE_IP,[FILTER_FLAG_IPV4|FILTER_FLAG_IPV6]))
|
184 |
+
throw new \Exception('Invalid IP given');
|
185 |
+
$ipFilename = $this->getIPRangeProviderFile($ip);
|
186 |
+
$ipLong = $this->ip2long($ip);
|
187 |
+
$ipFilePath = realpath($this->DataLocation.self::DS.$ipFilename);
|
188 |
+
if(!file_exists($ipFilePath))
|
189 |
+
throw new \Exception('IP Ranges provider file not found');
|
190 |
+
$IpRanges = include $ipFilePath;
|
191 |
+
foreach($IpRanges as $Range):
|
192 |
+
if(!is_array($Range) OR sizeof($Range) !== 3) continue;
|
193 |
+
if(preg_match('/^[01]+$/', $ipLong))
|
194 |
+
{
|
195 |
+
$Range[0] = $this->ip2long($Range[0]);
|
196 |
+
$Range[1] = $this->ip2long($Range[1]);
|
197 |
+
}
|
198 |
+
if($Range[1] < $ipLong) continue;
|
199 |
+
if(($Range[0]<=$ipLong))
|
200 |
+
{
|
201 |
+
$this->IsoCode = $Range[2]?:'ZZ';
|
202 |
+
break;
|
203 |
+
}
|
204 |
+
endforeach;
|
205 |
+
}
|
206 |
+
catch (\Exception $e)
|
207 |
+
{
|
208 |
+
trigger_error($e->getMessage());
|
209 |
+
}
|
210 |
+
return $this->IsoCode;
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Auto Get the current visitor IP Address
|
215 |
+
* @return string
|
216 |
+
*/
|
217 |
+
private function getRemoteIP()
|
218 |
+
{
|
219 |
+
$ip = '';
|
220 |
+
$serverIPKeys =['HTTP_X_COMING_FROM', 'HTTP_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_X_CLUSTER_CLIENT_IP',
|
221 |
+
'HTTP_X_FORWARDED', 'HTTP_VIA', 'HTTP_CLIENT_IP','HTTP_X_FORWARDED_FOR','REMOTE_ADDR'];
|
222 |
+
foreach ($serverIPKeys AS $IPKey) {
|
223 |
+
if(array_key_exists($IPKey,$_SERVER))
|
224 |
+
{
|
225 |
+
if (!strlen($_SERVER[$IPKey])) continue;
|
226 |
+
$ip = $_SERVER[$IPKey];
|
227 |
+
break;
|
228 |
+
}
|
229 |
+
}
|
230 |
+
if (($CommaPos = strpos($ip, ',')) > 0) {
|
231 |
+
$ip = substr($ip, 0, ($CommaPos - 1));
|
232 |
+
}
|
233 |
+
return $ip?:'0.0.0.0';
|
234 |
+
}
|
235 |
+
}
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0000.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0100.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0200.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0400.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/0800.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/1.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/10.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/100.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/1000.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/101.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/102.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/103.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/104.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/105.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/106.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/107.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/108.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/109.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/11.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/110.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/111.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/112.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/113.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/114.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/115.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/116.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/117.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/118.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/119.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/12.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/120.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/121.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/122.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/123.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/124.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/125.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/126.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/127.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/128.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/129.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/13.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/130.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/131.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/132.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/133.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/134.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/135.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/136.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/137.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/138.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/139.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/14.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/140.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/141.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/142.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/143.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/144.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/145.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/146.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/147.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/148.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/149.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/15.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/150.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/151.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/152.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/153.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/154.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/155.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/156.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/157.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/158.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/159.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/16.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/160.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/161.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/162.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/163.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/164.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/165.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/166.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/167.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/168.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/169.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/17.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/170.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/171.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/172.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/173.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/174.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/175.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/176.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/177.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/178.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/179.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/18.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/180.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/181.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/182.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/183.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/184.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/185.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/186.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/187.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/188.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/189.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/19.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/190.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/191.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/192.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/193.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/194.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/195.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/196.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/197.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/198.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/199.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/20.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/200.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2000.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2001.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2002.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2003.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/201.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/202.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/203.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/204.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/205.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/206.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/207.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/208.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/209.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/21.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/210.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/211.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/212.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/213.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/214.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/215.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/216.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/217.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/218.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/219.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/22.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/220.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/221.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/222.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/223.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/224.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/225.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/226.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/227.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/228.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/229.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/23.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/230.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/231.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/232.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/233.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/234.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/235.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/236.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/237.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/238.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/239.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/24.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2400.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2401.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2402.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2403.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2404.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2405.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2406.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2407.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2408.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2409.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240A.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240B.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240C.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240D.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240E.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/240F.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/241.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/242.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/243.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/244.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/245.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/246.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/247.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/248.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/249.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/25.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/250.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/251.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/252.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/253.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/254.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/255.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/26.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2600.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2601.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2602.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2603.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2604.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2605.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2606.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2607.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2608.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2609.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/260A.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/260C.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/260D.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/260E.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/260F.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2610.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2620.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/27.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/28.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2800.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2801.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2802.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2803.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2804.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2806.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/29.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A00.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A01.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A02.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A03.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A04.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A05.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A06.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A07.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A08.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A0A.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2A0B.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2C00.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2C0E.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/2C0F.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/3.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/30.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/31.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/32.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/33.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/34.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/35.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/36.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/37.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/38.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/39.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/4.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/40.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/4000.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/41.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/42.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/43.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/44.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/45.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/46.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/47.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/48.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/49.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/5.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/50.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/51.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/52.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/53.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/54.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/55.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/56.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/57.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/58.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/59.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/6.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/60.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/6000.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/61.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/62.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/63.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/64.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/65.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/66.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/67.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/68.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/69.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/7.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/70.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/71.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/72.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/73.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/74.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/75.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/76.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/77.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/78.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/79.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/8.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/80.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/8000.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/81.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/82.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/83.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/84.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/85.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/86.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/87.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/88.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/89.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/9.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/90.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/91.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/92.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/93.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/94.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/95.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/96.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/97.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/98.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/99.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/A000.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/C000.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/E000.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/F000.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/F800.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/FC00.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/FE00.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/FE80.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/FEC0.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/GeoIPDatas/FF00.php
RENAMED
File without changes
|
includes/{GeoIP → vendor/GeoIP}/LICENSE
RENAMED
File without changes
|
includes/{MobileDetect → vendor/MobileDetect}/LICENSE.txt
RENAMED
File without changes
|
includes/{MobileDetect → vendor/MobileDetect}/Mobile_Detect.php
RENAMED
File without changes
|
includes/widgets.php
CHANGED
@@ -1,38 +1,71 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The Quickadsense widgets.
|
4 |
+
*/
|
5 |
+
class QuickAdsenseAdWidget extends WP_Widget {
|
6 |
+
/**
|
7 |
+
* The class constructor.
|
8 |
+
*
|
9 |
+
* @param mixed $id The widget id.
|
10 |
+
*/
|
11 |
+
public function __construct( $id ) {
|
12 |
+
parent::__construct( sanitize_title( str_replace( [ '(', ')' ], '', 'AdsWidget' . $id . ' (Quick Adsense)' ) ), 'AdsWidget' . $id . ' (Quick Adsense)', [ 'description' => 'Quick Adsense on Sidebar Widget' ] );
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* The widget output.
|
17 |
+
*
|
18 |
+
* @param array $args Display arguments including 'before_title', 'after_title', 'before_widget', and 'after_widget'.
|
19 |
+
* @param array $instance — The settings for the particular instance of the widget.
|
20 |
+
*/
|
21 |
+
public function widget( $args, $instance ) {
|
22 |
+
$content = get_the_content();
|
23 |
+
$settings = get_option( 'quick_adsense_settings' );
|
24 |
+
if ( ( strpos( $content, '<!--OffAds-->' ) === false ) && ( strpos( $content, '<!--OffWidget-->' ) === false ) && ! ( is_home() && $settings['disable_widgets_on_homepage'] ) ) {
|
25 |
+
$widget_index = str_replace( [ 'AdsWidget', ' (Quick Adsense)' ], '', $args['widget_name'] );
|
26 |
+
if ( isset( $settings[ 'widget_ad_' . $widget_index . '_content' ] ) && ( '' !== $settings[ 'widget_ad_' . $widget_index . '_content' ] ) ) {
|
27 |
+
echo wp_kses( $args['before_widget'], quick_adsense_get_allowed_html() );
|
28 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
29 |
+
// The widget content needs to allow output of scripts, iframes etc necessary to output ads and trackers.
|
30 |
+
echo $settings[ 'widget_ad_' . $widget_index . '_content' ];
|
31 |
+
// phpcs:enable
|
32 |
+
echo wp_kses( $args['after_widget'], quick_adsense_get_allowed_html() );
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* This function should check that $new_instance is set correctly. The newly-calculated value of $instance should be returned. If false is returned, the instance won't be saved/updated.
|
39 |
+
*
|
40 |
+
* @param array $new_instance New settings for this instance as input by the user via WP_Widget::form().
|
41 |
+
* @param array $old_instance — Old settings for this instance.
|
42 |
+
*
|
43 |
+
* @return array — Settings to save or bool false to cancel saving.
|
44 |
+
*/
|
45 |
+
public function update( $new_instance, $old_instance ) {
|
46 |
+
return $new_instance;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Outputs the settings form.
|
51 |
+
*
|
52 |
+
* @param array $instance — Current settings.
|
53 |
+
*
|
54 |
+
* @return string — Default return is 'noform'.
|
55 |
+
*/
|
56 |
+
public function form( $instance ) {
|
57 |
+
return '<p>There are no options for this widget.</p>';
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
add_action(
|
62 |
+
'widgets_init',
|
63 |
+
function() {
|
64 |
+
$settings = get_option( 'quick_adsense_settings' );
|
65 |
+
for ( $i = 1; $i <= 10; $i++ ) {
|
66 |
+
if ( isset( $settings[ 'widget_ad_' . $i . '_content' ] ) && ( '' !== $settings[ 'widget_ad_' . $i . '_content' ] ) ) {
|
67 |
+
register_widget( new QuickAdsenseAdWidget( $i ) );
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
);
|
quick-adsense.php
CHANGED
@@ -1,39 +1,25 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
Plugin Name: Quick Adsense
|
4 |
-
Plugin URI: http://quickadsense.com/
|
5 |
-
Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
6 |
-
Author: namithjawahar
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
require_once(dirname(__FILE__).'/includes/controls.php');
|
27 |
-
require_once(dirname(__FILE__).'/includes/settings.php');
|
28 |
-
require_once(dirname(__FILE__).'/includes/widgets.php');
|
29 |
-
require_once(dirname(__FILE__).'/includes/quicktags.php');
|
30 |
-
require_once(dirname(__FILE__).'/includes/content.php');
|
31 |
-
require_once(dirname(__FILE__).'/includes/adsense.php');
|
32 |
-
if(!class_exists('Mobile_Detect')) {
|
33 |
-
require_once(dirname(__FILE__).'/includes/MobileDetect/Mobile_Detect.php');
|
34 |
-
}
|
35 |
-
if(!class_exists('iriven\\GeoIPCountry')) {
|
36 |
-
require_once(dirname(__FILE__).'/includes/GeoIP/GeoIPCountry.php');
|
37 |
-
}
|
38 |
-
/*End Include Files*/
|
39 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Quick Adsense
|
4 |
+
* Plugin URI: http://quickadsense.com/
|
5 |
+
* Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
6 |
+
* Author: namithjawahar
|
7 |
+
* Author URI: https://smartlogix.co.in/
|
8 |
+
* Version: 2.8
|
9 |
+
*/
|
10 |
+
require_once dirname( __FILE__ ) . '/includes/loader.php';
|
11 |
+
require_once dirname( __FILE__ ) . '/includes/countries.php';
|
12 |
+
require_once dirname( __FILE__ ) . '/includes/defaults.php';
|
13 |
+
require_once dirname( __FILE__ ) . '/includes/controls.php';
|
14 |
+
require_once dirname( __FILE__ ) . '/includes/settings.php';
|
15 |
+
require_once dirname( __FILE__ ) . '/includes/widgets.php';
|
16 |
+
require_once dirname( __FILE__ ) . '/includes/quicktags.php';
|
17 |
+
require_once dirname( __FILE__ ) . '/includes/content.php';
|
18 |
+
require_once dirname( __FILE__ ) . '/includes/adsense.php';
|
19 |
+
require_once dirname( __FILE__ ) . '/includes/class-filehandler.php';
|
20 |
+
if ( ! class_exists( 'Mobile_Detect' ) ) {
|
21 |
+
require_once dirname( __FILE__ ) . '/includes/vendor/MobileDetect/Mobile_Detect.php';
|
22 |
+
}
|
23 |
+
if ( ! class_exists( 'iriven\\GeoIPCountry' ) ) {
|
24 |
+
require_once dirname( __FILE__ ) . '/includes/vendor/GeoIP/GeoIPCountry.php';
|
25 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: namithjawahar
|
3 |
Tags: WordPress Plugin, adsense, google adsense, random adsense, random ads, advertising, adsense insertion, ad manager, ad, yahoo, google, ads, text insertion, widget, sidebar, admin, posts, plugin
|
4 |
Requires at least: 5.0
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 2.
|
7 |
|
8 |
Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
9 |
|
@@ -52,6 +52,12 @@ Sign up for a [Google Adsense Account](http://adsense.google.com/) to generate r
|
|
52 |
Please feedback to [http://quickadsense.com/](http://quickadsense.com/) for any bug you might have found, or any suggestion you like to add.
|
53 |
|
54 |
== Change Log ==
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
= 2.6 =
|
56 |
* Vi Integration Removed
|
57 |
* Plugin Ownership Change
|
2 |
Contributors: namithjawahar
|
3 |
Tags: WordPress Plugin, adsense, google adsense, random adsense, random ads, advertising, adsense insertion, ad manager, ad, yahoo, google, ads, text insertion, widget, sidebar, admin, posts, plugin
|
4 |
Requires at least: 5.0
|
5 |
+
Tested up to: 5.9.1
|
6 |
+
Stable tag: 2.8
|
7 |
|
8 |
Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
9 |
|
52 |
Please feedback to [http://quickadsense.com/](http://quickadsense.com/) for any bug you might have found, or any suggestion you like to add.
|
53 |
|
54 |
== Change Log ==
|
55 |
+
= 2.8 =
|
56 |
+
* Bug fixes and Security updates
|
57 |
+
|
58 |
+
= 2.7 =
|
59 |
+
* Bug fixes and Security updates
|
60 |
+
|
61 |
= 2.6 =
|
62 |
* Vi Integration Removed
|
63 |
* Plugin Ownership Change
|
screenshot-1.png
DELETED
Binary file
|
screenshot-2.png
DELETED
Binary file
|
screenshot-3.png
DELETED
Binary file
|