Ejemplo n.º 1
0
function whiteWebStat($content)
{
    $splStr = '';
    $splxx = '';
    $filePath = '';
    $nCount = '';
    $url = '';
    $s = '';
    $visitUrl = '';
    $viewUrl = '';
    $viewdatetime = '';
    $ip = '';
    $browser = '';
    $operatingsystem = '';
    $cookie = '';
    $screenwh = '';
    $moreInfo = '';
    $ipList = '';
    $dateClass = '';
    $splxx = aspSplit($content, vbCrlf() . '-------------------------------------------------' . vbCrlf());
    $nCount = 0;
    foreach ($splxx as $key => $s) {
        if (inStr($s, '当前:') > 0) {
            $nCount = $nCount + 1;
            $s = vbCrlf() . $s . vbCrlf();
            $dateClass = ADSql(getFileAttr($filePath, '3'));
            $visitUrl = ADSql(getStrCut($s, vbCrlf() . '来访', vbCrlf(), 0));
            $viewUrl = ADSql(getStrCut($s, vbCrlf() . '当前:', vbCrlf(), 0));
            $viewdatetime = ADSql(getStrCut($s, vbCrlf() . '时间:', vbCrlf(), 0));
            $ip = ADSql(getStrCut($s, vbCrlf() . 'IP:', vbCrlf(), 0));
            $browser = ADSql(getStrCut($s, vbCrlf() . 'browser: ', vbCrlf(), 0));
            $operatingsystem = ADSql(getStrCut($s, vbCrlf() . 'operatingsystem=', vbCrlf(), 0));
            $cookie = ADSql(getStrCut($s, vbCrlf() . 'Cookies=', vbCrlf(), 0));
            $screenwh = ADSql(getStrCut($s, vbCrlf() . 'Screen=', vbCrlf(), 0));
            $moreInfo = ADSql(getStrCut($s, vbCrlf() . '用户信息=', vbCrlf(), 0));
            $browser = ADSql(getBrType($moreInfo));
            if (inStr(vbCrlf() . $ipList . vbCrlf(), vbCrlf() . $ip . vbCrlf()) == false) {
                $ipList = $ipList . $ip . vbCrlf();
            }
            $viewdatetime = replace($viewdatetime, '来访', '00');
            if (isDate($viewdatetime) == false) {
                $viewdatetime = '1988/07/12 10:10:10';
            }
            $screenwh = left($screenwh, 20);
            if (1 == 2) {
                aspEcho('编号', $nCount);
                aspEcho('dateClass', $dateClass);
                aspEcho('visitUrl', $visitUrl);
                aspEcho('viewUrl', $viewUrl);
                aspEcho('viewdatetime', $viewdatetime);
                aspEcho('IP', $ip);
                aspEcho('browser', $browser);
                aspEcho('operatingsystem', $operatingsystem);
                aspEcho('cookie', $cookie);
                aspEcho('screenwh', $screenwh);
                aspEcho('moreInfo', $moreInfo);
                HR();
            }
            connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'websitestat (visiturl,viewurl,browser,operatingsystem,screenwh,moreinfo,viewdatetime,ip,dateclass) values(\'' . $visitUrl . '\',\'' . $viewUrl . '\',\'' . $browser . '\',\'' . $operatingsystem . '\',\'' . $screenwh . '\',\'' . $moreInfo . '\',\'' . $viewdatetime . '\',\'' . $ip . '\',\'' . $dateClass . '\')');
        }
    }
}
Ejemplo n.º 2
0
function makeAllHtml($columnType, $columnName, $columnId)
{
    $action = '';
    $s = '';
    $i = '';
    $nPageSize = '';
    $nCountSize = '';
    $nPage = '';
    $addSql = '';
    $url = '';
    $articleSql = '';
    handlePower('生成全部HTML页面');
    //管理权限处理
    writeSystemLog('', '生成全部HTML页面');
    //系统日志
    $GLOBALS['isMakeHtml'] = true;
    //栏目
    aspEcho('栏目', '');
    if ($columnType != '') {
        $addSql = 'where columnType=\'' . $columnType . '\'';
    }
    if ($columnName != '') {
        $addSql = getWhereAnd($addSql, 'where columnName=\'' . $columnName . '\'');
    }
    if ($columnId != '') {
        $addSql = getWhereAnd($addSql, 'where id in(' . $columnId . ')');
    }
    $rssObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webcolumn ' . $addSql . ' order by sortrank asc');
    while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) {
        $GLOBALS['glb_columnName'] = '';
        //开启生成html
        if ($rss['isonhtml'] == true) {
            if (inStr('|产品|新闻|视频|下载|案例|留言|反馈|招聘|订单|', '|' . $rss['columntype'] . '|') > 0) {
                if ($rss['columntype'] == '留言') {
                    $nCountSize = getRecordCount($GLOBALS['db_PREFIX'] . 'guestbook', '');
                    //记录数
                } else {
                    $nCountSize = getRecordCount($GLOBALS['db_PREFIX'] . 'articledetail', ' where parentid=' . $rss['id']);
                    //记录数
                }
                $nPageSize = $rss['npagesize'];
                $nPage = getPageNumb(CInt($nCountSize), CInt($nPageSize));
                if ($nPage <= 0) {
                    $nPage = 1;
                }
                for ($i = 1; $i <= $nPage; $i++) {
                    $url = getHandleRsUrl($rss['filename'], $rss['customaurl'], '/nav' . $rss['id']);
                    $GLOBALS['glb_filePath'] = replace($url, $GLOBALS['cfg_webSiteUrl'], '');
                    if (right($GLOBALS['glb_filePath'], 1) == '/' || $GLOBALS['glb_filePath'] == '') {
                        $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html';
                    }
                    //call echo("glb_filePath",glb_filePath)
                    $action = ' action actionType=\'nav\' columnName=\'' . $rss['columnname'] . '\' npage=\'' . $i . '\' listfilename=\'' . $GLOBALS['glb_filePath'] . '\' ';
                    //call echo("action",action)
                    makeWebHtml($action);
                    if ($i > 1) {
                        $GLOBALS['glb_filePath'] = mid($GLOBALS['glb_filePath'], 1, len($GLOBALS['glb_filePath']) - 5) . $i . '.html';
                    }
                    $s = '<a href="' . $GLOBALS['glb_filePath'] . '" target=\'_blank\'>' . $GLOBALS['glb_filePath'] . '</a>(' . $rss['isonhtml'] . ')';
                    aspEcho($action, $s);
                    if ($GLOBALS['glb_filePath'] != '') {
                        CreateDirFolder(getFileAttr($GLOBALS['glb_filePath'], '1'));
                        createFileGBK($GLOBALS['glb_filePath'], $GLOBALS['code']);
                    }
                    doEvents();
                    $GLOBALS['templateName'] = '';
                    //清空模板文件名称
                }
            } else {
                $action = ' action actionType=\'nav\' columnName=\'' . $rss['columnname'] . '\'';
                makeWebHtml($action);
                $GLOBALS['glb_filePath'] = replace(getColumnUrl($rss['columnname'], 'name'), $GLOBALS['cfg_webSiteUrl'], '');
                if (right($GLOBALS['glb_filePath'], 1) == '/' || $GLOBALS['glb_filePath'] == '') {
                    $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html';
                }
                $s = '<a href="' . $GLOBALS['glb_filePath'] . '" target=\'_blank\'>' . $GLOBALS['glb_filePath'] . '</a>(' . $rss['isonhtml'] . ')';
                aspEcho($action, $s);
                if ($GLOBALS['glb_filePath'] != '') {
                    CreateDirFolder(getFileAttr($GLOBALS['glb_filePath'], '1'));
                    createFileGBK($GLOBALS['glb_filePath'], $GLOBALS['code']);
                }
                doEvents();
                $GLOBALS['templateName'] = '';
            }
            connexecute('update ' . $GLOBALS['db_PREFIX'] . 'WebColumn set ishtml=true where id=' . $rss['id']);
            //更新导航为生成状态
        }
    }
    //单独处理指定栏目对应文章
    if ($columnId != '') {
        $articleSql = 'select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail where parentid=' . $columnId . ' order by sortrank asc';
        //批量处理文章
    } else {
        if ($addSql == '') {
            $articleSql = 'select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail order by sortrank asc';
        }
    }
    if ($articleSql != '') {
        //文章
        aspEcho('文章', '');
        $rssObj = $GLOBALS['conn']->query($articleSql);
        while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) {
            $GLOBALS['glb_columnName'] = '';
            $action = ' action actionType=\'detail\' columnName=\'' . $rss['parentid'] . '\' id=\'' . $rss['id'] . '\'';
            //call echo("action",action)
            makeWebHtml($action);
            $GLOBALS['glb_filePath'] = replace($GLOBALS['glb_url'], $GLOBALS['cfg_webSiteUrl'], '');
            if (right($GLOBALS['glb_filePath'], 1) == '/') {
                $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html';
            }
            $s = '<a href="' . $GLOBALS['glb_filePath'] . '" target=\'_blank\'>' . $GLOBALS['glb_filePath'] . '</a>(' . $rss['isonhtml'] . ')';
            aspEcho($action, $s);
            //文件不为空  并且开启生成html
            if ($GLOBALS['glb_filePath'] != '' && $rss['isonhtml'] == true) {
                CreateDirFolder(getFileAttr($GLOBALS['glb_filePath'], '1'));
                createFileGBK($GLOBALS['glb_filePath'], $GLOBALS['code']);
                connexecute('update ' . $GLOBALS['db_PREFIX'] . 'ArticleDetail set ishtml=true where id=' . $rss['id']);
                //更新文章为生成状态
            }
            $GLOBALS['templateName'] = '';
            //清空模板文件名称
        }
    }
    if ($addSql == '') {
        //单页
        aspEcho('单页', '');
        $rssObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'onepage order by sortrank asc');
        while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) {
            $GLOBALS['glb_columnName'] = '';
            $action = ' action actionType=\'onepage\' id=\'' . $rss['id'] . '\'';
            //call echo("action",action)
            makeWebHtml($action);
            $GLOBALS['glb_filePath'] = replace($GLOBALS['glb_url'], $GLOBALS['cfg_webSiteUrl'], '');
            if (right($GLOBALS['glb_filePath'], 1) == '/') {
                $GLOBALS['glb_filePath'] = $GLOBALS['glb_filePath'] . 'index.html';
            }
            $s = '<a href="' . $GLOBALS['glb_filePath'] . '" target=\'_blank\'>' . $GLOBALS['glb_filePath'] . '</a>(' . $rss['isonhtml'] . ')';
            aspEcho($action, $s);
            //文件不为空  并且开启生成html
            if ($GLOBALS['glb_filePath'] != '' && $rss['isonhtml'] == true) {
                CreateDirFolder(getFileAttr($GLOBALS['glb_filePath'], '1'));
                createFileGBK($GLOBALS['glb_filePath'], $GLOBALS['code']);
                connexecute('update ' . $GLOBALS['db_PREFIX'] . 'onepage set ishtml=true where id=' . $rss['id']);
                //更新单页为生成状态
            }
            $GLOBALS['templateName'] = '';
            //清空模板文件名称
        }
    }
}
Ejemplo n.º 3
0
function replaceCssImgPath($cssStr, $imgPath)
{
    $content = '';
    $splstr = '';
    $s = '';
    $c = '';
    $fileName = '';
    $toImgPath = '';
    $content = GetArray($cssStr, '\\(', '\\)', false, false);
    $splstr = aspSplit($content, '$Array$');
    foreach ($splstr as $key => $s) {
        if ($s != '') {
            $fileName = getFileAttr($s, 2);
            //引用图片
            if (inStr(lCase($s), 'data:image') == false) {
                $cssStr = replace($cssStr, '(' . $s . ')', '(' . $imgPath . $fileName . ')');
                //fileName="data:image/" & fileName
            }
        }
    }
    $replaceCssImgPath = $cssStr;
    return @$replaceCssImgPath;
}
Ejemplo n.º 4
0
function templateFileList($dir)
{
    $content = '';
    $splStr = '';
    $fileName = '';
    $s = '';
    $fileType = '';
    $folderName = '';
    $filePath = '';
    if (@$_SESSION['adminusername'] == 'ASPPHPCMS') {
        $content = getDirFolderNameList($dir, '');
        $splStr = aspSplit($content, vbCrlf());
        foreach ($splStr as $key => $folderName) {
            $s = '<a href=\'?act=templateFileList&dir=' . $dir . '/' . $folderName . '\'>' . $folderName . '</a>';
            aspEcho('<img src=\'../admin/Images/file/folder.gif\'>', $s);
        }
        $content = getDirFileNameList($dir, '');
    } else {
        $content = getDirHtmlNameList($dir);
    }
    $splStr = aspSplit($content, vbCrlf());
    foreach ($splStr as $key => $fileName) {
        if ($fileName != '') {
            $fileType = lCase(getFileAttr($fileName, 4));
            $filePath = $dir . '/' . $filename;
            if (inStr('|asa|asp|aspx|bat|bmp|cfm|cmd|com|css|db|default|dll|doc|exe|fla|folder|gif|h|htm|html|inc|ini|jpg|js|jtbc|log|mdb|mid|mp3|php|png|rar|real|rm|swf|txt|wav|xls|xml|zip|', '|' . $fileType . '|') == false) {
                $fileType = 'default';
            }
            $s = '<a href="../index.php?templatedir=' . escape($dir) . '&templateName=' . $fileName . '" target=\'_blank\'>预览</a> ';
            aspEcho('<img src=\'../admin/Images/file/' . $fileType . '.gif\'>' . $fileName . '(' . printSpaceValue(getFSize($filePath)) . ')', $s . '| <a href=\'?act=addEditFile&dir=' . $dir . '&fileName=' . $fileName . '\'>修改</a> | <a href=\'?act=delTemplateFile&dir=' . @$_REQUEST['dir'] . '&fileName=' . $fileName . '\' onclick=\'return checkDel()\'>删除</a>');
        }
    }
}