コード例 #1
0
 /**
  * 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
0
 /**
  * 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
0
 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
0
/**
 * 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
0
ファイル: Textsanitizer.php プロジェクト: naao/xcforum_proto
 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
0
		/**
		 *
		 *
		 * @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;
			}