Exemple #1
0
$title = '';
$lableName = '';
$content = '';
$tempS = '';
$url = '';
$isdisplay = '';
$nCount = '';
//echo('path='.handlePath('./../admin/后台菜单配置.ini'));
$content = getftext(handlePath('./../admin/后台菜单配置.ini'));
$content = Replace($content, "\t", '    ');
$splStr = aspSplit($content, chr(10));
//不用vbCrlf()  是因为在上传到GitHut上去,下载下来它会把后台菜单配置.ini文件编码转成utf-8 20160409
$nCount = 0;
foreach ($splStr as $s) {
    $tempS = $s;
    $s = AspTrim($s);
    if ($tempS != '' && substr(phptrim($s) . ' ', 0, 1) != '#') {
        $nCount = $nCount + 1;
        //总数
        if (substr($tempS, 0, 4) == '    ') {
        } else {
            $parentid = '-1';
        }
        if (trim(LCase($tempS)) == 'end') {
            break;
        } else {
            if (trim($s) != '') {
                $title = mid($s . ' ', 1, instr($s . ' ', ' ') - 1);
                $lableName = getStrCut($s, 'lablename=\'', '\'', 2);
                $url = getStrCut($s, 'url=\'', '\'', 2);
                $isdisplay = getStrCut($s, 'isdisplay=\'', '\'', 2);
Exemple #2
0
 function handleSqlTop($sql)
 {
     $s = "";
     $nLength = "";
     $leftStr = "";
     $rightStr = "";
     $nRow = "";
     $s = LCase($sql);
     $nLength = instr($s, " top ");
     $nSelect = instr(lcase($s), "select ");
     if ($nLength > 0 && $nSelect > 0) {
         //只允许查询有显示多少条的限制 20160408
         $leftStr = mid($sql, 1, $nLength);
         $rightStr = mid($sql, $nLength + 5, -1);
         $rightStr = AspTrim($rightStr);
         $nRow = mid($rightStr, 1, instr($rightStr, " "));
         $rightStr = mid($rightStr, instr($rightStr, " "), -1);
         //call echo("nRow",nRow)
         //call echo("leftStr",leftStr)
         //call echo("rightStr",rightStr)
         $sql = $leftStr . $rightStr . " limit " . $nRow;
     }
     $handleSqlTop = $sql;
     return @$handleSqlTop;
 }