示例#1
0
function newReplaceValueParam($content, $paramName, $replaceStr)
{
    $startStr = '';
    $endStr = '';
    $labelStr = '';
    $nLen = '';
    $nTimeFormat = '';
    $delHtmlYes = '';
    $trimYes = '';
    //ReplaceStr = ReplaceStr & "这里面放上内容在这时碳呀。"
    //ReplaceStr = CStr(ReplaceStr)            '转成字符类型
    if (isNul($replaceStr) == true) {
        $replaceStr = '';
    }
    $startStr = '[$' . $paramName;
    $endStr = '$]';
    if (inStr($content, $startStr) > 0 && inStr($content, $endStr) > 0) {
        $labelStr = StrCut($content, $startStr, $endStr, 1);
        //删除Html
        $delHtmlYes = rParam($labelStr, 'DelHtml');
        //是否删除Html
        if ($delHtmlYes == 'true') {
            $replaceStr = replace(delHtml($replaceStr), '<', '&lt;');
        }
        //HTML处理
        //删除两边空格
        $trimYes = rParam($labelStr, 'Trim');
        //是否删除两边空格
        if ($trimYes == 'true') {
            $replaceStr = TrimVbCrlf($replaceStr);
        }
        //截取字符处理
        $nLen = rParam($labelStr, 'Len');
        //字符长度值
        $nLen = handleNumber($nLen);
        //If nLen<>"" Then ReplaceStr = CutStr(ReplaceStr,nLen,"null")' Left(ReplaceStr,nLen)
        if ($nLen != '') {
            $replaceStr = CutStr($replaceStr, $nLen, '...');
        }
        //Left(ReplaceStr,nLen)
        //时间处理
        $nTimeFormat = rParam($labelStr, 'Format_Time');
        //时间处理值
        if ($nTimeFormat != '') {
            $replaceStr = Format_Time($replaceStr, $nTimeFormat);
        }
        $content = replace($content, $labelStr, $replaceStr);
    }
    $newReplaceValueParam = $content;
    return @$newReplaceValueParam;
}
示例#2
0
function handleHttpUrl($httpUrl)
{
    $headStr = '';
    $url = '';
    if (isNul($httpUrl)) {
        return '';
    }
    //为空则退出
    $httpUrl = replace(aspTrim($httpUrl), '\\', '/');
    $headStr = mid($httpUrl, 1, inStr($httpUrl, ':') + 2);
    $httpUrl = mid($httpUrl, inStr($httpUrl, ':') + 3, -1);
    $httpUrl = replace($httpUrl, 'http://', '【|http|】');
    $httpUrl = replace($httpUrl, 'https://', '【|https|】');
    $httpUrl = replace($httpUrl, 'ftp://', '【|ftp|】');
    while (inStr($httpUrl, '//') > 0) {
        $httpUrl = replace($httpUrl, '//', '/');
    }
    $httpUrl = replace($httpUrl, '【|http|】', 'http://');
    $httpUrl = replace($httpUrl, '【|https|】', 'https://');
    $httpUrl = replace($httpUrl, '【|ftp|】', 'ftp://');
    $url = $headStr . $httpUrl;
    ///"http://www.qibosoft.com/images/qibosoft/loading.gif/"
    if (left($url, 2) == '/"') {
        $url = mid($url, 3, -1);
    }
    if (right($url, 2) == '/"') {
        $url = mid($url, 1, len($url) - 2);
    }
    $handleHttpUrl = $url;
    return @$handleHttpUrl;
}
示例#3
0
function JsEncode__($s)
{
    if (isNul($s)) {
        $JsEncode__ = '';
        return @$JsEncode__;
    }
    $arr1 = '';
    $arr2 = '';
    $i = '';
    $j = '';
    $c = '';
    $p = '';
    $t = '';
    $arr1 = array(chr(34), chr(92), chr(47), chr(8), chr(12), chr(10), chr(13), chr(9));
    //34|",92|\,47|/,8|,12|,10| ,13| ,9|	,
    $arr2 = array(chr(34), chr(92), chr(47), chr(98), chr(102), chr(110), chr(114));
    //34|",92|\,47|/,98|b,102|f,110|n,114|r,1865|,
    for ($i = 1; $i <= len($s); $i++) {
        $p = true;
        $c = mid($s, $i, 1);
        for ($j = 0; $j <= uBound($arr1); $j++) {
            if ($c == $arr1[$j]) {
                $t = $t . '\\' . $arr2[$j];
                $p = false;
                break;
            }
        }
        if ($p) {
            $t = $t . $c;
        }
    }
    $JsEncode__ = $t;
    return @$JsEncode__;
}
示例#4
0
function handleAction($content)
{
    $startStr = '';
    $endStr = '';
    $ActionList = '';
    $splStr = '';
    $action = '';
    $s = '';
    $HandYes = '';
    $startStr = '{$';
    $endStr = '$}';
    $ActionList = GetArray($content, $startStr, $endStr, true, true);
    //Call echo("ActionList ", ActionList)
    $splStr = aspSplit($ActionList, '$Array$');
    foreach ($splStr as $key => $s) {
        $action = aspTrim($s);
        $action = HandleInModule($action, 'start');
        //处理\'替换掉
        if ($action != '') {
            $action = aspTrim(mid($action, 3, len($action) - 4)) . ' ';
            //call echo("s",s)
            $HandYes = true;
            //处理为真
            //{VB #} 这种是放在图片路径里,目的是为了在VB里不处理这个路径
            if (CheckFunValue($action, '# ') == true) {
                $action = '';
                //测试
            } else {
                if (CheckFunValue($action, 'GetLableValue ') == true) {
                    $action = XY_getLableValue($action);
                    //标题在搜索引擎里列表
                } else {
                    if (CheckFunValue($action, 'TitleInSearchEngineList ') == true) {
                        $action = XY_TitleInSearchEngineList($action);
                        //加载文件
                    } else {
                        if (CheckFunValue($action, 'Include ') == true) {
                            $action = XY_Include($action);
                            //栏目列表
                        } else {
                            if (CheckFunValue($action, 'ColumnList ') == true) {
                                $action = XY_AP_ColumnList($action);
                                //文章列表
                            } else {
                                if (CheckFunValue($action, 'ArticleList ') == true || CheckFunValue($action, 'CustomInfoList ') == true) {
                                    $action = XY_AP_ArticleList($action);
                                    //评论列表
                                } else {
                                    if (CheckFunValue($action, 'CommentList ') == true) {
                                        $action = XY_AP_CommentList($action);
                                        //搜索统计列表
                                    } else {
                                        if (CheckFunValue($action, 'SearchStatList ') == true) {
                                            $action = XY_AP_SearchStatList($action);
                                            //友情链接列表
                                        } else {
                                            if (CheckFunValue($action, 'Links ') == true) {
                                                $action = XY_AP_Links($action);
                                                //显示单页内容
                                            } else {
                                                if (CheckFunValue($action, 'GetOnePageBody ') == true || CheckFunValue($action, 'MainInfo ') == true) {
                                                    $action = XY_AP_GetOnePageBody($action);
                                                    //显示文章内容
                                                } else {
                                                    if (CheckFunValue($action, 'GetArticleBody ') == true) {
                                                        $action = XY_AP_GetArticleBody($action);
                                                        //显示栏目内容
                                                    } else {
                                                        if (CheckFunValue($action, 'GetColumnBody ') == true) {
                                                            $action = XY_AP_GetColumnBody($action);
                                                            //获得栏目URL
                                                        } else {
                                                            if (CheckFunValue($action, 'GetColumnUrl ') == true) {
                                                                $action = XY_GetColumnUrl($action);
                                                                //获得文章URL
                                                            } else {
                                                                if (CheckFunValue($action, 'GetArticleUrl ') == true) {
                                                                    $action = XY_GetArticleUrl($action);
                                                                    //获得单页URL
                                                                } else {
                                                                    if (CheckFunValue($action, 'GetOnePageUrl ') == true) {
                                                                        $action = XY_GetOnePageUrl($action);
                                                                        //------------------- 模板模块区 -----------------------
                                                                        //显示包裹块 作用不大
                                                                    } else {
                                                                        if (CheckFunValue($action, 'DisplayWrap ') == true) {
                                                                            $action = XY_DisplayWrap($action);
                                                                            //显示布局
                                                                        } else {
                                                                            if (CheckFunValue($action, 'Layout ') == true) {
                                                                                $action = XY_Layout($action);
                                                                                //显示模块
                                                                            } else {
                                                                                if (CheckFunValue($action, 'Module ') == true) {
                                                                                    $action = XY_Module($action);
                                                                                    //读模块内容
                                                                                } else {
                                                                                    if (CheckFunValue($action, 'ReadTemplateModule ') == true) {
                                                                                        $action = XY_ReadTemplateModule($action);
                                                                                        //获得内容模块 20150108
                                                                                    } else {
                                                                                        if (CheckFunValue($action, 'GetContentModule ') == true) {
                                                                                            $action = XY_ReadTemplateModule($action);
                                                                                            //读模板样式并设置标题与内容   软件里有个栏目Style进行设置
                                                                                        } else {
                                                                                            if (CheckFunValue($action, 'ReadColumeSetTitle ') == true) {
                                                                                                $action = XY_ReadColumeSetTitle($action);
                                                                                                //------------------- 其它区 -----------------------
                                                                                                //显示JS渲染ASP/PHP/VB等程序的编辑器
                                                                                            } else {
                                                                                                if (CheckFunValue($action, 'displayEditor ') == true) {
                                                                                                    $action = displayEditor($action);
                                                                                                    //Js版网站统计
                                                                                                } else {
                                                                                                    if (CheckFunValue($action, 'JsWebStat ') == true) {
                                                                                                        $action = XY_JsWebStat($action);
                                                                                                        //------------------- 链接区 -----------------------
                                                                                                        //普通链接A
                                                                                                    } else {
                                                                                                        if (CheckFunValue($action, 'HrefA ') == true) {
                                                                                                            $action = XY_HrefA($action);
                                                                                                            //栏目菜单(引用后台栏目程序)
                                                                                                        } else {
                                                                                                            if (CheckFunValue($action, 'ColumnMenu ') == true) {
                                                                                                                $action = XY_AP_ColumnMenu($action);
                                                                                                                //------------------- 循环处理 -----------------------
                                                                                                                //For循环处理
                                                                                                            } else {
                                                                                                                if (CheckFunValue($action, 'ForArray ') == true) {
                                                                                                                    $action = XY_ForArray($action);
                                                                                                                    //------------------- 待分区 -----------------------
                                                                                                                    //网站底部
                                                                                                                } else {
                                                                                                                    if (CheckFunValue($action, 'WebSiteBottom ') == true || CheckFunValue($action, 'WebBottom ') == true) {
                                                                                                                        $action = XY_AP_WebSiteBottom($action);
                                                                                                                        //显示网站栏目 20160331
                                                                                                                    } else {
                                                                                                                        if (CheckFunValue($action, 'DisplayWebColumn ') == true) {
                                                                                                                            $action = XY_DisplayWebColumn($action);
                                                                                                                            //URL加密
                                                                                                                        } else {
                                                                                                                            if (CheckFunValue($action, 'escape ') == true) {
                                                                                                                                $action = XY_escape($action);
                                                                                                                                //URL解密
                                                                                                                            } else {
                                                                                                                                if (CheckFunValue($action, 'unescape ') == true) {
                                                                                                                                    $action = XY_unescape($action);
                                                                                                                                    //asp与php版本
                                                                                                                                } else {
                                                                                                                                    if (CheckFunValue($action, 'EDITORTYPE ') == true) {
                                                                                                                                        $action = XY_EDITORTYPE($action);
                                                                                                                                        //获得网址
                                                                                                                                    } else {
                                                                                                                                        if (CheckFunValue($action, 'getUrl ') == true) {
                                                                                                                                            $action = XY_getUrl($action);
                                                                                                                                            //暂时不屏蔽
                                                                                                                                        } else {
                                                                                                                                            if (CheckFunValue($action, 'copyTemplateMaterial ') == true) {
                                                                                                                                                $action = '';
                                                                                                                                            } else {
                                                                                                                                                if (CheckFunValue($action, 'clearCache ') == true) {
                                                                                                                                                    $action = '';
                                                                                                                                                } else {
                                                                                                                                                    $HandYes = false;
                                                                                                                                                    //处理为假
                                                                                                                                                }
                                                                                                                                            }
                                                                                                                                        }
                                                                                                                                    }
                                                                                                                                }
                                                                                                                            }
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            //注意这样,有的则不显示 晕 And IsNul(action)=False
            if (isNul($action) == true) {
                $action = '';
            }
            if ($HandYes == true) {
                $content = replace($content, $s, $action);
            }
        }
    }
    $handleAction = $content;
    return @$handleAction;
}
示例#5
0
function twoDimensionalArrayDesc($splStr)
{
    $i = '';
    $j = '';
    $t = '';
    for ($i = 0; $i <= uBound($splStr); $i++) {
        if (isNul($splStr[$i][0]) == false) {
            for ($j = $i; $j <= uBound($splStr); $j++) {
                if ($splStr[$i][0] < $splStr[$j][0]) {
                    $t = $splStr[$i][0];
                    $splStr[$i][0] = $splStr[$j][0];
                    $splStr[$j][0] = $t;
                    $t = $splStr[$i][1];
                    $splStr[$i][1] = $splStr[$j][1];
                    $splStr[$j][1] = $t;
                }
            }
        }
    }
    $twoDimensionalArrayDesc = $splStr;
    return @$twoDimensionalArrayDesc;
}
示例#6
0
function replaceValueParam($content, $paramName, $replaceStr)
{
    $startStr = '';
    $endStr = '';
    $labelStr = '';
    $tempLabelStr = '';
    $nLen = '';
    $nTimeFormat = '';
    $delHtmlYes = '';
    $funStr = '';
    $trimYes = '';
    $isEscape = '';
    $s = '';
    $i = '';
    $ifStr = '';
    //判断字符
    $elseIfStr = '';
    //第二判断字符
    $valueStr = '';
    //显示字符
    $elseStr = '';
    //否则字符
    $elseIfValue = '';
    $elseValue = '';
    //第二判断值
    $instrStr = '';
    $instr2Str = '';
    //查找字符
    $tempReplaceStr = '';
    //暂存
    //ReplaceStr = ReplaceStr & "这里面放上内容在这时碳呀。"
    //ReplaceStr = CStr(ReplaceStr)            '转成字符类型
    if (isNul($replaceStr) == true) {
        $replaceStr = '';
    }
    $tempReplaceStr = $replaceStr;
    //最多处理99个  20160225
    for ($i = 1; $i <= 999; $i++) {
        $replaceStr = $tempReplaceStr;
        //恢复
        $startStr = '[$' . $paramName;
        $endStr = '$]';
        //字段名称严格判断 20160226
        if (inStr($content, $startStr) > 0 && inStr($content, $endStr) > 0 && (inStr($content, $startStr . ' ') > 0 || inStr($content, $startStr . $endStr) > 0)) {
            //获得对应字段加强版20151231
            if (inStr($content, $startStr . $endStr) > 0) {
                $labelStr = $startStr . $endStr;
            } else {
                if (inStr($content, $startStr . ' ') > 0) {
                    $labelStr = StrCut($content, $startStr . ' ', $endStr, 1);
                } else {
                    $labelStr = StrCut($content, $startStr, $endStr, 1);
                }
            }
            $tempLabelStr = $labelStr;
            $labelStr = HandleInModule($labelStr, 'start');
            //删除Html
            $delHtmlYes = RParam($labelStr, 'delHtml');
            //是否删除Html
            if ($delHtmlYes == 'true') {
                $replaceStr = replace(delHtml($replaceStr), '<', '&lt;');
            }
            //HTML处理
            //删除两边空格
            $trimYes = RParam($labelStr, 'trim');
            //是否删除两边空格
            if ($trimYes == 'true') {
                $replaceStr = TrimVbCrlf($replaceStr);
            }
            //截取字符处理
            $nLen = RParam($labelStr, 'len');
            //字符长度值
            $nLen = handleNumber($nLen);
            //If nLen<>"" Then ReplaceStr = CutStr(ReplaceStr,nLen,"null")' Left(ReplaceStr,nLen)
            if ($nLen != '') {
                $replaceStr = CutStr($replaceStr, $nLen, '...');
            }
            //Left(ReplaceStr,nLen)
            //时间处理
            $nTimeFormat = RParam($labelStr, 'format_time');
            //时间处理值
            if ($nTimeFormat != '') {
                $replaceStr = Format_Time($replaceStr, $nTimeFormat);
            }
            //获得栏目名称
            $s = RParam($labelStr, 'getcolumnname');
            if ($s != '') {
                if ($s == '@ME') {
                    $s = $replaceStr;
                }
                $replaceStr = getColumnName($s);
            }
            //获得栏目URL
            $s = RParam($labelStr, 'getcolumnurl');
            if ($s != '') {
                if ($s == '@ME') {
                    $s = $replaceStr;
                }
                $replaceStr = getColumnUrl($s, 'id');
            }
            //是否为密码类型
            $s = RParam($labelStr, 'password');
            if ($s != '') {
                if ($s != '') {
                    $replaceStr = $s;
                }
            }
            $ifStr = RParam($labelStr, 'if');
            $elseIfStr = RParam($labelStr, 'elseif');
            $valueStr = RParam($labelStr, 'value');
            $elseifValue = RParam($labelStr, 'elseifvalue');
            $elseValue = RParam($labelStr, 'elsevalue');
            $instrStr = RParam($labelStr, 'instr');
            $instr2Str = RParam($labelStr, 'instr2');
            //call echo("ifStr",ifStr)
            //call echo("valueStr",valueStr)
            //call echo("elseStr",elseStr)
            //call echo("elseIfStr",elseIfStr)
            //call echo("replaceStr",replaceStr)
            if ($ifStr != '' || $instrStr != '') {
                if ($ifStr == cStr($replaceStr) && $ifStr != '') {
                    $replaceStr = $valueStr;
                } else {
                    if ($elseIfStr == cStr($replaceStr) && $elseIfStr != '') {
                        $replaceStr = $valueStr;
                        if ($elseifValue != '') {
                            $replaceStr = $elseifValue;
                        }
                    } else {
                        if (inStr(cStr($replaceStr), $instrStr) > 0 && $instrStr != '') {
                            $replaceStr = $valueStr;
                        } else {
                            if (inStr(cStr($replaceStr), $instr2Str) > 0 && $instr2Str != '') {
                                $replaceStr = $valueStr;
                                if ($elseifValue != '') {
                                    $replaceStr = $elseifValue;
                                }
                            } else {
                                if ($elseValue != '@ME') {
                                    $replaceStr = $elseValue;
                                }
                            }
                        }
                    }
                }
            }
            //函数处理20151231    [$title  function='left(@ME,40)'$]
            $funStr = RParam($labelStr, 'function');
            //函数
            if ($funStr != '') {
                $funStr = replace($funStr, '@ME', $replaceStr);
                $replaceStr = HandleContentCode($funStr, '');
            }
            //默认值
            $s = RParam($labelStr, 'default');
            if ($s != '' && $s != '@ME') {
                if ($replaceStr == '') {
                    $replaceStr = $s;
                }
            }
            //escape转码
            $isEscape = lCase(RParam($labelStr, 'escape'));
            if ($isEscape == '1' || $isEscape == 'true') {
                $replaceStr = escape($replaceStr);
            }
            //文本颜色
            $s = RParam($labelStr, 'fontcolor');
            //函数
            if ($s != '') {
                $replaceStr = '<font color="' . $s . '">' . $replaceStr . '</font>';
            }
            //call echo(tempLabelStr,replaceStr)
            $content = replace($content, $tempLabelStr, $replaceStr);
        } else {
            break;
        }
    }
    $replaceValueParam = $content;
    return @$replaceValueParam;
}