本文整理汇总了PHP中PMF_Category::getCategoryUser方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Category::getCategoryUser方法的具体用法?PHP PMF_Category::getCategoryUser怎么用?PHP PMF_Category::getCategoryUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMF_Category
的用法示例。
在下文中一共展示了PMF_Category::getCategoryUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
$response = sprintf('<p>%s</p>', $plr->GetMsg('plmsgSearchAmount', $faqSearchResult->getNumberOfResults()));
$response .= '<ul>';
foreach ($faqSearchResult->getResultset() as $result) {
$url = sprintf('/index.php?action=artikel&cat=%d&id=%d&artlang=%s', $result->category_id, $result->id, $result->lang);
$oLink = new PMF_Link(PMF_Configuration::getInstance()->get('main.referenceURL') . $url);
$oLink->text = PMF_Utils::chopString($result->question, 15);
$oLink->itemTitle = $result->question;
$response .= sprintf('<li>%s<br /><div class="searchpreview">%s...</div></li>', $oLink->toHtmlAnchor(), PMF_Utils::chopString(strip_tags($result->answer), 10));
}
$response .= '</ul>';
$message = array('result' => $response);
} else {
$questionData = array('username' => $name, 'email' => $email, 'category_id' => $ucategory, 'question' => $question, 'is_visible' => $visibility);
$faq->addQuestion($questionData);
$questionMail = "User: " . $questionData['username'] . ", mailto:" . $questionData['email'] . "\n" . $PMF_LANG["msgCategory"] . ": " . $categories[$questionData['category_id']]["name"] . "\n\n" . wordwrap($question, 72) . "\n\n" . $faqconfig->get('main.referenceURL') . '/admin/';
$userId = $cat->getCategoryUser($questionData['category_id']);
$oUser = new PMF_User();
$oUser->getUserById($userId);
$userEmail = $oUser->getUserData('email');
$mainAdminEmail = PMF_Configuration::getInstance()->get('main.administrationMail');
$mail = new PMF_Mail();
$mail->setReplyTo($questionData['email'], $questionData['username']);
$mail->addTo($mainAdminEmail);
// Let the category owner get a copy of the message
if ($userEmail && $mainAdminEmail != $userEmail) {
$mail->addCc($userEmail);
}
$mail->subject = '%sitename%';
$mail->message = $questionMail;
$mail->send();
unset($mail);
示例2: array
$content = $content . "<br />" . $PMF_LANG["msgInfo"] . "<a href=\"http://" . PMF_String::substr($contentlink, 7) . "\" target=\"_blank\">" . $contentlink . "</a>";
}
$newData = array('lang' => $isTranslation == true ? $newLanguage : $LANGCODE, 'thema' => $thema, 'active' => FAQ_SQL_ACTIVE_NO, 'sticky' => 0, 'content' => $content, 'keywords' => $keywords, 'author' => $username, 'email' => $usermail, 'comment' => FAQ_SQL_YES, 'date' => date('YmdHis'), 'dateStart' => '00000000000000', 'dateEnd' => '99991231235959', 'linkState' => '', 'linkDateCheck' => 0);
if ($isNew) {
$categories = $categories['rubrik'];
} else {
$newData['id'] = $faqid;
$category = new PMF_Category();
$categories = $category->getCategoryIdsFromArticle($newData['id']);
}
$recordId = $faq->addRecord($newData, $isNew);
$faq->addCategoryRelations($categories, $recordId, $newData['lang']);
$sent = array();
// Let the PMF Administrator and the Category Owner to be informed by email of this new entry
foreach ($categories as $_category) {
$userId = $category->getCategoryUser($_category);
// Avoid to send multiple emails to the same owner
if (!isset($sent[$userId])) {
// TODO: Move this code to Category.php
$oUser = new PMF_User();
$oUser->getUserById($userId);
$catOwnerEmail = $oUser->getUserData('email');
$mail = new PMF_Mail();
$mail->unsetFrom();
$mail->setFrom($usermail);
$mail->addTo($faqconfig->get('main.administrationMail'));
// Let the category owner get a copy of the message
if ($faqconfig->get('main.administrationMail') != $catOwnerEmail) {
$mail->addCc($catOwnerEmail);
}
$mail->subject = '%sitename%';