Example #1
0
function handleHttpUrlArray($url)
{
    //on error resume next
    $urlDir = '';
    $fileName = '';
    $FileType = '';
    $fileStr = '';
    $httpAgreement = '';
    $webSite = '';
    $folderDir = '';
    $url = handleHttpUrl($url);
    $urlDir = mid($url, 1, inStrRev($url, '/'));
    $fileStr = mid($url, inStrRev($url, '/') + 1, -1);
    $fileName = $fileStr;
    if (inStr($fileStr, '?') > 0) {
        $fileName = mid($fileStr, 1, inStr($fileStr, '?') - 1);
    }
    $FileType = mid($fileName, inStrRev($fileName, '.') + 1, -1);
    $httpAgreement = mid($url, 1, inStr($url, ':') - 1);
    $webSite = getWebSite($url);
    //Call echo("url", url)
    //域名为空则发粗获得文件夹目录20160613
    if ($webSite != '') {
        $folderDir = mid($urlDir, len($webSite), -1);
    } else {
        echoYellowB('注意:不是有效网址', $url);
    }
    //HandleHttpUrlArray = Array(url, urlDir, fileName, fileType, fileStr, HttpAgreement, webSite, folderDir)
    $arrayData = '';
    $arrayData = aspSplit($url . vbCrlf() . $urlDir . vbCrlf() . $fileName . vbCrlf() . $FileType . vbCrlf() . $fileStr . vbCrlf() . $httpAgreement . vbCrlf() . $webSite . vbCrlf() . $folderDir, vbCrlf());
    $handleHttpUrlArray = $arrayData;
    return @$handleHttpUrlArray;
}
Example #2
0
function loadWebConfig()
{
    $templatedir = '';
    $GLOBALS['conn='] = OpenConn();
    $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'website');
    if (@mysql_num_rows($rsObj) != 0) {
        $rs = mysql_fetch_array($rsObj);
        $GLOBALS['cfg_webSiteUrl'] = PHPTrim($rs['websiteurl']);
        //网址
        $GLOBALS['cfg_webTemplate'] = $GLOBALS['webDir'] . PHPTrim($rs['webtemplate']);
        //模板路径
        $GLOBALS['cfg_webImages'] = $GLOBALS['webDir'] . PHPTrim($rs['webimages']);
        //图片路径
        $GLOBALS['cfg_webCss'] = $GLOBALS['webDir'] . PHPTrim($rs['webcss']);
        //css路径
        $GLOBALS['cfg_webJs'] = $GLOBALS['webDir'] . PHPTrim($rs['webjs']);
        //js路径
        $GLOBALS['cfg_webTitle'] = $rs['webtitle'];
        //网址标题
        $GLOBALS['cfg_webKeywords'] = $rs['webkeywords'];
        //网站关键词
        $GLOBALS['cfg_webDescription'] = $rs['webdescription'];
        //网站描述
        $GLOBALS['cfg_webSiteBottom'] = $rs['websitebottom'];
        //网站地底
        $GLOBALS['cfg_flags'] = $rs['flags'];
        //旗
        //改换模板20160202
        if (@$_REQUEST['templatedir'] != '') {
            //删除绝对目录前面的目录,不需要那个东西20160414
            $templatedir = replace(HandlePath(@$_REQUEST['templatedir']), HandlePath('/'), '/');
            //call eerr("templatedir",templatedir)
            if ((inStr($templatedir, ':') > 0 || inStr($templatedir, '..') > 0) && GetIP() != '127.0.0.1') {
                Eerr('提示', '模板目录有非法字符');
            }
            $templatedir = handleHttpUrl(replace($templatedir, HandlePath('/'), '/'));
            $GLOBALS['cfg_webImages'] = replace($GLOBALS['cfg_webImages'], $GLOBALS['cfg_webTemplate'], $templatedir);
            $GLOBALS['cfg_webCss'] = replace($GLOBALS['cfg_webCss'], $GLOBALS['cfg_webTemplate'], $templatedir);
            $GLOBALS['cfg_webJs'] = replace($GLOBALS['cfg_webJs'], $GLOBALS['cfg_webTemplate'], $templatedir);
            $GLOBALS['cfg_webTemplate'] = $templatedir;
        }
        $GLOBALS['webTemplate'] = $GLOBALS['cfg_webTemplate'];
    }
}
Example #3
0
function getHandleWebHtmlLink($RootPath, $content)
{
    $startStr = '';
    $endStr = '';
    $ImgList = '';
    $splStr = '';
    $c = '';
    $CssUrl = '';
    $NewCssUrl = '';
    $CssStr = '';
    $startStr = '<link ';
    $CssStr = '';
    $endStr = '>';
    $ImgList = GetArray($content, $startStr, $endStr, false, false);
    //Call RwEnd(ImgList)
    $splStr = aspSplit($ImgList, '$Array$');
    foreach ($splStr as $key => $CssUrl) {
        if ($CssUrl != '' && inStr(lCase($CssUrl), 'stylesheet') > 0) {
            //获得Css加强版,改于20141125
            $CssUrl = lCase(replace(replace(replace($CssUrl, '"', ''), '\'', ''), '>', ' ')) . ' ';
            $startStr = 'href=';
            $endStr = ' ';
            if (inStr($CssUrl, $startStr) > 0 && inStr($CssUrl, $endStr) > 0) {
                $CssUrl = StrCut($CssUrl, $startStr, $endStr, 2);
            }
            $NewCssUrl = handleHttpUrl($CssUrl);
            if (inStr($NewCssUrl, '/') > 0) {
                $NewCssUrl = mid($NewCssUrl, inStrRev($NewCssUrl, '/') + 1, -1);
            }
            if (lCase($NewCssUrl) != 'common.css' && lCase($NewCssUrl) != 'public.css') {
                $NewCssUrl = $RootPath . $NewCssUrl;
                $CssStr = $CssStr . '<link href="' . $NewCssUrl . '" rel="stylesheet" type="text/css" />' . vbCrlf();
            }
        }
    }
    if ($CssStr != '') {
        $CssStr = left($CssStr, len($CssStr) - 2);
    }
    $getHandleWebHtmlLink = $CssStr;
    return @$getHandleWebHtmlLink;
}
Example #4
0
function imgSrc($url, $title, $target)
{
    $url = handleHttpUrl($url);
    //处理一下URL 让之完整
    $imgSrc = 'src=\'' . $url . '\'' . aTitle($title) . imgAlt($title) . aTarget($target);
    return @$imgSrc;
}