コード例 #1
0
ファイル: MySqlClass.php プロジェクト: 313801120/AspToPhp
 function handleSqlTop($sql)
 {
     $s = "";
     $nLength = "";
     $leftStr = "";
     $rightStr = "";
     $nRow = "";
     $s = LCase($sql);
     $nLength = instr($s, " top ");
     if ($nLength > 0) {
         $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;
 }
コード例 #2
0
ファイル: Install.php プロジェクト: 313801120/AspPhpCms
$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);
                if ($isdisplay == '') {
                    $isdisplay = 1;
                }
                //ASPEcho('lablename', $lableName) ;
                if ($title != '') {
                    connExecute('insert into ' . $DB_PREFIX . 'ListMenu (title,parentid,sortrank,lablename,isdisplay,customaurl) values(\'' . $title . '\',' . $parentid . ',' . $nCount . ',\'' . $lableName . '\',' . $isdisplay . ',\'' . $url . '\')');
                    if ($parentid == '-1') {
                        $rsObj = $GLOBALS['conn']->query('select * from ' . $DB_PREFIX . 'ListMenu where title=\'' . $title . '\'');