[Plugin: ALO EasyMail Newsletter] Enabling PHP code on Newsletter themes
-
Hi,
First of all, thank you Alessandro Massasso for such great plugin ;).
I’m using ALO EasyMail Newsletter 2.2.1. I need using custom fields to extend this plugin and I resolved it editing this 2 lines on alo-easymail_functions.php. With this hack you will be able to use PHP on your themes and, of course, you will be able to use custom fields.
Replace this:
>>>
$html = file_get_contents( $theme_path );
>>>By these others:
>>>
ob_start();
require( $theme_path );
$html = ob_get_clean();
>>>And this other one:
>>>
$themes = glob( $dir. “*.{htm,html}”, GLOB_BRACE );
>>>By the next:
>>>
$themes = glob( $dir. “*.{htm,html,php}”, GLOB_BRACE );
>>>In the theme file you are going to need the folder URL of the theme, and we know that it’s not the same if we are sending an email than if we are reading the newsletter online. Here is how I get it (put this code on the top of your theme main file):
>>>
<?php
$newsletter_data_folder = “”;
if( empty( $theme ) ){ //$theme cames from alo-easymail_functions.php
$newsletter_data_folder = get_bloginfo(“template_url”).”/alo-easymail-themes/your_newsletter_name”;
}else{
$newsletter_data_folder = str_replace( “.php”, “”, $theme );
}
?>
>>>All done! ??
- The topic ‘[Plugin: ALO EasyMail Newsletter] Enabling PHP code on Newsletter themes’ is closed to new replies.