Please visit my site and leave your feedback: www.eventualo.net");
/**
* On plugin activation
*/
function ALO_em_install() {
if (!get_option('ALO_em_template'))
add_option('ALO_em_template', 'Hi [USER-NAME],
I have published a new post [POST-TITLE].
[POST-EXCERPT]
Please visit my site [SITE-LINK] to read it and leave your comment about it.
Hope to see you online!
[SITE-LINK]');
if (!get_option('ALO_em_lastposts'))
add_option('ALO_em_lastposts', 10);
}
register_activation_hook(__FILE__,'ALO_em_install');
/**
* Add menu pages
*/
function ALO_em_add_admin_menu() {
add_options_page('Alo EasyMail', 'Alo EasyMail', 8, 'alo-easymail-options', 'ALO_em_option_page');
add_management_page ('Alo EasyMail', 'Alo EasyMail', 8, 'alo-easymail/alo-easymail_main.php');
}
add_action('admin_menu', 'ALO_em_add_admin_menu');
/**
* Option page
*/
function ALO_em_option_page() {
global $wp_version;
if(isset($_REQUEST['submit']) and $_REQUEST['submit']) {
if(isset($_POST['content'])) {
$main_content = stripslashes($_REQUEST['content']);
$main_content = str_replace("\n", "
", $main_content);
update_option('ALO_em_template', $main_content);
}
if(isset($_POST['lastposts']) && (int)$_POST['lastposts'] > 0) update_option('ALO_em_lastposts', trim($_POST['lastposts']));
echo '
Updated.