當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Subscription::AddSectionToAllSubscriptions方法代碼示例

本文整理匯總了PHP中Subscription::AddSectionToAllSubscriptions方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subscription::AddSectionToAllSubscriptions方法的具體用法?PHP Subscription::AddSectionToAllSubscriptions怎麽用?PHP Subscription::AddSectionToAllSubscriptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Subscription的用法示例。


在下文中一共展示了Subscription::AddSectionToAllSubscriptions方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: camp_is_valid_url_name

$isValidShortName = camp_is_valid_url_name($cShortName);

if (!$isValidShortName) {
	camp_html_add_msg(getGS('The $1 field may only contain letters, digits and underscore (_) character.', '"' . getGS('URL Name') . '"'));
}

$editUrl = "/$ADMIN/sections/edit.php?Pub=$Pub&Issue=$Issue&Language=$Language&Section=$Section";
if (!camp_html_has_msgs()) {
	$modified = true;
	$modified &= $sectionObj->setName($cName);
	$modified &= $sectionObj->setDescription($cDescription);
	$modified &= $sectionObj->setSectionTemplateId($cSectionTplId);
	$modified &= $sectionObj->setArticleTemplateId($cArticleTplId);

	if ($cSubs == "a") {
	$numSubscriptionsAdded = Subscription::AddSectionToAllSubscriptions($Pub, $Section);
		if ($numSubscriptionsAdded < 0) {
			$errors[] = getGS('Error updating subscriptions.');
		}
	}
	if ($cSubs == "d") {
		$numSubscriptionsDeleted = Subscription::DeleteSubscriptionsInSection($Pub, $Section);
		if ($numSubscriptionsDeleted < 0) {
			$errors[] = getGS('Error updating subscriptions.');
		}
	}

	$conflictingSection = array_pop(Section::GetSections($Pub, $Issue, $Language, $cShortName, null, null, true));
	if (is_object($conflictingSection) && ($conflictingSection->getSectionNumber() != $Section)) {
		$conflictingSectionLink = "/$ADMIN/sections/edit.php?Pub=$Pub&Issue=$Issue&Language=$Language&Section=".$conflictingSection->getSectionNumber();
開發者ID:nistormihai,項目名稱:Newscoop,代碼行數:30,代碼來源:do_edit.php

示例2: array

$sectionsConstraints = array(new ComparisonOperation('idpublication', new Operator('is'), $f_publication_id),
new ComparisonOperation('nrissue', new Operator('is'), $f_issue_number),
new ComparisonOperation('number', new Operator('is'), $f_number));
$sections = Section::GetList($sectionsConstraints, null, 0, 0, $sectionsCount, true);
if ($sectionsCount > 0) {
    $correct = false;
    $errors[] = getGS('The section number $1 was already in use.', $f_number);
}
if ($correct) {
    $newSection = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_number);
    $columns = array();
    $columns['Description'] = $f_description;
    $created = $newSection->create($f_name, $f_url_name, $columns);
    if ($created) {
	    if ($f_add_subscriptions) {
	        $numSubscriptionsAdded = Subscription::AddSectionToAllSubscriptions($f_publication_id, $f_number);
			if ($numSubscriptionsAdded == -1) {
	            $errors[] = getGS('Error updating subscriptions.');
			}
	    }
	    camp_html_goto_page("/$ADMIN/sections/edit.php?Pub=$f_publication_id&Issue=$f_issue_number&Language=$f_language_id&Section=".$newSection->getSectionNumber());
    }
}

$tmpArray = array('Pub' => $publicationObj, 'Issue' => $issueObj);
camp_html_content_top(getGS('Adding new section'), $tmpArray);
?>

<P>
<CENTER>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box" ALIGN="CENTER">
開發者ID:nistormihai,項目名稱:Newscoop,代碼行數:31,代碼來源:do_add.php


注:本文中的Subscription::AddSectionToAllSubscriptions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。