当前位置: 首页>>代码示例>>PHP>>正文


PHP icms_core_DataFilter::filterHTMLdisplay方法代码示例

本文整理汇总了PHP中icms_core_DataFilter::filterHTMLdisplay方法的典型用法代码示例。如果您正苦于以下问题:PHP icms_core_DataFilter::filterHTMLdisplay方法的具体用法?PHP icms_core_DataFilter::filterHTMLdisplay怎么用?PHP icms_core_DataFilter::filterHTMLdisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在icms_core_DataFilter的用法示例。


在下文中一共展示了icms_core_DataFilter::filterHTMLdisplay方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: xoops_getbanner

/**
 * Gets banner HTML for use in templates
 *
 * @deprecated		Moving to a separate module
 *
 * @return object  $bannerobject  The generated banner HTML string
 */
function xoops_getbanner()
{
    global $icmsConfig;
    $db = icms_db_Factory::instance();
    $bresult = $db->query("SELECT * FROM " . $db->prefix('banner') . " ORDER BY RAND()", 1);
    if ($db->getRowsNum($bresult) > 0) {
        list($bid, $cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $date, $htmlbanner, $htmlcode) = $db->fetchRow($bresult);
        if ($icmsConfig['my_ip'] != $_SERVER['REMOTE_ADDR']) {
            $db->queryF(sprintf("UPDATE %s SET impmade = impmade+1 WHERE bid = '%u'", $db->prefix('banner'), (int) $bid));
        }
        /* Check if this impression is the last one and print the banner */
        if ($imptotal == $impmade && $imptotal != 0) {
            $newid = $db->genId($db->prefix('bannerfinish') . '_bid_seq');
            $sql = sprintf("INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES ('%u', '%u', '%u', '%u', '%u', '%u')", $db->prefix('bannerfinish'), (int) $newid, (int) $cid, (int) $impmade, (int) $clicks, (int) $date, time());
            $db->queryF($sql);
            $db->queryF(sprintf("DELETE FROM %s WHERE bid = '%u'", $db->prefix('banner'), (int) $bid));
        }
        if ($htmlbanner) {
            $bannerobject = icms_core_DataFilter::filterHTMLdisplay($htmlcode, 0, 0);
        } else {
            $bannerobject = '<div><a href="' . ICMS_URL . '/banners.php?op=click&amp;bid=' . $bid . '" rel="external">';
            if (stristr($imageurl, '.swf')) {
                $bannerobject = $bannerobject . '<object type="application/x-shockwave-flash" data="' . $imageurl . '" width="468" height="60">' . '<param name="movie" value="' . $imageurl . '"></param>' . '<param name="quality" value="high"></param>' . '</object>';
            } else {
                $bannerobject = $bannerobject . '<img src="' . $imageurl . '" alt="" />';
            }
            $bannerobject = $bannerobject . '</a></div>';
        }
        return $bannerobject;
    }
}
开发者ID:nao-pon,项目名称:impresscms,代码行数:38,代码来源:functions.php

示例2: getVar


//.........这里部分代码省略.........
                 default:
                     break 1;
             }
             break;
         case XOBJ_DTYPE_CURRENCY:
             $decimal_section_original = strstr($ret, '.');
             $decimal_section = $decimal_section_original;
             if ($decimal_section) {
                 if (strlen($decimal_section) == 1) {
                     $decimal_section = '.00';
                 } elseif (strlen($decimal_section) == 2) {
                     $decimal_section = $decimal_section . '0';
                 }
                 $ret = str_replace($decimal_section_original, $decimal_section, $ret);
             } else {
                 $ret = $ret . '.00';
             }
             break;
         case XOBJ_DTYPE_TXTAREA:
             switch (strtolower($format)) {
                 case 's':
                 case 'show':
                     $html = !empty($this->vars['dohtml']['value']) ? 1 : 0;
                     $xcode = !isset($this->vars['doxcode']['value']) || $this->vars['doxcode']['value'] == 1 ? 1 : 0;
                     $smiley = !isset($this->vars['dosmiley']['value']) || $this->vars['dosmiley']['value'] == 1 ? 1 : 0;
                     $image = !isset($this->vars['doimage']['value']) || $this->vars['doimage']['value'] == 1 ? 1 : 0;
                     $br = !isset($this->vars['dobr']['value']) || $this->vars['dobr']['value'] == 1 ? 1 : 0;
                     if (defined('XOOPS_EDITOR_IS_HTML')) {
                         $br = false;
                     }
                     if ($html) {
                         if ($br) {
                             // have to use this whilst ever we have a zillion editors in the core
                             return icms_core_DataFilter::filterHTMLdisplay($ret, $xcode, $br);
                         } else {
                             return icms_core_DataFilter::checkVar($ret, 'html', 'output');
                         }
                     } else {
                         return icms_core_DataFilter::checkVar($ret, 'text', 'output');
                     }
                     break 1;
                 case 'e':
                 case 'edit':
                     return icms_core_DataFilter::checkVar($ret, 'html', 'edit');
                     break 1;
                 case 'p':
                 case 'preview':
                     $html = !empty($this->vars['dohtml']['value']) ? 1 : 0;
                     $xcode = !isset($this->vars['doxcode']['value']) || $this->vars['doxcode']['value'] == 1 ? 1 : 0;
                     $smiley = !isset($this->vars['dosmiley']['value']) || $this->vars['dosmiley']['value'] == 1 ? 1 : 0;
                     $image = !isset($this->vars['doimage']['value']) || $this->vars['doimage']['value'] == 1 ? 1 : 0;
                     $br = !isset($this->vars['dobr']['value']) || $this->vars['dobr']['value'] == 1 ? 1 : 0;
                     if ($html) {
                         return icms_core_DataFilter::checkVar($ret, 'html', 'input');
                     } else {
                         return icms_core_DataFilter::checkVar($ret, 'text', 'input');
                     }
                     break 1;
                 case 'f':
                 case 'formpreview':
                     return htmlspecialchars(icms_core_DataFilter::stripSlashesGPC($ret), ENT_QUOTES);
                     break 1;
                 case 'n':
                 case 'none':
                 default:
                     break 1;
开发者ID:nao-pon,项目名称:impresscms,代码行数:67,代码来源:Object.php

示例3: previewTarea

 /**
  * Filters textarea form data submitted for preview
  *
  * The only difference between this and displayTarea is the need to deal with $_POST input instead of database output
  *
  * @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
  **/
 public function previewTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
 {
     /* @deprecated Use icms_core_DataFilter::checkVar, instead - the events for previewTarea need to be added, first */
     //icms_core_Debug::setDeprecated('icms_core_DataFilter::checkVar - type = text or html, $options1 = input', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
     /* trigger all the events tied to the beforePreviewTarea event */
     icms::$preload->triggerEvent('beforePreviewTarea', array(&$text, $html, $smiley, $xcode, $image, $br));
     $text = icms_core_DataFilter::stripSlashesGPC($text);
     if ($html = 0) {
         $text = icms_core_DataFilter::filterTextareaDisplay($text, $smiley, $xcode, $image, $br);
     } else {
         $text = icms_core_DataFilter::filterHTMLdisplay($text, $xcode, $br);
     }
     /* trigger all the events tied to the afterPreviewTarea event */
     icms::$preload->triggerEvent('afterPreviewTarea', array(&$text, $html, $smiley, $xcode, $image, $br));
     return $text;
 }
开发者ID:nao-pon,项目名称:impresscms,代码行数:29,代码来源:Textsanitizer.php


注:本文中的icms_core_DataFilter::filterHTMLdisplay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。