当前位置: 首页>>代码示例>>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;未经允许,请勿转载。