本文整理汇总了PHP中MyTextSanitizer::displayTarea方法的典型用法代码示例。如果您正苦于以下问题:PHP MyTextSanitizer::displayTarea方法的具体用法?PHP MyTextSanitizer::displayTarea怎么用?PHP MyTextSanitizer::displayTarea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyTextSanitizer
的用法示例。
在下文中一共展示了MyTextSanitizer::displayTarea方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayTarea
/**
* Filters textarea form data in DB for display
*
* @param string $text
* @param bool $html allow html?
* @param bool $smiley allow smileys?
* @param bool $xcode allow xoopscode?
* @param bool $image allow inline images?
* @param bool $br convert linebreaks?
* @return string
**/
function displayTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1, $nbsp = 0)
{
$this->nbsp = $nbsp;
$text = parent::displayTarea($text, $html, $smiley, $xcode, $image, $br);
return $this->postCodeDecode($text, $image);
/* if ($html != 1) {
// html not allowed
$text =& $this->htmlSpecialChars($text);
}
$text =& $this->makeClickable($text);
if ($smiley != 0) {
// process smiley
$text =& $this->smiley($text);
}
if ($xcode != 0) {
// decode xcode
if ($image != 0) {
// image allowed
$text =& $this->xoopsCodeDecode($text);
} else {
// image not allowed
$text =& $this->xoopsCodeDecode($text, 0);
}
}
if ($br != 0) {
$text =& $this->nl2Br($text);
}
return $text; */
}
示例2: displayTarea
/**
* Filters textarea form data in DB for display
*
* @param string $text
* @param bool $html allow html?
* @param bool $smiley allow smileys?
* @param bool $xcode allow xoopscode?
* @param bool $image allow inline images?
* @param bool $br convert linebreaks?
* @return string
**/
function displayTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1, $nbsp = 0)
{
// save "javascript:"
$text = preg_replace("/javascript:/si", "jjaavvaassccrriipptt::", $text);
$this->nbsp = $nbsp;
$text = parent::displayTarea($text, $html, $smiley, $xcode, $image, $br);
// restore "javascript:"
$text = preg_replace("/jjaavvaassccrriipptt::/", "javascript:", $text);
return $this->tinyDCodeDecode($text, $nbsp);
/* if ($html != 1) {
// html not allowed
$text =& $this->htmlSpecialChars($text);
}
$text =& $this->makeClickable($text);
if ($smiley != 0) {
// process smiley
$text =& $this->smiley($text);
}
if ($xcode != 0) {
// decode xcode
if ($image != 0) {
// image allowed
$text =& $this->xoopsCodeDecode($text);
} else {
// image not allowed
$text =& $this->xoopsCodeDecode($text, 0);
}
}
if ($br != 0) {
$text =& $this->nl2Br($text);
}
return $text; */
}
示例3: htmlspecialchars
function &displayTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1, $nbsp = 0, $number_entity = 0, $special_entity = 0)
{
$this->nbsp = $nbsp;
if (empty($xcode)) {
if (empty($html)) {
$text = htmlspecialchars($text, ENT_QUOTES);
}
if (!empty($br)) {
$text = nl2br($text);
}
} else {
$text = $this->prepareXcode($text);
$text = $this->postCodeDecode(parent::displayTarea($text, $html, $smiley, 1, $image, $br), $image);
}
if ($number_entity) {
$text = $this->reviveNumberEntity($text);
}
if ($special_entity) {
$text = $this->reviveSpecialEntity($text);
}
return $text;
}
示例4: getHomePage
/**
* Esta función permite cargar una página específica y desplegar
* toda su información
*/
function getHomePage($page)
{
global $xoopsOption, $xoopsConfig;
require_once XOOPS_ROOT_PATH . '/mainfile.php';
$db =& XoopsDatabaseFactory::getDatabaseConnection();
$result = $db->query("SELECT * FROM " . $db->prefix("qpages_pages") . " WHERE titulo_amigo='{$page}'");
if ($db->getRowsNum($result) <= 0) {
return;
}
$row = $db->fetchArray($result);
$xoopsOption['template_main'] = 'qpages_homepage.html';
require_once XOOPS_ROOT_PATH . '/header.php';
$tpl =& $xoopsTpl;
$groups = explode(',', $row['grupos']);
if (empty($xoopsUser)) {
if (!in_array(0, $groups)) {
return;
}
} else {
$ok = false;
foreach ($xoopsUser->getGroups() as $k) {
if ($ok) {
continue;
}
if (in_array($k, $groups)) {
$ok = true;
}
}
if (!$ok && !$xoopsUser->isAdmin()) {
return;
}
}
$tpl->assign('xoops_pagetitle', $row['titulo']);
$tpl->assign('page', array('title' => $row['titulo'], 'text' => MyTextSanitizer::displayTarea($row['texto'], $row['dohtml'], $row['dosmiley'], $row['doxcode'], $row['doimage'], $row['dobr']), 'id' => $row['id_page'], 'name' => $row['titulo_amigo']));
require_once XOOPS_ROOT_PATH . '/footer.php';
}
示例5:
public function &displayTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1, $nbsp = 0, $number_entity = 0, $special_entity = 0)
{
$this->nbsp = $nbsp;
if (empty($xcode)) {
if (empty($html)) {
$text = $this->htmlSpecialChars($text);
}
if (!empty($br)) {
$text = $this->nl2br($text);
}
} else {
$text = $this->prepareXcode($text);
// TODO: Legacy_TextFilter だと、xpWikiレンダラーが効かない・・
//$text = $this->postCodeDecode( parent::toShowTarea( $text , $html , $smiley , 1 , $image , $br ) , $image ) ;
$text = $this->postCodeDecode(parent::displayTarea($text, $html, $smiley, 1, $image, $br), $image);
}
if ($number_entity) {
$text = $this->reviveNumberEntity($text);
}
if ($special_entity) {
$text = $this->reviveSpecialEntity($text);
}
return $text;
}
示例6: getSearchWordList
/**
*
*
* @param array $modulelist
* @param string $text
* @return array
**/
function getSearchWordList( $modulelist, $text )
{
$q_arr = array();
$q_arr1 = array();
$q_arr2 = array();
$queryarray = array();
list($spatternf,$spatterne) = explode(",",$this->getModuleConfig("spattern"));
foreach ($modulelist as $mid=>$mod)
{
if (function_exists( $mod . "_xwords_StripCodes"))
{
$text = call_user_func($mod."_xwords_StripCodes",$text);
}
}
$text = $this->StripXcodes( $text ) ;
$text = $this->postCodeDecode($text,1) ;
$text = strip_tags(parent::displayTarea($text,1,1,1,1,0));
$count = 0;
if (preg_match_all('/([\'\"`])(.+?)\\1/',$text,$q_arr1))
{
if ( is_array($q_arr1[2]) && $count = count($q_arr1[2]) )
{
for ( $i = 0; $i < $count; $i++ )
{
if (preg_match('/(^[0-9A-Za-z]{3,})s$/i',$q_arr1[2][$i]))
{
$q_arr1[2][] = preg_replace('/(^[[:alnum:]]{3,})s$/i', "$1", $q_arr1[2][$i]);
$q_arr1[2][] = preg_replace('/(^[[:alnum:]]{3,})es$/i', "$1", $q_arr1[2][$i]);
}
}
}
}
// if (_CHARSET =="EUC-JP")
if ($spatternf && $spatterne)
{
// preg_match_all('/\xA1[\xAE\xC6\xC8\xCC\xCE\xD0\xD2\xD4\xD6\xD8\xDA](.+?)\xA1[\xAD\xC7\xC9\xCD\xCF\xD1\xD3\xD5\xD7\xD9\xDB]/',$text,$q_arr2);
preg_match_all("/$spatternf(.+?)$spatterne/",$text,$q_arr2);
}
$q_arr = array_unique(array_merge($q_arr1[2],$q_arr2[1]));
sort($q_arr);
reset($q_arr);
$count = 0;
if ( is_array($q_arr) && $count = count($q_arr) )
{
for ( $i = 0; $i < $count; $i++ )
{
if (preg_match('/\\\\/',$q_arr[$i]))
{
$q_arr[$i] = addslashes($q_arr[$i]);
}
$queryarray[] = addslashes($q_arr[$i]);
}
}
return $queryarray;
}