|
 
- UID
- 2
- 帖子
- 926
- 精华
- 5
- 积分
- 1486
- 威望
- 1486 度
- 论坛币
- 2323 元
- 阅读权限
- 10
- 在线时间
- 211 小时
- 注册时间
- 2007-1-18
- 最后登录
- 2008-12-25
|
1楼
发表于 2007-4-17 16:38
| 只看该作者
[DEDECMS]化复杂为简单,在列表页完成-取消推荐.加粗,颜色变化功能
我现在只用DEDE3.01 弄过3.1后台 4.0还没看
此功能哦都是在DEDE3.01下测试的
这样子,采集完数据,直接在列表页搞来搞去就OK了,哈哈
取消推荐功能
如果你的文章推荐了,DEDE版本下只能进入文章管理然后把 推荐 选框去掉-然后再点确定-后台又得找列表.弄过的都晓得这样非常麻烦滴.
方法:
在\DEDE目录下 查找archives_do.php文件
找到这个- //推荐文档
- function commendArchives();
- ---------------------------*/
- else if($dopost=="commendArchives"
- {
- SetPageRank(5);
- if( $aid!="" && !ereg("(".$aid."`|`".$aid."",$qstr) ) $qstr .= "`".$aid;
- if($qstr==""{
- ShowMsg("参数无效!",$ENV_GOBACK_URL);
- exit();
- }
- $qstrs = explode("`",$qstr);
- $dsql = new DedeSql(false);
- foreach($qstrs as $aid)
- {
- $aid = ereg_replace("[^0-9]","",$aid);
- if($aid=="" continue;
- $dsql->SetQuery("Update #@__archives set [color=Red]iscommend='11' [/color]where ID='$aid'";
- $dsql->ExecuteNoneQuery();
- }
- $dsql->Close();
- ShowMsg("成功把所选的文档设为推荐!",$ENV_GOBACK_URL);
- exit();
- }
- /*--------------------------
复制代码 将红字改为iscommend='0'
然后去DEDE后台列表中右键,点"推荐"的时候,实际上是取消推荐
如果你想在列表增加颜色和加粗的,看下面文件方位 dede\templets\content_list.htm
原代码 - //上下文菜单
- function ShowMenu(obj,aid,atitle)
- {
- var eobj,popupoptions
- popupoptions = [
- new ContextItem("浏览文档",function(){ window.open("archives_do.php?aid="+aid+"&dopost=viewArchives"; }),
- new ContextItem("编辑文档",function(){ location="archives_do.php?aid="+aid+"&dopost=editArchives"; }),
- new ContextSeperator(),
- new ContextItem("更新HTML",function(){ var qstr=getCheckboxItem(); location="archives_do.php?aid="+aid+"&dopost=makeArchives&qstr="+qstr; }),
- new ContextItem("审核文档",function(){ var qstr=getCheckboxItem(); location="archives_do.php?aid="+aid+"&dopost=checkArchives&qstr="+qstr; }),
- new ContextItem("推荐文档",function(){ var qstr=getCheckboxItem(); location="archives_do.php?aid="+aid+"&dopost=commendArchives&qstr="+qstr; }),
- new ContextSeperator(),
- new ContextItem("删除文档",function(){ var qstr=getCheckboxItem(); location="archives_do.php?qstr="+qstr+"&aid="+aid+"&dopost=delArchives"; }),
- new ContextSeperator(),
- new ContextItem("全部选择",function(){ selAll(); }),
- new ContextItem("取消选择",function(){ noSelAll(); }),
- new ContextSeperator(),
- new ContextItem("频道管理",function(){ location="catalog_main.php"; })
- ]
- ContextMenu.display(popupoptions)
- }
复制代码 想加什么随便加 ,我加了三行- new ContextItem("加粗",function(){ var qstr=getCheckboxItem(); location="archives_do.php?aid="+aid+"&dopost=jiachu&qstr="+qstr; }),
- new ContextItem("变红",function(){ var qstr=getCheckboxItem(); location="archives_do.php?aid="+aid+"&dopost=bianhong&qstr="+qstr; }),
- new ContextItem("变蓝",function(){ var qstr=getCheckboxItem(); location="archives_do.php?aid="+aid+"&dopost=bianlan&qstr="+qstr; }),
复制代码 下一步去找dede\archives_do.php
增加三个选项就是- //加粗
- function jiancu();
- ---------------------------*/
- else if($dopost=="jiachu"
- {
- SetPageRank(5);
- if( $aid!="" && !ereg("(".$aid."`|`".$aid."",$qstr) ) $qstr .= "`".$aid;
- if($qstr==""{
- ShowMsg("参数无效!",$ENV_GOBACK_URL);
- exit();
- }
- $qstrs = explode("`",$qstr);
- $dsql = new DedeSql(false);
- foreach($qstrs as $aid)
- {
- $aid = ereg_replace("[^0-9]","",$aid);
- if($aid=="" continue;
- $dsql->SetQuery("Update #@__archives set iscommend='5' where ID='$aid'");
- $dsql->ExecuteNoneQuery();
- }
- $dsql->Close();
- ShowMsg("成功把所选的文档设为推荐!",$ENV_GOBACK_URL);
- exit();
- }
- /*--------------------------
- //变红
- function bianhong();
- ---------------------------*/
- else if($dopost=="bianhong")
- {
- SetPageRank(5);
- if( $aid!="" && !ereg("(".$aid."`|`".$aid.")",$qstr) ) $qstr .= "`".$aid;
- if($qstr==""){
- ShowMsg("参数无效!",$ENV_GOBACK_URL);
- exit();
- }
- $qstrs = explode("`",$qstr);
- $dsql = new DedeSql(false);
- foreach($qstrs as $aid)
- {
- $aid = ereg_replace("[^0-9]","",$aid);
- if($aid=="") continue;
- $dsql->SetQuery("Update #@__archives set color='#FF0000' where ID='$aid'");
- $dsql->ExecuteNoneQuery();
- }
- $dsql->Close();
- ShowMsg("成功把所选的文档设为推荐!",$ENV_GOBACK_URL);
- exit();
- }
- /*--------------------------
- //变蓝
- function bianlan();
- ---------------------------*/
- else if($dopost=="bianlan")
- {
- SetPageRank(5);
- if( $aid!="" && !ereg("(".$aid."`|`".$aid.")",$qstr) ) $qstr .= "`".$aid;
- if($qstr==""){
- ShowMsg("参数无效!",$ENV_GOBACK_URL);
- exit();
- }
- $qstrs = explode("`",$qstr);
- $dsql = new DedeSql(false);
- foreach($qstrs as $aid)
- {
- $aid = ereg_replace("[^0-9]","",$aid);
- if($aid=="") continue;
- $dsql->SetQuery("Update #@__archives set color='#0000FF' where ID='$aid'");
- $dsql->ExecuteNoneQuery();
- }
- $dsql->Close();
- ShowMsg("成功把所选的文档设为推荐!",$ENV_GOBACK_URL);
- exit();
- }
- /*--------------------------
复制代码 |
|