您现在的位置是:首页 > 教程 > dedecms教程dedecms教程
织梦dedecms后台文章百度收录排名查询的实现方法
谷雪2024-01-28 23:47:38dedecms教程已有人查阅
导读1. 先把 :inc_baidu.php 放入后台根目录的的 inc 文件夹内,2. 再把ext_baidu.php放入后台根目录3. 然后修改后台根目录
1. 先把 :inc_baidu.php 放入后台根目录的的 inc 文件夹内,
2. 再把ext_baidu.php放入后台根目录
3. 然后修改后台根目录下的templets模版 文件夹 的content_list.htm :
代码如下:
代码如下:
2. 再把ext_baidu.php放入后台根目录
3. 然后修改后台根目录下的templets模版 文件夹 的content_list.htm :
代码如下:
<a href="javascript:getBaiduRanking(0)" class="coolbg"> 百度排名 </a>
<a href="javascript:getBaiduShoulu(0)" class="coolbg"> 百度收录 </a>
<a href="javascript:getBaiduZhonghe(0)" class="coolbg"> 百度综合 </a>
4. 之后修改后台根目录下的js文件夹 的list.js :代码如下:
//百度排名
function getBaiduRanking(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
if(qstr=='')
{
alert('必须选择一个或多个文档!');
return;
}
location="ext_baidu.php?aid="+aid+"&dopost=BaiduRanking&qstr="+qstr;
}
//百度收录
function getBaiduShoulu(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
if(qstr=='')
{
alert('必须选择一个或多个文档!');
return;
}
location="ext_baidu.php?aid="+aid+"&dopost=BaiduShoulu&qstr="+qstr;
}
//百度收录排名 综合查询
function getBaiduZhonghe(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
if(qstr=='')
{
alert('必须选择一个或多个文档!');
return;
}
location="ext_baidu.php?aid="+aid+"&dopost=BaiduZhonghe&qstr="+qstr;
}
inc_baidu.php完整代码
<?php
require_once(dirname(__FILE__).'/../config.php');
require_once(DEDEADMIN.'/inc/inc_batchup.php');
require_once(DEDEADMIN.'/inc/inc_archives_functions.php');
require_once(DEDEINC.'/typelink.class.php');
require_once(DEDEINC.'/arc.archives.class.php');
//得到标题
function getTitle($aid)
{
//利用传递ID,得到网址
$aid = $aid;
$aid = preg_replace("#[^0-9]#", '', $aid);
$Archives=new Archives();
//获取表信息
$arcQuery = "SELECT title FROM `xjq_archives` WHERE id='$aid' ";
$arcRow =$Archives->dsql->GetOne($arcQuery);
$title=$arcRow[title];
return $title;
}
//得到网址
function getUrl($aid){
//利用传递ID,得到网址
$aid = $aid;
$aid = preg_replace("#[^0-9]#", '', $aid);
$Archives=new Archives();
//获取主表信息
$query = "SELECT arc.*,ch.maintable,ch.addtable,ch.issystem,ch.editcon,
tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl
FROM `xjq_arctiny` arc
LEFT JOIN `xjq_arctype` tp ON tp.id=arc.typeid
LEFT JOIN `xjq_channeltype` ch ON ch.id=tp.channeltype
WHERE arc.id='$aid' ";
$trow = $Archives->dsql->GetOne($query);
$trow['maintable'] = ( trim($trow['maintable'])=='' ? 'xjq_archives' : trim($trow['maintable']) );
if($trow['issystem'] != -1)
{
$arcQuery = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl
FROM `{$trow['maintable']}` arc LEFT JOIN `xjq_arctype` tp on arc.typeid=tp.id
LEFT JOIN `xjq_channeltype` ch on ch.id=arc.channel WHERE arc.id='$aid' ";
$arcRow =$Archives->dsql->GetOne($arcQuery);
if($arcRow['ismake']==-1 || $arcRow['corank']!=0 || $arcRow['arcrank']!=0 || ($arcRow['typeid']==0 && $arcRow['channel']!=-1) || $arcRow['money']>0)
{
$weburl='{$cfg_phpurl}/view.php?aid='.$aid;
return $weburl;
}
}
else
{
$arcRow['id'] = $aid;
$arcRow['typeid'] = $trow['typeid'];
$arcRow['senddate'] = $trow['senddate'];
$arcRow['title'] = '';
$arcRow['ismake'] = 1;
$arcRow['arcrank'] = $trow['corank'];
$arcRow['namerule'] = $trow['namerule'];
$arcRow['typedir'] = $trow['typedir'];
$arcRow['money'] = 0;
$arcRow['filename'] = '';
$arcRow['moresite'] = $trow['moresite'];
$arcRow['siteurl'] = $trow['siteurl'];
$arcRow['sitepath'] = $trow['sitepath'];
}
$arcurl = GetFileUrl($arcRow['id'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],$arcRow['ismake'],$arcRow['arcrank'],
$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],$arcRow['filename'],$arcRow['moresite'],$arcRow['siteurl'],$arcRow['sitepath']);
$arcfile = GetFileUrl($arcRow['id'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],
$arcRow['ismake'],$arcRow['arcrank'],$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],$arcRow['filename']);
if(preg_match("#^http:#", $arcfile))
{
$arcfile = preg_replace("#^http:\/\/([^\/]*)\/#i", '/', $arcfile);
}
$truefile = GetTruePath().$arcfile;
if(!file_exists($truefile))
{
MakeArt($aid,TRUE);
}
$weburl=$arcurl;
return $weburl;
}
/*//检查排名
function getBaiduRanking($aid)
{
//利用传递ID,得到网址
$aid = $aid;
$aid = preg_replace("#[^0-9]#", '', $aid);
$Archives=new Archives();
//获取主表信息
$query = "SELECT arc.*,ch.maintable,ch.addtable,ch.issystem,ch.editcon,
tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl
FROM `xjq_arctiny` arc
LEFT JOIN `xjq_arctype` tp ON tp.id=arc.typeid
LEFT JOIN `xjq_channeltype` ch ON ch.id=tp.channeltype
WHERE arc.id='$aid' ";
$trow = $Archives->dsql->GetOne($query);
$trow['maintable'] = ( trim($trow['maintable'])=='' ? 'xjq_archives' : trim($trow['maintable']) );
if($trow['issystem'] != -1)
{
$arcQuery = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl
FROM `{$trow['maintable']}` arc LEFT JOIN `xjq_arctype` tp on arc.typeid=tp.id
LEFT JOIN `xjq_channeltype` ch on ch.id=arc.channel WHERE arc.id='$aid' ";
$arcRow =$Archives->dsql->GetOne($arcQuery);
if($arcRow['ismake']==-1 || $arcRow['corank']!=0 || $arcRow['arcrank']!=0 || ($arcRow['typeid']==0 && $arcRow['channel']!=-1) || $arcRow['money']>0)
{
$webname='{$cfg_phpurl}/view.php?aid='.$aid;
// exit();
}
}
else
{
$arcRow['id'] = $aid;
$arcRow['typeid'] = $trow['typeid'];
$arcRow['senddate'] = $trow['senddate'];
$arcRow['title'] = '';
$arcRow['ismake'] = 1;
$arcRow['arcrank'] = $trow['corank'];
$arcRow['namerule'] = $trow['namerule'];
$arcRow['typedir'] = $trow['typedir'];
$arcRow['money'] = 0;
$arcRow['filename'] = '';
$arcRow['moresite'] = $trow['moresite'];
$arcRow['siteurl'] = $trow['siteurl'];
$arcRow['sitepath'] = $trow['sitepath'];
}
$arcurl = GetFileUrl($arcRow['id'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],$arcRow['ismake'],$arcRow['arcrank'],
$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],$arcRow['filename'],$arcRow['moresite'],$arcRow['siteurl'],$arcRow['sitepath']);
$arcfile = GetFileUrl($arcRow['id'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],
$arcRow['ismake'],$arcRow['arcrank'],$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],$arcRow['filename']);
if(preg_match("#^http:#", $arcfile))
{
$arcfile = preg_replace("#^http:\/\/([^\/]*)\/#i", '/', $arcfile);
}
$truefile = GetTruePath().$arcfile;
if(!file_exists($truefile))
{
MakeArt($aid,TRUE);
}
$weburl=$arcurl;
$keyword=getTitle($aid);
$baiduurl = 'http://www.ebingou.cn/s?rn=100&wd='.$keyword;
$pagecode = RemoveUselessCode(file_get_contents($baiduurl));
//$pagecode = RemoveUselessCode($pagecode);
$seolist = getSeoList($pagecode);
$ranking = getNumber($seolist,$weburl);
return $ranking;
}*/
/*
//检查收录
function getBaiduShoulu($aid)
{
//利用传递ID,得到网址
$aid = $aid;
$aid = preg_replace("#[^0-9]#", '', $aid);
$Archives=new Archives();
//获取主表信息
$query = "SELECT arc.*,ch.maintable,ch.addtable,ch.issystem,ch.editcon,
tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl
FROM `xjq_arctiny` arc
LEFT JOIN `xjq_arctype` tp ON tp.id=arc.typeid
LEFT JOIN `xjq_channeltype` ch ON ch.id=tp.channeltype
WHERE arc.id='$aid' ";
$trow = $Archives->dsql->GetOne($query);
$trow['maintable'] = ( trim($trow['maintable'])=='' ? 'xjq_archives' : trim($trow['maintable']) );
if($trow['issystem'] != -1)
{
$arcQuery = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl
FROM `{$trow['maintable']}` arc LEFT JOIN `xjq_arctype` tp on arc.typeid=tp.id
LEFT JOIN `xjq_channeltype` ch on ch.id=arc.channel WHERE arc.id='$aid' ";
$arcRow =$Archives->dsql->GetOne($arcQuery);
if($arcRow['ismake']==-1 || $arcRow['corank']!=0 || $arcRow['arcrank']!=0 || ($arcRow['typeid']==0 && $arcRow['channel']!=-1) || $arcRow['money']>0)
{
$weburl='{$cfg_phpurl}/view.php?aid='.$aid;
// exit();
}
}
else
{
$arcRow['id'] = $aid;
$arcRow['typeid'] = $trow['typeid'];
$arcRow['senddate'] = $trow['senddate'];
$arcRow['title'] = '';
$arcRow['ismake'] = 1;
$arcRow['arcrank'] = $trow['corank'];
$arcRow['namerule'] = $trow['namerule'];
$arcRow['typedir'] = $trow['typedir'];
$arcRow['money'] = 0;
$arcRow['filename'] = '';
$arcRow['moresite'] = $trow['moresite'];
$arcRow['siteurl'] = $trow['siteurl'];
$arcRow['sitepath'] = $trow['sitepath'];
}
$arcurl = GetFileUrl($arcRow['id'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],$arcRow['ismake'],$arcRow['arcrank'],
$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],$arcRow['filename'],$arcRow['moresite'],$arcRow['siteurl'],$arcRow['sitepath']);
$arcfile = GetFileUrl($arcRow['id'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],
$arcRow['ismake'],$arcRow['arcrank'],$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],$arcRow['filename']);
if(preg_match("#^http:#", $arcfile))
{
$arcfile = preg_replace("#^http:\/\/([^\/]*)\/#i", '/', $arcfile);
}
$truefile = GetTruePath().$arcfile;
if(!file_exists($truefile))
{
MakeArt($aid,TRUE);
}
$weburl=$arcurl;
// exit();
//return $weburl;
$baiduurl2 = 'http://www.ebingou.cn/s?wd='.$weburl;
//$baiduurl2 = 'http://www.ebingou.cn/s?wd=site%3A'.$weburl;
$pagecode2 = RemoveUselessCode(file_get_contents($baiduurl2));
$pagecode = RemoveUselessCode($pagecode);
$seolist2 = getSeoList($pagecode2);
$Shoulu = getShoulu($seolist2,$weburl);
return $Shoulu;
}*/
//检查排名
function getBaiduRanking($aid)
{
$aid = $aid;
$keyword=getTitle($aid);
$weburl=getUrl($aid);
$baiduurl = 'http://www.ebingou.cn/s?rn=100&wd='.$keyword;
$pagecode = RemoveUselessCode(file_get_contents($baiduurl));
//$pagecode = RemoveUselessCode($pagecode);
$seolist = getSeoList($pagecode);
$ranking = getNumber($seolist,$weburl);
return $ranking;
}
//检查收录
function getBaiduShoulu($aid)
{
$aid = $aid;
$weburl=getUrl($aid);
$baiduurl2 = 'http://www.ebingou.cn/s?wd='.$weburl;
//$baiduurl2 = 'http://www.ebingou.cn/s?wd=site%3A'.$webname;
$pagecode2 = RemoveUselessCode(file_get_contents($baiduurl2));
$pagecode = RemoveUselessCode($pagecode);
$seolist2 = getSeoList($pagecode2);
$Shoulu = getShoulu($seolist2,$weburl);
return $Shoulu;
}
/*
* 去除不必要代码 减少总字符数 增加处理速度
* @return string
*/
function RemoveUselessCode($string)
{
$string = preg_replace("/<style.*>.*<\/style>/isU", '', $string);//样式
$string = preg_replace("/<script.*>.*<\/script>/isU", '', $string);//JS
$string = preg_replace("/<div id=\"out\">.*<\/form><\/div>/isU", '', $string);//上导航
$string = preg_replace("/<div id=\"rs\">.*<\/body>/isU", '', $string);//相关搜索
$string = preg_replace("/http\:\/\/\w{1,4}\.baidu\.com\/.*\"/isU", '"', $string);//百度连接
$string = preg_replace("/<font color=#CC0000>(.*)<\/font>/isU", '\\1', $string);//文字颜色
$string = preg_replace("/<em>(.*)<\/em>/isU", '\\1', $string);//em标签
$string = preg_replace("/style=\".*\"/isU", '', $string);//分样式
$string = preg_replace("/onmousedown=\".*\"/isU", '', $string);//动作代码
//$string = preg_replace('/\s/isU', '', $string);
return $string;
}
/*
* 获得自然排名信息列表
* @return array
*/
function getSeoList($string)
{
//列表正则
$Preg='/<table cellpadding=\"0\" cellspacing=\"0\".*id=\"\d{1,3}\".*>.*<\/table>/isU';
//标题正则
//$titlePreg='/<h3 class=\"t\"><a.*>(.*)<\/a><\/h3>/isU';
$titlePreg='/<td class=\"{0,1}f\"{0,1}.*>.*<a.* href=\"(.*)\".*>(.*)<\/a>/isU';
//描述正则
$descriptionPreg='/<font size=\"{0,1}-1\"{0,1}>(.*)<br/isU';
//URL正则
$urlPreg='/<span class=\"g\">(.*)<\/span>/isU';
//人工干预
$urlspecial='/<font color=\"{0,1}#008000\"{0,1}>(.*)<\/font>/isU';
preg_match_all($Preg,$string,$listinfo);
//print_r($listinfo);
if($listinfo == "")
{
return "-";
}
else
{
$i=0;
$list=array();
foreach($listinfo[0] as $listOne)
{
preg_match($titlePreg,$listOne,$title);
preg_match($descriptionPreg,$listOne,$description);
$description[1] = preg_replace('/<.*>(.*)<\/>/isU', '\\1', $description[1]);
$list[$i]["title"]=$title[2];
$list[$i]["description"]=$description[1];
$list[$i]["url"]=$title[1];
$i++;
}
return $list;
}
}
/*
* 获得排名
* @return string
*/
function getNumber(array $list,$weburl)
{
$number = 0;
foreach($list as $i=>$one)
{
if(stripos($one["url"],$weburl,0) !== false)
{
$number = $i+1;
return $number;
break;
}
}
return $number;
}
/*
* 判断是否收录
* @return string
*/
function getShoulu(array $list,$weburl)
{
$shoulu = '否';
foreach($list as $i=>$one)
{
if(stripos($one["url"],$weburl,0) !== false)
{
$shoulu = '是';
return $shoulu;
break;
}
}
return $shoulu;
}
?>
ext_baidu.php完整代码
<?php
require_once(dirname(__FILE__).'/config.php');
require_once(DEDEADMIN.'/inc/inc_baidu.php');
?>
<html xmlns="http://www.ebingou.cn</title>
</head>
<body>
<?php
$dopost=$_GET['dopost'];
$aid=$_GET['aid'];
$qstr=$_GET['qstr'];
if(empty($dopost))
{
ShowMsg('对不起,你没指定运行参数!','-1');
exit();
}
$aid = isset($aid) ? preg_replace("#[^0-9]#", '', $aid) : '';
/*--------------------------
//文档百度排名
function getBaiduRanking(){ }
---------------------------*/
if($dopost=='BaiduRanking')
{
?>
<table width="500" border="1" align="center" cellpadding="1" cellspacing="1">
<tr bgcolor="#CCFFFF">
<td>ID</td>
<td>标题</td>
<td>百度排名</td>
</tr>
<?php
if( !empty($aid) && empty($qstr) ) $qstr = $aid;
if($qstr=='')
{
ShowMsg("参数无效!","recycling.php");
exit();
}
$qstrs = explode("`", $qstr);
foreach($qstrs as $aid)
{
echo '<tr><td>'.$aid.'</td>';
echo '<td>'.getTitle($aid).'</td>';
echo '<td>'.getBaiduRanking($aid).'</td></tr>';
}
}
else if($dopost=='BaiduShoulu')
{
?>
<table width="500" border="1" align="center" cellpadding="1" cellspacing="1">
<tr bgcolor="#CCFFFF">
<td>ID</td>
<td>标题</td>
<td>百度收录</td>
</tr>
<?php
if( !empty($aid) && empty($qstr) ) $qstr = $aid;
if($qstr=='')
{
ShowMsg("参数无效!","recycling.php");
exit();
}
$qstrs = explode("`", $qstr);
foreach($qstrs as $aid)
{
echo '<tr><td>'.$aid.'</td>';
echo '<td>'.getTitle($aid).'</td>';
echo '<td>'.getBaiduShoulu($aid).'</td></tr>';
}
}else if($dopost=='BaiduZhonghe')
{
?>
<table width="500" border="1" align="center" cellpadding="1" cellspacing="1">
<tr bgcolor="#CCFFFF">
<td>ID</td>
<td>标题</td>
<td>百度排名</td>
<td>百度收录</td>
</tr>
<?php
if( !empty($aid) && empty($qstr) ) $qstr = $aid;
if($qstr=='')
{
ShowMsg("参数无效!","recycling.php");
exit();
}
$qstrs = explode("`", $qstr);
foreach($qstrs as $aid)
{
echo '<tr><td>'.$aid.'</td>';
echo '<td>'.getTitle($aid).'</td>';
echo '<td>'.getBaiduRanking($aid).'</td>';
echo '<td>'.getBaiduShoulu($aid).'</td></tr>';
}
}
?>
</table>
<br/>
<br/>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td><a href="content_list.php">返回列表</a></td>
<td>QQ:
by@ ebingou.cn</td>
</tr>
</table>
</body>
</html>
list.js 完整代码
<!--
if(moz) {
extendEventObject();
extendElementModel();
emulateAttachEvent();
}
function viewArc(aid){
if(aid==0) aid = getOneItem();
window.open("archives_do.php?aid="+aid+"&dopost=viewArchives");
}
function kwArc(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
if(qstr=='')
{
alert('必须选择一个或多个文档!');
return;
}
location="archives_do.php?aid="+aid+"&dopost=makekw&qstr="+qstr;
}
function editArc(aid){
if(aid==0) aid = getOneItem();
location="archives_do.php?aid="+aid+"&dopost=editArchives";
}
function updateArc(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
location="archives_do.php?aid="+aid+"&dopost=makeArchives&qstr="+qstr;
}
function checkArc(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
location="archives_do.php?aid="+aid+"&dopost=checkArchives&qstr="+qstr;
}
function moveArc(e, obj, cid){
var qstr=getCheckboxItem();
if(qstr=='')
{
alert('必须选择一个或多个文档!');
return;
}
LoadQuickDiv(e, 'archives_do.php?dopost=moveArchives&qstr='+qstr+'&channelid='+cid+'&rnd='+Math.random(), 'moveArchives', '450px', '180px');
ChangeFullDiv('show');
}
function adArc(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
location="archives_do.php?aid="+aid+"&dopost=commendArchives&qstr="+qstr;
}
function cAtts(jname, e, obj)
{
var qstr=getCheckboxItem();
var screeheight = document.body.clientHeight + 20;
if(qstr=='')
{
alert('必须选择一个或多个文档!');
return;
}
LoadQuickDiv(e, 'archives_do.php?dopost=attsDlg&qstr='+qstr+'&dojob='+jname+'&rnd='+Math.random(), 'attsDlg', '450px', '160px');
ChangeFullDiv('show', screeheight);
}
function delArc(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
location="archives_do.php?qstr="+qstr+"&aid="+aid+"&dopost=delArchives";
}
function QuickEdit(aid, e, obj)
{
LoadQuickDiv(e, 'archives_do.php?dopost=quickEdit&aid='+aid+'&rnd='+Math.random(), 'quickEdit', '450px', '300px');
ChangeFullDiv('show');
}
//百度排名
function getBaiduRanking(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
if(qstr=='')
{
alert('必须选择一个或多个文档!');
return;
}
location="ext_baidu.php?aid="+aid+"&dopost=BaiduRanking&qstr="+qstr;
}
//百度收录
function getBaiduShoulu(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
if(qstr=='')
{
alert('必须选择一个或多个文档!');
return;
}
location="ext_baidu.php?aid="+aid+"&dopost=BaiduShoulu&qstr="+qstr;
}
//百度收录排名 综合查询
function getBaiduZhonghe(aid){
var qstr=getCheckboxItem();
if(aid==0) aid = getOneItem();
if(qstr=='')
{
alert('必须选择一个或多个文档!');
return;
}
location="ext_baidu.php?aid="+aid+"&dopost=BaiduZhonghe&qstr="+qstr;
}
//上下文菜单
function ShowMenu(evt,obj,aid,atitle)
{
var popupoptions
popupoptions = [
new ContextItem("浏览文档",function(){ viewArc(aid); }),
new ContextItem("编辑属性",function(){ QuickEdit(aid, evt, obj); }),
new ContextItem("编辑文档",function(){ editArc(aid); }),
new ContextSeperator(),
new ContextItem("更新HTML",function(){ updateArc(aid); }),
new ContextItem("审核文档",function(){ checkArc(aid); }),
new ContextItem("推荐文档",function(){ adArc(aid); }),
new ContextItem("删除文档",function(){ delArc(aid); }),
new ContextSeperator(),
new ContextItem("复制(<u>C</u>)",function(){ copyToClipboard(atitle); }),
new ContextItem("重载页面",function(){ location.reload(); }),
new ContextSeperator(),
new ContextItem("全部选择",function(){ selAll(); }),
new ContextItem("取消选择",function(){ noSelAll(); }),
new ContextSeperator(),
new ContextItem("关闭菜单",function(){})
]
ContextMenu.display(evt,popupoptions);
//location="catalog_main.php";
}
//获得选中文件的文件名
function getCheckboxItem()
{
var allSel="";
if(document.form2.arcID.value) return document.form2.arcID.value;
for(i=0;i<document.form2.arcID.length;i++)
{
if(document.form2.arcID[i].checked)
{
if(allSel=="")
allSel=document.form2.arcID[i].value;
else
allSel=allSel+"`"+document.form2.arcID[i].value;
}
}
return allSel;
}
//获得选中其中一个的id
function getOneItem()
{
var allSel="";
if(document.form2.arcID.value) return document.form2.arcID.value;
for(i=0;i<document.form2.arcID.length;i++)
{
if(document.form2.arcID[i].checked)
{
allSel = document.form2.arcID[i].value;
break;
}
}
return allSel;
}
function selAll()
{
for(i=0;i<document.form2.arcID.length;i++)
{
if(!document.form2.arcID[i].checked)
{
document.form2.arcID[i].checked=true;
}
}
}
function noSelAll()
{
for(i=0;i<document.form2.arcID.length;i++)
{
if(document.form2.arcID[i].checked)
{
document.form2.arcID[i].checked=false;
}
}
}
-->
本文标签:
很赞哦! ()
下一篇:dedecms栏目标题优化调用
相关文章
随机图文
-
利用dede织梦cms的全局函数显示当前URL
最近想要在文章页面下面添加一个可以显示当前文章URL,以防止别人的采集工具。通过一些尝试发现可以通过织梦模板自带的一个全局函数来实现 -
使用flashfxp工具把网站上传到主机空间的方法
首先FlashFXP工具的配置从本地电脑上传文件。购买了虚拟主机后,可以从主机商那边获得主机空间的FTP地址、用户名和密码。 -
把织梦dedecms搜索框整合各大搜索引擎多功能搜索框的方法
不少朋友使用织梦DedeCms搭建网站的时候,希望在搜索框里面能整合各大搜索引擎,通过下面方面可以整合各大搜索引擎。 -
dedecms模板调用解析代码实例
PHP Code复制内容到剪贴板<?php require_once (dirname(__FILE__) . "/include/common.inc.php");
留言与评论 (共有 条评论) |