织梦dedecms后台文章百度收录排名开发教程

织梦dedecms后台文章百度收录排名开发教程,可以在网站后台查询文章百度收录情况。


1. 先把 :inc_baidu.php 放入后台根目录的的 inc 文件夹内,

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.baidu.com/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.baidu.com/s?wd='.$weburl;
//$baiduurl2 = 'http://www.baidu.com/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.baidu.com/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.baidu.com/s?wd='.$weburl;
//$baiduurl2 = 'http://www.baidu.com/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.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>百度收录排名by : w2kan.com</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:793664261

   by@ w2kan.com</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织梦默认的TAG标签不是很灵活。有时候我们的标签需要进行一个分类,能不能像{dede:arclist}标签的自定义属性(如:flag=c,h),这样全站调用的时候更灵活。 全站调用TAG标签方法一般是: {dede:tag row='100' sort='new' getall='1'}a target="_blank
未审核文档的TAG会显示在TAG列表页面, 固然点击进入TAG时, 相关的未审核文章不会显示出来, 这样对用户体验是很不好的. DEDECMS暂时没有提供这个功能,所以要解决这个问题, 让DEDECMS不显示未审核文档的TAG, 就要修改TAG的显示库文件 tag.lib.php。 方法一 打
我们都知道DEDECMS生成的文件夹是按天生成的,只要传了图片就会自动建立个年月日的文件,centos系统下,都是随便排序的,很难找到对应文件夹,如果要按顺序排列,要怎么操作呢? 一、文件管理器: 修改 /dede/templets/file_manage_main.html $dh = dir($inp
我们有时候需要对织梦文档的点击量进行批量维护,比如采集来的文章,点击量都为0,需要批量修改,可以用到如下方法1。 1、在数据库里运行下面的代码就可以了,文章的点击量变得随机从500到1000 UPDATE dede_archives SET click=FLOOR(500 + (RAND() * 1000))
用过dedecms的朋友都知道,织梦cms后台系统基本参数里是无法直接上传图片的,我们更换logo图只能到ftp里替换,非常的不方便,我们如果想直接在系统基本参数里上传,要怎么处理呢?在这里需要对代码进行修改,具体流程如下: 实现方法,打开/dede/templets/sy
dedecms要想调用所有子栏目是没有这个标签的,要调用只可用sql标签,reid表示子栏目,channeltype=6表示模型为商品,sortrank表示按排序升序.小的放前面 {dede:sql sql=Select * from `dede_arctype` where reid0 and channeltype=6 ORDER BY sortrank limit 15}