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


PHP dede_htmlspecialchars函数代码示例

本文整理汇总了PHP中dede_htmlspecialchars函数的典型用法代码示例。如果您正苦于以下问题:PHP dede_htmlspecialchars函数的具体用法?PHP dede_htmlspecialchars怎么用?PHP dede_htmlspecialchars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: HtmlReplace

 function HtmlReplace($str, $rptype = 0)
 {
     $str = stripslashes($str);
     $str = preg_replace("/<[\\/]{0,1}style([^>]*)>(.*)<\\/style>/i", '', $str);
     //2011-06-30 禁止会员投稿添加css样式 (by:织梦的鱼)
     if ($rptype == 0) {
         $str = dede_htmlspecialchars($str);
     } else {
         if ($rptype == 1) {
             $str = dede_htmlspecialchars($str);
             $str = str_replace(" ", ' ', $str);
             $str = preg_replace("/[\r\n\t ]{1,}/", ' ', $str);
         } else {
             if ($rptype == 2) {
                 $str = dede_htmlspecialchars($str);
                 $str = str_replace(" ", '', $str);
                 $str = preg_replace("/[\r\n\t ]/", '', $str);
             } else {
                 $str = preg_replace("/[\r\n\t ]{1,}/", ' ', $str);
                 $str = preg_replace('/script/i', 'script', $str);
                 $str = preg_replace("/<[\\/]{0,1}(link|meta|ifr|fra)[^>]*>/i", '', $str);
             }
         }
     }
     return addslashes($str);
 }
开发者ID:hensonvip,项目名称:ymroad,代码行数:26,代码来源:filter.helper.php

示例2: text2wml

function text2wml($content)
{
    $content = str_replace('$', '$$', $content);
    $content = str_replace("\r\n", "\n", dede_htmlspecialchars($content));
    $content = explode("\n", $content);
    for ($i = 0; $i < count($content); $i++) {
        // 过滤首尾空格
        $content[$i] = trim($content[$i]);
        // 如果去掉全角空格为空行,则设为空行,否则不对全角空格过滤。
        if (str_replace(" ", "", $content[$i]) == "") {
            $content[$i] = "";
        }
    }
    //合并各行,转化为 WML,并过滤掉空行
    $content = str_replace("<p><br /></p>\n", "", "<p>" . implode("<br /></p>\n<p>", $content) . "<br /></p>\n");
    return $content;
}
开发者ID:ahmatjan,项目名称:cmf2,代码行数:17,代码来源:wap.inc.php

示例3: getForm

 /**
  *  获取用户数据表单
  *
  * @access    public
  * @param     string  $type  表单类型
  * @param     string  $value  值
  * @param     string  $admintype  模型类型
  * @return    string
  */
 function getForm($type = 'post', $value = '', $admintype = 'membermodel2')
 {
     global $cfg_cookie_encode;
     $dtp = new DedeTagParse();
     $dtp->SetNameSpace("field", "<", ">");
     $dtp->LoadSource($this->info);
     $formstring = '';
     $formfields = '';
     $func = $type == 'post' ? 'GetFormItem' : 'GetFormItemValue';
     if (is_array($dtp->CTags)) {
         foreach ($dtp->CTags as $tagid => $tag) {
             if ($tag->GetAtt('autofield')) {
                 if ($tag->GetAtt('state') == 1) {
                     //如果启用该字段
                     if ($type == 'post') {
                         //对一些字段进行特殊处理
                         if ($tag->GetName() == 'onlynet') {
                             $formstring .= '<li><span>联系方式限制:</span><div class="lform">
                 <input name="onlynet" type="radio" id="onlynet" value="2" checked="checked" />
                 不公开所有联系方式
                 <input name="onlynet" type="radio" id="onlynet" value="1" />
                 不公开电话、详细地址
                 <input name="onlynet" type="radio" id="onlynet" value="0"  />
                 公开所有联系方式</div></li>';
                         } else {
                             if ($tag->GetName() == 'place' || $tag->GetName() == 'oldplace') {
                                 $formtitle = $tag->GetName() == 'place' ? '目前所在地' : '家乡所在地';
                                 $formstring .= '<li><div class="lform">' . GetEnumsForm('nativeplace', 0, $tag->GetName()) . '</div><span>' . $formtitle . ':</span></li>';
                             } else {
                                 if (array_key_exists($tag->GetName(), $this->egroups)) {
                                     //对联动模型进行特殊处理
                                     $formstring .= '<li><div class="lform">' . GetEnumsForm($tag->GetName(), 0, $tag->GetName()) . '</div><span>' . $this->egroups[$tag->GetName()] . ':</span></li>';
                                 } else {
                                     if ($tag->GetAtt('type') == 'checkbox') {
                                         //对checkbox模型进行特殊处理
                                         $formstring .= $func($tag, $admintype);
                                     } else {
                                         $formstring .= $func($tag, $admintype);
                                     }
                                 }
                             }
                         }
                     } else {
                         if ($tag->GetName() == 'onlynet') {
                             $formstring .= '<p style="display:none"><label>联系方式限制:</label>
                 <input name="onlynet" type="radio" id="onlynet" value="2" checked="checked" />
                 不公开所有联系方式
                 <input name="onlynet" type="radio" id="onlynet" value="1" />
                 不公开电话、详细地址
                 <input name="onlynet" type="radio" id="onlynet" value="0"  />
                 公开所有联系方式</p>';
                         } else {
                             if ($tag->GetName() == 'place' || $tag->GetName() == 'oldplace') {
                                 $formtitle = $tag->GetName() == 'place' ? '目前所在地' : '家乡所在地';
                                 $formstring .= '<p><label>' . $formtitle . ':</label>' . GetEnumsForm('nativeplace', $value[$tag->GetName()], $tag->GetName()) . '</p>';
                             } else {
                                 if ($tag->GetName() == 'birthday') {
                                     $formstring .= '<p><label>' . $tag->GetAtt('itemname') . ':</label><input type="text" class="intxt" style="width: 100px;" id="birthday" value="' . $value[$tag->GetName()] . '" name="birthday"></p>';
                                 } else {
                                     if (array_key_exists($tag->GetName(), $this->egroups)) {
                                         //对联动模型进行特殊处理
                                         $formstring .= '<p><label>' . $this->egroups[$tag->GetName()] . ':</label> ' . GetEnumsForm($tag->GetName(), $value[$tag->GetName()], $tag->GetName()) . '</p>';
                                     } else {
                                         if ($tag->GetAtt('type') == 'checkbox') {
                                             //对checkbox模型进行特殊处理
                                             $formstring .= $func($tag, dede_htmlspecialchars($value[$tag->GetName()], ENT_QUOTES), $admintype);
                                         } else {
                                             if ($tag->GetAtt('type') == 'img') {
                                                 $fieldname = $tag->GetName();
                                                 $labelname = $tag->GetAtt('itemname');
                                                 $fvalue = dede_htmlspecialchars($value[$tag->GetName()], ENT_QUOTES);
                                                 $imgstrng = "<p><label>{$labelname}:</label><input type='text' name='{$fieldname}' value='{$fvalue}' id='{$fieldname}' style='width:300px'  class='text' /> <input name='" . $fieldname . "_bt' class='inputbut' type='button' value='浏览...' onClick=\"SelectImage('addcontent.{$fieldname}','big')\" />\r\n</p>";
                                                 $formstring .= $imgstrng;
                                             } else {
                                                 $formstring .= $func($tag, dede_htmlspecialchars($value[$tag->GetName()], ENT_QUOTES), $admintype);
                                                 //echo $formstring;
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     $formfields .= $formfields == '' ? $tag->GetName() . ',' . $tag->GetAtt('type') : ';' . $tag->GetName() . ',' . $tag->GetAtt('type');
                 }
             }
         }
     }
     $formstring .= "<input type=\"hidden\" name=\"dede_fields\" value=\"" . $formfields . "\" />\n";
     $formstring .= "<input type=\"hidden\" name=\"dede_fieldshash\" value=\"" . md5($formfields . $cfg_cookie_encode) . "\" />";
     return $formstring;
//.........这里部分代码省略.........
开发者ID:ahmatjan,项目名称:cmf2,代码行数:101,代码来源:membermodel.cls.php

示例4: dede_htmlspecialchars

     } else {
         $link = $row1['arcurl'];
     }
     $link = dede_htmlspecialchars($link);
     $description = dede_htmlspecialchars(strip_tags($row['description']));
     $text = dede_htmlspecialchars(strip_tags($row['body']));
     $image = $row['litpic'] == '' ? '' : $row['litpic'];
     if ($image != '' && strpos($image, 'http://') === false) {
         $image = ($cfg_basehost == '' ? 'http://' . $_SERVER["HTTP_HOST"] . $cfg_cmspath : $cfg_basehost) . $image;
     }
     //$headlineimg = '';
     $keywords = dede_htmlspecialchars($row['keywords']);
     $category = dede_htmlspecialchars($row['typename']);
     $author = dede_htmlspecialchars($row['writer']);
     $source = dede_htmlspecialchars($row['source']);
     $pubdate = dede_htmlspecialchars(gmdate('Y-m-d H:i', $row['pubdate'] + $cfg_cli_time * 3600));
     $baidunews .= "<item>\n";
     $baidunews .= "<title>{$title} </title>\n";
     $baidunews .= "<link>{$link} </link>\n";
     $baidunews .= "<description>{$description} </description>\n";
     $baidunews .= "<text>{$text} </text>\n";
     $baidunews .= "<image>{$image} </image>\n";
     //$baidunews .= "<headlineimages/>\n";
     $baidunews .= "<keywords>{$keywords} </keywords>\n";
     $baidunews .= "<category>{$category} </category>\n";
     $baidunews .= "<author>{$author} </author>\n";
     $baidunews .= "<source>{$source} </source>\n";
     $baidunews .= "<pubDate>{$pubdate} </pubDate>\n";
     $baidunews .= "</item>\n";
 }
 $baidunews .= "</document>\n";
开发者ID:iabing,项目名称:mzzyc,代码行数:31,代码来源:baidunews.php

示例5: foreach

        foreach ($latests['comments'] as $k => $v) {
            $data[] = array('nickname' => $v['passport']['nickname'], 'content' => $v['content'], 'topic_title' => $v['topic_title'], 'topic_url' => $v['topic_url']);
        }
    }
    echo json_encode($latests);
    exit;
} elseif ($dopost == 'getcode') {
    if (!changyan_islogin()) {
        ShowMsg("您尚未登录畅言,请先登录后继续使用……!", '?');
        exit;
    }
    changyan_check_islogin();
    $user = changyan_get_setting('user');
    $sign = changyan_gen_sign($user);
    $result = changyan_getcode(CHANGYAN_CLIENT_ID, $user, false, $sign);
    $code = dede_htmlspecialchars($result['code']);
    $msg = <<<EOT
<style type='text/css'>
pre {
width:50%;
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 20px;
word-break: break-all;
word-wrap: break-word;
white-space: pre;
white-space: pre-wrap;
background-color: #f5f5f5;
border: 1px solid #ccc;
开发者ID:sunxguo,项目名称:hzjy,代码行数:31,代码来源:changyan_main.php

示例6: CheckCatalog

</table>
</form>
<?php 
                                                //AJAX窗体结束
                                            } else {
                                                if ($dopost == 'quickEditSave') {
                                                    require_once DEDEADMIN . '/inc/inc_archives_functions.php';
                                                    //权限检测
                                                    if (!TestPurview('a_Edit')) {
                                                        if (TestPurview('a_AccEdit')) {
                                                            CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限!");
                                                        } else {
                                                            CheckArcAdmin($aid, $cuserLogin->getUserID());
                                                        }
                                                    }
                                                    $title = dede_htmlspecialchars(cn_substrR($title, $cfg_title_maxlen));
                                                    $shorttitle = cn_substrR($shorttitle, 36);
                                                    $keywords = trim(cn_substrR($keywords, 60));
                                                    if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) {
                                                        $arcrank = -1;
                                                    }
                                                    $adminid = $cuserLogin->getUserID();
                                                    //属性处理
                                                    $flag = isset($flags) ? join(',', $flags) : '';
                                                    if (!empty($flag)) {
                                                        if (preg_match("#p#", $oldflag)) {
                                                            $flag .= ',p';
                                                        }
                                                        if (preg_match("#j#", $oldflag)) {
                                                            $flag .= ',j';
                                                        }
开发者ID:playfay,项目名称:FlowDedeCmsBackstageTemplets,代码行数:31,代码来源:archives_do.php

示例7: addslashes

                                         $forms .= "结束时间:<input type=\"text\" name=\"enddate\" value=\"\" /><br />";
                                     } else {
                                         $tmp = '';
                                     }
                                 }
                             }
                         }
                     }
                     $addonstring .= $tmp . ',';
                 }
             }
             $forms .= '<input type="submit" name="submit" value="开始搜索" /></form>';
             $formssql = addslashes($forms);
             $query = "REPLACE INTO #@__advancedsearch(mid, maintable, mainfields, addontable, addonfields, forms, template) VALUES('{$mid}','{$maintable}','{$mainstring}','{$addontable}','{$addonstring}','{$formssql}', '{$template}')";
             $dsql->ExecuteNoneQuery($query);
             $formshtml = dede_htmlspecialchars($forms);
             echo '<meta http-equiv="Content-Type" content="text/html; charset=' . $cfg_soft_lang . '">';
             echo "下面为生成的html表单,请自行复制,根据自己需求修改样式后粘贴到对应的模板中<br><br><textarea cols=\"100\"  rows=\"10\">" . $forms . "</textarea>";
             echo '<br />预览:<br /><hr>';
             echo $forms;
         }
     }
     exit;
 } else {
     if ($dopost == 'del') {
         $mid = intval($mid);
         $dsql->ExecuteNoneQuery("DELETE FROM `#@__advancedsearch` WHERE mid = '{$mid}'; ");
         ShowMsg("成功删除一个自定义搜索!", "mychannel_main.php");
         exit;
     }
 }
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:mychannel_edit.php

示例8: getForm

 /**
  *  获取表单
  *
  * @access    public
  * @param     string  $type  类型
  * @param     string  $value  值
  * @param     string  $admintype  管理类型
  * @return    string
  */
 function getForm($type = 'post', $value = '', $admintype = 'diy')
 {
     global $cfg_cookie_encode;
     $dtp = new DedeTagParse();
     $dtp->SetNameSpace("field", "<", ">");
     $dtp->LoadSource($this->info);
     $formstring = '';
     $formfields = '';
     $func = $type == 'post' ? 'GetFormItem' : 'GetFormItemValue';
     if (is_array($dtp->CTags)) {
         foreach ($dtp->CTags as $tagid => $tag) {
             if ($tag->GetAtt('autofield')) {
                 if ($type == 'post') {
                     $formstring .= $func($tag, $admintype);
                 } else {
                     $formstring .= $func($tag, dede_htmlspecialchars($value[$tag->GetName()], ENT_QUOTES), $admintype);
                 }
                 $formfields .= $formfields == '' ? $tag->GetName() . ',' . $tag->GetAtt('type') : ';' . $tag->GetName() . ',' . $tag->GetAtt('type');
             }
         }
     }
     $formstring .= "<input type=\"hidden\" name=\"dede_fields\" value=\"" . $formfields . "\" />\n";
     $formstring .= "<input type=\"hidden\" name=\"dede_fieldshash\" value=\"" . md5($formfields . $cfg_cookie_encode) . "\" />";
     return $formstring;
 }
开发者ID:stonelf,项目名称:mcgmh,代码行数:34,代码来源:diyform.cls.php

示例9: dirname

 * @package        DedeCMS.Administrator
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once dirname(__FILE__) . "/config.php";
CheckPurview('temp_Test');
require_once DEDEINC . "/arc.partview.class.php";
if (empty($partcode)) {
    ShowMsg('错误请求', 'javascript:;');
    exit;
}
$partcode = stripslashes($partcode);
if (empty($typeid)) {
    $typeid = 0;
}
if (empty($showsource)) {
    $showsource = "";
}
if ($typeid > 0) {
    $pv = new PartView($typeid);
} else {
    $pv = new PartView();
}
$pv->SetTemplet($partcode, "string");
if ($showsource == "" || $showsource == "yes") {
    echo "模板代码:";
    echo "<span style='color:red;'><pre>" . dede_htmlspecialchars($partcode) . "</pre></span>";
    echo "结果:<hr size='1' width='100%'>";
}
$pv->Display();
开发者ID:playfay,项目名称:FlowDedeCmsBackstageTemplets,代码行数:31,代码来源:tag_test_action.php

示例10: lib_changyan

function lib_changyan(&$ctag, &$refObj)
{
    global $dsql, $envs;
    //属性处理
    $attlist = "type|code,config|,class|_DEDECY,style|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $reval = "";
    if (!$dsql->IsTable("#@__plus_changyan_setting")) {
        return '没安装畅言模块';
    }
    $client_id = changyan_get_setting('appid');
    if (empty($client_id)) {
        return '尚未注册畅言帐号,请到后台注册';
    }
    if ($type == 'code' or $type == 'code2') {
        $reval .= "<div class='{$class}' style='{$style}'>";
        $prefix = 'changyan';
        $key = 'code';
        $row = GetCache($prefix, $key);
        if (!is_array($row)) {
            $appid = changyan_get_setting('appid');
            $user = changyan_get_setting('user');
            $sign = changyan_gen_sign($user);
            $result = changyan_getcode(CHANGYAN_CLIENT_ID, $user, false, $sign, $appid);
            if ($result['status'] == 1) {
                return '未获取畅言代码,错误消息:' . $result['msg'];
            }
            $row['reval'] = dede_htmlspecialchars($result['code']);
            SetCache($prefix, $key, $row, 60 * 60 * 1);
        }
        if (!empty($config)) {
            $config_arr = array();
            $configs = explode(',', $config);
            if (count($configs) > 0) {
                foreach ($configs as $c) {
                    $item = explode(':', $c);
                    $config_arr[$item[0]] = $item[1];
                }
            }
            $config_str = json_encode($config_arr);
            $reval .= <<<EOT
<script>
    var_config={$config_str};
</script>
EOT;
        }
        $reval .= htmlspecialchars_decode($row['reval']);
        $reval = str_replace("id='SOHUCS'", "id='SOHUCS' sid='{$refObj->ArcID}'", $reval);
        if ($type == 'code2') {
            $reval = preg_replace("#window.SCS_NO_IFRAME[ ]?=[ ]?true;#i", "", $reval);
        }
        $reval = str_replace("<script>", "</div><script>", $reval);
    } elseif ($type == 'count') {
        if (!$GLOBALS['changyan_count_js']) {
            $reval .= "<script type=\"text/javascript\" src=\"http://assets.changyan.sohu.com/upload/plugins/plugins.count.js\"></script>";
        }
        $reval .= "<a href=\"#SOHUCS\" id=\"changyan_count_unit\"></a>";
        $GLOBALS['changyan_count_js'] = TRUE;
    }
    return $reval;
}
开发者ID:healthguo,项目名称:PHP,代码行数:62,代码来源:changyan.lib.php

示例11: ShowMsg

        $arcRow = $dsql->GetOne("SELECT s.*,t.* FROM `#@__member_stow` AS s LEFT JOIN `#@__member_stowtype` AS t ON s.type=t.stowname WHERE s.aid='{$aid}' AND s.type='{$type}'");
        if (!is_array($arcRow)) {
            ShowMsg("无法把未知文档推荐给好友!", "-1");
            exit;
        }
        $arcRow['arcurl'] = $arcRow['indexurl'] . "=" . $arcRow['aid'];
        extract($arcRow, EXTR_OVERWRITE);
    }
} else {
    if ($action == 'send') {
        if (!CheckEmail($email)) {
            echo "<script>alert('Email格式不正确!');history.go(-1);</script>";
            exit;
        }
        $mailbody = '';
        $msg = dede_htmlspecialchars($msg);
        $mailtitle = "你的好友给你推荐了一篇文章";
        $mailbody .= "{$msg} \r\n\r\n";
        $mailbody .= "Power by http://www.dedecms.com 织梦内容管理系统!";
        $headers = "From: " . $cfg_adminemail . "\r\nReply-To: " . $cfg_adminemail;
        if ($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) {
            $mailtype = 'TXT';
            require_once DEDEINC . '/mail.class.php';
            $smtp = new smtp($cfg_smtp_server, $cfg_smtp_port, true, $cfg_smtp_usermail, $cfg_smtp_password);
            $smtp->debug = false;
            $smtp->sendmail($email, $cfg_webname, $cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
        } else {
            @mail($email, $mailtitle, $mailbody, $headers);
        }
        ShowMsg("成功推荐一篇文章!", $arcurl);
        exit;
开发者ID:iabing,项目名称:mzzyc,代码行数:31,代码来源:recommend.php

示例12: dede_htmlspecialchars

       <td align="left" style="padding:3px;">
<?php 
                    if ($row['type'] == 'bool') {
                        $c1 = '';
                        $c2 = '';
                        $row['value'] == 'Y' ? $c1 = " checked" : ($c2 = " checked");
                        echo "<input type='radio' class='np' name='edit___{$row['varname']}' value='Y'{$c1}>是 ";
                        echo "<input type='radio' class='np' name='edit___{$row['varname']}' value='N'{$c2}>否 ";
                    } else {
                        if ($row['type'] == 'bstring') {
                            echo "<textarea name='edit___{$row['varname']}' row='4' id='edit___{$row['varname']}' class='textarea_info' style='width:98%;height:50px'>" . dede_htmlspecialchars($row['value']) . "</textarea>";
                        } else {
                            if ($row['type'] == 'number') {
                                echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value='{$row['value']}' style='width:30%'>";
                            } else {
                                echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value=\"" . dede_htmlspecialchars($row['value']) . "\" style='width:80%'>";
                            }
                        }
                    }
                    ?>
</td>
       <td><?php 
                    echo $row['varname'];
                    ?>
</td>
      </tr>
      <?php 
                }
                ?>
     </table>
      <?php 
开发者ID:playfay,项目名称:FlowDedeCmsBackstageTemplets,代码行数:31,代码来源:sys_info.php

示例13: GetArcList

 /**
  *  获得文档列表
  *
  * @access    public
  * @param     string  $innertext  底层模板
  * @return    string
  */
 function GetArcList($innertext = "")
 {
     $typeid = $this->TypeID;
     $innertext = trim($innertext);
     if ($innertext == "") {
         $innertext = GetSysTemplets("rss.htm");
     }
     $orwhere = " arc.arcrank > -1 ";
     $orwhere .= " AND (arc.typeid in (" . GetSonIds($this->TypeID, $this->TypeFields['channeltype']) . ") ) ";
     $ordersql = " ORDER BY arc.id desc";
     $query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,\n        tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n        FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n        WHERE {$orwhere} {$ordersql} LIMIT 0," . $this->MaxRow;
     $this->dsql->SetQuery($query);
     $this->dsql->Execute('al');
     $artlist = '';
     $dtp2 = new DedeTagParse();
     $dtp2->SetNameSpace('field', '[', ']');
     $dtp2->LoadSource($innertext);
     while ($row = $this->dsql->GetArray('al')) {
         //处理一些特殊字段
         if ($row['litpic'] == '-' || $row['litpic'] == '') {
             $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
         }
         if (!preg_match("/^http:\\/\\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
             $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
         }
         $row['picname'] = $row['litpic'];
         $row["arcurl"] = GetFileUrl($row["id"], $row["typeid"], $row["senddate"], $row["title"], $row["ismake"], $row["arcrank"], $row["namerule"], $row["typedir"], $row["money"], $row['filename'], $row["moresite"], $row["siteurl"], $row["sitepath"]);
         $row["typeurl"] = GetTypeUrl($row["typeid"], $row["typedir"], $row["isdefault"], $row["defaultname"], $row["ispart"], $row["namerule2"], $row["moresite"], $row["siteurl"], $row["sitepath"]);
         $row["info"] = $row["description"];
         $row["filename"] = $row["arcurl"];
         $row["stime"] = GetDateMK($row["pubdate"]);
         $row["image"] = "<img src='" . $row["picname"] . "' border='0'>";
         $row["fullurl"] = $GLOBALS["cfg_basehost"] . $row["arcurl"];
         // 2011-6-20 启用多站点RSS输出存在的路径问题(by:织梦的鱼)
         if ($GLOBALS['cfg_multi_site'] == 'Y') {
             $row["fullurl"] = $row["arcurl"];
         }
         $row["phpurl"] = $GLOBALS["cfg_plus_dir"];
         $row["templeturl"] = $GLOBALS["cfg_templets_dir"];
         if ($row["source"] == '') {
             $row["source"] = $GLOBALS['cfg_webname'];
         }
         if ($row["writer"] == '') {
             $row["writer"] = "秩名";
         }
         foreach ($row as $k => $v) {
             $row[$k] = dede_htmlspecialchars($v);
         }
         if (is_array($dtp2->CTags)) {
             foreach ($dtp2->CTags as $k => $ctag) {
                 if ($ctag->GetName() == 'array') {
                     //传递整个数组,在runphp模式中有特殊作用
                     $dtp2->Assign($k, $row);
                 } else {
                     if (isset($row[$ctag->GetName()])) {
                         $dtp2->Assign($k, $row[$ctag->GetName()]);
                     } else {
                         $dtp2->Assign($k, '');
                     }
                 }
             }
         }
         $artlist .= $dtp2->GetResult() . "\r\n";
     }
     $this->dsql->FreeResult('al');
     return $artlist;
 }
开发者ID:hensonvip,项目名称:ymroad,代码行数:74,代码来源:arc.rssview.class.php

示例14: preg_replace

$id = preg_replace("#[^0-9]#", "", $id);
$action = isset($action) ? trim($action) : '';
if ($id < 1) {
    ShowMsg("含有非法操作!.", "-1");
    exit;
}
//取出圈子信息
$row = $db->GetOne("SELECT * FROM #@__groups WHERE groupid='{$id}'");
$groupsname = $row['groupname'];
$groupstoreid = $row['storeid'];
$groupishidden = $row['ishidden'];
$groupissystem = $row['issystem'];
$groupcreater = $row['creater'];
$groupimg = $row['groupimg'];
$ismaster = $row['ismaster'];
$groupdes = dede_htmlspecialchars($row['des']);
$groupisindex = $row['isindex'];
$groupsmalltype = $row['smalltype'];
//编译小分类成数组
$smalltypes = $row['smalltype'];
$lists = array();
$smalltypes = @explode(",", $smalltypes);
foreach ($smalltypes as $k) {
    $kk = @explode("|", $k);
    @array_push($lists, $kk[1]);
}
//====保存圈子信息=====//
if ($action == "save") {
    $groupname = cn_substr($groupname, 75);
    $storeid = preg_replace("#[^0-9]#", "", $store);
    $issystem = preg_replace("#[^0-1]#", "", $issystem);
开发者ID:iabing,项目名称:mzzyc,代码行数:31,代码来源:group_edit.php

示例15: StringSafe

 function StringSafe($str, $safestep = -1)
 {
     $safestep = $safestep > -1 ? $safestep : $this->stringSafe;
     //过滤危险的HTML(默认级别)
     if ($safestep == 1) {
         $str = preg_replace("#script:#i", "script:", $str);
         $str = preg_replace("#<[\\/]{0,1}(link|meta|ifr|fra|scr)[^>]*>#isU", '', $str);
         $str = preg_replace("#[\r\n\t ]{1,}#", ' ', $str);
         return $str;
     } else {
         if ($this->stringSafe == 2) {
             $str = addslashes(dede_htmlspecialchars(stripslashes($str)));
             $str = preg_replace("#eval#i", 'eval', $str);
             $str = preg_replace("#union#i", 'union', $str);
             $str = preg_replace("#concat#i", 'concat', $str);
             $str = preg_replace("#--#", '--', $str);
             $str = preg_replace("#[\r\n\t ]{1,}#", ' ', $str);
             return $str;
         } else {
             return $str;
         }
     }
 }
开发者ID:iabing,项目名称:mzzyc,代码行数:23,代码来源:Lurd.class.php


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