本文整理汇总了PHP中TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::substituteMarker方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentObjectRenderer::substituteMarker方法的具体用法?PHP ContentObjectRenderer::substituteMarker怎么用?PHP ContentObjectRenderer::substituteMarker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
的用法示例。
在下文中一共展示了ContentObjectRenderer::substituteMarker方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: errorMessage
/**
* Generates an error message.
* @author Martin Helmich <m.helmich@mittwald.de>
* @param array $conf The plugin's configuration vars
* @param string $message The error message
* @return string The HTML error message
*/
function errorMessage($conf, $message)
{
$templateFile = $this->cObj->fileResource($conf['template.']['login_error']);
$template = $this->cObj->getSubpart($templateFile, '###LOGINERROR###');
$marker = '';
if (is_array($message)) {
foreach ($message as $singleMessage) {
$marker .= $this->cObj->stdWrap($singleMessage, $conf['errorMessage.']);
}
} else {
$marker = $this->cObj->stdWrap($message, $conf['errorMessage.']);
}
return $this->cObj->substituteMarker($template, '###LOGINERROR_MESSAGE###', $marker);
}
示例2: main
/**
* The plugin's main function
* @author Martin Helmich <m.helmich@mittwald.de>
*
* @param string $content The content
* @param array $conf The plugin's configuration vars
* @return string The plugin content
*
* @uses getConfig
* @uses setHeaders
* @uses display
*/
function main($content, $conf)
{
$time = $this->microtime_float();
$this->init($conf);
// Configuring so caching is not expected. This value means that no cHash params are ever set.
// We do this, because it's a USER_INT object!
$this->pi_USER_INT_obj = 1;
$this->getConfig();
$this->small = $this->piVars['ext'] ? !$this->piVars['ext'] : TRUE;
$content = $this->display($content);
$time = $this->microtime_float() - $time;
if ($this->conf['debug']) {
$content .= $this->cObj->substituteMarker($this->pi_getLL('debug'), '###EXECUTIONTIME###', round($time, 4));
}
return $this->pi_wrapInBaseClass($content);
}
示例3: 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();
//.........这里部分代码省略.........