Beispiel #1
0
}

if ($f_default_alias != $publicationObj->getDefaultAliasId()) {
	camp_is_alias_conflicting($f_default_alias);
}
if ($f_name != $publicationObj->getName()) {
	camp_is_publication_conflicting($f_name);
}

if (camp_html_has_msgs()) {
      camp_html_goto_page($backLink);
}

$forum = new Phorum_forum($publicationObj->getForumId());
if (!$forum->exists()) {
	$forum = camp_forum_create($publicationObj);
}
$forum->setName($f_name);
$forum->setIsVisible($f_comments_enabled);
$publicationObj->setPublicComments($f_comments_public_enabled);

$setting = new Phorum_setting('mod_emailcomments', 'S');
if (!$setting->exists()) {
	$setting->create();
}
$setting->update(array('addresses' => array($forum->getForumId() => $f_comments_moderator_to)));
$setting->update(array('from_addresses' => array($forum->getForumId() => $f_comments_moderator_from)));

$columns = array('Name' => $f_name,
				 'IdDefaultAlias' => $f_default_alias,
				 'IdDefaultLanguage' => $f_language,
Beispiel #2
0
				 'UnitCost' => $f_unit_cost,
				 'UnitCostAllLang' => $f_unit_cost_all_lang,
				 'Currency' => $f_currency,
                 'comments_enabled' => $f_comments_enabled,
			     'comments_article_default_enabled'=> $f_comments_article_default,
			     'comments_subscribers_moderated' => $f_comments_subscribers_moderated,
			     'comments_public_moderated' => $f_comments_public_moderated,
			     'comments_captcha_enabled' => $f_comments_captcha_enabled,
				 'comments_spam_blocking_enabled' => $f_comments_spam_blocking_enabled,
                 'seo' => serialize($f_seo));

$created = $publicationObj->create($columns);
if ($created) {
	$alias->setPublicationId($publicationObj->getPublicationId());

	$forum = camp_forum_create($publicationObj, $f_comments_public_enabled);
	camp_forum_update($forum, $f_name, $f_comments_enabled, $f_comments_public_enabled);
	$setting = new Phorum_setting('mod_emailcomments', 'S');
	if (!$setting->exists()) {
		$setting->create();
	}
	$setting->update(array('addresses' => array($forum->getForumId() => $f_comments_moderator_to)));
	$setting->update(array('from_addresses' => array($forum->getForumId() => $f_comments_moderator_from)));

	camp_html_add_msg("Publication created.", "ok");
	camp_html_goto_page("/$ADMIN/pub/edit.php?Pub=".$publicationObj->getPublicationId());
} else {
	$alias->delete();
	camp_html_add_msg(getGS('The publication could not be added.'));
	camp_html_goto_page($backLink);
}