本文整理汇总了PHP中Subscriber::updateSubscriptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Subscriber::updateSubscriptions方法的具体用法?PHP Subscriber::updateSubscriptions怎么用?PHP Subscriber::updateSubscriptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subscriber
的用法示例。
在下文中一共展示了Subscriber::updateSubscriptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$categories = array();
foreach ($all_categories as $category) {
$category['subscribed'] = false;
$categories[$category['id']] = $category;
}
$keywords = $subscriber->getKeywords();
$subscriptions_updated = false;
if (isset($_POST['save_settings'])) {
$subscribe_categories = array();
if (isset($_POST['categories']) && is_array($_POST['categories'])) {
foreach ($_POST['categories'] as $categoryId) {
if (array_key_exists($categoryId, $categories) || $categoryId === '0') {
$subscribe_categories[] = $db->real_escape_string($categoryId);
}
}
if ($subscriber->updateSubscriptions($subscribe_categories)) {
$subscriptions_updated = true;
}
}
if (isset($_POST['keywords']) && $_POST['keywords'] != $keywords) {
if ($subscriber->setKeywords($_POST['keywords'])) {
$keywords = $subscriber->getKeywords();
$subscriptions_updated = true;
}
}
if ($subscriptions_updated) {
$postman->MailSubscriptionUpdated($email, $auth);
}
} else {
$subscribe_categories = $subscriber->getSubscriptions();
}