function nav() { global $tml; ?> <ul id="submenu" class="subsubsub"> <?php $first = true; foreach ($this->pages as $k => $p) { if (isset($p["defaultly_hidden"]) && $p["defaultly_hidden"] && $this->page != $k) { continue; } if (!$first) { echo "|"; } else { $first = false; } $query_string = TML_admin_pages_hierarchy::build_query($this->level_id, $k, $this->page == $k); ?> <li> <a href="?<?php echo attribute_escape($query_string); ?> "<?php if ($this->page == $k) { ?> class="current"<?php } ?> > <?php echo $p["display"]; ?> </a> </li> <?php } ?> </ul> <div class="clear"></div> <?php }
</strong></p></div></p> <?php } else { ?> <p><div id="message" class="error"><p><strong> <?php $tml_form_errors->list_errors(); ?> </strong></p></div></p><?php } } extract($values); ?> <form method="post" action="?<?php echo attribute_escape(TML_admin_pages_hierarchy::build_query()); ?> "> <?php wp_nonce_field("thank-me-later-admin-additional-options-message-defaults"); ?> <p><?php _e("These options can be overridden on a per-message basis.", "thankmelater"); ?> </p> <table class="form-table"> <tbody> <tr valign="top">
$values["uid"] = $tml->get_unique_id(); // append the new message $opt_messages[] = $values; if ($send_after < 0) { $tml_form_errors->add_error("send_after", __("Message Delay time must not be negative.", "thankmelater")); } if ($send_after_plus_minus < 0) { $tml_form_errors->add_error("send_after_plus_minus", __("Message Delay plus-minus time must not be negative.", "thankmelater")); } if (!$tml_form_errors->has_errors) { // no errors // update the option $tml->update_option("messages", $opt_messages); // show friendly success message $message = __("Your message has been added. %sGo to messages overview »%s", 'thankmelater'); $message = sprintf($message, '<a href="?' . attribute_escape(TML_admin_pages_hierarchy::build_query($tml_admin_messages->level_id, "overview")) . '">', '</a>'); TML_form::show_message($message, TML_form::MESSAGE_UPDATED); ### Send the sample e-mail ### if (isset($_POST["send_sample"])) { $send_sample = 1; $send_sample_email = isset($_POST["send_sample_email"]) ? $_POST["send_sample_email"] : ""; $posts = get_posts("numberposts=1&orderby=date"); $post = $posts[0]; // Create a fake, temporary comment. $comment = array('comment_post_ID' => $post->ID, 'comment_author' => '(Name)', 'comment_author_email' => $send_sample_email, 'comment_author_url' => get_option('siteurl'), 'comment_author_IP' => $_SERVER['REMOTE_ADDR'], 'comment_date' => date('Y-m-d H:i:s'), 'comment_date_gmt' => gmdate('Y-m-d H:i:s'), 'comment_content' => 'This is just a sample comment that I\'ve written', 'comment_approved' => 1, 'comment_agent' => $_SERVER['HTTP_USER_AGENT'], 'comment_type' => '', 'comment_parent' => 0, 'user_id' => 0); $comment = get_comment(wp_insert_comment($comment), OBJECT); $email_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM " . $tml->table_name("emails") . " WHERE email = %s", $send_sample_email)); if ($email_id === NULL) { // no row was found in the table: insert one; get an ID $wpdb->insert($tml->table_name("emails"), array("email" => $send_sample_email, "subscribed" => true), array("%s", "%b")); $email_id = $wpdb->insert_id;
" /> <?php if (!isset($msgid)) { ?> <input type="submit" name="draft" tabindex="24" value="<?php _e("Save as Draft", "thankmelater"); ?> " /> <?php } ?> <?php if (isset($msgid)) { ?> <a class="submitdelete deletion" style="margin-left: 25px; color: #FF0000;" href="?<?php echo attribute_escape(TML_admin_pages_hierarchy::build_query($tml_admin_messages->level_id, "delete_message") . "&msgid=" . urlencode($msgid) . "&checksum=" . urlencode($checksum)); ?> " tabindex="25"><?php _e("Delete", "thankmelater"); ?> </a> <?php } ?> </p> </form>
</table> <p><div id="message" class="error"><p><strong><?php _e("Warning! If you delete this message, thank you e-mails will not be sent for any comments associated with this message. You may set the probability of this message to 0 rather than deleting it, if you wish. Are you sure you wish to delete this message?", "thankmelater"); ?> <form method="post" action="?<?php echo attribute_escape(TML_admin_pages_hierarchy::build_query() . "&msgid=" . urlencode($msgid) . "&checksum=" . urlencode($checksum)); ?> "> <?php wp_nonce_field("thank-me-later-admin-messages-delete-message"); ?> <input type="hidden" value="yes" name="delete" /> <p><input type="submit" name="submit" value="<?php echo attribute_escape(__("Yes, delete this message", "thankmelater")); ?> " tabindex="2" /> </form> </strong></p></div></p> <p><strong><a href="?<?php echo attribute_escape(TML_admin_pages_hierarchy::build_query($tml_admin_messages->level_id, "overview")); ?> " tabindex="2"><?php _e("No, do not delete this message", "thankmelater"); ?> </a></strong></p> <?php }
$tml_install->update_table($table_name, $table["structure"], "CREATE TABLE `{$table_name}` " . $table["sql"]); ?> <p><div id="message" class="updated"><p><strong><?php printf(__("Table '%s' has been repaired.", 'thankmelater'), $table_name); ?> </strong></p></div></p> <?php } // does table need update? (checks table structure, existance) $needs_update = $tml_install->needs_update($table_name, $table["structure"]); $error = false; $status = '<span class="ok">' . __("OK", "thankmelater") . '</span>'; if ($needs_update) { $error = true; // table needs update; give link to fix table $status = '<span class="not_ok">' . sprintf(__("Error: %sRepair Table%s.", "thankmelater"), '<a href="?' . attribute_escape(TML_admin_pages_hierarchy::build_query()) . '&repair_table=' . attribute_escape(urlencode($table_name)) . '">', '</a>') . '</span>'; } // add row $parameters[] = array("error" => $error, "param_name" => sprintf(__("Table '%s'", "thankmelater"), $table_name), "status" => $status); } TML_form::show_message(sprintf(__("Need help? %sVisit the support forum%s.", 'thankmelater'), '<a href="http://infinity-infinity.com/forums/forum/3" target="_blank">', '</a>'), TML_form::MESSAGE_INFO); ?> <h3><?php _e("Environment Status", "thankmelater"); ?> </h3> <p><?php _e("The following parameters have been tested. Any parameter which may cause a problem with TML's operation will be labelled 'Error'.", "thankmelater"); ?>