getUserID().'.txt';
if(!file_exists($myIcoFile)) $myIcoFile = $defaultIcoFile;
//默认主页
if(empty($dopost))
{
require(DEDEINC.'/inc/inc_fun_funAdmin.php');
$verLockFile = DEDEDATA.'/admin/ver.txt';
$fp = fopen($verLockFile,'r');
$upTime = trim(fread($fp,64));
fclose($fp);
$oktime = substr($upTime,0,4).'-'.substr($upTime,4,2).'-'.substr($upTime,6,2);
$offUrl = SpGetNewInfo();
$dedecmsidc = DEDEDATA.'/admin/idc.txt';
$fp = fopen($dedecmsidc,'r');
$dedeIDC = fread($fp,filesize($dedecmsidc));
fclose($fp);
$myMoveFile = DEDEDATA.'/admin/move-'.$cuserLogin->getUserID().'.txt';
if(file_exists($myMoveFile))
{
$fp = fopen($myMoveFile,'r');
$movedata= fread($fp,filesize($myMoveFile));
$movedata = unserialize($movedata);
$column1 = array();
$column2 = array();
foreach ($movedata['items'] as $key => $value) {
if($value['column'] == 'column1') $column1 = $column1 + array($key => $value['id']);
else if($value['column'] == 'column2') $column2 = $column2 + array($key => $value['id']);
}
include DedeInclude('templets/index_body_move.htm');
}else{
include DedeInclude('templets/index_body.htm');
}
exit();
}
/*-----------------------
增加新项
function _AddNew() { }
-------------------------*/
else if($dopost=='addnew')
{
if(empty($link) || empty($title))
{
ShowMsg("链接网址或标题不能为空!","-1");
exit();
}
$fp = fopen($myIcoFile,'r');
$oldct = trim(fread($fp, filesize($myIcoFile)));
fclose($fp);
$link = preg_replace("#['\"]#", '`', $link);
$title = preg_replace("#['\"]#", '`', $title);
$ico = preg_replace("#['\"]#", '`', $ico);
$oldct .= "\r\n";
$myIcoFileTrue = DEDEDATA.'/admin/quickmenu-'.$cuserLogin->getUserID().'.txt';
$fp = fopen($myIcoFileTrue, 'w');
fwrite($fp, $oldct);
fclose($fp);
ShowMsg("成功增加一个项目!","index_body.php?".time());
exit();
}
/*---------------------------
保存修改的项
function _EditSave() { }
----------------------------*/
else if($dopost=='editsave')
{
$quickmenu = stripslashes($quickmenu);
$myIcoFileTrue = DEDEDATA.'/admin/quickmenu-'.$cuserLogin->getUserID().'.txt';
$fp = fopen($myIcoFileTrue,'w');
fwrite($fp,$quickmenu);
fclose($fp);
ShowMsg("成功修改快捷操作项目!","index_body.php?".time());
exit();
}
/*---------------------------
保存修改的项
function _EditSave() { }
----------------------------*/
else if($dopost=='movesave')
{
$movedata = str_replace('\\',"",$sortorder);
$movedata = json_decode($movedata,TRUE);
$movedata = serialize($movedata);
$myIcoFileTrue = DEDEDATA.'/admin/move-'.$cuserLogin->getUserID().'.txt';
$fp = fopen($myIcoFileTrue,'w');
fwrite($fp,$movedata);
fclose($fp);
}
/*-----------------------------
显示修改表单
function _EditShow() { }
-----------------------------*/
else if($dopost=='editshow')
{
$fp = fopen($myIcoFile,'r');
$oldct = trim(fread($fp,filesize($myIcoFile)));
fclose($fp);
?>
GetOne($query);
$query = " SELECT COUNT(*) AS dd FROM `#@__feedback` ";
$row2 = $dsql->GetOne($query);
$chArrNames = array();
$query = "SELECT id, typename FROM `#@__channeltype` ";
$dsql->Execute('c', $query);
while($row = $dsql->GetArray('c'))
{
$chArrNames[$row['id']] = $row['typename'];
}
$query = "SELECT COUNT(channel) AS dd, channel FROM `#@__arctiny` GROUP BY channel ";
$allArc = 0;
$chArr = array();
$dsql->Execute('a', $query);
while($row = $dsql->GetArray('a'))
{
$allArc += $row['dd'];
$row['typename'] = $chArrNames[$row['channel']];
$chArr[] = $row;
}
?>
-2 ORDER BY arc.id DESC LIMIT 0, 6 ";
$arcArr = array();
$dsql->Execute('m', $query);
while($row = $dsql->GetArray('m'))
{
$arcArr[] = $row;
}
AjaxHead();
?>
{$row['title']}";
if($row['arcrank']==-1) $linkstr .= "(未审核)";
?>
|
array(
'method' => $post ? 'POST' : 'GET',
'header' => $header,
'content' => $content,
'timeout' => $timeout,
),
));
$fp = @fopen($scheme.'://'.$host.':'.$port.$path, 'b', false, $context);
$fpflag = 1;
}
if (!$fp) {
return '';
} else {
stream_set_blocking($fp, true);
stream_set_timeout($fp, $timeout);
@fwrite($fp, $out);
$status = stream_get_meta_data($fp);
if (!$status['timed_out']) {
while (!feof($fp) && !$fpflag) {
if (($header = @fgets($fp)) && ($header == "\r\n" || $header == "\n")) {
break;
}
}
if ($limit) {
$return = stream_get_contents($fp, $limit);
} else {
$return = stream_get_contents($fp);
}
}
@fclose($fp);
return $return;
}
}
$seo_info = array();
$seo_info = $dsql->GetOne("SELECT * FROM `#@__plus_seoinfo` ORDER BY id DESC");
$now = time();
if ( empty($seo_info) OR $now - $seo_info['create_time'] > 60*60*6 )
{
$site = str_replace(array("http://",'/'),'',$cfg_basehost);
$url = "http://www.alexa.com/siteinfo/{$site}";
$html = dedeseo_http_send($url);
//var_dump($html);exit;
if ( preg_match("#API at http://aws.amazon.com/awis -->(.*)#isU",$html,$matches) )
{
$seo_info['alexa_num'] = isset($matches[1])? trim($matches[1]) : 0;
}
$seo_info['alexa_num'] = empty($seo_info['alexa_num'])? 0 : $seo_info['alexa_num'];
if ( preg_match("#Flag'>(.*)#isU",$html,$matches) )
{
$seo_info['alexa_area_num'] = isset($matches[1])? trim($matches[1]) : 0;
}
$seo_info['alexa_area_num'] = empty($seo_info['alexa_area_num'])? 0 : $seo_info['alexa_area_num'];
$url = "http://www.baidu.com/s?wd=site:{$site}";
$html = Html2Text(dedeseo_http_send($url));
if ( preg_match("#结果数约([\d]+)个#",$html,$matches) )
{
$seo_info['baidu_count'] = isset($matches[1])? $matches[1] : 0;
}
if (empty($seo_info['baidu_count']) AND preg_match("#网站共有([\d, ]+)个#",$html,$matches) )
{
$seo_info['baidu_count'] = isset($matches[1])? trim($matches[1]) : 0;
}
$seo_info['baidu_count'] = empty($seo_info['baidu_count'])? 0 : $seo_info['baidu_count'];
$url = "http://www.sogou.com/web?query=site:{$site}";
$html = Html2Text(dedeseo_http_send($url));
if ( preg_match("#结果数约([\d]+)个#",$html,$matches) )
{
$seo_info['sogou_count'] = isset($matches[1])? $matches[1] : 0;
}
if (empty($seo_info['sogou_count']) AND preg_match("#找到约([\d, ]+)条结果#",$html,$matches) )
{
$seo_info['sogou_count'] = isset($matches[1])? trim($matches[1]) : 0;
}
$seo_info['sogou_count'] = empty($seo_info['sogou_count'])? 0 : $seo_info['sogou_count'];
$url = "http://www.haosou.com/s?q=site%3A{$site}";
$html = Html2Text(dedeseo_http_send($url));
if ( preg_match("#结果数约([\d]+)个#",$html,$matches) )
{
$seo_info['haosou360_count'] = isset($matches[1])? $matches[1] : 0;
}
if (empty($seo_info['haosou360_count']) AND preg_match("#结果约([\d, ]+)个#",$html,$matches) )
{
$seo_info['haosou360_count'] = isset($matches[1])? trim($matches[1]) : 0;
}
$seo_info['haosou360_count'] = empty($seo_info['haosou360_count'])? 0 : $seo_info['haosou360_count'];
$in_query = "INSERT INTO `#@__plus_seoinfo` (`create_time`, `alexa_num`, `alexa_area_num`, `baidu_count`, `sogou_count`, `haosou360_count`) VALUES ({$now}, '{$seo_info['alexa_num']}', '{$seo_info['alexa_area_num']}', '{$seo_info['baidu_count']}', '{$seo_info['sogou_count']}', '{$seo_info['haosou360_count']}');";
$dsql->ExecuteNoneQuery($in_query);
}
$inff=array(
'alexa_num'=>'Alexa全球排名',
'alexa_area_num'=>'Alexa地区排名',
'baidu_count'=>'百度收录',
'sogou_count'=>'搜狗收录',
'haosou360_count'=>'360收录',
);
?>
$value )
{
if ( $key=='id' OR $key=='create_time' ) continue;
?>
: |
|