Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: "Create the email" generates nothing #8636
    gilesfreeman
    Participant

    Hi Stefano,
    Did you have any luck with the debugging code?
    For the moment I’m just copy pasting to create the email.
    Thanks,
    Giles

    in reply to: "Create the email" generates nothing #8626
    gilesfreeman
    Participant

    Thankyou very much Stefano. It’s the “CE” theme. Login details sent through. I’d be very greatful. I’ll check tomorrow morning with the providor re output buffering.

    in reply to: "Create the email" generates nothing #8624
    gilesfreeman
    Participant

    Oops, Scratch that, I got it to work using theme-3. Must be a fault in my theme code. I’ll start debugging…

    
    <?php
    global $newsletter; // Newsletter object
    global $post; // Current post managed by WordPress
    
    /*
     * 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['showposts'] = (int)$theme_options['theme_max_posts'];
    if ($filters['showposts'] == 0) $filters['showposts'] = 100;
    
    // Include only posts from specified categories. Do not filter per category is no
    // one category has been selected.
    if (is_array($theme_options['theme_categories'])) {
        $filters['cat'] = implode(',', $theme_options['theme_categories']);
    }
    
    // Retrieve the posts asking them to WordPress
    $posts = get_posts($filters);
    
    // Styles
    $color = $theme_options['theme_color'];
    if (empty($color)) $color = '#777';
    
    $font = $theme_options['theme_font'];
    $font_size = $theme_options['theme_font_size'];
    
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
        <title></title>
        <style>
            * {
                font-family: <?php echo $font; ?>;
                font-size: <?php echo $font_size; ?>;
            }
    		h1 {
    		font-family:Georgia,serif !important;color:#242424;padding-bottom:15px;size:24px;line-height:26px;padding:0;margin:0;font-weight:normal;text-align:left;text-decoration:none;
    		}
    		img {width:150px;height:150px;}
        </style>
    </head>
    <body>
      
    <table style="background:#ffffff" width="600" align="center" border="0" cellpadding="0" cellspacing="0">
    
        <tbody>
    	<tr>
    	<td style="color:#363636;font:normal 11px georgia,serif;text-align:center;padding:10px 0 20px 0">
    	<?php echo $theme_options['theme_pre_message']; ?>
    	</td>
    	</tr>
    
        
    
        <tr>
        <td>
    
    	<table width="100%" align="center" border="0" cellpadding="20" cellspacing="0">
    	<tbody>
    	<tr>
    	<td style="background:#ffffff">
    	<p style="text-align:center;margin:0;padding-top:5px;padding-bottom:5px">
    	<img src="<?php echo $theme_url; ?>/images/logo.100.gif" alt="" style="width:100px !important;  height:100px !important;">
    	</p>
    	
    	<p style="color:#121212;font-family:georgia,serif;font-size:36px;text-align:center;margin:0;padding-top:5px;padding-bottom:5px;border-top:1px dotted #e1e2e3">
    	<?php bloginfo('name'); ?>
    	</p>
    	
    	<p style="color:#363636;font-family:georgia,serif;font-size:18px;text-align:center;margin:0;padding-top:5px;padding-bottom:5px;border-top:1px dotted #ebebeb">
    	<?php bloginfo('description'); ?>
    	</p>
    	
    	<p style="color:#363636;font-family:georgia,serif;font-size:12px;text-align:center;margin:0;padding-top:3px">
    	Hanoi, Vietnam
    	</p>
    
    <table cellpadding="10" style="table-layout:fixed; width:865px; color:#121212; font:normal 12px/1.5em georgia,serif; margin:0 0 0 0; padding:0 0 0 0; border-bottom:1px dotted #e1e2e3";>
    <tbody>
    
    <?php 
    $cat_args = array(
      'orderby' => 'name',
      'order' => 'ASC',
      'child_of' => 0
    );
    
    $categories =   get_categories($cat_args); 
    
    foreach($categories as $category) { 
    echo '<tr style="background:#fff;"><td><img src="'.$theme_url.'/images/white.png" alt="" style="height:50px !important; width:150px !important;"></td></tr>';
    echo '<tr>';
    echo '<td style="background:#bbe3b9; width:160px !important;">';
    echo '<h1 style="font-family:Georgia,serif !important;color:#242424;font-size:24px;line-height:26px;padding:0;margin:0;font-weight:normal;text-align:left;text-decoration:none;">' . $category->name.'</h1>';
    echo '</td">';
    echo '<td style="width:150px !important;"></td>';
    echo '<td style="width:150px !important;"></td>';
    echo '<td style="width:150px !important;"></td>';
    echo '<td style="width:150px !important;"></td>';
    echo '</tr>';
    
    	
         $post_args = array(
          'numberposts' => 5,
          'category' => $category->term_id 
        );
    echo '<tr>';
        $posts = get_posts($post_args);
    	
    	foreach ($posts as $post) {
    		setup_postdata($post);
    		$image = nt_post_image(get_the_ID());
    	?>
    	
    	<td style="vertical-align:left; margin-right:10px; margin-bottom:0; padding-right:10px!important; border-right:1px dotted #e1e2e3; background:#d6eed5;">
    	
    	<div style="height:190px !important; border-bottom: 1px solid #fff;">
    	
    	<div style="margin:0;">
    	<a target="_tab" href="<?php echo get_permalink(); ?>" target="_blank">
    	<img src="<?php echo $image; ?>" alt=""  border="0" style="vertical-align:top; padding:0px; margin:0px; display:block; width:150px; height:150px;">
    	</a>
    	</div>
    	
    	
    	<div style="display:inline-block;text-align:left;font-family:arial,sans-serif;font-size:11px;background:#bbe3b9;margin:0;padding:5px;">
    	<a target="_tab" href="<?php echo get_permalink(); ?>" style="color:#121212;font-weight:bold;text-decoration:none" target="_blank">
    	<?php echo $theme_options['theme_read_more']; ?>
    	</a>
    	</div>
    	
    	</div>
    	
    	<p style="font-family:georgia,serif;color:#242424;font-size:18px;line-height:18px;padding:0">
    	<a target="_tab" href="<?php echo get_permalink(); ?>" style="color:#242424;text-decoration:none" target="_blank">
    	<?php if (strlen($post->post_title) > 50) {
    	echo substr(the_title($before = '', $after = '', FALSE), 0, 40) . '...'; } else {
    	the_title();
    	} ?>
    	</a>
    	</p>
    	<p style="font-family:'Arial',sans-serif !important;line-height:1.5em;margin:15px 0; padding-right:10px;"><?php the_excerpt(); ?>. </p>
    	</td>
    	
    	<?php 
    	} 
    	echo '</tr>';
    } 
    ?>
    
    </tr>
    <br/>
    
    	</tbody>
    	</table>  
    	</tbody>
    	</table>  
      
    </body>
    </html>
    
    
    in reply to: "Create the email" generates nothing #8623
    gilesfreeman
    Participant

    Hi again,

    No luck I’m afraid, I tried with three standard themes still no generation.
    I feel the problem may lie with the windows server, I’m just not sure where to look.

    Thankyou,

    Giles

    in reply to: "Create the email" generates nothing #8617
    gilesfreeman
    Participant

    Hi Stefano!

    Yes, I’m using a custom theme. It displays fine in the “New Newsletter” page
    (ie location is http://sef.org.vn/newsletter/wp-admin/admin.php?page=newsletter_emails_new)
    The next step seems to be the problem – it doesnt seem to create the html email.

    in reply to: "Create the email" generates nothing #8615
    gilesfreeman
    Participant

    this is the email, generated and ready to go:
    http://gilesfreeman.com/download/create-newsletter.png

Viewing 6 posts - 1 through 6 (of 6 total)