本文整理汇总了PHP中TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::substituteSubpart方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentObjectRenderer::substituteSubpart方法的具体用法?PHP ContentObjectRenderer::substituteSubpart怎么用?PHP ContentObjectRenderer::substituteSubpart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
的用法示例。
在下文中一共展示了ContentObjectRenderer::substituteSubpart方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateMail
/**
* This Method generates a Mailcontent with $this->templatecode
* as Mailtemplate. First Line in Template represents the Mailsubject.
* The other required data can be queried from database by Parameters.
*
* @param string $orderUid The uid for the specified Order
* @param array $orderData Contaning additional data like Customer UIDs.
* @param string $templateCode Template code
*
* @return string The built Mailcontent
*/
protected function generateMail($orderUid, array $orderData, $templateCode)
{
$database = $this->getDatabaseConnection();
$markerArray = array('###ORDERID###' => $orderUid);
$content = $this->cObj->getSubpart($templateCode, '###MAILCONTENT###');
// Get The addresses
$deliveryAdress = '';
if ($orderData['cust_deliveryaddress']) {
$data = $database->exec_SELECTgetSingleRow('*', 'tt_address', 'uid = ' . (int) $orderData['cust_deliveryaddress']);
if (is_array($data)) {
$deliveryAdress = $this->makeAdressView($data, '###DELIVERY_ADDRESS###', $content);
}
}
$content = $this->cObj->substituteSubpart($content, '###DELIVERY_ADDRESS###', $deliveryAdress);
$billingAdress = '';
if ($orderData['cust_invoice']) {
$data = $database->exec_SELECTgetSingleRow('*', 'tt_address', 'uid = ' . (int) $orderData['cust_invoice']);
if (is_array($data)) {
$billingAdress = $this->makeAdressView($data, '###BILLING_ADDRESS###', $content);
$this->customermailadress = $data['email'];
}
}
$content = $this->cObj->substituteSubpart($content, '###BILLING_ADDRESS###', $billingAdress);
$content = $this->cObj->substituteSubpart($content, '###INVOICE_VIEW###', '');
/*
* Hook for processing Marker Array
*/
$hookObject = \CommerceTeam\Commerce\Factory\HookFactory::getHook('Hook/OrdermailHooks', 'generateMail');
if (is_object($hookObject) && method_exists($hookObject, 'processMarker')) {
$markerArray = $hookObject->processMarker($markerArray, $this);
}
$content = $this->cObj->substituteMarkerArray($content, $markerArray);
// Since The first line of the mail is the Subject, trim the template
return ltrim($content);
}
示例2: aclAction
/**
*
* Displays a form for editing a forum's access control lists (ACLs).
* In this form, the administrator can grant or deny read, write and moderation
* access to every frontend group.
*
* @access private
* @return string HTML content
*/
function aclAction()
{
$forumUid = intval($this->v['setACLs']);
$forumData = $this->p->getBoardData($forumUid);
if (!$this->checkActionAllowance($forumData['parentID'] == 0 ? 'category' : 'forum', 'acl')) {
return $this->displayNoAccessError();
}
if ($this->v['acl_save']) {
$this->saveAclAction();
} elseif ($this->v['acl_cancel']) {
$this->redirectToAction(array());
}
$template = $this->cObj->fileResource($this->conf['templates.']['acl']);
$groupTemplate = $this->cObj->getSubpart($template, '###GROUP_ROW###');
# Very ugly. Why does "getParentUserGroups" have to return its result as
# commaseperated list, and not as array? Well, can't change that now...
$readGroups = array_filter(explode(',', $this->tools->getParentUserGroups($forumData['grouprights_read'])), 'intval');
$writeGroups = array_filter(explode(',', $this->tools->getParentUserGroups($forumData['grouprights_write'])), 'intval');
$moderatorGroups = array_filter(explode(',', $this->tools->getParentUserGroups($forumData['grouprights_mod'])), 'intval');
$marker = array('###ANON_READ_CHECKED###' => count($readGroups) > 0 ? '' : 'checked="checked"', '###ALL_READ_CHECKED###' => count($readGroups) > 0 ? '' : 'checked="checked"', '###ALL_WRITE_CHECKED###' => count($writeGroups) > 0 ? '' : 'checked="checked"', '###FORM_ACTION###' => $this->p->pi_getPageLink($GLOBALS['TSFE']->id), '###FORUM_UID###' => $forumUid);
$template = $this->cObj->substituteMarkerArray($template, $marker);
$template = $this->cObj->substituteSubpart($template, '###GROUP_ROW###', $this->aclGetGroupRow($groupTemplate, array($readGroups, $writeGroups, $moderatorGroups)));
$template = preg_replace_callback('/###L:([A-Z_-]+)###/i', array($this, 'replaceLL'), $template);
return $template;
}
示例3: generateMail
/**
* This Method generates a Mailcontent with $this->templatecode
* as Mailtemplate. First Line in Template represents the Mailsubject.
* The other required data can be queried from database by Parameters.
*
* @param string $orderUid The uid for the specified Order
* @param array $orderData Contaning additional data like Customer UIDs.
* @param string $templateCode Template code
*
* @return string The built Mailcontent
*/
protected function generateMail($orderUid, array $orderData, $templateCode)
{
$database = $this->getDatabaseConnection();
$markerArray = array();
$markerArray['###ORDERID###'] = $orderUid;
/**
* Since The first line of the mail is the Subject, trim the template
*/
$content = ltrim($this->cObj->getSubpart($templateCode, '###MAILCONTENT###'));
// Get The addresses
$deliveryAdress = '';
if ($orderData['cust_deliveryaddress']) {
$data = $database->exec_SELECTgetSingleRow('*', 'tt_address', 'uid=' . (int) $orderData['cust_deliveryaddress']);
if (is_array($data)) {
$deliveryAdress = $this->makeAdressView($data, '###DELIVERY_ADDRESS###');
}
}
$content = $this->cObj->substituteSubpart($content, '###DELIVERY_ADDRESS###', $deliveryAdress);
$billingAdress = '';
if ($orderData['cust_invoice']) {
$data = $database->exec_SELECTgetSingleRow('*', 'tt_address', 'uid=' . (int) $orderData['cust_invoice']);
if (is_array($data)) {
$billingAdress = $this->makeAdressView($data, '###BILLING_ADDRESS###');
$this->customermailadress = $data['email'];
}
}
$content = $this->cObj->substituteSubpart($content, '###BILLING_ADDRESS###', $billingAdress);
$invoicelist = '';
$content = $this->cObj->substituteSubpart($content, '###INVOICE_VIEW###', $invoicelist);
/**
* Hook for processing Marker Array
*/
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce_ordermails/mod1/class.tx_commerce_moveordermail.php']['generateMail'])) {
GeneralUtility::deprecationLog('
hook
$GLOBALS[\'TYPO3_CONF_VARS\'][\'EXTCONF\'][\'commerce_ordermails/mod1/class.tx_commerce_moveordermail.php\'][\'generateMail\']
is deprecated since commerce 1.0.0, it will be removed in commerce 1.4.0, please use instead
$GLOBALS[\'TYPO3_CONF_VARS\'][\'EXTCONF\'][\'commerce/Classes/Hook/OrdermailHooks.php\'][\'generateMail\']
');
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce_ordermails/mod1/class.tx_commerce_moveordermail.php']['generateMail'] as $classRef) {
$hookObj = GeneralUtility::getUserObj($classRef);
if (method_exists($hookObj, 'ProcessMarker')) {
$markerArray = $hookObj->ProcessMarker($markerArray, $this);
}
}
}
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/Classes/Hook/OrdermailHooks.php']['generateMail'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/Classes/Hook/OrdermailHooks.php']['generateMail'] as $classRef) {
$hookObj = GeneralUtility::getUserObj($classRef);
if (method_exists($hookObj, 'ProcessMarker')) {
$markerArray = $hookObj->ProcessMarker($markerArray, $this);
}
}
}
$content = $this->cObj->substituteMarkerArray($content, $markerArray);
return ltrim($content);
}
示例4: array
/**
* Outputs information about a specific user for the post listing.
* @param int $uid The UID of the user whose information are to be displayed
* @param array $conf The configuration vars of the plugin
* @param bool $threadauthor TRUE, if the user is the author of the thread displayed. In
* this case, a special string telling that this user is the author
* of the thread is displayed.
* @return string The user information
*/
function ident_user($uid, $conf, $threadauthor = FALSE)
{
$userData = !is_array($uid) ? tx_mmforum_tools::get_userdata($uid) : $uid;
$template = $this->cObj->fileResource($this->conf['template.']['list_post']);
$template = $this->cObj->getSubpart($template, '###USERINFO###');
if ($template) {
$avatar = $this->getUserAvatar($userData);
$marker = array('###LLL_DELETED###' => $this->pi_getLL('user-deleted'), '###USERNAME###' => $this->cObj->stdWrap($userData[$this->getUserNameField()], $this->conf['list_posts.']['userinfo.']['username_stdWrap.']), '###USERREALNAME###' => $this->cObj->stdWrap($userData['name'], $this->conf['list_posts.']['userinfo.']['realname_stdWrap.']), '###USERRANKS###' => $this->get_userranking($uid, $conf), '###TOPICCREATOR###' => $uid == $threadauthor ? $this->cObj->stdWrap($this->pi_getLL('topic-topicauthor'), $this->conf['list_posts.']['userinfo.']['creator_stdWrap.']) : '', '###AVATAR###' => $avatar, '###LLL_REGSINCE###' => $this->pi_getLL('user-regSince'), '###LLL_POSTCOUNT###' => $this->pi_getLL('user-posts'), '###REGSINCE###' => $this->cObj->stdWrap($userData['crdate'], $this->conf['list_posts.']['userinfo.']['crdate_stdWrap.']), '###POSTCOUNT###' => intval($userData['tx_mmforum_posts']), '###USER_RATING###' => $this->isUserRating() ? $this->getRatingDisplay('fe_users', $userData['uid']) : '');
if ($userData === false) {
$template = $this->cObj->substituteSubpart($template, '###USERINFO_REGULAR###', '');
} else {
$template = $this->cObj->substituteSubpart($template, '###USERINFO_DELETED###', '');
}
// Include hooks
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['userInformation_marker'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['userInformation_marker'] as $_classRef) {
$_procObj =& GeneralUtility::getUserObj($_classRef);
$marker = $_procObj->userInformation_marker($marker, $userData, $this);
}
}
$content = $this->cObj->substituteMarkerArray($template, $marker);
} else {
if ($userData === false) {
return '<strong>' . $this->pi_getLL('user.deleted') . '</strong>';
}
$content = '<strong>' . $userData[$this->getUserNameField()] . '</strong><br />';
if ($this->conf['list_posts.']['userinfo_realName'] && $userData['name']) {
$content .= $this->cObj->wrap($userData['name'], $this->conf['list_posts.']['userinfo_realName_wrap']);
}
$userranking = $this->get_userranking($uid, $conf) . '<br />';
if ($uid == $threadauthor) {
$userranking .= $this->cObj->wrap($this->pi_getLL('topic.topicauthor'), $this->conf['list_posts.']['userinfo_topicauthor_wrap']);
}
$content .= $userranking;
if ($userData['tx_mmforum_avatar']) {
$content .= $this->tools->res_img($conf['path_avatar'] . $userData['tx_mmforum_avatar'], $conf['avatar_height'], $conf['avatar_width']);
}
$content .= $this->cObj->wrap($this->pi_getLL('user.regSince') . ': ' . date('d.m.Y', $userData['crdate']) . '<br />' . $this->pi_getLL('user.posts') . ': ' . $userData['tx_mmforum_posts'], $this->conf['list_posts.']['userinfo_content_wrap']);
}
return $content;
}
示例5: array
/**
* Displays the post queue.
* This function displays all elements of the postqueue in a list
* view.
*
* @author Martin Helmich
* @version 2007-07-21
* @return string The postqueue list content
*/
function display_postQueue()
{
$template = $this->cObj->fileResource($this->conf['template.']['postqueue']);
$template = $this->cObj->getSubpart($template, '###POSTQUEUE_LIST###');
$template_row = $this->cObj->getSubpart($template, '###POSTQUEUE_ITEM###');
$marker = array('###LLL_PUBLISH###' => $this->pi_getLL('postqueue.publishtab'), '###LLL_DELETE###' => $this->pi_getLL('postqueue.deletetab'), '###LLL_IGNORE###' => $this->pi_getLL('postqueue.ignoretab'), '###LLL_POSTTEXT###' => $this->pi_getLL('postqueue.posttext'), '###LLL_POSTQUEUE###' => $this->pi_getLL('postqueue.title'), '###LLL_PUBLISHBUTTON###' => $this->pi_getLL('postqueue.publishbutton'), '###LLL_NOITEMS###' => $this->pi_getLL('postqueue.noitems'), '###ACTION###' => $this->parent->escapeURL($this->parent->pi_getPageLink($GLOBALS['TSFE']->id)));
$template = $this->cObj->substituteMarkerArray($template, $marker);
$rContent = '';
$boards = $this->getModeratorBoards();
if (is_array($boards)) {
$res = $this->databaseHandle->exec_SELECTquery('q.*', 'tx_mmforum_postqueue q LEFT JOIN tx_mmforum_topics t ON q.post_parent = t.uid', 'q.deleted = 0 AND (t.deleted=0 OR t.uid IS NULL) AND (q.topic_forum IN (' . implode(',', $boards) . ') OR t.forum_id IN (' . implode(',', $boards) . '))', '', 'q.crdate DESC');
} elseif ($boards === true) {
$res = $this->databaseHandle->exec_SELECTquery('*', 'tx_mmforum_postqueue', 'deleted=0', '', 'crdate DESC');
}
if ($boards !== false) {
if ($this->databaseHandle->sql_num_rows($res) > 0) {
$template = $this->cObj->substituteSubpart($template, '###POSTQUEUE_NOITEMS###', '');
} else {
$template = $this->cObj->substituteSubpart($template, '###POSTQUEUE_ITEMLIST###', '');
}
while ($arr = $this->databaseHandle->sql_fetch_assoc($res)) {
$rMarker = array('###LLL_WROTE###' => $this->pi_getLL('postqueue.wrote'), '###DATE###' => $this->parent->formatDate($arr['post_time']), '###POST_TEXT###' => $this->tx_mmforum_postparser->main($this->parent, $this->conf, $this->parent->escape($arr['post_text']), 'textparser'), '###UID###' => $arr['uid'], '###POST_POSTER###' => $this->parent->linkToUserProfile($arr['post_user']), '###CHECK_DELETE###' => '', '###CHECK_IGNORE###' => $arr['hidden'] ? 'checked="checked"' : '', '###CHECK_PUBLISH###' => $arr['hidden'] ? '' : 'checked="checked"', '###FORUMPATH###' => $this->getForumLink($arr['topic_forum']));
if ($arr['topic']) {
$rMarker['###TOPIC_LINK###'] = $this->parent->escape($arr['topic_title']) . ' [' . $this->pi_getLL('postqueue.newTopic') . ']';
} else {
$tData = $this->parent->getTopicData($arr['post_parent']);
$linkParams[$this->parent->prefixId] = array('action' => 'list_post', 'tid' => $tData['uid']);
if ($this->parent->getIsRealURL()) {
$linkParams[$this->parent->prefixId]['fid'] = $tData['forum_id'];
}
$rMarker['###TOPIC_LINK###'] = $this->parent->pi_linkToPage($this->parent->escape($tData['topic_title']), $this->conf['pid_forum'], '', $linkParams);
}
$rContent .= $this->cObj->substituteMarkerArray($template_row, $rMarker);
}
$template = $this->cObj->substituteSubpart($template, '###POSTQUEUE_ITEM###', $rContent);
} else {
$template = $this->cObj->substituteSubpart($template, '###POSTQUEUE_ITEMLIST###', '');
}
return $template;
}
示例6: objDisplay
/**
* Display a poll.
* This function displays a poll. Depending on whether the user that is
* currently logged in is allowed to vote on this poll (this will be the
* case if the user has not already voted in this poll and if the poll is
* not yet expired), the user will see a set of radio buttons allowing him/her
* to choose an answering possibility, or the poll results.
*
* @return string The poll content
* @version 2007-05-22
*/
function objDisplay()
{
if ($this->piVars['poll']['vote'] == '1') {
$this->objVote();
}
$template = $this->cObj->fileResource($this->conf['template.']['polls']);
$template = $this->cObj->getSubpart($template, '###POLL_DISPLAY###');
$vote = $this->getMayVote();
if (!$vote) {
$template = $this->cObj->substituteSubpart($template, '###POLL_SUBMIT###', '');
$row_template = $this->cObj->getSubpart($template, '###POLL_ANSWER_2###');
} else {
$row_template = $this->cObj->getSubpart($template, '###POLL_ANSWER_1###');
}
$res = $this->databaseHandle->exec_SELECTquery('*', 'tx_mmforum_polls_answers', 'poll_id=' . intval($this->data['uid']) . ' AND deleted=0');
$i = 1;
$aContent = '';
while ($arr = $this->databaseHandle->sql_fetch_assoc($res)) {
$pAnswers = $arr['votes'] > 0 ? round($arr['votes'] / $this->data['votes'] * 100) : 0;
if ($this->conf['polls.']['pollBar_colorMap.'][$i]) {
$color = $this->conf['polls.']['pollBar_colorMap.'][$i];
} else {
$color = $this->conf['polls.']['pollBar_colorMap.']['default'];
}
$aMarker = array('###ANSWER_UID###' => $arr['uid'], '###ANSWER_TEXT###' => $this->p->escape($arr['answer']), '###ANSWER_COUNT###' => sprintf($this->p->pi_getLL('poll.replies'), $arr['votes'], $this->data['votes'], $pAnswers . '%'), '###ANSWER_ANSWERS###' => '<div style="width: ' . $pAnswers . '%; height:10px; background-color: ' . $color . ';"> </div>', '###ENABLE###' => '');
$aContent .= $this->cObj->substituteMarkerArray($row_template, $aMarker);
$i++;
}
$actionParams[$this->p->prefixId] = array('tid' => $this->p->piVars['tid'], 'fid' => $this->p->piVars['fid'], 'action' => 'list_post');
$actionLink = $this->p->pi_getPageLink($GLOBALS['TSFE']->id, '', $actionParams);
$marker = array('###LABEL_POLL###' => $this->p->pi_getLL('poll.title'), '###LABEL_VOTE###' => $this->p->pi_getLL('poll.vote'), '###LABEL_QUESTION###' => $this->p->pi_getLL('poll.question'), '###QUESTION###' => $this->p->escape($this->data['question']), '###EXPIRES###' => $this->data['endtime'] ? $this->p->pi_getLL('poll.expires') . ' ' . date('d. m. Y, H:i', $this->data['endtime']) : '', '###ACTION###' => $this->p->escapeURL($actionLink), '###ICON###' => $this->cObj->cObjGetSingle($this->conf['polls.']['poll_icon'], $this->conf['polls.']['poll_icon.']));
$marker['###EXPIRES###'] = $this->cObj->stdWrap($marker['###EXPIRES###'], $this->conf['polls.']['expired_stdWrap.']);
$template = $this->cObj->substituteMarkerArray($template, $marker);
$template = $this->cObj->substituteSubpart($template, '###POLL_ANSWER_1###', $aContent);
$template = $this->cObj->substituteSubpart($template, '###POLL_ANSWER_2###', '');
return $template;
}
示例7: printPosts
/**
* Prints an array of posts.
* This function prints an array of posts that are to be listed in the RSS
* feed.
* @param array $posts A numeric array of all posts that shall be listed in the
* RSS
* @return string The RSS feed as XML string
*/
function printPosts($posts)
{
$template = $this->cObj->fileResource($this->conf['template.']['rss']);
$template = $this->cObj->getSubpart($template, '###RSS_FEED###');
$rowTemplate = $this->cObj->getSubpart($template, '###RSS_POST_ITEM###');
// Include hooks
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['rss_posts'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['rss_posts'] as $_classRef) {
$_procObj =& GeneralUtility::getUserObj($_classRef);
$marker = $_procObj->rss_posts($posts, $this);
}
}
// TODO: FIXME undefined variables $mode, $param
$marker = array('###RSS_ENCODING###' => $GLOBALS['TSFE']->renderCharset, '###RSS_TITLE###' => '<![CDATA[' . $this->getFeedTitle($mode, $param) . ']]>', '###RSS_DESCRIPTION###' => $this->getFeedDescription(), '###RSS_URL###' => $this->pObj->escapeURL($this->getFeedURL()), '###RSS_GENERATOR###' => 'mm_forum powered by TYPO3', '###RSS_LASTBUILT###' => date('r'), '###RSS_LANGUAGE###' => $this->pObj->LLkey == 'default' ? 'en' : $this->pObj->LLkey);
// Include hooks
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['rss_globalMarkers'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['rss_globalMarkers'] as $_classRef) {
$_procObj =& GeneralUtility::getUserObj($_classRef);
$marker = $_procObj->rss_globalMarkers($marker, $posts, $this);
}
}
$template = $this->cObj->substituteMarkerArray($template, $marker);
$rowContent = '';
foreach ($posts as $post) {
$rowMarker = array('###RSS_TOPIC_NAME###' => $this->pObj->escape($post['topic_title']), '###RSS_POST_LINK###' => $this->getPostLink($post['post_uid']), '###RSS_POST_DATE###' => date('r', $post['post_time']), '###RSS_POST_TEXT_SHORT###' => $this->getPostTextShort($post['post_text']), '###RSS_POST_TEXT###' => $this->getPostTextComplete($post['post_text']), '###RSS_FORUM_NAME###' => $this->pObj->escape($post['forum_name']), '###RSS_POST_AUTHOR###' => $this->pObj->escape($post[$this->conf['userNameField'] ? $this->conf['userNameField'] : 'username']));
$rowContent .= $this->cObj->substituteMarkerArray($rowTemplate, $rowMarker);
// Include hooks
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['rss_itemMarkers'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['mm_forum']['forum']['rss_itemMarkers'] as $_classRef) {
$_procObj =& GeneralUtility::getUserObj($_classRef);
$rowMarker = $_procObj->rss_itemMarkers($marker, $post, $this);
}
}
}
$template = $this->cObj->substituteSubpart($template, '###RSS_POST_ITEM###', $rowContent);
return $template;
}
示例8: array
/**
* Displays information about a certain user, whose UID is submitted via GP-Vars.
* @param string $content The content of the plugin
* @param array $conf The configuration vars for the plugin
* @return string The new content of the plugin
*/
function view_profil($content, $conf)
{
$imgInfo = array('border' => $conf['img_border'], 'alt' => '', 'src' => '', 'style' => '');
#$user_id = intval($this->piVars['user_id']);
if ($this->useRealUrl() && $this->piVars['fid']) {
$user = tx_mmforum_FeUser::getByUsername($this->piVars['fid']);
} else {
$user = tx_mmforum_FeUser::getByUID($this->piVars['user_id']);
}
$template = $this->cObj->fileResource($conf['template.']['userdetail']);
$template = $this->cObj->getSubpart($template, "###USERDETAIL###");
if ($user === null) {
return $this->errorMessage($conf, $this->pi_getLL('user.error_notExist'));
}
// Language-dependent field labels
$marker = array('###LABEL_ABOUT###' => $this->pi_getLL('user.allAbout'), '###LABEL_REGDATE###' => $this->pi_getLL('user.regDate'), '###LABEL_TOTALPOSTS###' => $this->pi_getLL('user.totalPosts'), '###LABEL_LOCATION###' => $this->pi_getLL('user.location'), '###LABEL_WEBSITE###' => $this->pi_getLL('user.website'), '###LABEL_PROFESSION###' => $this->pi_getLL('user.profession'), '###LABEL_INTERESTS###' => $this->pi_getLL('user.interests'), '###LABEL_CONTACT###' => $this->pi_getLL('user.contact'), '###LABEL_POSTHISTORY###' => $this->pi_getLL('user.posthistory'), '###LABEL_10TOPICS###' => $this->pi_getLL('user.10topics'), '###LABEL_AVATAR###' => $this->pi_getLL('user.avatar'), '###LABEL_USERNAME###' => $this->pi_getLL('user.username'), '###LABEL_FIELD###' => $this->pi_getLL('user.field'), '###LABEL_VALUE###' => $this->pi_getLL('user.value'), '###LABEL_USERPROFILE###' => $this->pi_getLL('user.profile'), '###LABEL_RATING###' => $this->pi_getLL('user.rating'));
// Username
$marker['###USER###'] = $this->escape($user->gD($this->getUserNameField()));
// Date of registration
$marker['###REGDATE###'] = $this->cObj->stdWrap($user->getCrdate(), $this->conf['user_profile.']['crdate_stdWrap.']);
// Number of posts
$marker['###TOTALPOSTS###'] = $user->getPostCount();
if ($user->getPostCount() >= $this->conf['user_hotposts']) {
// Special icon for users with more than a certain number posts defined in TypoScript
$str = $this->cObj->substituteMarker($this->pi_getLL('user.hot'), '###HOTPOSTS###', $this->conf['user_hotposts']);
$imgInfo['src'] = $this->conf['path_img'] . $this->conf['images.']['5kstar'];
$imgInfo['alt'] = $str;
$imgInfo['title'] = $str;
$marker['###TOTALPOSTS###'] .= $this->buildImageTag($imgInfo);
}
// Rating
if ($this->isUserRating()) {
$marker['###RATING###'] = $this->getRatingDisplay('fe_users', $user->getUid());
} else {
$template = $this->cObj->substituteSubpart($template, '###SUBP_RATING###', '');
}
// Avatar
$marker['###AVATAR###'] = '';
if ($user->hasAvatar()) {
$marker['###AVATAR###'] = tx_mmforum_tools::res_img($user->getAvatar($conf['path_avatar']), $conf['avatar_width'], $conf['avatar_height']);
}
// E-Mail (currently deactivated)
$marker['###MAIL###'] = '';
#'<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&tx_mmforum_pi1[action]=send_mail&tx_mmforum_pi1[uid]='.$row['uid'].'"><img src="'.$conf['path_img'].'mail.gif" border="0"></a>';
// Private Messaging
if ($GLOBALS['TSFE']->fe_user->user['username'] && !(isset($conf['pm_enabled']) && intval($conf['pm_enabled']) === 0)) {
$linkParams['tx_mmforum_pi3'] = array('action' => 'message_write', 'folder' => 'inbox', 'messid' => $this->pi_getLL('realurl.pmnew'), 'userid' => $user->getUID());
$marker['###PM###'] = $this->createButton('pm', $linkParams, $this->conf['pm_id'], true);
} else {
$marker['###PM###'] = '';
}
// A link to a page presenting the last 10 posts by this user
$linkparams = array();
$linkparams[$this->prefixId] = array('action' => 'post_history', 'user_id' => $user->getUID());
if ($this->useRealUrl()) {
unset($linkparams[$this->prefixId]['user_id']);
$linkparams[$this->prefixId]['fid'] = $user->getUsername();
}
$marker['###10POSTS###'] = $this->pi_linkToPage($this->pi_getLL('user.lastPostsLink'), $GLOBALS['TSFE']->id, '', $linkparams) . '<br />';
// A list of the last 10 topic created by this user
$marker['###10TOPICS###'] = $this->view_last_10_topics($user->getUID());
// The number of topics created by this user (currently not used?)
$res = $this->databaseHandle->exec_SELECTquery('COUNT(uid)', 'tx_mmforum_topics', "topic_poster='{$user->getUID()}'" . $this->getStoragePIDQuery());
list($topic_num) = $this->databaseHandle->sql_fetch_row($res);
$marker['###THEMEN###'] = "<strong>" . $topic_num . "</strong>";
// The last post made by this user (currently not used?)
$res = $this->databaseHandle->exec_SELECTquery('uid,topic_id', 'tx_mmforum_posts', "deleted='0' AND hidden='0' AND poster_id='{$user->getUID()}'" . $this->getStoragePIDQuery(), '', 'crdate DESC', '1');
list($lastpost_id, $lastpost_topic_id) = $this->databaseHandle->sql_fetch_row($res);
$res = $this->databaseHandle->exec_SELECTquery('topic_title', 'tx_mmforum_topics', "uid='{$lastpost_topic_id}'" . $this->getStoragePIDQuery());
list($lastpost_topic_name) = $this->databaseHandle->sql_fetch_row($res);
$lastpost_topic_name = str_replace('<', '<', $lastpost_topic_name);
$lastpost_topic_name = str_replace('>', '>', $lastpost_topic_name);
// User defined fields
$userField_template = $this->cObj->getSubpart($template, '###USERFIELDS###');
$userField_content = '';
$userField_private = $this->getIsAdmin() || $this->getIsMod() ? '' : ' AND f.public=1';
/*$res = $this->databaseHandle->exec_SELECTquery(
'f.*,c.field_value',
'tx_mmforum_userfields f, tx_mmforum_userfields_contents c',
'f.hidden=0 AND f.deleted=0 AND c.deleted=0 AND c.field_id=f.uid AND c.user_id='.$user_id.$userField_private,
'',
'f.sorting DESC'
);*/
$res = $this->databaseHandle->exec_SELECTquery('*', 'tx_mmforum_userfields f', 'f.hidden=0 AND f.deleted=0' . $userField_private, '', 'sorting DESC');
$parser = GeneralUtility::makeInstance('t3lib_TSparser');
while ($arr = $this->databaseHandle->sql_fetch_assoc($res)) {
$cRes = $this->databaseHandle->exec_SELECTquery('field_value', 'tx_mmforum_userfields_contents c', 'c.deleted=0 AND c.field_id=' . $arr['uid'] . ' AND c.user_id=' . $user->getUid());
if ($this->databaseHandle->sql_num_rows($cRes)) {
list($fieldContent) = $this->databaseHandle->sql_fetch_row($cRes);
$arr['field_value'] = $fieldContent;
} else {
$fieldContent = '';
}
$parser->setup = array();
//.........这里部分代码省略.........