本文整理汇总了PHP中CBuser::replaceUserVars方法的典型用法代码示例。如果您正苦于以下问题:PHP CBuser::replaceUserVars方法的具体用法?PHP CBuser::replaceUserVars怎么用?PHP CBuser::replaceUserVars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBuser
的用法示例。
在下文中一共展示了CBuser::replaceUserVars方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cbReplaceVars
/**
* Replaces [fieldname] by the content of the user row (except for [password])
*
* @param string $msg
* @param stdClass $row
* @param boolean|array $htmlspecialchars on replaced values only: FALSE : no htmlspecialchars, TRUE: do htmlspecialchars, ARRAY: callback method
* @param boolean $menuStats
* @param array $extraStrings
* @param boolean $translateLanguage on $msg only
* @return string
*/
function cbReplaceVars($msg, &$row, $htmlspecialchars = true, $menuStats = true, $extraStrings = null, $translateLanguage = true)
{
if ($extraStrings === null) {
$extraStrings = array();
}
if (isset($row->id) && is_object($row) && strtolower(get_class($row)) == 'moscomprofileruser') {
$cbUser =& CBuser::getInstance($row->id);
} else {
$cbUser = new CBuser();
$cbUser->loadCbRow($row);
}
return $cbUser->replaceUserVars($msg, $htmlspecialchars, $menuStats, $extraStrings, $translateLanguage);
}
示例2: cbReplaceVars
/**
* Replaces [fieldname] by the content of the user row (except for [password])
*
* @param string $msg
* @param UserTable|\stdClass $row
* @param boolean|array $htmlspecialchars on replaced values only: FALSE : no htmlspecialchars, TRUE: do htmlspecialchars, ARRAY: callback method
* @param boolean $menuStats
* @param array $extraStrings
* @param boolean $translateLanguage on $msg only
* @return string
*/
function cbReplaceVars($msg, $row, $htmlspecialchars = true, $menuStats = true, $extraStrings = null, $translateLanguage = true)
{
if ($extraStrings === null) {
$extraStrings = array();
}
if (isset($row->id) && is_object($row) && $row instanceof UserTable) {
$cbUser =& CBuser::getInstance($row->id);
} else {
$cbUser = new CBuser();
$cbUser->loadCbRow($row);
}
return $cbUser->replaceUserVars($msg, $htmlspecialchars, $menuStats, $extraStrings, $translateLanguage);
}
示例3: getSubstituteString
/**
* Parses a string using trigger specific substitution information
*
* @param $string
* @param bool $htmlspecialchars
* @param array|bool $translate
* @return string
*/
public function getSubstituteString( $string, $htmlspecialchars = true, $translate = true )
{
if ( $this->get( '_password' ) ) {
$string = str_ireplace( '[password]', $this->get( '_password' ), $string );
}
if ( $this->get( '_cbuser' ) ) {
$string = $this->_cbuser->replaceUserVars( $string, $htmlspecialchars, false, $this->get( '_extras' ), $translate );
}
if ( $this->getParams()->get( 'format', false, GetterInterface::BOOLEAN ) ) {
$string = cbautoactionsClass::formatCondition( $string, $this->get( '_vars' ) );
}
return $string;
}