本文整理汇总了PHP中XenForo_Helper_String::autoLinkPlainText方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Helper_String::autoLinkPlainText方法的具体用法?PHP XenForo_Helper_String::autoLinkPlainText怎么用?PHP XenForo_Helper_String::autoLinkPlainText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Helper_String
的用法示例。
在下文中一共展示了XenForo_Helper_String::autoLinkPlainText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: helperBodyText
/**
* Prepares simple body text with word wrap, censoring, and nl2br.
* HTML/BB code is not parsed within string.
*
* @param string $string
*
* @return string
*/
public static function helperBodyText($string)
{
$string = XenForo_Helper_String::censorString($string);
$string = XenForo_Helper_String::autoLinkPlainText(htmlspecialchars($string));
return nl2br($string);
}
示例2: prepareField
public function prepareField(array $field, $editMode = true, $viewingUser = null)
{
$this->standardizeViewingUserReference($viewingUser);
if (!empty($field)) {
$field['title'] = XenForo_Helper_String::censorString($field['title']);
$field['description'] = XenForo_Helper_String::censorString($field['description']);
$field['isMultiChoice'] = $field['field_type'] === 'checkbox' || $field['field_type'] === 'multiselect';
if (!empty($field['field_choices']) && !is_array($field['field_choices'])) {
$field['fieldChoices'] = @unserialize($field['field_choices']);
}
if (isset($field['field_value'])) {
if ($field['isMultiChoice']) {
if (is_string($field['field_value'])) {
$field['field_value'] = @unserialize($field['field_value']);
} else {
if (!is_array($field['field_value'])) {
$field['field_value'] = array();
}
}
}
if ($field['match_type'] === 'url' && $editMode === false) {
$field['field_value'] = XenForo_Helper_String::autoLinkPlainText($field['field_value']);
}
$field['hasValue'] = is_string($field['field_value']) && $field['field_value'] !== '' || !is_string($field['field_value']) && $field['field_value'];
} else {
$field['hasValue'] = false;
}
if (!is_array($field['category'])) {
$field['category'] = @unserialize($field['category']);
}
if (!is_array($field['content'])) {
$field['content'] = @unserialize($field['content']);
}
}
return $field;
}
示例3: prepareCamera
public function prepareCamera(array $camera)
{
if ($camera) {
if (!empty($camera['camera_data'])) {
$camera['camera_data'] = @unserialize($camera['camera_data']);
foreach ($camera['camera_data'] as $key => &$data) {
$data = array('name' => new XenForo_Phrase('sonnb_xengallery_camera_data__' . $key), 'value' => Zend_Uri::check($data) ? XenForo_Helper_String::autoLinkPlainText($data) : $data);
}
if (!isset($camera['photo_count'])) {
$camera['photo_count'] = $this->countCameras(array('camera_name' => $camera['camera_name']));
}
$camera['camera_data']['total_photos'] = array('name' => new XenForo_Phrase('sonnb_xengallery_camera_data__total_photos'), 'value' => $camera['photo_count']);
}
}
return $camera;
}