本文整理汇总了PHP中PMF_Category::getCategoryIdsFromArticle方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Category::getCategoryIdsFromArticle方法的具体用法?PHP PMF_Category::getCategoryIdsFromArticle怎么用?PHP PMF_Category::getCategoryIdsFromArticle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMF_Category
的用法示例。
在下文中一共展示了PMF_Category::getCategoryIdsFromArticle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
}
$isTranslation = false;
if (!is_null($faqlanguage)) {
$isTranslation = true;
$newLanguage = $faqlanguage;
}
if (PMF_String::substr($contentlink, 7) != "") {
$answer = sprintf('%s<br /><div id="newFAQContentLink">%s<a href="http://%s" target="_blank">%s</a></div>', $answer, $PMF_LANG['msgInfo'], PMF_String::substr($contentlink, 7), $contentlink);
}
$autoActivate = PMF_Configuration::getInstance()->get('records.defaultActivation');
$newData = array('lang' => $isTranslation == true ? $newLanguage : $languageCode, 'thema' => $question, 'active' => $autoActivate ? FAQ_SQL_ACTIVE_YES : FAQ_SQL_ACTIVE_NO, 'sticky' => 0, 'content' => nl2br($answer), 'keywords' => $keywords, 'author' => $name, 'email' => $email, 'comment' => FAQ_SQL_YES, 'date' => date('YmdHis'), 'dateStart' => '00000000000000', 'dateEnd' => '99991231235959', 'linkState' => '', 'linkDateCheck' => 0);
if ($isNew) {
$categories = $categories['rubrik'];
} else {
$newData['id'] = $faqid;
$categories = $category->getCategoryIdsFromArticle($newData['id']);
}
$recordId = $faq->addRecord($newData, $isNew);
$faq->addCategoryRelations($categories, $recordId, $newData['lang']);
// Activate visits
$visits = PMF_Visits::getInstance();
$visits->add($recordId, $newData['lang']);
if ($autoActivate) {
// Add user permissions
$faq->addPermission('user', $recordId, -1);
$category->addPermission('user', $categories['rubrik'], array(-1));
// Add group permission
if ($faqconfig->get('security.permLevel') != 'basic') {
$faq->addPermission('group', $recordId, -1);
$category->addPermission('group', $categories['rubrik'], array(-1));
}