本文整理汇总了PHP中Newsletter::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Newsletter::delete方法的具体用法?PHP Newsletter::delete怎么用?PHP Newsletter::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Newsletter
的用法示例。
在下文中一共展示了Newsletter::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
function delete($id = FALSE)
{
if ($id) {
$newsletter = new Newsletter($id);
$newsletter->delete();
set_notify('success', lang('delete_data_complete'));
}
redirect('newsletters/admin/newsletters');
}
示例2: edit
/**
* Diese Methode nimmt umfangreiche Pruefungen der uebergebenen GET- und POST-Parameter
* vor und veranlasst jede nur moegliche Veraenderung der Newsletter und ihrer
* Eintraege.
* @return string entstehende Ausgaben und Fehlermeldungen
*/
protected function edit()
{
$rueckgabe = "";
// ggf. Newsletter loeschen
if (array_key_exists("deleteNewsletter", $_GET) && strlen($_GET['deleteNewsletter']) > 0) {
$tmp = new Newsletter($_GET['deleteNewsletter']);
if ($tmp->delete()) {
$rueckgabe .= $this->text->get_text("newsletter_delete_success");
} else {
$rueckgabe .= $this->text->get_text("newsletter_delete_error");
}
}
// neuen Newsletter erstellen
if (array_key_exists("newNewsletter", $_GET)) {
$id = Newsletter::create();
}
// fertigen Newsletter versenden
if (array_key_exists("sendNewsletter", $_GET)) {
if (array_key_exists("senderAddress", $_GET) && strlen($_GET['senderAddress']) > 0) {
// Schritt 2: Newsletter wirklich absenden
$newsletter_id = $_GET['sendNewsletter'];
$tmp = new Newsletter($newsletter_id);
$tmp->update_timestamp();
$rueckgabe = $tmp->send();
// $rueckgabe.= $this->text->get_text( "newsletter_send_success_01").$count."<br />";
// $count = $this->db->query("SELECT count(email) FROM ".PREFIX."newsletter");
// $rueckgabe.= $this->text->get_text( "newsletter_send_success_02").$count[0]['count(email)'];
} else {
// Schritt 1: Absender auswaehlen
$params = explode(";", SENDER_ADDRESS);
$rueckgabe .= $this->execute_view(ROOT_PATH . "admin/confirm_sending.view.php", $params);
}
}
// neuen Eintrag zu einem Newsletter anlegen
if (array_key_exists("newEntry", $_GET) && array_key_exists("edit", $_GET) && strlen($_GET['edit']) > 0) {
$tmp = new Newsletter($_GET['edit']);
$tmp->add_entry();
}
// einen Eintrag loeschen
if (array_key_exists("deleteEntry", $_GET) && strlen($_GET['deleteEntry']) > 0) {
$tmp = new Newsletter($_GET['edit']);
$erg = $tmp->delete_entry($_GET['deleteEntry']);
$rueckgabe .= $this->text->get_text("newsletter_entry_delete_success");
}
// einen bearbeiteten Eintrag speichern
$entry_id = $this->postman->get_plaintext("saveEntry");
if (!is_null($entry_id) && strlen($entry_id) > 0) {
$newsletter_id = Newsletter::get_newsletter_id_for_entry($entry_id);
if (!is_null($newsletter_id)) {
$tmp = new Newsletter($newsletter_id);
if ($tmp->save_entry()) {
$rueckgabe .= $this->text->get_text("newsletter_save_entry_success");
} else {
$rueckgabe .= $this->text->get_text("newsletter_save_entry_error");
}
}
}
// Entry hoch verschieben
if (array_key_exists("entryUp", $_GET) && strlen($_GET['entryUp']) > 0) {
$newsletter_id = Newsletter::get_newsletter_id_for_entry($_GET['entryUp']);
$tmp = new Newsletter($newsletter_id);
$tmp->entry_up($_GET['entryUp']);
}
// Entry nach unten verschieben
if (array_key_exists("entryDown", $_GET) && strlen($_GET['entryDown'] > 0)) {
$newsletter_id = Newsletter::get_newsletter_id_for_entry($_GET['entryDown']);
$tmp = new Newsletter($newsletter_id);
$tmp->entry_down($_GET['entryDown']);
}
return $rueckgabe;
}
示例3: _wpr_newsletter_delete
function _wpr_newsletter_delete()
{
global $wpdb;
$prefix = $wpdb->prefix;
$nid = $_GET['nid'];
try {
$newsletter = new Newsletter($nid);
} catch (Exception $excp) {
_wpr_set("_wpr_view", "newsletter_delete_not_found");
return;
}
if (isset($_GET['confirmed']) && $_GET['confirmed'] == 'true') {
$newsletter->delete();
$newsletter_home = Routing::newsletterHome();
wp_redirect($newsletter_home);
}
$getEmailsPendingDeliveryQuery = sprintf("SELECT COUNT(*) number FROM %swpr_queue WHERE sid=(SELECT id FROM %swpr_subscribers WHERE nid=%d) AND sent=0;", $prefix, $prefix, $nid);
$emails_pending_count_result = $wpdb->get_results($getEmailsPendingDeliveryQuery);
$number_pending = $emails_pending_count_result[0]->number;
_wpr_set("newsletter_name", $newsletter->getNewsletterName());
_wpr_set("subscriber_count", $newsletter->getNumberOfActiveSubscribers());
_wpr_set("_wpr_view", "newsletter_delete");
_wpr_set("nid", $nid);
_wpr_set("emailsPendingDelivery", $number_pending);
}
示例4: Newsletter
<?php
require_once "../../includes/functions.inc";
if ($id = Tools::valueGet("guid")) {
$news = new Newsletter($id);
$news->delete($school->getID());
}
Tools::redirect("../../news_letter.php");