Version Description
- Added language selector on subscriber profile page on multilanguage site
- Fix multilanguage label on profile page
- Added newsletter_user_post_subscribe hook (just after saving the subscription, before saving you can use newsletter_user_subscribe)
- Added checks for WP 5.5 breaking changes
- Added new layout (big images) on posts block
- Added standard button on post block
- Minor fix on hero block
- Added support for Popup Maker (need a free addon)
Download this release
Release Info
Developer | satollo |
Plugin | Newsletter |
Version | 6.7.5 |
Comparing to | |
See all releases |
Code changes from version 6.7.3 to 6.7.5
- admin.css +15 -0
- admin.min.css +1 -0
- emails/blocks/hero/block-left.php +1 -1
- emails/blocks/hero/block-right.php +1 -1
- emails/blocks/posts/block.php +43 -408
- emails/blocks/posts/layout-big-image.php +111 -0
- emails/blocks/posts/layout-one.php +116 -0
- emails/blocks/posts/layout-two.php +167 -0
- emails/blocks/posts/options.php +37 -14
- emails/blocks/posts/style.css +1 -1
- emails/images/automated.png +0 -0
- emails/theme.php +23 -16
- emails/tnp-composer/_scripts/newsletter-builder-v2.js +1 -1
- emails/tnp-composer/css/newsletter.css +2 -1
- includes/addon.php +24 -13
- includes/composer.php +23 -0
- includes/helper.php +14 -0
- includes/mailer.php +13 -4
- includes/module.php +9 -0
- plugin.php +15 -7
- profile/profile.php +34 -9
- readme.txt +24 -7
- subscription/subscription.php +7 -2
- tnp-header.php +15 -0
- unsubscription/unsubscription.php +9 -24
- users/export.php +3 -6
- users/index.php +4 -0
admin.css
CHANGED
@@ -117,6 +117,20 @@
|
|
117 |
}
|
118 |
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
/*******************************************************************************
|
121 |
* Header
|
122 |
*/
|
@@ -794,6 +808,7 @@ p.description {
|
|
794 |
font-weight: 700;
|
795 |
padding: 0;
|
796 |
margin: 0px;
|
|
|
797 |
}
|
798 |
|
799 |
#tnp-heading h3 {
|
117 |
}
|
118 |
|
119 |
|
120 |
+
#tnp-promotion-bar {
|
121 |
+
background-color: #FF5F65;
|
122 |
+
color: ddd;
|
123 |
+
padding: 10px 0;
|
124 |
+
text-align: center;
|
125 |
+
font-size: 16px;
|
126 |
+
}
|
127 |
+
|
128 |
+
#tnp-promotion-bar a {
|
129 |
+
color: #fff;
|
130 |
+
font-weight: normal;
|
131 |
+
text-decoration: none;
|
132 |
+
}
|
133 |
+
|
134 |
/*******************************************************************************
|
135 |
* Header
|
136 |
*/
|
808 |
font-weight: 700;
|
809 |
padding: 0;
|
810 |
margin: 0px;
|
811 |
+
margin-bottom: 15px;
|
812 |
}
|
813 |
|
814 |
#tnp-heading h3 {
|
admin.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#tnp-wrap *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#tnp-wrap .iris-picker,#tnp-wrap .iris-picker *{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#tnp-wrap *:before,#tnp-wrap *:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}@media all and (max-width:1100px){.col-md-12{width:100%}.col-md-11{width:100%}.col-md-10{width:100%}.col-md-9{width:100%}.col-md-8{width:100%}.col-md-7{width:100%}.col-md-6{width:100%}.col-md-5{width:100%}.col-md-4{width:100%}.col-md-3{width:100%}.col-md-2{width:100%}.col-md-1{width:100%}}.tnp-row-padded{width:90%;margin:0 auto;display:flex;justify-content:space-between}.tnp-col-3-boxed{width:30%;border:1px solid #3c414c;padding:0 0 30px 0;border-radius:10px}.tnp-margin-top{margin-top:80px}#tnp-wrap,#tnp-header,#tnp-body p,#tnp-body td,#tnp-body td p,#tnp-body input,#tnp-body select,#tnp-body textarea{font-family:soleil,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#tnp-body h1,#tnp-body h2,#tnp-body h3,#tnp-body h4{font-family:soleil,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#tnp-promotion-bar{background-color:#ff5f65;color:ddd;padding:10px 0;text-align:center;font-size:16px}#tnp-promotion-bar a{color:#fff;font-weight:normal;text-decoration:none}#tnp-header{text-align:left;font-size:12px;color:#fff;font-family:soleil,sans-serif}#tnp-header input{font-size:12px}#tnp-header a{text-decoration:none;color:white;letter-spacing:.1em}#tnp-header a:hover{color:#fff}.error a,.error a:hover{color:#000!important}.updated a,.updated a:hover{color:#000!important}.tnp-error{border-left:5px solid #d00;background-color:#fff;padding:15px;margin:15px 0;font-size:1.2em;line-height:1.5em}.tnp-warning{border-left:5px solid #ffb900;background-color:#fff;padding:15px;margin:15px 0;font-size:1.2em;line-height:1.5em}.tnp-message{border-left:5px solid #46b450;background-color:#fff;padding:15px;margin:15px 0;font-size:1.2em;line-height:1.5em}#tnp-body h1,#tnp-body h2,#tnp-body h3,#tnp-body h4,#tnp-body p{color:#fff}#tnp-body a,#tnp-body a:active{color:#2980b9}#tnp-body a:hover{color:#3498db}#tnp-body .tnp-submit{margin-bottom:10px}#tnp-body .button,#tnp-body .button:visited,#tnp-body .button:hover,#tnp-body .button:active,#tnp-body .button:focus,#tnp-body .button-primary,#tnp-body .button-primary:visited,#tnp-body .button-primary:hover,#tnp-body .button-secondary,#tnp-body .button-secondary:visited,#tnp-body .button-secondary:hover{color:#fff;background-color:#3498db;text-shadow:none;width:auto}#tnp-body span.wp-media-buttons-icon:before{color:#fff}#tnp-body .tnp-button{color:#fff;background-color:#3498db;text-shadow:none}#tnp-body .button-primary.tnp-button-white,#tnp-body .tnp-button.tnp-button-white{color:#444!important;background-color:#fff!important;box-shadow:none!important;-webkit-box-shadow:none!important;width:auto}#tnp-body .form-table h1,#tnp-body .form-table h2,#tnp-body .form-table h4,#tnp-body .form-table h3{color:#444}#tnp-body tbody th,#tnp-body td,#tnp-body td p,#tnp-body td .button,#tnp-body td .button:visited,#tnp-body td .button:hover,#tnp-body td .button:active,#tnp-body td .button:focus{color:#444}#tnp-body td a,#tnp-body td a:visited{color:#27ae60}#tnp-body .form-table{background-color:#fff;border:1px solid #ecf0f1;margin-top:2em;border-spacing:4px;border-collapse:separate}#tnp-body .form-table th{text-align:right;font-weight:bold;max-width:200px;color:#000;background-color:#ecf0f1;vertical-align:middle}#tnp-body .form-table th small{font-weight:normal}#tnp-body .form-table textarea{width:100%}#tnp-body .form-table table{border-collapse:collapse}#tnp-body .form-table table td,.form-table table th{padding:5px;font-size:.9em;font-weight:normal;border:1px solid #eee}#tnp-body .form-table table thead th{text-align:left;font-weight:bold}#tnp-body .widefat{width:90%}#tnp-body .widefat th{text-align:left}#tnp-body .widefat thead{background-color:#3498db;font-family:soleil,sans-serif;color:#fff!important}#tnp-body .widefat thead tr th{color:#fff!important}#tnp-body .widefat td,.widefat th{vertical-align:middle}.tnp-newsletters-list tbody tr{height:70px}.widefat tr:nth-child(even){background-color:#f4faff}#tnp-body #tabs h1,#tnp-body #tabs h2,#tnp-body #tabs h3,#tnp-body #tabs h4,#tnp-body #tabs p,#tnp-body #tabs td,#tnp-body #tabs th,#tnp-body #tabs input,#tnp-body #tabs select,#tnp-body #tabs textarea,#tnp-body #tabs a{color:#444}#tnp-body #tabs .button,#tnp-body #tabs .button:visited,#tnp-body #tabs .button:hover,#tnp-body #tabs .button-primary,#tnp-body #tabs .button-primary:visited,#tnp-body #tabs .button-primary:hover,#tnp-body #tabs .button-secondary,#tnp-body #tabs .button-secondary:visited,#tnp-body #tabs .button-secondary:hover{color:#fff;width:auto}table.clicks td{border:1px solid #666;padding:2px;font-size:10px}table.clicks{border-collapse:collapse}.grid{border-collapse:collapse}.grid td,.grid th{padding:10px;border:1px solid #ddd;margin:0}.grid th{background-color:#aaa}.tnp-checkboxes label{display:block;float:left;width:220px;border:1px solid #ccc;background-color:#f4f4f4;margin-bottom:5px;padding:5px;white-space:nowrap;margin-right:5px}.tnp-buttons{padding:10px}.newsletter-checkbox-group,.nl-checkbox-group{float:left;margin-right:5px;border:1px solid #ccc;background-color:#f4f4f4;margin-bottom:5px;padding:5px;white-space:nowrap;overflow:hidden}.newsletter-checkboxes-item{float:left;margin-right:5px;border:1px solid #ddd;border-radius:3px;background-color:#f4f4f4;width:150px;margin-bottom:5px;padding:3px;white-space:nowrap;overflow:hidden}.newsletter-checkboxes-item input{vertical-align:text-bottom}.newsletter-checkboxes-item label{display:inline}.newsletter-preferences-item{float:left;margin-right:5px;border:1px solid #ccc;background-color:#f4f4f4;width:250px;margin-bottom:5px;padding:5px;white-space:nowrap;overflow:hidden}.newsletter-preferences-item label{display:inline}.form-table td .nl-checkbox-group label{display:inline}.tnp-notice{padding:15px;margin:10px 0;padding-right:70px;position:relative;border:1px solid #eee;background-color:#fff;color:#444;font-size:13px;border-left:5px solid #27ae60}.tnp-notice a{color:#0073aa;text-decoration:none;font-weight:bold}.tnp-notice a.tnp-dismiss{display:block;position:absolute;right:10px;top:13px;font-size:25px;text-decoration:none;color:#666}.tnp-notice input[type=email]{margin:10px 5px 5px;width:250px;border:0;box-shadow:none;background-color:#ecf0f1;padding:8px}.tnp-notice input[type=submit]{border:0;box-shadow:none;background-color:#27ae60;padding:8px;font-family:soleil,sans-serif;font-size:13px;color:#fff;cursor:pointer}.newsletter-message{background-color:#efe;border-color:#393;border-radius:5px;border-style:solid;border-width:3px;padding:.6em;margin-bottom:.6em}.newsletter-error-span{color:#f00;font-weight:bold}.newsletter-error{background-color:#fee;border-color:#933;border-radius:5px;border-style:solid;border-width:2px;padding:.6em;margin-bottom:.6em}.newsletter-error strong,.newsletter-message strong{font-weight:bold}#newsletter-warnings{background-color:#ffebe8;border-color:#C00;border-radius:3px;border-style:solid;border-width:1px;padding:.6em;margin-bottom:.6em}.newsletter-buttons{margin-top:1em;margin-bottom:1em}.tnp-paginator{margin-top:10px;margin-bottom:5px}.newsletter-option-grid th{text-align:right;width:auto;border:0;padding:3px;font-weight:normal;vertical-align:top;padding-right:15px}.newsletter-option-grid td{border:0;padding:3px;vertical-align:top}.newsletter-box{border:1px solid #ddd;padding:10px;background-color:#fafafa;margin-bottom:15px}.newsletter-box h3{margin-top:0}.newsletter-textarea-preview{border:1px solid #ddd}.tnp-tab-notice{background-color:#fff;border:1px solid #eee;border-left:3px solid gray;padding:10px;margin:10px 0;color:#444}.tnp-tab-warning{background-color:#fff;border:1px solid #eee;border-left:3px solid orange;padding:10px;margin:10px 0;color:#444}.tnp-tab-success{background-color:#fff;border:1px solid #eee;border-left:3px solid green;padding:10px;margin:10px 0;color:#444}.tnp-tab-error{background-color:#fff;border:1px solid #eee;border-left:3px solid red;padding:10px;margin:10px 0;color:#444}.tnp-tip{margin-top:5px}.tip-button{padding:0 5px;color:#fd5f65;text-transform:uppercase;letter-spacing:.2em;font-size:10px;border:1px red solid}.tip-content{font-weight:500;font-size:11px;color:#999}p.description{font-size:12px!important}.tnp-theme-preview{display:inline-block;text-align:center}.tnp-theme-preview p{font-family:soleil;font-size:13px;letter-spacing:.2em;color:#fff}.tnp-theme-preview img:hover{box-shadow:3px 3px 8px 2px #293848}.tnp-theme-preview img{border-radius:10px;height:190px;width:auto}.tnp-theme-preview .tnp-theme-composer{height:250px;width:auto}.tnp-theme-preview .tnp-theme-html{height:250px;width:auto}.tnp-header-logo{margin-left:10px}.wp-core-ui .button-primary{background-color:#2b2f3a;color:#fff;width:auto}#tnp-body{padding:10px;background-color:#28313c}.tnp-darkbg{background-color:#34495e!important}#tnp-body h3{margin-top:25px;clear:both;margin-bottom:10px}.tnp-body-lite{background-color:#f1f1f1!important}#tnp-heading{padding:10px;margin-bottom:10px;border-radius:5px}#tnp-heading a{color:#fff;border-bottom:1px solid #fff;text-decoration:none}#tnp-heading a:hover{color:#27ae60;border-bottom:1px solid #27ae60}#tnp-heading div p{color:#565656}#tnp-heading h2{color:#fff;font-family:soleil,sans-serif;letter-spacing:.1rem;font-size:1.1rem;line-height:1.8rem;text-transform:uppercase;vertical-align:middle;font-weight:700;padding:0;margin:0;margin-bottom:15px}#tnp-heading h3{color:#27ae60;font-family:soleil,sans-serif;letter-spacing:.1rem;font-size:.8rem;line-height:1.8rem;text-transform:uppercase;vertical-align:middle;font-weight:700;padding:0;margin:0}#tnp-heading p{margin:0;color:#ccc}#tnp-heading .notice p{margin:.5em 0;padding:2px}#tnp-heading .tnp-btn-h1{color:#fff;background-color:#3498db;border-radius:3px;padding:6px 11px;text-decoration:none;text-transform:capitalize;font-family:soleil,sans-serif;margin-left:10px;font-size:.75rem;font-weight:300;border:0}#tnp-heading .tnp-btn-h1:hover{color:#fff;background-color:#5dade2;-webkit-transition:background-color .25s linear;transition:background-color .25s linear;-webkit-font-smoothing:subpixel-antialiased;border:0;color:#fff}.metabox-holder{width:100%}.postbox{border:0}.postbox h3 a{float:right}#dashboard-widgets .postbox-container{width:33.333%}#tnp-body .postbox p{color:#000}#dashboard-widgets .postbox-container .postbox h3{font-family:soleil,sans-serif;letter-spacing:.05rem;background-color:#415b76;color:#fff;margin:0;padding:9px}#dashboard-widgets .postbox-container h3 a{color:white;text-decoration:none;margin-left:5px;padding:2px 8px;background-color:#26c281;border-radius:2px;font-weight:300;text-transform:capitalize;font-size:.8rem}#dashboard-widgets .postbox-container h3 a:hover{color:white;text-decoration:none;margin-left:5px;background-color:#2ecc71}.postbox-container i{margin-right:3px}#tnp-dash-newsletters tr td:last-of-type{width:80px;text-align:right}#tnp-dash-subscribers tr td:last-of-type{width:80px;text-align:right}#tnp-dash-subscribers tr td:first-of-type{width:250px;overflow:hidden}#tnp-dash-subscribers table{table-layout:fixed}#tnp-dash-documentation .inside div{margin-top:10px}#tnp-dash-documentation .inside a{text-decoration:none;color:#fff;display:block;font-family:soleil,sans-serif;padding:5px 10px}#tnp-footer{margin-top:10px;padding:20px 10px 10px 40px;background-color:#28313c;font-family:soleil,sans-serif}#tnp-footer div{width:33%;display:inline-block}#tnp-footer a{color:#fff;text-decoration:none}#tnp-footer a:hover{color:#bdc3c7}#tnp-footer input[type="submit"]{background-color:#2ecc71;border:0;padding:5px;color:#fff}#tnp-footer form{white-space:nowrap}#tnp-footer li{display:inline;margin-left:15px;padding:2px 5px;border-left:3px solid #2ecc71}#wpwrap{background-color:#222b36!important}#dashboard-widgets .button{border:0;background:0;box-shadow:none;color:#322c39}#dashboard-widgets .button:hover{background-color:#ecf0f1}.wp-core-ui .button-secondary,.wp-core-ui .button-primary{background-color:#3498db;border:0;box-shadow:none;color:#fff;font-family:soleil,sans-serif;margin:0 2px;width:auto}.wp-core-ui .button-secondary,.wp-core-ui .button,.wp-core-ui .button-primary{background-color:#3498db;box-shadow:none;color:#fff;font-family:soleil,sans-serif;margin:0 2px}.wp-core-ui .button-secondary:hover,.wp-core-ui .button:hover,.wp-core-ui .button-primary:hover{background-color:#5dade2;color:#fff;width:auto}span.wp-media-buttons-icon:before{color:#fff}.tnp-paginator [value="Go"]{background-color:#27ae60}.tnp-paginator [value="Go"]:hover{background-color:#2ecc71}.notice-dismiss{padding:3px}.tnp-paginator{color:#fff;font-family:soleil,sans-serif;margin:10px 0}.tnp-paginator .button-secondary{padding:5px;line-height:normal;height:auto;font-size:12px;height:25px;border:0;border-radius:3px;vertical-align:baseline}.tnp-paginator [value="Go"]{background-color:#27ae60!important}.tnp-paginator [value="Go"]:hover{background-color:#2ecc71!important}.tnp-paginator input{background-color:#2c3e50;border:0;border-radius:3px;color:#fff;padding:5px;line-height:normal;font-size:12px;height:25px}.tnp-subscribers-search{color:#fff;font-family:soleil,sans-serif;background-color:#2c3e50;padding:20px;border-radius:5px;margin-bottom:20px;display:inline-block}.tnp-subscribers-search select{margin-left:5px;padding:0;line-height:inherit}.tnp-video-container{position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden}.tnp-video-container iframe,.tnp-video-container object,.tnp-video-container embed{position:absolute;top:0;left:0;width:100%;height:100%}.bg-white{background-color:#FFF}.orange{background-color:#f39c12}.blue{background-color:#2980b9}.purple{background-color:#8e44ad}.notice a{color:#27ae60!important;text-decoration:underline!important}.tnp-chart{border:1px solid #eee;width:100%}.tnp-db-table{width:auto;background-color:#fff}.tnp-db-table thead{border-bottom:1px solid #eee}.tnp-db-table th{font-weight:bold}.tnp-db-table td,.tnp-db-table th{padding:3px;font-family:monospace;border:0}.tnp-main-status h3,.tnp-main-status h4{color:#fff}#tnp-status-table .tnp-ok{font-weight:bold;color:white;font-size:14px;background-color:#27ae60;padding:2px 10px;border-radius:10px;display:inline-block;width:75px;text-align:center}#tnp-status-table .tnp-ko{font-weight:bold;color:white;font-size:14px;background-color:#e74c41;padding:2px 10px;border-radius:10px;display:inline-block;width:75px;text-align:center}#tnp-status-table .tnp-maybe{font-weight:bold;color:white;font-size:14px;background-color:#f1c40f;padding:2px 10px;border-radius:10px;display:inline-block;width:75px;text-align:center}.tnp-main-status .tnp-log-files li{padding-left:15px}.tnp-main-status .tnp-log-files li,.tnp-main-status .tnp-log-files li a{color:#fff}.tnp-main-status .tnp-log-files .tnp-log-size{font-style:italic}table.widefat{border:0;box-shadow:none}#tnp-status-table tbody tr:nth-child(2n+1){background-color:#ecf0f1;border-radius:2px;margin:5px}#tnp-parameters-table tbody tr:nth-child(2n+1){background-color:#ecf0f1;border-radius:2px;margin:5px}#tnp-body .ui-widget{font-family:soleil,sans-serif}#tnp-body #tabs{background-color:transparent;border:0!important;padding:0;margin:0}#tnp-body #tabs .ui-widget-header{background:#28313c;border:0}#tnp-body #tabs .ui-tabs-panel{padding:15px!important;background-color:#fff}#tnp-body #tabs a.ui-tabs-anchor,#tnp-body #tabs a.ui-tabs-anchor:visited{color:#444}#tnp-body .ui-tabs .ui-tabs-nav{padding:0}#tnp-body .ui-tabs .ui-tabs-nav li a{font-size:14px}#tnp-body #tabs .ui-tabs{border-color:#28313c;background-color:#28313c;border:0}#tnp-body #tabs .ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0 0;background-color:#f2f2f2}#tnp-body #tabs .ui-tabs .ui-tabs-panel{padding:1em 0;background-color:#f2f2f2;margin:0;border:0}#tnp-body .ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{background:#fff!important;font-weight:normal;font-family:soleil,sans-serif}#tnp-body .ui-widget-content{background:#fff}#tnp-body .ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:0;background:#ecf0f1;font-family:soleil,sans-serif}.tnp-extension-premium-box,.tnp-extension-free-box,.tnp-integration-box{width:300px;height:220px;background-color:#222b36;text-align:center;margin:20px;float:left;position:relative}.tnp-extension-premium-box:hover,.tnp-extension-free-box:hover,.tnp-integration-box:hover{background-color:#232c35;box-shadow:1px 1px 15px #222b36}.tnp-extension-premium-box p,.tnp-extension-free-box p,.tnp-integration-box p{padding:5px 10px;color:#72777c;font-size:14px;margin-top:0}.tnp-extension-premium-box h3{font-family:soleil,sans-serif;padding:5px 8px!important;border-radius:3px;display:inline-block;font-size:16px;color:#fff;margin-bottom:0!important;margin-top:25px!important;font-weight:300;width:auto!important;border-bottom:none!important}.tnp-extension-free-box h3{font-family:soleil,sans-serif;padding:5px 8px!important;border-radius:3px;display:inline-block;font-size:16px;color:#fff;margin-bottom:0!important;margin-top:25px!important;font-weight:300;width:auto!important;border-bottom:none!important}.tnp-integration-box h3{font-family:soleil,sans-serif;padding:5px 8px!important;border-radius:3px;display:inline-block;font-size:16px;color:#fff;margin-bottom:0!important;margin-top:25px!important;font-weight:300;width:auto!important;border-bottom:none!important}.tnp-extension-premium-action{bottom:0;position:absolute;width:100%;padding:12px;font-family:soleil,sans-serif}.tnp-extension-free-action{bottom:0;position:absolute;width:100%;padding:12px;font-family:soleil,sans-serif}.tnp-integration-action{bottom:0;position:absolute;width:100%;padding:12px;font-family:soleil,sans-serif}.tnp-extension-premium-action span{color:#27ae60}.tnp-extension-free-action span{color:#27ae60}.tnp-integration-action span{color:#27ae60}.tnp-extension-activate{color:#1abc9c;padding:5px 8px;text-decoration:none;cursor:pointer}.tnp-extension-install{color:#2980b9;padding:5px 8px;text-decoration:none;cursor:pointer}.tnp-extension-buy{color:#f1c40f;padding:5px 8px;text-decoration:none;cursor:pointer}#tnp-body a.tnp-extension-details{color:#999;padding:5px 8px;text-decoration:none;cursor:pointer}.tnp-extension-free{color:#d35400;padding:5px 8px;text-decoration:none;cursor:pointer;position:relative}img.tnp-extensions-free-badge{position:absolute;display:block;right:0;top:0;width:70px}.tnp-extensions-image img{margin:25px 0 -10px}#tnp-subscribe-overlay{height:100vh;width:100vw;z-index:10000;display:none;background-image:url(images/modal-background.png);background-repeat:repeat;position:fixed;top:0;left:-20px}#tnp-subscribe-modal{width:600px;background-color:rgba(255,255,255,1);margin-right:auto;margin-left:auto;margin-top:100px;-webkit-box-shadow:0 0 20px 0 rgba(0,0,0,0.5);-moz-box-shadow:0 0 20px 0 rgba(0,0,0,0.5);box-shadow:0 0 20px 0 rgba(0,0,0,0.5);padding:25px;background-color:#1d2b38;text-align:center}#tnp-subscribe-modal img{width:30%}#tnp-subscribe-title{font-size:20px;margin-top:30px;margin-bottom:30px;line-height:30px;color:white;font-weight:200}#tnp-subscribe-email-wrapper{margin:20px}#tnp-subscribe-email-wrapper input{border:0;background-color:#223242;color:white}#tnp-subscribe-email{font-size:24px;box-sizing:border-box;width:100%;padding:10px;text-align:center}#tnp-subscribe-submit-wrapper{margin-bottom:20px}#tnp-subscribe-submit{font-size:24px;background-color:#219050;color:#fff;padding:10px 35px;border:0;font-size:17px;letter-spacing:2px}#tnp-subscribe-no-thanks{color:#666;margin-top:20px;margin-bottom:20px}#tnp-body div.tnp-emails-theme-options{background-color:#fff;padding:10px;margin-top:14px}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:0;background:#ecf0f1;font-family:soleil,sans-serif}.cd-slider-wrapper{position:relative;width:100%;height:90vh;overflow:hidden;margin:0 auto}.cd-slider-wrapper .cd-slider,.cd-slider-wrapper .cd-slider>li{height:100%;width:100%}.tnp-logo-big{width:300px}.tnp-row{display:table-row}.tnp-third{width:33%;float:left}.tnp-welcome-confirm-button{color:#fff;padding:10px 30px;background-color:#2ecc71;font-weight:700;font-size:15px;box-shadow:0 20px 38px rgba(0,0,0,0.16);text-decoration:none;display:inline-block;text-align:center;margin:20px auto 0}.tnp-welcome-confirm-button:hover{box-shadow:0 0 38px rgba(0,0,0,0.16);color:#fff}.tnp-welcome-confirm-button:visited{color:#fff;text-decoration:none}.tnp-welcome-link-button{color:#fff;padding:10px 30px;background-color:#3498db;font-weight:700;font-size:15px;box-shadow:0 20px 38px rgba(0,0,0,0.16);text-decoration:none}.tnp-welcome-link-button:hover{box-shadow:0 0 38px rgba(0,0,0,0.16);color:#fff}.tnp-welcome-link-button:visited{color:#fff;text-decoration:none}#tnp-welcome input[type="text"],#tnp-welcome input[type="email"]{max-width:90%}.tnp-welcome-next{background-color:#2ecc71;padding:10px 20px;color:white;text-decoration:none;font-weight:600;font-size:16px;margin:0 10px;box-shadow:0 10px 30px rgba(0,0,0,0.16);width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;display:flex;align-items:center}.tnp-welcome-next:hover{box-shadow:0 0 38px rgba(0,0,0,0.16);color:#fff}.tnp-welcome-next:visited{color:#fff;text-decoration:none}.tnp-welcome-prev{background-color:#3498db;padding:10px 20px;color:white;text-decoration:none;font-weight:600;font-size:16px;margin:0 0 0 10px;box-shadow:0 10px 30px rgba(0,0,0,0.16);width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;display:flex;align-items:center}.tnp-welcome-prev:hover{box-shadow:0 0 38px rgba(0,0,0,0.16);color:#fff}.tnp-welcome-prev:visited{color:#fff;text-decoration:none}.tnp-welcome-next svg{margin-left:10px}.tnp-welcome-prev svg{margin-right:10px}.cd-slider input{width:250px;height:40px;border:1px solid #6c7280;background:#454a56;color:white;color:white;padding:0 10px}.cd-slider>li{position:absolute;top:0;left:0;opacity:0;display:table;background-position:center center;background-repeat:no-repeat;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.cd-slider>li.visible{position:relative;z-index:2;opacity:1}.cd-slider>li:first-of-type{background-color:#2b313a}.cd-slider>li:nth-of-type(2){background-color:#2b313a}.cd-slider>li:nth-of-type(3){background-color:#2b313a}.cd-slider>li:nth-of-type(4){background-color:#2b313a}.cd-slider>li:first-of-type,.cd-slider>li:nth-of-type(2),.cd-slider>li:nth-of-type(3),.cd-slider>li:nth-of-type(4){background-size:cover}.cd-slider>li>div{display:table-cell;vertical-align:middle;text-align:center}.cd-slider>li h2,.cd-slider>li p{text-shadow:0 1px 3px rgba(0,0,0,0.1);line-height:1.2;margin:0 auto 14px;color:#fff;width:90%;max-width:320px}.cd-slider>li h2{font-size:40px}.cd-slider>li p{font-size:18px;line-height:26px;text-align:left;color:#b8c3c9;margin:40px auto}.cd-slider>li .cd-btn{display:inline-block;padding:1.2em 1.4em;margin-top:.8em;background-color:rgba(0,0,0,0.6);border-radius:.25em;font-size:1.3rem;font-weight:700;letter-spacing:1px;color:#fff;text-transform:uppercase;-webkit-transition:background-color .2s;-moz-transition:background-color .2s;transition:background-color .2s}.no-touch .cd-slider>li .cd-btn:hover{background-color:rgba(0,0,0,0.8)}@media only screen and (min-width:768px){.cd-slider>li h2,.cd-slider>li p{max-width:520px}.cd-slider>li h2{font-size:40px}.cd-slider>li p{font-size:18px;line-height:26px;text-align:left;color:#b8c3c9;margin:40px auto}}@media only screen and (min-width:1170px){.cd-slider>li h2,.cd-slider>li p{margin-bottom:20px}.cd-slider>li h2{font-size:40px}.cd-slider>li p{font-size:18px;line-height:26px;text-align:center;color:#b8c3c9;margin:30px auto}}.cd-slider-navigation{position:relative;bottom:110px;z-index:3;display:flex;justify-content:center}.cd-svg-cover{position:absolute;z-index:1;left:0;top:0;height:100%;width:100%;opacity:0}.cd-svg-cover path{fill:#ed6a6a}.cd-svg-cover.is-animating{z-index:4;opacity:1;-webkit-transition:opacity .6s;-moz-transition:opacity .6s;transition:opacity .6s}.switch{position:relative;display:inline-block;width:60px;height:34px}.switch input{display:none}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:"";height:26px;width:26px;left:4px;bottom:4px;background-color:white;-webkit-transition:.4s;transition:.4s}input:checked+.slider{background-color:#2196f3}input:focus+.slider{box-shadow:0 0 1px #2196f3}input:checked+.slider:before{-webkit-transform:translateX(26px);-ms-transform:translateX(26px);transform:translateX(26px)}.slider.round{border-radius:34px}.slider.round:before{border-radius:50%}#tnp-body div.tnp-emails-theme-options table.form-table{margin:0}#tnp-body div.tnp-emails-theme-options h3{color:#000}.tnp-emails-edit #options-subject{font-size:16px;display:inline-block;margin:20px 0;width:auto;border-radius:4px;padding:5px 10px}.tnp-suggest-button{font-family:soleil,sans-serif;margin-left:8px;border-radius:3px;background-color:#2980b9;padding:10px 15px 8px;font-size:14px;color:#fff!important;text-decoration:none}.tnp-suggest-button:hover{background-color:#3f8dbf}.tnp-popup-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.8);z-index:10000}.tnp-popup{width:40vw;height:66vh;overflow:auto;margin:100px auto 0 auto;background-color:#181818;padding:20px;position:relative}.tnp-popup-close{display:block;position:absolute;top:5px;right:5px;background-color:#181818;color:#fff;font-size:40px;padding:10px;text-align:right;cursor:pointer}.tnp-subjects-header{font-size:16px;color:#fff;padding:0 70px 20px 20px;font-family:soleil,sans-serif;border-bottom:1px solid #282828}#tnp-edit-subjects-list{padding:0 70px 20px 20px}#tnp-edit-subjects-list a{padding:5px}#tnp-edit-subjects-list svg{margin:0 10px 0 0;vertical-align:middle}.tnp-subject-category{color:#565656;margin:25px 0 10px 0;font-size:12px;text-transform:uppercase;letter-spacing:.1em}#tnp-edit-emoji-list{font-size:28px}#tnp-edit-emoji-list a{display:inline-block;margin-right:5px;margin-bottom:5px}.tnp-list-conditions p{margin:0 10px}.tnp-lists .tnp-notes{margin:0;font-size:.9em}iframe.tnp-editor-preview-mobile{box-sizing:border-box;background-color:#fff;border:1px solid #bbb;box-shadow:1px 1px 10px #777;border-radius:10px;padding:5px;width:320px;height:500px;float:left}iframe.tnp-editor-preview-desktop{box-sizing:border-box;background-color:#fff;border:1px solid #bbb;border-radius:10px;box-shadow:1px 1px 10px #777;padding:15px;width:650px;margin-right:20px;height:500px;float:left}#tnp-license-control{border-left:5px solid #27ae60;display:inline-block;padding:15px 20px;margin-left:-10px;margin-top:15px;border-radius:2px;background-color:#fff}#tnp-license-control form{margin-bottom:10px;margin-top:10px}#tnp-license-control form input{padding-left:10px}#tnp-license-control a{border-bottom:0;color:#27ae60}#tnp-nl-status{width:100%;background:#fffafa;padding:15px 25px 15px 25px;border-left:10px solid #27ae60;border-radius:0 5px 5px 0}#tnp-nl-status p{font-size:17px}.tnp-nl-status-row{margin:10px 0}.tnp-nl-status-title{font-size:26px;line-height:32px;margin:5px 0 0 0;color:#3498db;font-weight:900;vertical-align:middle}.tnp-nl-status-title-value{font-size:13px;line-height:32px;margin:0 0 0 5px;color:#fff;background-color:#95a5a6;border-radius:4px;text-transform:uppercase;letter-spacing:1px;vertical-align:sub}.tnp-nl-status-schedule-targeting{font-size:15px;color:#34495e}.tnp-nl-status-schedule-value{font-size:15px;color:#34495e}.tnp-status-header #options-subject{width:calc(100% - 150px)}.tnp-one-third{width:40%;display:inline-block;vertical-align:top}.tnp-two-thirds{width:59%;display:inline-block;vertical-align:top}.tnp-progress{display:flex;height:1.5rem;overflow:hidden;font-size:.75rem;background-color:#c9cccf;border-radius:.25rem;margin:0;min-width:100px}.tnp-progress-bar{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;white-space:nowrap;background-color:#007bff;transition:width .6s ease}.tnp-progress.sent .tnp-progress-bar{background-color:green}.tnp-progress-numbers{text-align:center;color:#666}.tnp-progress-date{color:#666;font-style:italic}span.tnp-email-status-new{background-color:#8e44ad;padding:2px 10px;border-radius:4px;color:#fff;white-space:nowrap}span.tnp-email-status-paused{background-color:#95a5a6;padding:2px 10px;border-radius:4px;color:#fff;white-space:nowrap}span.tnp-email-status-sending{background-color:#27ae60;padding:2px 10px;border-radius:4px;color:#fff;white-space:nowrap}span.tnp-email-status-scheduled{background-color:#e67e22;padding:2px 10px;border-radius:4px;color:#fff;white-space:nowrap}span.tnp-email-status-sent{background-color:#95a5a6;padding:2px 10px;border-radius:4px;color:#fff;white-space:nowrap}.tnp-themes-new{border-bottom:2px solid #243342;margin-bottom:30px;padding-bottom:30px}#tnp-schedule-button{background-color:#e67e22!important}#tnp-schedule-button:hover{background-color:#ec913f!important}.tnp-button-cancel{background-color:#e74c3c!important}.tnpc-preview{margin-top:10px}.tnpc-preview .fake-browser-ui iframe{width:700px}.tnpc-preview .fake-mobile-browser-ui iframe{width:320px}.fake-browser-ui{padding:30px 0 0;border-radius:3px;border-bottom:10px solid #ccc;background:#ddd;display:inline-block;position:relative;line-height:0;vertical-align:top;margin-left:20px}.fake-mobile-browser-ui{padding:30px 10px 37px;border-radius:10px;border-bottom:10px solid #ccc;background:#ddd;display:inline-block;position:relative;line-height:0;margin-left:30px}.fake-browser-ui .frame{display:block;height:25px;position:absolute;top:12px;left:8px}.fake-mobile-browser-ui .frame{display:block;height:25px;margin-top:10px}.fake-browser-ui span{height:12px;width:12px;border-radius:8px;background-color:#eee;border:1px solid #dadada;float:left;margin:0 0 0 4px}.fake-mobile-browser-ui span{height:50px;width:50px;border-radius:60px;background-color:#eee;border:2px solid #ccc;display:block;margin:auto}.fake-browser-ui .bt-1{background-color:#ed594a}.fake-browser-ui .bt-2{background-color:#fdd800}.fake-browser-ui .bt-3{background-color:#5ac05a}#tnp-promo{text-align:left;background-color:#222b36;margin:20px;border-radius:5px;padding:20px 40px}#tnp-promo .tnp-promo-how-to{width:50%;padding:5px 20px;margin-top:30px;margin-bottom:30px;border-left:2px solid #f1c40f}#tnp-promo .tnp-promo-how-to h3{color:#ecf0f1;margin:0;line-height:36px}#tnp-promo .tnp-promo-how-to p{color:#ecf0f1;margin:0;font-size:16px;line-height:26px}#tnp-promo .tnp-promo-buttons{margin:50px 0}#tnp-promo .tnp-promo-button{background:#27ae60;text-decoration:none;color:white;padding:15px 20px;font-size:15px;border-radius:2px}#tnp-promo .tnp-promo-button:hover{background:#2ecc71;color:white}#tnp-promo .tnp-promo-button i{margin-right:3px}#tnp-body td a.tnp-table-link,#tnp-body td a.tnp-table-link:visited{color:#444}#tnp-body td a.tnp-table-link:hover{color:#3498db}.text-left{text-align:left}
|
emails/blocks/hero/block-left.php
CHANGED
@@ -32,7 +32,7 @@
|
|
32 |
}
|
33 |
</style>
|
34 |
|
35 |
-
<table width="
|
36 |
<tr>
|
37 |
<td align="center" valign="top">
|
38 |
<a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow" inline-class="image-a">
|
32 |
}
|
33 |
</style>
|
34 |
|
35 |
+
<table width="50%" align="left" class="hero-table" border="0" cellspacing="0" cellpadding="0">
|
36 |
<tr>
|
37 |
<td align="center" valign="top">
|
38 |
<a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow" inline-class="image-a">
|
emails/blocks/hero/block-right.php
CHANGED
@@ -34,7 +34,7 @@
|
|
34 |
|
35 |
<div dir="rtl">
|
36 |
|
37 |
-
<table width="
|
38 |
<tr>
|
39 |
<td align="center" valign="top" dir="ltr">
|
40 |
<a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow" inline-class="image-a">
|
34 |
|
35 |
<div dir="rtl">
|
36 |
|
37 |
+
<table width="50%" align="right" class="hero-table" border="0" cellspacing="0" cellpadding="0">
|
38 |
<tr>
|
39 |
<td align="center" valign="top" dir="ltr">
|
40 |
<a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow" inline-class="image-a">
|
emails/blocks/posts/block.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* Name: Last posts
|
4 |
* Section: content
|
@@ -32,6 +33,7 @@ $defaults = array(
|
|
32 |
'block_padding_right' => 15,
|
33 |
'block_padding_top' => 15,
|
34 |
'block_padding_bottom' => 15,
|
|
|
35 |
'excerpt_length' => 30,
|
36 |
'post_offset' => 0,
|
37 |
'automated_include' => 'new',
|
@@ -57,7 +59,13 @@ $title_font_size = $options['title_font_size'];
|
|
57 |
$show_image = !empty($options['show_image']);
|
58 |
|
59 |
$filters = array();
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
$filters['offset'] = max((int) $options['post_offset'], 0);
|
62 |
|
63 |
if (!empty($options['categories'])) {
|
@@ -68,34 +76,38 @@ if (!empty($options['tags'])) {
|
|
68 |
$filters['tag'] = $options['tags'];
|
69 |
}
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
$filters['date_query'] = array(
|
75 |
-
'after' => gmdate('c', $context['last_run'])
|
76 |
-
);
|
77 |
-
}
|
78 |
-
|
79 |
-
$posts = Newsletter::instance()->get_posts($filters, $options['language']);
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
} else if ($options['automated'] == '2') {
|
90 |
-
$out['skip'] = true;
|
91 |
-
return;
|
92 |
}
|
93 |
-
}
|
94 |
|
95 |
-
// We have something new but we need to reload the posts without filtering by date
|
96 |
-
if ($options['automated_include'] == 'max') {
|
97 |
-
unset($filters['date_query']);
|
98 |
$posts = Newsletter::instance()->get_posts($filters, $options['language']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
}
|
101 |
|
@@ -106,395 +118,18 @@ if ($posts) {
|
|
106 |
$current_language = Newsletter::instance()->get_current_language();
|
107 |
Newsletter::instance()->switch_language($options['language']);
|
108 |
|
109 |
-
$button_background = $options['button_background'];
|
110 |
-
$button_label = $options['button_label'];
|
111 |
-
$button_font_family = $options['button_font_family'];
|
112 |
-
$button_font_size = $options['button_font_size'];
|
113 |
-
$button_color = $options['button_font_color'];
|
114 |
-
|
115 |
$alternative = plugins_url('newsletter') . '/emails/blocks/posts/images/blank.png';
|
116 |
$alternative_2 = plugins_url('newsletter') . '/emails/blocks/posts/images/blank-240x160.png';
|
117 |
|
118 |
remove_all_filters('excerpt_more');
|
119 |
-
?>
|
120 |
-
|
121 |
-
<?php if (!$posts) { ?>
|
122 |
-
|
123 |
-
|
124 |
-
<div inline-class="nocontents"><?php echo $options['automated_no_contents'] ?></div>
|
125 |
|
126 |
-
|
127 |
-
|
128 |
-
|
|
|
|
|
|
|
129 |
}
|
130 |
-
?>
|
131 |
-
|
132 |
-
<?php if ($options['layout'] == 'one') { ?>
|
133 |
-
<style>
|
134 |
-
.posts-post-date {
|
135 |
-
padding: 0 0 5px 0;
|
136 |
-
font-size: 13px;
|
137 |
-
font-family: <?php echo $font_family ?>;
|
138 |
-
font-weight: normal;
|
139 |
-
color: #aaaaaa;
|
140 |
-
}
|
141 |
-
|
142 |
-
.posts-post-title {
|
143 |
-
padding: 0 0 5px 0;
|
144 |
-
font-size: <?php echo $title_font_size ?>px;
|
145 |
-
font-family: <?php echo $title_font_family ?>;
|
146 |
-
font-weight: normal;
|
147 |
-
color: <?php echo $options['title_font_color'] ?>;
|
148 |
-
line-height: normal;
|
149 |
-
}
|
150 |
-
|
151 |
-
.posts-post-excerpt {
|
152 |
-
padding: 10px 0 15px 0;
|
153 |
-
font-family: <?php echo $font_family ?>;
|
154 |
-
color: <?php echo $options['font_color'] ?>;
|
155 |
-
font-size: <?php echo $font_size ?>px;
|
156 |
-
line-height: 1.5em;
|
157 |
-
}
|
158 |
-
|
159 |
-
.posts-button-table {
|
160 |
-
background-color: <?php echo $button_background ?>;
|
161 |
-
/*border:1px solid #353535;*/
|
162 |
-
border-radius:5px;
|
163 |
-
align: right;
|
164 |
-
}
|
165 |
-
.posts-button-td {
|
166 |
-
color: <?php echo $button_color ?>;
|
167 |
-
font-family:<?php echo $font_family ?>;
|
168 |
-
font-size:<?php echo $button_font_size ?>px;
|
169 |
-
font-weight:normal;
|
170 |
-
letter-spacing:normal;
|
171 |
-
line-height:normal;
|
172 |
-
padding-top:10px;
|
173 |
-
padding-right:15px;
|
174 |
-
padding-bottom:10px;
|
175 |
-
padding-left:15px;
|
176 |
-
text-align: right;
|
177 |
-
}
|
178 |
-
.posts-button-a {
|
179 |
-
color:<?php echo $button_color ?>;
|
180 |
-
font-size:<?php echo $button_font_size ?>px;
|
181 |
-
font-weight:normal;
|
182 |
-
text-decoration:none;
|
183 |
-
}
|
184 |
-
</style>
|
185 |
-
<!-- COMPACT ARTICLE SECTION -->
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="responsive-table">
|
190 |
-
|
191 |
-
<?php foreach ($posts as $post) { ?>
|
192 |
-
<?php
|
193 |
-
$url = tnp_post_permalink($post);
|
194 |
-
$media = null;
|
195 |
-
if ($show_image) {
|
196 |
-
$media = tnp_composer_block_posts_get_media($post, ['width' => 300, 'height' => 0]);
|
197 |
-
if ($media)
|
198 |
-
$media->set_width(105);
|
199 |
-
}
|
200 |
-
?>
|
201 |
-
|
202 |
-
<tr>
|
203 |
-
|
204 |
-
<td valign="top" style="padding: 20px 0 0 0;" class="posts-td-1">
|
205 |
-
|
206 |
-
<?php if ($media) { ?>
|
207 |
-
<table width="20%" cellpadding="0" cellspacing="0" border="0" align="left" class="posts-1-column" style="margin-bottom: 20px">
|
208 |
-
<tr>
|
209 |
-
<td>
|
210 |
-
<a href="<?php echo tnp_post_permalink($post) ?>" target="_blank">
|
211 |
-
<img src="<?php echo $media->url ?>"
|
212 |
-
width="<?php echo $media->width ?>"
|
213 |
-
height="<?php echo $media->height ?>"
|
214 |
-
alt="<?php echo esc_attr($media->alt) ?>"
|
215 |
-
border="0"
|
216 |
-
class="posts-1-image"
|
217 |
-
style="display: block; max-width: 100%; width: <?php echo $media->width ?>px" width="<?php echo $media->width ?>">
|
218 |
-
</a>
|
219 |
-
</td>
|
220 |
-
</tr>
|
221 |
-
</table>
|
222 |
-
<?php } ?>
|
223 |
-
|
224 |
-
<table width="<?php echo $media ? '78%' : '100%' ?>" cellpadding="0" cellspacing="0" border="0" class="posts-1-column" align="right">
|
225 |
-
<tr>
|
226 |
-
<td>
|
227 |
-
|
228 |
-
<!-- ARTICLE -->
|
229 |
-
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
230 |
-
<?php if (!empty($options['show_date'])) { ?>
|
231 |
-
<tr>
|
232 |
-
<td align="<?php echo $align_left?>" inline-class="posts-post-date">
|
233 |
-
<?php echo tnp_post_date($post) ?>
|
234 |
-
</td>
|
235 |
-
</tr>
|
236 |
-
<?php } ?>
|
237 |
-
<tr>
|
238 |
-
<td align="<?php echo $align_left?>"
|
239 |
-
inline-class="posts-post-title"
|
240 |
-
class="tnpc-row-edit tnpc-inline-editable"
|
241 |
-
data-type="title" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir?>">
|
242 |
-
<?php
|
243 |
-
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $post->ID) ?
|
244 |
-
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $post->ID) :
|
245 |
-
tnp_post_title($post)
|
246 |
-
?>
|
247 |
-
</td>
|
248 |
-
</tr>
|
249 |
-
<tr>
|
250 |
-
<td align="<?php echo $align_left?>"
|
251 |
-
inline-class="posts-post-excerpt"
|
252 |
-
class="padding-copy tnpc-row-edit tnpc-inline-editable"
|
253 |
-
data-type="text" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir?>">
|
254 |
-
<?php
|
255 |
-
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
|
256 |
-
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
|
257 |
-
tnp_post_excerpt($post, $excerpt_length)
|
258 |
-
?>
|
259 |
-
</td>
|
260 |
-
</tr>
|
261 |
-
<tr>
|
262 |
-
<td align="<?php echo $align_left?>" class="padding">
|
263 |
-
<table border="0" cellpadding="0" cellspacing="0" inline-class="posts-button-table" align="<?php echo $align_right?>">
|
264 |
-
<tr>
|
265 |
-
<td align="center" valign="middle" inline-class="posts-button-td" dir="<?php echo $dir?>">
|
266 |
-
<a href="<?php echo esc_attr($url) ?>" target="_blank" inline-class="posts-button-a" dir="<?php echo $dir?>"><?php echo $button_label ?></a>
|
267 |
-
</td>
|
268 |
-
</tr>
|
269 |
-
</table>
|
270 |
-
</td>
|
271 |
-
</tr>
|
272 |
-
</table>
|
273 |
-
|
274 |
-
</td>
|
275 |
-
</tr>
|
276 |
-
</table>
|
277 |
-
|
278 |
-
</td>
|
279 |
-
</tr>
|
280 |
-
|
281 |
-
<?php } ?>
|
282 |
-
|
283 |
-
</table>
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
<?php } else { ?>
|
288 |
-
|
289 |
-
<style>
|
290 |
-
.posts-post-date {
|
291 |
-
padding: 10px 0 0 15px;
|
292 |
-
font-size: 13px;
|
293 |
-
font-family: <?php echo $font_family ?>;
|
294 |
-
font-weight: normal;
|
295 |
-
color: #aaaaaa;
|
296 |
-
}
|
297 |
-
.posts-post-title {
|
298 |
-
padding: 15px 0 0 0;
|
299 |
-
font-family: <?php echo $title_font_family ?>;
|
300 |
-
color: <?php echo $options['title_font_color'] ?>;
|
301 |
-
font-size: <?php echo $title_font_size ?>px;
|
302 |
-
line-height: 1.3em;
|
303 |
-
}
|
304 |
-
.posts-post-excerpt {
|
305 |
-
padding: 5px 0 0 0;
|
306 |
-
font-family: <?php echo $font_family ?>;
|
307 |
-
color: <?php echo $options['font_color'] ?>;
|
308 |
-
font-size: <?php echo $font_size ?>px;
|
309 |
-
line-height: 1.4em;
|
310 |
-
}
|
311 |
-
.posts-button-table {
|
312 |
-
background-color: <?php echo $button_background ?>;
|
313 |
-
/*border:1px solid #353535;*/
|
314 |
-
border-radius:5px;
|
315 |
-
align: right;
|
316 |
-
}
|
317 |
-
.posts-button-td {
|
318 |
-
color: <?php echo $button_color ?>;
|
319 |
-
font-family:<?php echo $font_family ?>;
|
320 |
-
font-size:<?php echo $button_font_size ?>px;
|
321 |
-
font-weight:normal;
|
322 |
-
letter-spacing:normal;
|
323 |
-
line-height:normal;
|
324 |
-
padding-top:15px;
|
325 |
-
padding-right:30px;
|
326 |
-
padding-bottom:15px;
|
327 |
-
padding-left:30px;
|
328 |
-
text-align: right;
|
329 |
-
}
|
330 |
-
.posts-button-a {
|
331 |
-
color:<?php echo $button_color ?>;
|
332 |
-
font-size:<?php echo $button_font_size ?>px;
|
333 |
-
font-weight:normal;
|
334 |
-
text-decoration:none;
|
335 |
-
}
|
336 |
-
</style>
|
337 |
-
<!-- TWO COLUMN SECTION -->
|
338 |
-
|
339 |
-
|
340 |
-
<!-- TWO COLUMNS -->
|
341 |
-
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
342 |
-
<?php foreach (array_chunk($posts, 2) AS $row) { ?>
|
343 |
-
<tr>
|
344 |
-
<td valign="top" style="padding: 10px;" class="mobile-wrapper two-columns">
|
345 |
-
|
346 |
-
<!-- LEFT COLUMN -->
|
347 |
-
<table cellpadding="0" cellspacing="0" border="0" width="47%" align="left" class="responsive-table">
|
348 |
-
<tr>
|
349 |
-
<td style="padding: 20px 0 40px 0;">
|
350 |
-
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
351 |
-
<?php if ($show_image) { ?>
|
352 |
-
<?php
|
353 |
-
$size = array('width' => 240, 'height' => 160, "crop" => true);
|
354 |
-
$media = tnp_composer_block_posts_get_media($row[0], $size, $alternative_2);
|
355 |
-
?>
|
356 |
-
<tr>
|
357 |
-
<td align="center" valign="middle" class="tnpc-row-edit" data-type="image">
|
358 |
-
<a href="<?php echo tnp_post_permalink($row[0]) ?>" target="_blank">
|
359 |
-
<img src="<?php echo $media->url ?>"
|
360 |
-
width="<?php echo $media->width ?>"
|
361 |
-
height="<?php echo $media->height ?>"
|
362 |
-
alt="Image"
|
363 |
-
border="0"
|
364 |
-
class="img-max">
|
365 |
-
</a>
|
366 |
-
</td>
|
367 |
-
</tr>
|
368 |
-
<?php } ?>
|
369 |
-
<tr>
|
370 |
-
<td align="center"
|
371 |
-
inline-class="posts-post-title"
|
372 |
-
class="tnpc-row-edit tnpc-inline-editable"
|
373 |
-
data-type="title" data-id="<?php echo $row[0]->ID ?>">
|
374 |
-
<?php
|
375 |
-
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $row[0]->ID) ?
|
376 |
-
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $row[0]->ID) :
|
377 |
-
tnp_post_title($row[0])
|
378 |
-
?>
|
379 |
-
</td>
|
380 |
-
</tr>
|
381 |
-
<?php if (!empty($options['show_date'])) { ?>
|
382 |
-
<tr>
|
383 |
-
<td align="center" inline-class="posts-post-date">
|
384 |
-
<?php echo tnp_post_date($row[0]) ?>
|
385 |
-
</td>
|
386 |
-
</tr>
|
387 |
-
<?php } ?>
|
388 |
-
<tr>
|
389 |
-
<td align="center"
|
390 |
-
inline-class="posts-post-excerpt"
|
391 |
-
class="tnpc-row-edit tnpc-inline-editable"
|
392 |
-
data-type="text" data-id="<?php echo $row[0]->ID ?>">
|
393 |
-
<?php
|
394 |
-
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $row[0]->ID) ?
|
395 |
-
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $row[0]->ID) :
|
396 |
-
tnp_post_excerpt($row[0], $excerpt_length)
|
397 |
-
?>
|
398 |
-
</td>
|
399 |
-
</tr>
|
400 |
-
<tr>
|
401 |
-
<td align="center">
|
402 |
-
<br>
|
403 |
-
<table border="0" cellpadding="0" cellspacing="0" inline-class="posts-button-table" align="center">
|
404 |
-
<tr>
|
405 |
-
<td align="center" valign="middle" inline-class="posts-button-td">
|
406 |
-
<a href="<?php echo tnp_post_permalink($row[0]) ?>" target="_blank" inline-class="posts-button-a"><?php echo $button_label ?></a>
|
407 |
-
</td>
|
408 |
-
</tr>
|
409 |
-
</table>
|
410 |
-
</td>
|
411 |
-
</tr>
|
412 |
-
</table>
|
413 |
-
</td>
|
414 |
-
</tr>
|
415 |
-
</table>
|
416 |
-
|
417 |
-
<?php if (!empty($row[1])) { ?>
|
418 |
-
<!-- RIGHT COLUMN -->
|
419 |
-
<table cellpadding="0" cellspacing="0" border="0" width="47%" align="right" class="responsive-table">
|
420 |
-
<tr>
|
421 |
-
<td style="padding: 20px 0 40px 0;">
|
422 |
-
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
423 |
-
<?php if ($show_image) { ?>
|
424 |
-
<?php
|
425 |
-
$size = array('width' => 240, 'height' => 160, "crop" => true);
|
426 |
-
$media = tnp_composer_block_posts_get_media($row[1], $size, $alternative_2);
|
427 |
-
?>
|
428 |
-
<tr>
|
429 |
-
<td align="center" valign="middle" class="tnpc-row-edit" data-type="image">
|
430 |
-
<a href="<?php echo tnp_post_permalink($row[1]) ?>" target="_blank">
|
431 |
-
<img src="<?php echo $media->url ?>"
|
432 |
-
width="<?php echo $media->width ?>"
|
433 |
-
height="<?php echo $media->height ?>"
|
434 |
-
alt="Image" border="0" class="img-max">
|
435 |
-
</a>
|
436 |
-
</td>
|
437 |
-
</tr>
|
438 |
-
<?php } ?>
|
439 |
-
<tr>
|
440 |
-
<td align="center"
|
441 |
-
inline-class="posts-post-title"
|
442 |
-
class="tnpc-row-edit tnpc-inline-editable"
|
443 |
-
data-type="title" data-id="<?php echo $row[1]->ID ?>">
|
444 |
-
<?php
|
445 |
-
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $row[1]->ID) ?
|
446 |
-
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $row[1]->ID) :
|
447 |
-
tnp_post_title($row[1])
|
448 |
-
?>
|
449 |
-
</td>
|
450 |
-
</tr>
|
451 |
-
<?php if (!empty($options['show_date'])) { ?>
|
452 |
-
<tr>
|
453 |
-
<td align="center" inline-class="posts-post-date">
|
454 |
-
<?php echo tnp_post_date($row[1]) ?>
|
455 |
-
</td>
|
456 |
-
</tr>
|
457 |
-
<?php } ?>
|
458 |
-
<tr>
|
459 |
-
<td align="center"
|
460 |
-
inline-class="posts-post-excerpt"
|
461 |
-
class="tnpc-row-edit tnpc-inline-editable"
|
462 |
-
data-type="text" data-id="<?php echo $row[1]->ID ?>">
|
463 |
-
<?php
|
464 |
-
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $row[1]->ID) ?
|
465 |
-
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $row[1]->ID) :
|
466 |
-
tnp_post_excerpt($row[1], $excerpt_length)
|
467 |
-
?>
|
468 |
-
</td>
|
469 |
-
</tr>
|
470 |
-
<tr>
|
471 |
-
<td align="center">
|
472 |
-
<br>
|
473 |
-
<table border="0" cellpadding="0" cellspacing="0" inline-class="posts-button-table" align="center">
|
474 |
-
<tr>
|
475 |
-
<td align="center" valign="middle" inline-class="posts-button-td">
|
476 |
-
<a href="<?php echo tnp_post_permalink($row[1]) ?>" target="_blank" inline-class="posts-button-a"><?php echo $button_label ?></a>
|
477 |
-
</td>
|
478 |
-
</tr>
|
479 |
-
</table>
|
480 |
-
</td>
|
481 |
-
</tr>
|
482 |
-
</table>
|
483 |
-
</td>
|
484 |
-
</tr>
|
485 |
-
</table>
|
486 |
-
<?php } ?>
|
487 |
-
|
488 |
-
</td>
|
489 |
-
</tr>
|
490 |
-
|
491 |
-
<?php } ?>
|
492 |
-
|
493 |
-
</table>
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
<?php }
|
498 |
|
499 |
Newsletter::instance()->switch_language($options['language']);
|
500 |
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* Name: Last posts
|
5 |
* Section: content
|
33 |
'block_padding_right' => 15,
|
34 |
'block_padding_top' => 15,
|
35 |
'block_padding_bottom' => 15,
|
36 |
+
'button_font_weight' => 'normal',
|
37 |
'excerpt_length' => 30,
|
38 |
'post_offset' => 0,
|
39 |
'automated_include' => 'new',
|
59 |
$show_image = !empty($options['show_image']);
|
60 |
|
61 |
$filters = array();
|
62 |
+
|
63 |
+
$options['max'] = (int) $options['max'];
|
64 |
+
if ($options['layout'] == 'two') {
|
65 |
+
$options['max'] = (int) floor($options['max'] / 2) * 2;
|
66 |
+
}
|
67 |
+
|
68 |
+
$filters['posts_per_page'] = $options['max'];
|
69 |
$filters['offset'] = max((int) $options['post_offset'], 0);
|
70 |
|
71 |
if (!empty($options['categories'])) {
|
76 |
$filters['tag'] = $options['tags'];
|
77 |
}
|
78 |
|
79 |
+
if ($context['type'] != 'automated') {
|
80 |
+
$posts = Newsletter::instance()->get_posts($filters, $options['language']);
|
81 |
+
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
+
if (!empty($options['automated_disabled'])) {
|
84 |
+
$posts = Newsletter::instance()->get_posts($filters, $options['language']);
|
85 |
+
} else {
|
86 |
+
// Can be empty when composing...
|
87 |
+
if (!empty($context['last_run'])) {
|
88 |
+
$filters['date_query'] = array(
|
89 |
+
'after' => gmdate('c', $context['last_run'])
|
90 |
+
);
|
|
|
|
|
|
|
91 |
}
|
|
|
92 |
|
|
|
|
|
|
|
93 |
$posts = Newsletter::instance()->get_posts($filters, $options['language']);
|
94 |
+
if (empty($posts)) {
|
95 |
+
if ($options['automated'] == '1') {
|
96 |
+
$out['stop'] = true;
|
97 |
+
return;
|
98 |
+
} else if ($options['automated'] == '2') {
|
99 |
+
$out['skip'] = true;
|
100 |
+
return;
|
101 |
+
} else {
|
102 |
+
echo '<div inline-class="nocontents">', $options['automated_no_contents'], '</div>';
|
103 |
+
return;
|
104 |
+
}
|
105 |
+
} else {
|
106 |
+
if ($options['automated_include'] == 'max') {
|
107 |
+
unset($filters['date_query']);
|
108 |
+
$posts = Newsletter::instance()->get_posts($filters, $options['language']);
|
109 |
+
}
|
110 |
+
}
|
111 |
}
|
112 |
}
|
113 |
|
118 |
$current_language = Newsletter::instance()->get_current_language();
|
119 |
Newsletter::instance()->switch_language($options['language']);
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
$alternative = plugins_url('newsletter') . '/emails/blocks/posts/images/blank.png';
|
122 |
$alternative_2 = plugins_url('newsletter') . '/emails/blocks/posts/images/blank-240x160.png';
|
123 |
|
124 |
remove_all_filters('excerpt_more');
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
+
if ($options['layout'] == 'one') {
|
127 |
+
include __DIR__ . '/layout-one.php';
|
128 |
+
} else if ($options['layout'] == 'two') {
|
129 |
+
include __DIR__ . '/layout-two.php';
|
130 |
+
} else {
|
131 |
+
include __DIR__ . '/layout-big-image.php';
|
132 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
Newsletter::instance()->switch_language($options['language']);
|
135 |
|
emails/blocks/posts/layout-big-image.php
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$size = ['width' => 600, 'height' => 0];
|
3 |
+
?>
|
4 |
+
<style>
|
5 |
+
.post-date {
|
6 |
+
padding: 0 0 5px 0;
|
7 |
+
font-size: 13px;
|
8 |
+
font-family: <?php echo $font_family ?>;
|
9 |
+
font-weight: normal;
|
10 |
+
color: #aaaaaa;
|
11 |
+
}
|
12 |
+
|
13 |
+
.post-title {
|
14 |
+
padding: 0 0 5px 0;
|
15 |
+
font-size: <?php echo $title_font_size ?>px;
|
16 |
+
font-family: <?php echo $title_font_family ?>;
|
17 |
+
font-weight: normal;
|
18 |
+
color: <?php echo $options['title_font_color'] ?>;
|
19 |
+
line-height: normal;
|
20 |
+
}
|
21 |
+
|
22 |
+
.post-excerpt {
|
23 |
+
padding: 10px 0 15px 0;
|
24 |
+
font-family: <?php echo $font_family ?>;
|
25 |
+
color: <?php echo $options['font_color'] ?>;
|
26 |
+
font-size: <?php echo $font_size ?>px;
|
27 |
+
line-height: 1.5em;
|
28 |
+
}
|
29 |
+
</style>
|
30 |
+
|
31 |
+
|
32 |
+
<?php foreach ($posts as $post) { ?>
|
33 |
+
<?php
|
34 |
+
$url = tnp_post_permalink($post);
|
35 |
+
$media = null;
|
36 |
+
if ($show_image) {
|
37 |
+
$media = tnp_composer_block_posts_get_media($post, $size);
|
38 |
+
|
39 |
+
if ($media) {
|
40 |
+
$media->link = $url;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
$options['button_url'] = $url;
|
44 |
+
?>
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
<?php if ($media) { ?>
|
49 |
+
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin-bottom: 20px">
|
50 |
+
<tr>
|
51 |
+
<td align="center">
|
52 |
+
<?php echo TNP_Composer::image($media) ?>
|
53 |
+
</td>
|
54 |
+
</tr>
|
55 |
+
</table>
|
56 |
+
<?php } ?>
|
57 |
+
|
58 |
+
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="responsive-table">
|
59 |
+
<tr>
|
60 |
+
<td>
|
61 |
+
|
62 |
+
<!-- ARTICLE -->
|
63 |
+
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
64 |
+
<?php if (!empty($options['show_date'])) { ?>
|
65 |
+
<tr>
|
66 |
+
<td align="<?php echo $align_left ?>" inline-class="post-date">
|
67 |
+
<?php echo tnp_post_date($post) ?>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
<?php } ?>
|
71 |
+
<tr>
|
72 |
+
<td align="<?php echo $align_left ?>"
|
73 |
+
inline-class="post-title"
|
74 |
+
class="tnpc-row-edit tnpc-inline-editable"
|
75 |
+
data-type="title" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir ?>">
|
76 |
+
<?php
|
77 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $post->ID) ?
|
78 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $post->ID) :
|
79 |
+
tnp_post_title($post)
|
80 |
+
?>
|
81 |
+
</td>
|
82 |
+
</tr>
|
83 |
+
<tr>
|
84 |
+
<td align="<?php echo $align_left ?>"
|
85 |
+
inline-class="post-excerpt"
|
86 |
+
class="padding-copy tnpc-row-edit tnpc-inline-editable"
|
87 |
+
data-type="text" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir ?>">
|
88 |
+
<?php
|
89 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
|
90 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
|
91 |
+
tnp_post_excerpt($post, $excerpt_length)
|
92 |
+
?>
|
93 |
+
</td>
|
94 |
+
</tr>
|
95 |
+
<tr>
|
96 |
+
<td align="<?php echo $align_left ?>" align="center">
|
97 |
+
<?php echo TNP_Composer::button($options) ?>
|
98 |
+
<br><br>
|
99 |
+
</td>
|
100 |
+
</tr>
|
101 |
+
</table>
|
102 |
+
|
103 |
+
</td>
|
104 |
+
</tr>
|
105 |
+
</table>
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
<?php } ?>
|
110 |
+
|
111 |
+
|
emails/blocks/posts/layout-one.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$size = ['width' => 300, 'height' => 0];
|
3 |
+
?>
|
4 |
+
<style>
|
5 |
+
.post-date {
|
6 |
+
padding: 0 0 5px 0;
|
7 |
+
font-size: 13px;
|
8 |
+
font-family: <?php echo $font_family ?>;
|
9 |
+
font-weight: normal;
|
10 |
+
color: #aaaaaa;
|
11 |
+
}
|
12 |
+
|
13 |
+
.post-title {
|
14 |
+
padding: 0 0 5px 0;
|
15 |
+
font-size: <?php echo $title_font_size ?>px;
|
16 |
+
font-family: <?php echo $title_font_family ?>;
|
17 |
+
font-weight: normal;
|
18 |
+
color: <?php echo $options['title_font_color'] ?>;
|
19 |
+
line-height: normal;
|
20 |
+
}
|
21 |
+
|
22 |
+
.post-excerpt {
|
23 |
+
padding: 10px 0 15px 0;
|
24 |
+
font-family: <?php echo $font_family ?>;
|
25 |
+
color: <?php echo $options['font_color'] ?>;
|
26 |
+
font-size: <?php echo $font_size ?>px;
|
27 |
+
line-height: 1.5em;
|
28 |
+
}
|
29 |
+
</style>
|
30 |
+
|
31 |
+
|
32 |
+
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="responsive-table">
|
33 |
+
|
34 |
+
<?php foreach ($posts as $post) { ?>
|
35 |
+
<?php
|
36 |
+
$url = tnp_post_permalink($post);
|
37 |
+
$media = null;
|
38 |
+
if ($show_image) {
|
39 |
+
$media = tnp_composer_block_posts_get_media($post, $size);
|
40 |
+
var_dump($media);
|
41 |
+
if ($media) {
|
42 |
+
$media->link = $url;
|
43 |
+
$media->set_width(105);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
$options['button_url'] = $url;
|
47 |
+
?>
|
48 |
+
|
49 |
+
<tr>
|
50 |
+
|
51 |
+
<td valign="top" style="padding: 20px 0 0 0;" class="td-1">
|
52 |
+
|
53 |
+
<?php if ($media) { ?>
|
54 |
+
<table width="20%" cellpadding="0" cellspacing="0" border="0" align="left" class="1-column" style="margin-bottom: 20px">
|
55 |
+
<tr>
|
56 |
+
<td>
|
57 |
+
<?php echo TNP_Composer::image($media) ?>
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
</table>
|
61 |
+
<?php } ?>
|
62 |
+
|
63 |
+
<table width="<?php echo $media ? '78%' : '100%' ?>" cellpadding="0" cellspacing="0" border="0" class="responsive-table" align="right">
|
64 |
+
<tr>
|
65 |
+
<td>
|
66 |
+
|
67 |
+
<!-- ARTICLE -->
|
68 |
+
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
69 |
+
<?php if (!empty($options['show_date'])) { ?>
|
70 |
+
<tr>
|
71 |
+
<td align="<?php echo $align_left ?>" inline-class="post-date">
|
72 |
+
<?php echo tnp_post_date($post) ?>
|
73 |
+
</td>
|
74 |
+
</tr>
|
75 |
+
<?php } ?>
|
76 |
+
<tr>
|
77 |
+
<td align="<?php echo $align_left ?>"
|
78 |
+
inline-class="post-title"
|
79 |
+
class="tnpc-row-edit tnpc-inline-editable"
|
80 |
+
data-type="title" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir ?>">
|
81 |
+
<?php
|
82 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $post->ID) ?
|
83 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $post->ID) :
|
84 |
+
tnp_post_title($post)
|
85 |
+
?>
|
86 |
+
</td>
|
87 |
+
</tr>
|
88 |
+
<tr>
|
89 |
+
<td align="<?php echo $align_left ?>"
|
90 |
+
inline-class="post-excerpt"
|
91 |
+
class="padding-copy tnpc-row-edit tnpc-inline-editable"
|
92 |
+
data-type="text" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir ?>">
|
93 |
+
<?php
|
94 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
|
95 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
|
96 |
+
tnp_post_excerpt($post, $excerpt_length)
|
97 |
+
?>
|
98 |
+
</td>
|
99 |
+
</tr>
|
100 |
+
<tr>
|
101 |
+
<td align="<?php echo $align_left ?>" class="padding">
|
102 |
+
<?php echo TNP_Composer::button($options) ?>
|
103 |
+
</td>
|
104 |
+
</tr>
|
105 |
+
</table>
|
106 |
+
|
107 |
+
</td>
|
108 |
+
</tr>
|
109 |
+
</table>
|
110 |
+
|
111 |
+
</td>
|
112 |
+
</tr>
|
113 |
+
|
114 |
+
<?php } ?>
|
115 |
+
|
116 |
+
</table>
|
emails/blocks/posts/layout-two.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$size = array('width' => 240, 'height' => 160, "crop" => true);
|
3 |
+
?>
|
4 |
+
<style>
|
5 |
+
.post-date {
|
6 |
+
padding: 10px 0 0 15px;
|
7 |
+
font-size: 13px;
|
8 |
+
font-family: <?php echo $font_family ?>;
|
9 |
+
font-weight: normal;
|
10 |
+
color: #aaaaaa;
|
11 |
+
}
|
12 |
+
.post-title {
|
13 |
+
padding: 15px 0 0 0;
|
14 |
+
font-family: <?php echo $title_font_family ?>;
|
15 |
+
color: <?php echo $options['title_font_color'] ?>;
|
16 |
+
font-size: <?php echo $title_font_size ?>px;
|
17 |
+
line-height: 1.3em;
|
18 |
+
}
|
19 |
+
.post-excerpt {
|
20 |
+
padding: 5px 0 0 0;
|
21 |
+
font-family: <?php echo $font_family ?>;
|
22 |
+
color: <?php echo $options['font_color'] ?>;
|
23 |
+
font-size: <?php echo $font_size ?>px;
|
24 |
+
line-height: 1.4em;
|
25 |
+
}
|
26 |
+
</style>
|
27 |
+
|
28 |
+
<!-- TWO COLUMNS -->
|
29 |
+
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
30 |
+
|
31 |
+
<?php foreach (array_chunk($posts, 2) AS $row) { ?>
|
32 |
+
<?php
|
33 |
+
$media = null;
|
34 |
+
if ($show_image) {
|
35 |
+
$media = tnp_composer_block_posts_get_media($row[0], $size, $alternative_2);
|
36 |
+
$media->link = tnp_post_permalink($row[0]);
|
37 |
+
}
|
38 |
+
$options['button_url'] = tnp_post_permalink($row[0]);
|
39 |
+
?>
|
40 |
+
<tr>
|
41 |
+
<td valign="top" style="padding: 10px;" class="mobile-wrapper two-columns">
|
42 |
+
|
43 |
+
<!-- LEFT COLUMN -->
|
44 |
+
<table cellpadding="0" cellspacing="0" border="0" width="47%" align="left" class="responsive-table">
|
45 |
+
<tr>
|
46 |
+
<td style="padding: 20px 0 40px 0;">
|
47 |
+
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
48 |
+
<?php if ($media) { ?>
|
49 |
+
<tr>
|
50 |
+
<td align="center" valign="middle" class="tnpc-row-edit" data-type="image">
|
51 |
+
<?php echo TNP_Composer::image($media) ?>
|
52 |
+
</td>
|
53 |
+
</tr>
|
54 |
+
<?php } ?>
|
55 |
+
<tr>
|
56 |
+
<td align="center"
|
57 |
+
inline-class="post-title"
|
58 |
+
class="tnpc-row-edit tnpc-inline-editable"
|
59 |
+
data-type="title" data-id="<?php echo $row[0]->ID ?>">
|
60 |
+
<?php
|
61 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $row[0]->ID) ?
|
62 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $row[0]->ID) :
|
63 |
+
tnp_post_title($row[0])
|
64 |
+
?>
|
65 |
+
</td>
|
66 |
+
</tr>
|
67 |
+
<?php if (!empty($options['show_date'])) { ?>
|
68 |
+
<tr>
|
69 |
+
<td align="center" inline-class="post-date">
|
70 |
+
<?php echo tnp_post_date($row[0]) ?>
|
71 |
+
</td>
|
72 |
+
</tr>
|
73 |
+
<?php } ?>
|
74 |
+
<tr>
|
75 |
+
<td align="center"
|
76 |
+
inline-class="post-excerpt"
|
77 |
+
class="tnpc-row-edit tnpc-inline-editable"
|
78 |
+
data-type="text" data-id="<?php echo $row[0]->ID ?>">
|
79 |
+
<?php
|
80 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $row[0]->ID) ?
|
81 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $row[0]->ID) :
|
82 |
+
tnp_post_excerpt($row[0], $excerpt_length)
|
83 |
+
?>
|
84 |
+
</td>
|
85 |
+
</tr>
|
86 |
+
<tr>
|
87 |
+
<td align="center">
|
88 |
+
<br>
|
89 |
+
<?php echo TNP_Composer::button($options) ?>
|
90 |
+
</td>
|
91 |
+
</tr>
|
92 |
+
</table>
|
93 |
+
</td>
|
94 |
+
</tr>
|
95 |
+
</table>
|
96 |
+
|
97 |
+
<?php
|
98 |
+
$media = null;
|
99 |
+
if ($show_image) {
|
100 |
+
$media = tnp_composer_block_posts_get_media($row[1], $size, $alternative_2);
|
101 |
+
$media->link = tnp_post_permalink($row[1]);
|
102 |
+
}
|
103 |
+
$options['button_url'] = tnp_post_permalink($row[1]);
|
104 |
+
?>
|
105 |
+
<!-- RIGHT COLUMN -->
|
106 |
+
<table cellpadding="0" cellspacing="0" border="0" width="47%" align="right" class="responsive-table">
|
107 |
+
<tr>
|
108 |
+
<td style="padding: 20px 0 40px 0;">
|
109 |
+
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
110 |
+
<?php if ($media) { ?>
|
111 |
+
|
112 |
+
<tr>
|
113 |
+
<td align="center" valign="middle" class="tnpc-row-edit" data-type="image">
|
114 |
+
<?php echo TNP_Composer::image($media) ?>
|
115 |
+
</td>
|
116 |
+
</tr>
|
117 |
+
<?php } ?>
|
118 |
+
<tr>
|
119 |
+
<td align="center"
|
120 |
+
inline-class="post-title"
|
121 |
+
class="tnpc-row-edit tnpc-inline-editable"
|
122 |
+
data-type="title" data-id="<?php echo $row[1]->ID ?>">
|
123 |
+
<?php
|
124 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $row[1]->ID) ?
|
125 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $row[1]->ID) :
|
126 |
+
tnp_post_title($row[1])
|
127 |
+
?>
|
128 |
+
</td>
|
129 |
+
</tr>
|
130 |
+
<?php if (!empty($options['show_date'])) { ?>
|
131 |
+
<tr>
|
132 |
+
<td align="center" inline-class="post-date">
|
133 |
+
<?php echo tnp_post_date($row[1]) ?>
|
134 |
+
</td>
|
135 |
+
</tr>
|
136 |
+
<?php } ?>
|
137 |
+
<tr>
|
138 |
+
<td align="center"
|
139 |
+
inline-class="post-excerpt"
|
140 |
+
class="tnpc-row-edit tnpc-inline-editable"
|
141 |
+
data-type="text" data-id="<?php echo $row[1]->ID ?>">
|
142 |
+
<?php
|
143 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $row[1]->ID) ?
|
144 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $row[1]->ID) :
|
145 |
+
tnp_post_excerpt($row[1], $excerpt_length)
|
146 |
+
?>
|
147 |
+
</td>
|
148 |
+
</tr>
|
149 |
+
<tr>
|
150 |
+
<td align="center">
|
151 |
+
<br>
|
152 |
+
<?php echo TNP_Composer::button($options) ?>
|
153 |
+
</td>
|
154 |
+
</tr>
|
155 |
+
</table>
|
156 |
+
</td>
|
157 |
+
</tr>
|
158 |
+
</table>
|
159 |
+
|
160 |
+
|
161 |
+
</td>
|
162 |
+
</tr>
|
163 |
+
|
164 |
+
<?php } ?>
|
165 |
+
|
166 |
+
</table>
|
167 |
+
|
emails/blocks/posts/options.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/* @var $options array contains all the options the current block we're ediging contains */
|
4 |
/* @var $controls NewsletterControls */
|
5 |
/* @var $fields NewsletterFields */
|
@@ -10,31 +9,55 @@ if (class_exists('NewsletterExtensions')) {
|
|
10 |
}
|
11 |
?>
|
12 |
<p>
|
13 |
-
Custom post types can be added using our <a href="<?php echo $extensions_url?>" target="_blank">Advanced Composer Blocks Addon</a>.
|
14 |
</p>
|
15 |
|
16 |
<?php if ($context['type'] == 'automated') { ?>
|
17 |
|
18 |
-
<?php $fields->select('
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
-
<?php $fields->select('automated_include', __('What to include', 'newsletter'), array('new' => __('New posts after last newsletter', 'newsletter'),
|
23 |
-
'max' => __('Always max posts if at least one is new', 'newsletter')),
|
24 |
-
array('description'=>'This option is effective only when the newsletter is generated, not while composing')) ?>
|
25 |
<?php } ?>
|
26 |
|
27 |
|
28 |
-
<?php $fields->select('layout', __('Layout', 'newsletter'), array('one' => __('One column', 'newsletter'),
|
|
|
|
|
29 |
|
30 |
<?php $fields->font('title_font', __('Title font', 'newsletter')) ?>
|
31 |
|
32 |
-
<?php $fields->number(
|
33 |
|
34 |
<?php $fields->font('font', __('Excerpt font', 'newsletter')) ?>
|
35 |
|
36 |
<div class="tnp-field-row">
|
37 |
-
<label class="tnp-row-label"><?php _e('Dates and images', 'newsletter')?></label>
|
38 |
<div class="tnp-field-col-2">
|
39 |
<?php $fields->checkbox('show_image', __('Show image', 'newsletter')) ?>
|
40 |
</div>
|
@@ -48,8 +71,8 @@ if (class_exists('NewsletterExtensions')) {
|
|
48 |
<div class="tnp-field-col-2">
|
49 |
<?php $fields->select_number('max', __('Max posts', 'newsletter'), 1, 40); ?>
|
50 |
</div>
|
51 |
-
|
52 |
-
<?php $fields->select_number(
|
53 |
</div>
|
54 |
</div>
|
55 |
|
@@ -59,7 +82,7 @@ if (class_exists('NewsletterExtensions')) {
|
|
59 |
|
60 |
<?php $fields->section(__('Filters', 'newsletter')) ?>
|
61 |
<?php $fields->categories(); ?>
|
62 |
-
<?php $fields->text('tags', __('Tags', 'newsletter'), ['description'=>__('Comma separated')]); ?>
|
63 |
|
64 |
<?php $fields->block_commons() ?>
|
65 |
|
1 |
<?php
|
|
|
2 |
/* @var $options array contains all the options the current block we're ediging contains */
|
3 |
/* @var $controls NewsletterControls */
|
4 |
/* @var $fields NewsletterFields */
|
9 |
}
|
10 |
?>
|
11 |
<p>
|
12 |
+
Custom post types can be added using our <a href="<?php echo $extensions_url ?>" target="_blank">Advanced Composer Blocks Addon</a>.
|
13 |
</p>
|
14 |
|
15 |
<?php if ($context['type'] == 'automated') { ?>
|
16 |
|
17 |
+
<?php $fields->select('automated_disabled', '', ['' => 'Check for new posts since last newsletter', '1' => 'Do not check for new posts']) ?>
|
18 |
+
|
19 |
+
<div class="tnp-field-row">
|
20 |
+
<div class="tnp-field-col-2">
|
21 |
+
<?php
|
22 |
+
$fields->select('automated_include', __('If there are new posts', 'newsletter'),
|
23 |
+
[
|
24 |
+
'new' => __('Include only new posts', 'newsletter'),
|
25 |
+
'max' => __('Include specified max posts', 'newsletter')
|
26 |
+
],
|
27 |
+
['description' => ''])
|
28 |
+
?>
|
29 |
+
</div>
|
30 |
+
<div class="tnp-field-col-2">
|
31 |
+
<?php
|
32 |
+
$fields->select('automated', __('If there are not new posts', 'newsletter'),
|
33 |
+
[
|
34 |
+
'' => 'Show the message below',
|
35 |
+
'1' => 'Do not send the newsletter',
|
36 |
+
'2' => 'Remove this block'
|
37 |
+
],
|
38 |
+
['description' => ''])
|
39 |
+
?>
|
40 |
+
<?php $fields->text('automated_no_contents', null, ['placeholder'=>'No new posts message']) ?>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
|
45 |
|
|
|
|
|
|
|
46 |
<?php } ?>
|
47 |
|
48 |
|
49 |
+
<?php $fields->select('layout', __('Layout', 'newsletter'), array('one' => __('One column', 'newsletter'),
|
50 |
+
'two' => __('Two columns', 'newsletter'),
|
51 |
+
'big-image' => __('One column, big image', 'newsletter'))) ?>
|
52 |
|
53 |
<?php $fields->font('title_font', __('Title font', 'newsletter')) ?>
|
54 |
|
55 |
+
<?php $fields->number('excerpt_length', __('Excerpt words', 'newsletter'), array('min' => 0)); ?>
|
56 |
|
57 |
<?php $fields->font('font', __('Excerpt font', 'newsletter')) ?>
|
58 |
|
59 |
<div class="tnp-field-row">
|
60 |
+
<label class="tnp-row-label"><?php _e('Dates and images', 'newsletter') ?></label>
|
61 |
<div class="tnp-field-col-2">
|
62 |
<?php $fields->checkbox('show_image', __('Show image', 'newsletter')) ?>
|
63 |
</div>
|
71 |
<div class="tnp-field-col-2">
|
72 |
<?php $fields->select_number('max', __('Max posts', 'newsletter'), 1, 40); ?>
|
73 |
</div>
|
74 |
+
<div class="tnp-field-col-2">
|
75 |
+
<?php $fields->select_number('post_offset', __('Posts offset', 'newsletter'), 0, 20); ?>
|
76 |
</div>
|
77 |
</div>
|
78 |
|
82 |
|
83 |
<?php $fields->section(__('Filters', 'newsletter')) ?>
|
84 |
<?php $fields->categories(); ?>
|
85 |
+
<?php $fields->text('tags', __('Tags', 'newsletter'), ['description' => __('Comma separated')]); ?>
|
86 |
|
87 |
<?php $fields->block_commons() ?>
|
88 |
|
emails/blocks/posts/style.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
@media (max-width:
|
2 |
.posts-1-column {
|
3 |
width: 100%!important;
|
4 |
}
|
1 |
+
@media (max-width: 525px) {
|
2 |
.posts-1-column {
|
3 |
width: 100%!important;
|
4 |
}
|
emails/images/automated.png
ADDED
Binary file
|
emails/theme.php
CHANGED
@@ -71,29 +71,36 @@ $themes = $module->themes->get_all_with_data();
|
|
71 |
<?php $controls->init(); ?>
|
72 |
<?php $controls->hidden('theme'); ?>
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
<div class="tnp-theme-preview">
|
77 |
-
<p><?php echo _e('Responsive Drag & Drop Composer', 'newsletter') ?></p>
|
78 |
-
<a href="<?php echo $module->get_admin_page_url('composer'); ?>" style="margin-right: 20px; margin-bottom: 20px">
|
79 |
-
<img class="tnp-theme-composer" src="<?php echo plugins_url('newsletter') . '/emails/images/composer.gif' ?>">
|
80 |
-
</a>
|
81 |
-
</div>
|
82 |
-
|
83 |
-
<div class="tnp-theme-preview">
|
84 |
-
<p><> Raw HTML</p>
|
85 |
-
<a href="<?php echo wp_nonce_url('admin.php?page=newsletter_emails_new&id=rawhtml', 'newsletter-new') ?>" style="margin-right: 20px; margin-bottom: 20px">
|
86 |
-
<img class="tnp-theme-html" src="<?php echo plugins_url('newsletter') . '/emails/images/html.png' ?>">
|
87 |
-
</a>
|
88 |
-
</div>
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
<h2>Classic Themes</h2>
|
92 |
|
93 |
<?php foreach ($themes as $id => $data) { ?>
|
94 |
<div class="tnp-theme-preview">
|
95 |
<p><?php echo esc_html($data['name']) ?></p>
|
96 |
-
<a href="<?php echo wp_nonce_url('admin.php?page=newsletter_emails_new&id=' .
|
97 |
<img src="<?php echo esc_attr($data['screenshot']) ?>">
|
98 |
</a>
|
99 |
</div>
|
71 |
<?php $controls->init(); ?>
|
72 |
<?php $controls->hidden('theme'); ?>
|
73 |
|
74 |
+
<div class="tnp-themes-new">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
+
<div class="tnp-theme-preview">
|
77 |
+
<p><?php echo _e('Responsive Drag & Drop Composer', 'newsletter') ?></p>
|
78 |
+
<a href="<?php echo $module->get_admin_page_url('composer'); ?>" style="margin-right: 20px; margin-bottom: 20px">
|
79 |
+
<img class="tnp-theme-composer" src="<?php echo plugins_url('newsletter') . '/emails/images/composer.gif' ?>">
|
80 |
+
</a>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<div class="tnp-theme-preview">
|
84 |
+
<p><> Raw HTML</p>
|
85 |
+
<a href="<?php echo wp_nonce_url('admin.php?page=newsletter_emails_new&id=rawhtml', 'newsletter-new') ?>" style="margin-right: 20px; margin-bottom: 20px">
|
86 |
+
<img class="tnp-theme-html" src="<?php echo plugins_url('newsletter') . '/emails/images/html.png' ?>">
|
87 |
+
</a>
|
88 |
</div>
|
89 |
+
|
90 |
+
<div class="tnp-theme-preview">
|
91 |
+
<p>Automatic</p>
|
92 |
+
<a href="https://www.thenewsletterplugin.com/automated?utm_source=plugin&utm_campaign=automated&utm_medium=themes" style="margin-right: 20px; margin-bottom: 20px">
|
93 |
+
<img class="tnp-theme-html" src="<?php echo plugins_url('newsletter') . '/emails/images/automated.png' ?>">
|
94 |
+
</a>
|
95 |
+
</div>
|
96 |
+
|
97 |
+
</div>
|
98 |
<h2>Classic Themes</h2>
|
99 |
|
100 |
<?php foreach ($themes as $id => $data) { ?>
|
101 |
<div class="tnp-theme-preview">
|
102 |
<p><?php echo esc_html($data['name']) ?></p>
|
103 |
+
<a href="<?php echo wp_nonce_url('admin.php?page=newsletter_emails_new&id=' . urlencode($id), 'newsletter-new') ?>" style="margin-right: 20px; margin-bottom: 20px">
|
104 |
<img src="<?php echo esc_attr($data['screenshot']) ?>">
|
105 |
</a>
|
106 |
</div>
|
emails/tnp-composer/_scripts/newsletter-builder-v2.js
CHANGED
@@ -454,7 +454,7 @@ jQuery(document).ready(function () {
|
|
454 |
break;
|
455 |
}
|
456 |
case 'title': {
|
457 |
-
element = "<
|
458 |
break;
|
459 |
}
|
460 |
}
|
454 |
break;
|
455 |
}
|
456 |
case 'title': {
|
457 |
+
element = "<textarea name='" + newInputName + "' class='" + className + "-textarea' rows='2'>" + value + "</textarea>";
|
458 |
break;
|
459 |
}
|
460 |
}
|
emails/tnp-composer/css/newsletter.css
CHANGED
@@ -10,7 +10,7 @@ img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;
|
|
10 |
table{border-collapse:collapse !important;}
|
11 |
img.aligncenter{display:block;margin:0 auto;}
|
12 |
|
13 |
-
@media
|
14 |
|
15 |
/* ALLOWS FOR FLUID TABLES */
|
16 |
table[class="wrapper"]{
|
@@ -53,6 +53,7 @@ img.aligncenter{display:block;margin:0 auto;}
|
|
53 |
/* FULL-WIDTH TABLES */
|
54 |
table[class="responsive-table"]{
|
55 |
width:100%!important;
|
|
|
56 |
}
|
57 |
|
58 |
/* UTILITY CLASSES FOR ADJUSTING PADDING ON MOBILE */
|
10 |
table{border-collapse:collapse !important;}
|
11 |
img.aligncenter{display:block;margin:0 auto;}
|
12 |
|
13 |
+
@media all and (max-width: 525px) {
|
14 |
|
15 |
/* ALLOWS FOR FLUID TABLES */
|
16 |
table[class="wrapper"]{
|
53 |
/* FULL-WIDTH TABLES */
|
54 |
table[class="responsive-table"]{
|
55 |
width:100%!important;
|
56 |
+
max-width: 100%!important;
|
57 |
}
|
58 |
|
59 |
/* UTILITY CLASSES FOR ADJUSTING PADDING ON MOBILE */
|
includes/addon.php
CHANGED
@@ -23,7 +23,7 @@ class NewsletterAddon {
|
|
23 |
}
|
24 |
add_action('newsletter_init', array($this, 'init'));
|
25 |
//Load translations from specific addon /languages/ directory
|
26 |
-
|
27 |
}
|
28 |
|
29 |
/**
|
@@ -32,7 +32,7 @@ class NewsletterAddon {
|
|
32 |
* @param bool $first_install
|
33 |
*/
|
34 |
function upgrade($first_install = false) {
|
35 |
-
|
36 |
}
|
37 |
|
38 |
/**
|
@@ -40,7 +40,7 @@ class NewsletterAddon {
|
|
40 |
* fires the <code>newsletter_init</code> event.
|
41 |
*/
|
42 |
function init() {
|
43 |
-
|
44 |
}
|
45 |
|
46 |
/**
|
@@ -112,6 +112,7 @@ class NewsletterAddon {
|
|
112 |
}
|
113 |
return $r;
|
114 |
}
|
|
|
115 |
}
|
116 |
|
117 |
/**
|
@@ -175,21 +176,33 @@ class NewsletterMailerAddon extends NewsletterAddon {
|
|
175 |
* @param string $subject
|
176 |
* @return TNP_Mailer_Message
|
177 |
*/
|
178 |
-
static function get_test_message($to, $subject = '') {
|
179 |
$message = new TNP_Mailer_Message();
|
180 |
$message->to = $to;
|
181 |
$message->to_name = '';
|
182 |
-
$
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
$message->headers['X-Newsletter-Email-Id'] = '0';
|
|
|
188 |
if (empty($subject)) {
|
189 |
$message->subject = '[' . get_option('blogname') . '] Test message from Newsletter (' . date(DATE_ISO8601) . ')';
|
190 |
} else {
|
191 |
$message->subject = $subject;
|
192 |
}
|
|
|
|
|
|
|
|
|
|
|
193 |
$message->from = Newsletter::instance()->options['sender_email'];
|
194 |
$message->from_name = Newsletter::instance()->options['sender_name'];
|
195 |
return $message;
|
@@ -203,14 +216,12 @@ class NewsletterMailerAddon extends NewsletterAddon {
|
|
203 |
* @param int $count Number of message objects to create
|
204 |
* @return TNP_Mailer_Message[]
|
205 |
*/
|
206 |
-
function get_test_messages($to, $count) {
|
207 |
$messages = array();
|
208 |
for ($i = 0; $i < $count; $i++) {
|
209 |
-
$messages[] = self::get_test_message($to, '[' . get_option('blogname') . '] Test message ' . ($i + 1) . ' from Newsletter (' . date(DATE_ISO8601) . ')');
|
210 |
}
|
211 |
return $messages;
|
212 |
}
|
213 |
|
214 |
}
|
215 |
-
|
216 |
-
|
23 |
}
|
24 |
add_action('newsletter_init', array($this, 'init'));
|
25 |
//Load translations from specific addon /languages/ directory
|
26 |
+
load_plugin_textdomain('newsletter-' . $this->name, false, 'newsletter-' . $this->name . '/languages/');
|
27 |
}
|
28 |
|
29 |
/**
|
32 |
* @param bool $first_install
|
33 |
*/
|
34 |
function upgrade($first_install = false) {
|
35 |
+
|
36 |
}
|
37 |
|
38 |
/**
|
40 |
* fires the <code>newsletter_init</code> event.
|
41 |
*/
|
42 |
function init() {
|
43 |
+
|
44 |
}
|
45 |
|
46 |
/**
|
112 |
}
|
113 |
return $r;
|
114 |
}
|
115 |
+
|
116 |
}
|
117 |
|
118 |
/**
|
176 |
* @param string $subject
|
177 |
* @return TNP_Mailer_Message
|
178 |
*/
|
179 |
+
static function get_test_message($to, $subject = '', $type = '') {
|
180 |
$message = new TNP_Mailer_Message();
|
181 |
$message->to = $to;
|
182 |
$message->to_name = '';
|
183 |
+
if (empty($type) || $type == 'html') {
|
184 |
+
$message->body = "<!DOCTYPE html>\n";
|
185 |
+
$message->body .= "This is the rich text (HTML) version of a test message.</p>\n";
|
186 |
+
$message->body .= "This is a <strong>bold text</strong></p>\n";
|
187 |
+
$message->body .= "This is a <a href='http://www.thenewsletterplugin.com'>link to www.thenewsletterplugin.com</a></p>\n";
|
188 |
+
}
|
189 |
+
|
190 |
+
if (empty($type) || $type == 'text') {
|
191 |
+
$message->body_text = 'This is the TEXT version of a test message. You should see this message only if you email client does not support the rich text (HTML) version.';
|
192 |
+
}
|
193 |
+
|
194 |
$message->headers['X-Newsletter-Email-Id'] = '0';
|
195 |
+
|
196 |
if (empty($subject)) {
|
197 |
$message->subject = '[' . get_option('blogname') . '] Test message from Newsletter (' . date(DATE_ISO8601) . ')';
|
198 |
} else {
|
199 |
$message->subject = $subject;
|
200 |
}
|
201 |
+
|
202 |
+
if ($type) {
|
203 |
+
$message->subject .= ' - ' . $type . ' only';
|
204 |
+
}
|
205 |
+
|
206 |
$message->from = Newsletter::instance()->options['sender_email'];
|
207 |
$message->from_name = Newsletter::instance()->options['sender_name'];
|
208 |
return $message;
|
216 |
* @param int $count Number of message objects to create
|
217 |
* @return TNP_Mailer_Message[]
|
218 |
*/
|
219 |
+
function get_test_messages($to, $count, $type = '') {
|
220 |
$messages = array();
|
221 |
for ($i = 0; $i < $count; $i++) {
|
222 |
+
$messages[] = self::get_test_message($to, '[' . get_option('blogname') . '] Test message ' . ($i + 1) . ' from Newsletter (' . date(DATE_ISO8601) . ')', $type);
|
223 |
}
|
224 |
return $messages;
|
225 |
}
|
226 |
|
227 |
}
|
|
|
|
includes/composer.php
CHANGED
@@ -266,6 +266,29 @@ class TNP_Composer {
|
|
266 |
$b .= '</td></tr></table>';
|
267 |
return $b;
|
268 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
|
270 |
/**
|
271 |
* Returns a WP media ID for the specified post (or false if nothing can be found)
|
266 |
$b .= '</td></tr></table>';
|
267 |
return $b;
|
268 |
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
*
|
272 |
+
* @param TNP_Media $media
|
273 |
+
* @return string
|
274 |
+
*/
|
275 |
+
static function image($media) {
|
276 |
+
$b = '';
|
277 |
+
if ($media->link) {
|
278 |
+
$b .= '<a href="' . $media->link . '" target="_blank" style="text-decoration: none">';
|
279 |
+
}
|
280 |
+
|
281 |
+
$b .= '<img src="' . $media->url . '" width="' . $media->width . '"'
|
282 |
+
. ' height="' . $media->height . '"'
|
283 |
+
. ' alt="' . esc_attr($media->alt) . '"'
|
284 |
+
. ' border="0" style="max-width: 100%">';
|
285 |
+
|
286 |
+
if ($media->link) {
|
287 |
+
$b .= '</a>';
|
288 |
+
}
|
289 |
+
|
290 |
+
return $b;
|
291 |
+
}
|
292 |
|
293 |
/**
|
294 |
* Returns a WP media ID for the specified post (or false if nothing can be found)
|
includes/helper.php
CHANGED
@@ -218,6 +218,20 @@ function tnp_resize($media_id, $size) {
|
|
218 |
}
|
219 |
|
220 |
$absolute_file = $uploads['basedir'] . '/' . $relative_file;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
// Relative and absolute name of the thumbnail.
|
222 |
$pathinfo = pathinfo($relative_file);
|
223 |
$relative_thumb = $pathinfo['dirname'] . '/' . $pathinfo['filename'] . '-' . $width . 'x' . $height . ($crop ? '-c' : '') . '.' . $pathinfo['extension'];
|
218 |
}
|
219 |
|
220 |
$absolute_file = $uploads['basedir'] . '/' . $relative_file;
|
221 |
+
|
222 |
+
if (substr($relative_file, -4) === '.gif') {
|
223 |
+
$editor = wp_get_image_editor($absolute_file);
|
224 |
+
$new_size = $editor->get_size();
|
225 |
+
$media = new TNP_Media();
|
226 |
+
$media->width = $new_size['width'];
|
227 |
+
$media->height = $new_size['height'];
|
228 |
+
if ($media->width > $width) {
|
229 |
+
$media->set_width($width);
|
230 |
+
}
|
231 |
+
$media->url = $uploads['baseurl'] . '/' . $relative_file;
|
232 |
+
return $media;
|
233 |
+
}
|
234 |
+
|
235 |
// Relative and absolute name of the thumbnail.
|
236 |
$pathinfo = pathinfo($relative_file);
|
237 |
$relative_thumb = $pathinfo['dirname'] . '/' . $pathinfo['filename'] . '-' . $width . 'x' . $height . ($crop ? '-c' : '') . '.' . $pathinfo['extension'];
|
includes/mailer.php
CHANGED
@@ -477,16 +477,25 @@ class NewsletterDefaultSMTPMailer extends NewsletterMailer {
|
|
477 |
* @return PHPMailer
|
478 |
*/
|
479 |
function get_mailer() {
|
|
|
|
|
480 |
if ($this->mailer) {
|
481 |
return $this->mailer;
|
482 |
}
|
483 |
|
484 |
$logger = $this->get_logger();
|
485 |
$logger->debug('Setting up PHP mailer');
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
$this->mailer->IsSMTP();
|
491 |
$this->mailer->Host = $this->options['host'];
|
492 |
if (!empty($this->options['port'])) {
|
477 |
* @return PHPMailer
|
478 |
*/
|
479 |
function get_mailer() {
|
480 |
+
global $wp_version;
|
481 |
+
|
482 |
if ($this->mailer) {
|
483 |
return $this->mailer;
|
484 |
}
|
485 |
|
486 |
$logger = $this->get_logger();
|
487 |
$logger->debug('Setting up PHP mailer');
|
488 |
+
if (version_compare($wp_version, '5.4.9') > 0) {
|
489 |
+
require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php';
|
490 |
+
require_once ABSPATH . WPINC . '/PHPMailer/SMTP.php';
|
491 |
+
require_once ABSPATH . WPINC . '/PHPMailer/Exception.php';
|
492 |
+
$this->mailer = new PHPMailer\PHPMailer\PHPMailer(false);
|
493 |
+
} else {
|
494 |
+
require_once ABSPATH . WPINC . '/class-phpmailer.php';
|
495 |
+
require_once ABSPATH . WPINC . '/class-smtp.php';
|
496 |
+
$this->mailer = new PHPMailer();
|
497 |
+
}
|
498 |
+
|
499 |
$this->mailer->IsSMTP();
|
500 |
$this->mailer->Host = $this->options['host'];
|
501 |
if (!empty($this->options['port'])) {
|
includes/module.php
CHANGED
@@ -15,6 +15,7 @@ class TNP_Media {
|
|
15 |
var $width;
|
16 |
var $height;
|
17 |
var $alt;
|
|
|
18 |
|
19 |
/** Sets the width recalculating the height */
|
20 |
public function set_width($width) {
|
@@ -1664,6 +1665,12 @@ class NewsletterModule {
|
|
1664 |
$email = null;
|
1665 |
}
|
1666 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1667 |
|
1668 |
|
1669 |
$text = apply_filters('newsletter_replace', $text, $user, $email);
|
@@ -1772,6 +1779,7 @@ class NewsletterModule {
|
|
1772 |
$text = str_replace('{company_legal}', $options['footer_legal'], $text);
|
1773 |
|
1774 |
|
|
|
1775 |
//$this->logger->debug('Replace end');
|
1776 |
return $text;
|
1777 |
}
|
@@ -1822,6 +1830,7 @@ class NewsletterModule {
|
|
1822 |
if (!isset($_POST['ts']) || time() - $_POST['ts'] > 60) {
|
1823 |
return false;
|
1824 |
}
|
|
|
1825 |
if ($captcha) {
|
1826 |
$n1 = (int) $_POST['n1'];
|
1827 |
if (empty($n1)) {
|
15 |
var $width;
|
16 |
var $height;
|
17 |
var $alt;
|
18 |
+
var $link;
|
19 |
|
20 |
/** Sets the width recalculating the height */
|
21 |
public function set_width($width) {
|
1665 |
$email = null;
|
1666 |
}
|
1667 |
}
|
1668 |
+
|
1669 |
+
$initial_language = $this->get_current_language();
|
1670 |
+
|
1671 |
+
if ($user && $user->language) {
|
1672 |
+
$this->switch_language($user->language);
|
1673 |
+
}
|
1674 |
|
1675 |
|
1676 |
$text = apply_filters('newsletter_replace', $text, $user, $email);
|
1779 |
$text = str_replace('{company_legal}', $options['footer_legal'], $text);
|
1780 |
|
1781 |
|
1782 |
+
$this->switch_language($initial_language);
|
1783 |
//$this->logger->debug('Replace end');
|
1784 |
return $text;
|
1785 |
}
|
1830 |
if (!isset($_POST['ts']) || time() - $_POST['ts'] > 60) {
|
1831 |
return false;
|
1832 |
}
|
1833 |
+
|
1834 |
if ($captcha) {
|
1835 |
$n1 = (int) $_POST['n1'];
|
1836 |
if (empty($n1)) {
|
plugin.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Newsletter
|
5 |
Plugin URI: https://www.thenewsletterplugin.com/plugins/newsletter
|
6 |
Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
|
7 |
-
Version: 6.7.
|
8 |
Author: Stefano Lissa & The Newsletter Team
|
9 |
Author URI: https://www.thenewsletterplugin.com
|
10 |
Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
|
@@ -35,7 +35,7 @@ if (version_compare(phpversion(), '5.6', '<')) {
|
|
35 |
return;
|
36 |
}
|
37 |
|
38 |
-
define('NEWSLETTER_VERSION', '6.7.
|
39 |
|
40 |
global $newsletter, $wpdb;
|
41 |
|
@@ -186,6 +186,11 @@ class Newsletter extends NewsletterModule {
|
|
186 |
add_action( 'admin_enqueue_scripts', array( $this, 'hook_wp_admin_enqueue_scripts' ) );
|
187 |
}
|
188 |
|
|
|
|
|
|
|
|
|
|
|
189 |
}
|
190 |
|
191 |
}
|
@@ -422,7 +427,7 @@ class Newsletter extends NewsletterModule {
|
|
422 |
}
|
423 |
$this->save_options($this->options);
|
424 |
}
|
425 |
-
|
426 |
delete_transient("tnp_extensions_json");
|
427 |
|
428 |
return true;
|
@@ -1254,13 +1259,16 @@ class Newsletter extends NewsletterModule {
|
|
1254 |
}
|
1255 |
|
1256 |
$newsletter_page_url = get_permalink($page->ID);
|
1257 |
-
if ($language && $
|
1258 |
if (class_exists('SitePress')) {
|
1259 |
$newsletter_page_url = apply_filters('wpml_permalink', $newsletter_page_url, $language, true);
|
1260 |
}
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
|
|
|
|
|
|
1264 |
}
|
1265 |
|
1266 |
return $newsletter_page_url;
|
4 |
Plugin Name: Newsletter
|
5 |
Plugin URI: https://www.thenewsletterplugin.com/plugins/newsletter
|
6 |
Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
|
7 |
+
Version: 6.7.5
|
8 |
Author: Stefano Lissa & The Newsletter Team
|
9 |
Author URI: https://www.thenewsletterplugin.com
|
10 |
Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
|
35 |
return;
|
36 |
}
|
37 |
|
38 |
+
define('NEWSLETTER_VERSION', '6.7.5');
|
39 |
|
40 |
global $newsletter, $wpdb;
|
41 |
|
186 |
add_action( 'admin_enqueue_scripts', array( $this, 'hook_wp_admin_enqueue_scripts' ) );
|
187 |
}
|
188 |
|
189 |
+
add_action('wp_ajax_tnp_hide_promotion', function () {
|
190 |
+
update_option('newsletter_promotion', $_POST['id']);
|
191 |
+
die();
|
192 |
+
});
|
193 |
+
|
194 |
}
|
195 |
|
196 |
}
|
427 |
}
|
428 |
$this->save_options($this->options);
|
429 |
}
|
430 |
+
|
431 |
delete_transient("tnp_extensions_json");
|
432 |
|
433 |
return true;
|
1259 |
}
|
1260 |
|
1261 |
$newsletter_page_url = get_permalink($page->ID);
|
1262 |
+
if ($language && $newsletter_page_url) {
|
1263 |
if (class_exists('SitePress')) {
|
1264 |
$newsletter_page_url = apply_filters('wpml_permalink', $newsletter_page_url, $language, true);
|
1265 |
}
|
1266 |
+
if ( function_exists( 'pll_get_post' ) ) {
|
1267 |
+
$translated_page = get_permalink( pll_get_post( $page->ID ), $language );
|
1268 |
+
if ( $translated_page ) {
|
1269 |
+
$newsletter_page_url = $translated_page;
|
1270 |
+
}
|
1271 |
+
}
|
1272 |
}
|
1273 |
|
1274 |
return $newsletter_page_url;
|
profile/profile.php
CHANGED
@@ -25,10 +25,10 @@ class NewsletterProfile extends NewsletterModule {
|
|
25 |
}
|
26 |
|
27 |
function hook_newsletter_action($action, $user, $email) {
|
28 |
-
|
29 |
if (in_array($action, ['p', 'profile', 'pe', 'profile-save', 'profile_export', 'ps'])) {
|
30 |
if (!$user || $user->status != TNP_User::STATUS_CONFIRMED) {
|
31 |
-
$this->dienow('The subscriber was not found or is not confirmed.');
|
32 |
}
|
33 |
}
|
34 |
|
@@ -61,7 +61,7 @@ class NewsletterProfile extends NewsletterModule {
|
|
61 |
}
|
62 |
|
63 |
/**
|
64 |
-
*
|
65 |
* @param stdClass $user
|
66 |
*/
|
67 |
function get_profile_export_url($user) {
|
@@ -72,7 +72,7 @@ class NewsletterProfile extends NewsletterModule {
|
|
72 |
* URL to the subscriber profile edit action. This URL MUST NEVER be changed by
|
73 |
* 3rd party plugins. Plugins can change the final URL after the action has been executed using the
|
74 |
* <code>newsletter_profile_url</code> filter.
|
75 |
-
*
|
76 |
* @param stdClass $user
|
77 |
*/
|
78 |
function get_profile_url($user, $email = null) {
|
@@ -98,7 +98,7 @@ class NewsletterProfile extends NewsletterModule {
|
|
98 |
}
|
99 |
|
100 |
/**
|
101 |
-
*
|
102 |
* @param type $text
|
103 |
* @param type $key
|
104 |
* @param TNP_User $user
|
@@ -181,7 +181,7 @@ class NewsletterProfile extends NewsletterModule {
|
|
181 |
if (!$email) {
|
182 |
continue;
|
183 |
}
|
184 |
-
// 'id'=>$item->email_id,
|
185 |
$newsletters[] = array('subject' => $email->subject, 'action' => $action, 'sent' => date('Y-m-d h:i:s', $email->send_on));
|
186 |
}
|
187 |
|
@@ -197,7 +197,7 @@ class NewsletterProfile extends NewsletterModule {
|
|
197 |
|
198 |
/**
|
199 |
* Build the profile editing form for the specified subscriber.
|
200 |
-
*
|
201 |
* @param TNP_User $user
|
202 |
* @return string
|
203 |
*/
|
@@ -244,6 +244,24 @@ class NewsletterProfile extends NewsletterModule {
|
|
244 |
$buffer .= "</div>\n";
|
245 |
}
|
246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
// Profile
|
248 |
for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
|
249 |
if ($options['profile_' . $i . '_status'] == 0) {
|
@@ -335,7 +353,7 @@ class NewsletterProfile extends NewsletterModule {
|
|
335 |
/**
|
336 |
* Saves the subscriber data extracting them from the $_REQUEST and for the
|
337 |
* subscriber identified by the <code>$user</code> object.
|
338 |
-
*
|
339 |
* @return type
|
340 |
*/
|
341 |
function save_profile($user) {
|
@@ -345,6 +363,7 @@ class NewsletterProfile extends NewsletterModule {
|
|
345 |
$data = array();
|
346 |
$data['id'] = $user->id;
|
347 |
|
|
|
348 |
$options_profile = get_option('newsletter_profile', array());
|
349 |
$options_main = get_option('newsletter_main', array());
|
350 |
|
@@ -391,6 +410,12 @@ class NewsletterProfile extends NewsletterModule {
|
|
391 |
die('Wrong sex field');
|
392 |
}
|
393 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
|
395 |
// Lists. If not list is present or there is no list to choose or all are unchecked.
|
396 |
$nl = array();
|
@@ -436,7 +461,7 @@ class NewsletterProfile extends NewsletterModule {
|
|
436 |
if (isset($alert)) {
|
437 |
$user->alert = $alert;
|
438 |
} else {
|
439 |
-
$user->alert = $
|
440 |
}
|
441 |
return $user;
|
442 |
}
|
25 |
}
|
26 |
|
27 |
function hook_newsletter_action($action, $user, $email) {
|
28 |
+
|
29 |
if (in_array($action, ['p', 'profile', 'pe', 'profile-save', 'profile_export', 'ps'])) {
|
30 |
if (!$user || $user->status != TNP_User::STATUS_CONFIRMED) {
|
31 |
+
$this->dienow(__('The subscriber was not found or is not confirmed.', 'newsletter'));
|
32 |
}
|
33 |
}
|
34 |
|
61 |
}
|
62 |
|
63 |
/**
|
64 |
+
*
|
65 |
* @param stdClass $user
|
66 |
*/
|
67 |
function get_profile_export_url($user) {
|
72 |
* URL to the subscriber profile edit action. This URL MUST NEVER be changed by
|
73 |
* 3rd party plugins. Plugins can change the final URL after the action has been executed using the
|
74 |
* <code>newsletter_profile_url</code> filter.
|
75 |
+
*
|
76 |
* @param stdClass $user
|
77 |
*/
|
78 |
function get_profile_url($user, $email = null) {
|
98 |
}
|
99 |
|
100 |
/**
|
101 |
+
*
|
102 |
* @param type $text
|
103 |
* @param type $key
|
104 |
* @param TNP_User $user
|
181 |
if (!$email) {
|
182 |
continue;
|
183 |
}
|
184 |
+
// 'id'=>$item->email_id,
|
185 |
$newsletters[] = array('subject' => $email->subject, 'action' => $action, 'sent' => date('Y-m-d h:i:s', $email->send_on));
|
186 |
}
|
187 |
|
197 |
|
198 |
/**
|
199 |
* Build the profile editing form for the specified subscriber.
|
200 |
+
*
|
201 |
* @param TNP_User $user
|
202 |
* @return string
|
203 |
*/
|
244 |
$buffer .= "</div>\n";
|
245 |
}
|
246 |
|
247 |
+
if ( $this->is_multilanguage() ) {
|
248 |
+
|
249 |
+
$languages = $this->get_languages();
|
250 |
+
|
251 |
+
$buffer .= '<div class="tnp-field tnp-field-language">';
|
252 |
+
$buffer .= '<label>' . __( 'Language', 'Newsletter' ) . '</label>';
|
253 |
+
$buffer .= '<select name="nlng" class="tnp-language">';
|
254 |
+
|
255 |
+
$buffer .= '<option value="" disabled ' . ( empty( $user->language ) ? ' selected' : '' ) . '>' . __( 'Select language', 'newsletter' ) . '</option>';
|
256 |
+
foreach ( $languages as $key => $language ) {
|
257 |
+
$buffer .= '<option value="' . $key . '"' . ( $user->language == $key ? ' selected' : '' ) . '>' . $language . '</option>';
|
258 |
+
}
|
259 |
+
|
260 |
+
$buffer .= '</select>';
|
261 |
+
$buffer .= "</div>\n";
|
262 |
+
|
263 |
+
}
|
264 |
+
|
265 |
// Profile
|
266 |
for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
|
267 |
if ($options['profile_' . $i . '_status'] == 0) {
|
353 |
/**
|
354 |
* Saves the subscriber data extracting them from the $_REQUEST and for the
|
355 |
* subscriber identified by the <code>$user</code> object.
|
356 |
+
*
|
357 |
* @return type
|
358 |
*/
|
359 |
function save_profile($user) {
|
363 |
$data = array();
|
364 |
$data['id'] = $user->id;
|
365 |
|
366 |
+
$options = $this->get_option('', $this->get_current_language($user));
|
367 |
$options_profile = get_option('newsletter_profile', array());
|
368 |
$options_main = get_option('newsletter_main', array());
|
369 |
|
410 |
die('Wrong sex field');
|
411 |
}
|
412 |
}
|
413 |
+
if ( isset( $_REQUEST['nlng'] ) ) {
|
414 |
+
$languages = $this->get_languages();
|
415 |
+
if ( isset( $languages[ $_REQUEST['nlng'] ] ) ) {
|
416 |
+
$data['language'] = $_REQUEST['nlng'];
|
417 |
+
}
|
418 |
+
}
|
419 |
|
420 |
// Lists. If not list is present or there is no list to choose or all are unchecked.
|
421 |
$nl = array();
|
461 |
if (isset($alert)) {
|
462 |
$user->alert = $alert;
|
463 |
} else {
|
464 |
+
$user->alert = $options['saved'];
|
465 |
}
|
466 |
return $user;
|
467 |
}
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
|
3 |
Requires at least: 3.4.0
|
4 |
Tested up to: 5.4.2
|
5 |
-
Stable tag: 6.7.
|
6 |
Requires PHP: 5.6
|
7 |
Contributors: satollo,webagile,michael-travan
|
8 |
|
@@ -32,12 +32,12 @@ We redesigned our drag and drop composer to make your campaign creation even eas
|
|
32 |
* **Single** And **Double Opt-In** plus privacy checkbox for EU laws compliance
|
33 |
* **Subscribers lists** to fine-target your campaigns
|
34 |
* PHP API and REST API for coders and integrations
|
35 |
-
* SMTP-Ready
|
36 |
* Customizable Themes
|
37 |
* **Status panel** to check your blog mailing capability and configuration
|
38 |
* **Compatible with every SMTP plugin**: Post SMTP (aka Postman), WP Mail SMTP, Easy WP SMTP, Easy SMTP Mail, WP Mail Bank, ...
|
39 |
* **Subscribers import** from file
|
40 |
-
* Newsletter with Html and Text message versions
|
41 |
|
42 |
= Find Us =
|
43 |
|
@@ -88,7 +88,7 @@ Anyway if you configure the plugin to use external services (usually an external
|
|
88 |
|
89 |
We provide support for our plugin on [Wordpress.org forums](https://wordpress.org/support/plugin/newsletter) and through our [official forum](https://www.thenewsletterplugin.com/forums).
|
90 |
|
91 |
-
Premium Users with an active license have access to one-to-one support via our [ticketing system](https://www.thenewsletterplugin.com/support-ticket).
|
92 |
|
93 |
= Follow Us =
|
94 |
|
@@ -113,6 +113,23 @@ Thank you, The Newsletter Team
|
|
113 |
|
114 |
== Changelog ==
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
= 6.7.3 =
|
117 |
|
118 |
* Added the company_legal tag
|
@@ -174,7 +191,7 @@ Thank you, The Newsletter Team
|
|
174 |
|
175 |
= 6.6.3 =
|
176 |
|
177 |
-
* Changed the administration script enqueuing
|
178 |
* Improved the status page
|
179 |
* Added notice on page list to highlight the Newsletter dedicated page
|
180 |
|
@@ -198,7 +215,7 @@ Thank you, The Newsletter Team
|
|
198 |
* Revisited the posts block
|
199 |
* Support for the new Reports addon styles
|
200 |
* Improved the excerpt extraction
|
201 |
-
* Cancellation administrative notifications on/off switch
|
202 |
|
203 |
= 6.5.8 =
|
204 |
|
@@ -244,7 +261,7 @@ Thank you, The Newsletter Team
|
|
244 |
|
245 |
= 6.5.2 =
|
246 |
|
247 |
-
* Fixed image block
|
248 |
* Newsletter editing page with TinyMCE now saves before sending a test
|
249 |
|
250 |
= 6.5.1 =
|
2 |
Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
|
3 |
Requires at least: 3.4.0
|
4 |
Tested up to: 5.4.2
|
5 |
+
Stable tag: 6.7.5
|
6 |
Requires PHP: 5.6
|
7 |
Contributors: satollo,webagile,michael-travan
|
8 |
|
32 |
* **Single** And **Double Opt-In** plus privacy checkbox for EU laws compliance
|
33 |
* **Subscribers lists** to fine-target your campaigns
|
34 |
* PHP API and REST API for coders and integrations
|
35 |
+
* SMTP-Ready
|
36 |
* Customizable Themes
|
37 |
* **Status panel** to check your blog mailing capability and configuration
|
38 |
* **Compatible with every SMTP plugin**: Post SMTP (aka Postman), WP Mail SMTP, Easy WP SMTP, Easy SMTP Mail, WP Mail Bank, ...
|
39 |
* **Subscribers import** from file
|
40 |
+
* Newsletter with Html and Text message versions
|
41 |
|
42 |
= Find Us =
|
43 |
|
88 |
|
89 |
We provide support for our plugin on [Wordpress.org forums](https://wordpress.org/support/plugin/newsletter) and through our [official forum](https://www.thenewsletterplugin.com/forums).
|
90 |
|
91 |
+
Premium Users with an active license have access to one-to-one support via our [ticketing system](https://www.thenewsletterplugin.com/support-ticket).
|
92 |
|
93 |
= Follow Us =
|
94 |
|
113 |
|
114 |
== Changelog ==
|
115 |
|
116 |
+
= 6.7.5 =
|
117 |
+
|
118 |
+
* Added language selector on subscriber profile page on multilanguage site
|
119 |
+
* Fix multilanguage label on profile page
|
120 |
+
* Added newsletter_user_post_subscribe hook (just after saving the subscription, before saving you can use newsletter_user_subscribe)
|
121 |
+
* Added checks for WP 5.5 breaking changes
|
122 |
+
* Added new layout (big images) on posts block
|
123 |
+
* Added standard button on post block
|
124 |
+
* Minor fix on hero block
|
125 |
+
* Added support for Popup Maker (need a free addon)
|
126 |
+
|
127 |
+
= 6.7.4 =
|
128 |
+
|
129 |
+
* Improved posts block in the Automated context with more options
|
130 |
+
* Improved the unsubscribe header
|
131 |
+
* Removed the Auto-Submitted header
|
132 |
+
|
133 |
= 6.7.3 =
|
134 |
|
135 |
* Added the company_legal tag
|
191 |
|
192 |
= 6.6.3 =
|
193 |
|
194 |
+
* Changed the administration script enqueuing
|
195 |
* Improved the status page
|
196 |
* Added notice on page list to highlight the Newsletter dedicated page
|
197 |
|
215 |
* Revisited the posts block
|
216 |
* Support for the new Reports addon styles
|
217 |
* Improved the excerpt extraction
|
218 |
+
* Cancellation administrative notifications on/off switch
|
219 |
|
220 |
= 6.5.8 =
|
221 |
|
261 |
|
262 |
= 6.5.2 =
|
263 |
|
264 |
+
* Fixed image block
|
265 |
* Newsletter editing page with TinyMCE now saves before sending a test
|
266 |
|
267 |
= 6.5.1 =
|
subscription/subscription.php
CHANGED
@@ -645,6 +645,7 @@ class NewsletterSubscription extends NewsletterModule {
|
|
645 |
}
|
646 |
|
647 |
$user = $this->get_user($email);
|
|
|
648 |
|
649 |
if ($user != null) {
|
650 |
// Email already registered in our database
|
@@ -718,6 +719,8 @@ class NewsletterSubscription extends NewsletterModule {
|
|
718 |
if ($emails) {
|
719 |
$this->send_message(($user->status == Newsletter::STATUS_CONFIRMED) ? 'confirmed' : 'confirmation', $user);
|
720 |
}
|
|
|
|
|
721 |
|
722 |
return $user;
|
723 |
}
|
@@ -852,8 +855,10 @@ class NewsletterSubscription extends NewsletterModule {
|
|
852 |
}
|
853 |
$message = str_replace('{message}', $message, $template);
|
854 |
|
855 |
-
|
856 |
-
|
|
|
|
|
857 |
// Replaces tags from the template
|
858 |
$message = $this->replace($message, $user);
|
859 |
$subject = $this->replace($subject, $user);
|
645 |
}
|
646 |
|
647 |
$user = $this->get_user($email);
|
648 |
+
|
649 |
|
650 |
if ($user != null) {
|
651 |
// Email already registered in our database
|
719 |
if ($emails) {
|
720 |
$this->send_message(($user->status == Newsletter::STATUS_CONFIRMED) ? 'confirmed' : 'confirmation', $user);
|
721 |
}
|
722 |
+
|
723 |
+
$user = apply_filters('newsletter_user_post_subscribe', $user);
|
724 |
|
725 |
return $user;
|
726 |
}
|
855 |
}
|
856 |
$message = str_replace('{message}', $message, $template);
|
857 |
|
858 |
+
//$headers = array('Auto-Submitted' => 'auto-generated');
|
859 |
+
|
860 |
+
$headers = array();
|
861 |
+
|
862 |
// Replaces tags from the template
|
863 |
$message = $this->replace($message, $user);
|
864 |
$subject = $this->replace($subject, $user);
|
tnp-header.php
CHANGED
@@ -33,6 +33,21 @@ $warning = false;
|
|
33 |
|
34 |
$warning |= empty($status_options['mail']);
|
35 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
<div class="tnp-drowpdown" id="tnp-header">
|
38 |
<a href="?page=newsletter_main_index"><img src="<?php echo plugins_url('newsletter'); ?>/images/header/tnp-logo-red-header.png" class="tnp-header-logo" style="vertical-align: bottom;"></a>
|
33 |
|
34 |
$warning |= empty($status_options['mail']);
|
35 |
?>
|
36 |
+
<script>
|
37 |
+
function tnp_close_promotion() {
|
38 |
+
jQuery.post(ajaxurl + "?action=tnp_hide_promotion", {id: 'june-2020'});
|
39 |
+
document.getElementById('tnp-promotion-bar').style.display = 'none';
|
40 |
+
}
|
41 |
+
</script>
|
42 |
+
|
43 |
+
<?php if (get_option('newsletter_promotion') !== 'june-2020' && time() < gmmktime(0, 0, 0, 7, 15, 2020)) { ?>
|
44 |
+
<div id="tnp-promotion-bar">
|
45 |
+
<a href="https://www.thenewsletterplugin.com/premium?utm_source=plugin-bar&utm_campaign=june-2020" onclick="tnp_close_promotion(); return true;" target="_blank">50% discount offer until July, 15. Check it out.</a>
|
46 |
+
|
47 |
+
<a href="javascript:void(tnp_close_promotion('june-2020'))">No, thank you!</a>
|
48 |
+
</div>
|
49 |
+
<?php } ?>
|
50 |
+
|
51 |
|
52 |
<div class="tnp-drowpdown" id="tnp-header">
|
53 |
<a href="?page=newsletter_main_index"><img src="<?php echo plugins_url('newsletter'); ?>/images/header/tnp-logo-red-header.png" class="tnp-header-logo" style="vertical-align: bottom;"></a>
|
unsubscription/unsubscription.php
CHANGED
@@ -41,8 +41,11 @@ class NewsletterUnsubscription extends NewsletterModule {
|
|
41 |
die();
|
42 |
break;
|
43 |
|
|
|
44 |
case 'uc':
|
45 |
-
if ($
|
|
|
|
|
46 |
$this->unsubscribe($user, $email);
|
47 |
$url = $this->build_message_url(null, 'unsubscribed', $user, $email);
|
48 |
wp_redirect($url);
|
@@ -52,14 +55,6 @@ class NewsletterUnsubscription extends NewsletterModule {
|
|
52 |
die();
|
53 |
break;
|
54 |
|
55 |
-
case 'lu':
|
56 |
-
// List Unsubscribe - action from oneclick unsubscribe header
|
57 |
-
if ($this->one_click_list_unsubscribe_check()) {
|
58 |
-
$this->unsubscribe($user, $email);
|
59 |
-
}
|
60 |
-
die();
|
61 |
-
break;
|
62 |
-
|
63 |
case 'reactivate':
|
64 |
if ($this->antibot_form_check()) {
|
65 |
$this->reactivate($user);
|
@@ -80,7 +75,7 @@ class NewsletterUnsubscription extends NewsletterModule {
|
|
80 |
*/
|
81 |
function unsubscribe($user, $email = null) {
|
82 |
global $wpdb;
|
83 |
-
|
84 |
if ($user->status == TNP_User::STATUS_UNSUBSCRIBED) {
|
85 |
return $user;
|
86 |
}
|
@@ -92,7 +87,7 @@ class NewsletterUnsubscription extends NewsletterModule {
|
|
92 |
|
93 |
do_action('newsletter_user_unsubscribed', $user);
|
94 |
|
95 |
-
|
96 |
|
97 |
if ($email) {
|
98 |
$wpdb->update(NEWSLETTER_USERS_TABLE, array('unsub_email_id' => (int) $email->id, 'unsub_time' => time()), array('id' => $user->id));
|
@@ -214,23 +209,13 @@ class NewsletterUnsubscription extends NewsletterModule {
|
|
214 |
$list_unsubscribe_values[] = "<mailto:$unsubscribe_address?subject=unsubscribe>";
|
215 |
}
|
216 |
|
217 |
-
$unsubscribe_action_url = $this->build_action_url('
|
218 |
$list_unsubscribe_values[] = "<$unsubscribe_action_url>";
|
219 |
|
220 |
-
$headers['List-Unsubscribe-Post'] = 'List-Unsubscribe=One-Click';
|
221 |
$headers['List-Unsubscribe'] = implode(', ', $list_unsubscribe_values);
|
222 |
-
|
223 |
-
}
|
224 |
-
|
225 |
-
/**
|
226 |
-
* @return bool
|
227 |
-
*/
|
228 |
-
function one_click_list_unsubscribe_check() {
|
229 |
-
if (isset($_POST['List-Unsubscribe']) && 'One-Click' === $_POST['List-Unsubscribe'] || 'List-Unsubscribe=One-Click' === file_get_contents('php://input')) {
|
230 |
-
return true;
|
231 |
-
}
|
232 |
|
233 |
-
return
|
234 |
}
|
235 |
|
236 |
}
|
41 |
die();
|
42 |
break;
|
43 |
|
44 |
+
case 'lu': //Left for backwards compatibility, could be removed after some time
|
45 |
case 'uc':
|
46 |
+
if (isset($_POST['List-Unsubscribe']) && 'One-Click' === $_POST['List-Unsubscribe']) {
|
47 |
+
$this->unsubscribe($user, $email);
|
48 |
+
} else if ($this->antibot_form_check()) {
|
49 |
$this->unsubscribe($user, $email);
|
50 |
$url = $this->build_message_url(null, 'unsubscribed', $user, $email);
|
51 |
wp_redirect($url);
|
55 |
die();
|
56 |
break;
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
case 'reactivate':
|
59 |
if ($this->antibot_form_check()) {
|
60 |
$this->reactivate($user);
|
75 |
*/
|
76 |
function unsubscribe($user, $email = null) {
|
77 |
global $wpdb;
|
78 |
+
|
79 |
if ($user->status == TNP_User::STATUS_UNSUBSCRIBED) {
|
80 |
return $user;
|
81 |
}
|
87 |
|
88 |
do_action('newsletter_user_unsubscribed', $user);
|
89 |
|
90 |
+
|
91 |
|
92 |
if ($email) {
|
93 |
$wpdb->update(NEWSLETTER_USERS_TABLE, array('unsub_email_id' => (int) $email->id, 'unsub_time' => time()), array('id' => $user->id));
|
209 |
$list_unsubscribe_values[] = "<mailto:$unsubscribe_address?subject=unsubscribe>";
|
210 |
}
|
211 |
|
212 |
+
$unsubscribe_action_url = $this->build_action_url('uc', $user, $email);
|
213 |
$list_unsubscribe_values[] = "<$unsubscribe_action_url>";
|
214 |
|
|
|
215 |
$headers['List-Unsubscribe'] = implode(', ', $list_unsubscribe_values);
|
216 |
+
$headers['List-Unsubscribe-Post'] = 'List-Unsubscribe=One-Click';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
|
218 |
+
return $headers;
|
219 |
}
|
220 |
|
221 |
}
|
users/export.php
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
<?php
|
2 |
-
@
|
|
|
3 |
|
4 |
$options_profile = get_option('newsletter_profile');
|
5 |
$controls = new NewsletterControls();
|
6 |
-
$module = NewsletterUsers::instance();
|
7 |
|
|
|
8 |
?>
|
9 |
|
10 |
<div class="wrap" id="tnp-wrap">
|
@@ -14,10 +15,6 @@ $module = NewsletterUsers::instance();
|
|
14 |
<div id="tnp-heading">
|
15 |
|
16 |
<h2><?php _e('Export', 'newsletter') ?></h2>
|
17 |
-
<p>
|
18 |
-
<strong>The import and export functions ARE NOT for backup</strong>.
|
19 |
-
If you want to backup you should consider to backup the <code><?php echo $wpdb->prefix ?>newsletter*</code> tables.
|
20 |
-
</p>
|
21 |
|
22 |
</div>
|
23 |
|
1 |
<?php
|
2 |
+
/* @var $this NewsletterUsers */
|
3 |
+
include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
|
4 |
|
5 |
$options_profile = get_option('newsletter_profile');
|
6 |
$controls = new NewsletterControls();
|
|
|
7 |
|
8 |
+
$controls->warnings[] = 'The export cannot be used for backup and restore. <a href="https://www.thenewsletterplugin.com/documentation/developers/backup-recovery/" target="_blank">Read more</a>.';
|
9 |
?>
|
10 |
|
11 |
<div class="wrap" id="tnp-wrap">
|
15 |
<div id="tnp-heading">
|
16 |
|
17 |
<h2><?php _e('Export', 'newsletter') ?></h2>
|
|
|
|
|
|
|
|
|
18 |
|
19 |
</div>
|
20 |
|
users/index.php
CHANGED
@@ -121,6 +121,10 @@ $controls->data['search_page'] ++;
|
|
121 |
<h2><?php _e('Subscribers', 'newsletter') ?>
|
122 |
<a class="tnp-btn-h1" href="?page=newsletter_users_new"><?php _e('Add a subscriber', 'newsletter') ?></a>
|
123 |
</h2>
|
|
|
|
|
|
|
|
|
124 |
|
125 |
</div>
|
126 |
|
121 |
<h2><?php _e('Subscribers', 'newsletter') ?>
|
122 |
<a class="tnp-btn-h1" href="?page=newsletter_users_new"><?php _e('Add a subscriber', 'newsletter') ?></a>
|
123 |
</h2>
|
124 |
+
|
125 |
+
<p>
|
126 |
+
See the <a href="admin.php?page=newsletter_users_massive">maintenance panel</a> to move subscribers between list, massively delete and so on.
|
127 |
+
</p>
|
128 |
|
129 |
</div>
|
130 |
|