first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

View File

@@ -0,0 +1,47 @@
<?php
/*
* This is a pre packaged theme options page. Every option name
* must start with "theme_" so Newsletter can distinguish them from other
* options that are specific to the object using the theme.
*
* An array of theme default options should always be present and that default options
* should be merged with the current complete set of options as shown below.
*
* Every theme can define its own set of options, the will be used in the theme.php
* file while composing the email body. Newsletter knows nothing about theme options
* (other than saving them) and does not use or relies on any of them.
*
* For multilanguage purpose you can actually check the constants "WP_LANG", until
* a decent system will be implemented.
*/
if (!defined('ABSPATH'))
exit;
$theme_defaults = array(
'theme_max_posts'=>10,
'theme_categories'=>array()
);
// Mandatory!
$controls->merge_defaults($theme_defaults);
?>
<p>This theme build an email loading all new posts after the date of the last run.</p>
<table class="form-table">
<tr>
<th>Max new posts to include</th>
<td>
<?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
</td>
</tr>
<tr>
<th>Categories</th>
<td>
<?php $controls->categories_group('theme_categories'); ?>
</td>
</tr>
</table>
<?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>

View File

@@ -0,0 +1,49 @@
<?php
global $newsletter; // Newsletter object
global $post; // Current post managed by WordPress
if (!defined('ABSPATH'))
exit;
// This file is included inside a function so it inherit all the local variables.
// Since a theme has it's own options, it must check if there is new content to send
// out.
// Inside $theme_options['last_time'] there is the time stamps of the last run
// to be used to decide if we need to stop or not.
$filters = array();
$filters['posts_per_page'] = (int)$theme_options['max_posts'];
if ($filters['posts_per_page'] == 0) $filters['posts_per_page'] = 10;
// This theme has an option with categories to be included.
if (is_array($theme_options['categories'])) {
$filters['cat'] = implode(',', $theme_options['categories']);
}
$posts = get_posts($filters);
// Retrieve the posts asking them to WordPress
$posts = get_posts($filters);
?><?php echo $theme_options['theme_opening_text']; ?>
* <?php echo $theme_options['theme_title']; ?>
<?php
foreach ($posts as $post) {
// Setup the post (WordPress requirement)
setup_postdata($post);
?>
<?php the_title(); ?>
<?php the_permalink(); ?>
<?php } ?>
<?php echo $theme_options['theme_footer_text']; ?>

View File

@@ -0,0 +1,124 @@
<?php
global $newsletter; // Newsletter object
global $post; // Current post managed by WordPress
if (!defined('ABSPATH'))
exit;
/*
* Some variabled are prepared by Newsletter Plus and are available inside the theme,
* for example the theme options used to build the email body as configured by blog
* owner.
*
* $theme_options - is an associative array with theme options: every option starts
* with "theme_" as required. See the theme-options.php file for details.
* Inside that array there are the autmated email options as well, if needed.
* A special value can be present in theme_options and is the "last_run" which indicates
* when th automated email has been composed last time. Is should be used to find if
* there are now posts or not.
*
* $is_test - if true it means we are composing an email for test purpose.
*/
// This array will be passed to WordPress to extract the posts
$filters = array();
// Maximum number of post to retrieve
$filters['posts_per_page'] = (int) $theme_options['theme_max_posts'];
if ($filters['posts_per_page'] == 0)
$filters['posts_per_page'] = 10;
// Include only posts from specified categories. Do not filter per category is no
// one category has been selected.
if (isset($theme_options['theme_categories']) && is_array($theme_options['theme_categories'])) {
$filters['cat'] = implode(',', $theme_options['theme_categories']);
}
// Retrieve the posts asking them to WordPress
$posts = get_posts($filters);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<br />
<table cellspacing="0" align="center" border="0" style="max-width:600px; width:600px; background-color: #eee;" cellpadding="0" width="600px">
<!-- Header -->
<tr style="background: #455560; background-image: url(<?php echo plugins_url('header.jpg', __FILE__); ?>); height:80px;width:600px;" cellspacing="0" border="0" align="center" cellpadding="0" width="600" height="80">
<td height="80" width="600" style="color: #fff; font-size: 30px; font-family: Arial;" align="center" valign="middle">
<?php echo get_option('blogname'); ?>
</td>
</tr>
<tr style="background: #d0d0d0; height:20px;width:600px;">
<td valign="top" height="20" width="600" bgcolor="#ffffff" align="center" style="font-family: Arial; font-size: 12px">
<?php echo get_option('blogdescription'); ?>
</td>
</tr>
<tr>
<td>
<table cellspacing="0" border="0" style="max-width:600px; width:600px; background-color: #eee;font-family:helvetica,arial,sans-serif;color:#555;font-size:13px;line-height:15px;" align="center" cellpadding="20" width="600px">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" bordercolor="" width="100%" bgcolor="#ffffff">
<?php
// Do not use &post, it leads to problems...
foreach ($posts as $post) {
// Setup the post (WordPress requirement)
setup_postdata($post);
// The theme can "suggest" a subject replacing the one configured, for example. In this case
// the theme, is there is no subject, suggest the first post title.
if (empty($theme_options['subject']))
$theme_options['subject'] = $post->post_title;
// Extract a thumbnail, return null if no thumb can be found
$image = nt_post_image(get_the_ID());
?>
<tr>
<td style="font-family: Arial; font-size: 12px">
<?php if ($image != null) { ?>
<img src="<?php echo $image; ?>" alt="picture" align="left" width="100" height="100" style="margin-right: 10px"/>
<?php } ?>
<a target="_tab" href="<?php echo get_permalink(); ?>" style="color: #000; text-decoration: none"><b><?php the_title(); ?></b></a><br />
<?php the_excerpt(); ?>
</td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
<?php if (!isset($theme_options['theme_social_disable'])) { ?>
<tr>
<td style="font-family: Arial; font-size: 12px">
<?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php'; ?>
</td>
</tr>
<?php } ?>
<tr>
<td bgcolor="#ffffff" style="font-family: Arial; font-size: 12px">
This email was sent to <b>{email}</b> because you opted in on <?php echo get_option('blogname'); ?> website.
<br />
<a target="_tab" href="{profile_url}">Manage the subscription</a> |
<a target="_tab" href="{unsubscription_url}">Unsubscribe</a>
</td>
</tr>
</table>
</body>
</html>