DEDECMS content Page The responsible editor calls the code _DEDECMS

Source: Internet
Author: User
Tags tagname
The second step is to modify the variable output code (open the inc_archives_view.php under the Include directory)

and find the following code:
var $TypeLink;
var $ChannelUnit;
var $dsql;
var $Fields;
var $DTP;
var $ArcID;
var $SplitPageField;
var $SplitFields;
var $NowPage;
var $TotalPage;

At the bottom of this code, add:

var $Adminname;

Find again:

Hot keywords
else if ($tagname = = "Hotwords") {
$this->dtp->assign ($tagid,
Gethotkeywords ($this->dsql, $ctag->getatt (' num '), $ctag->getatt (' Subday '), $ctag->getatt (' maxlength ') ));
}
Join the code below.

The responsible editor calls
else if ($tagname = = "AdminName") {
$this->dtp->assign ($tagid, $this->getadminname ());
}

Find again:
//----------------------
Get the author information for this article
//----------------------
function Getmemberinfo ()
{
if (!isset ($this->memberinfos[' ID ')) {
if ($this->fields[' MemberID ']==0) return ";
else{
$this->memberinfos = $this->dsql->getone ("Select Id,userid,uname,spacename,spaceimage from #@__member where Id= ' {$this->fields[' MemberID ']};
}
}
if (!isset ($this->memberinfos[' ID ')) return "";
else{
$minfo = "<a href= '". $cfg _memberurl. " /index.php?uid= ". $this->memberinfos[' userid ']." ' > Browse <font color= ' red ' ><b>;
$minfo. = $this->memberinfos[' uname ']. " </font></b> 's personal space </a>
";
return $minfo;
}
}

Add the following code below this section

//--------------------------
The responsible editor calls
//----------------------
function Getadminname ()
{
$adm = "";
$rid = $this->arcid;
$query = "Select A.id,a.adminid,b.id,b.uname from #@__archives a LEFT join #@__admin B in a.adminid=b.id where a.id order by a.id= $rid desc ";
$editor = $this->dsql->getone ($query);
if (Is_array ($editor)) {
$this->adminer = $this->dsql->getone ("Select Id,userid,uname from #@__member where uname= ' {$editor [' uname ']} ' ");
if (!isset ($this->adminer[' uname ')) {
$adm = "{$editor [' uname ']}";
}else{
$adm = "<a href= '". $GLOBALS [' Cfg_cmspath ']. " /member/index.php?uid= ". $this->adminer[' userid ']." ' >{$editor [' uname ']}</a>
";
}

}
return $adm;
}

This step is OK.

The third step is to modify the background file (open the article_eidt_action.php in the Dede directory)

Note: The purpose of this step is to update the current editor ID when the article is edited again by another administrator. If you do not modify this step, the editor will always display the original Publisher ID or the article approver Administrator ID.

Find this piece of code:

$inQuery = "
Update #@__archives Set
Typeid= ' $typeid ',
Typeid2= ' $typeid 2 ',
sortrank= ' $sortrank ',
Redirecturl= ' $redirecturl ',
Iscommend= ' $iscommend ',
Ismake= ' $ismake ',
arcrank= ' $arcrank ',
Money= ' $money ',
Title= ' $title ',
Color= ' $color ',
Writer= ' $writer ',
Source= ' $source ',
Litpic= ' $litpic ',
Pubdate= ' $pubdate ',

Join the code below.
Adminid= ' $adminID ',

Done.

We look at it step-by-step, and then change, should not be wrong.



Special Note: The editor and the foreground contributors are completely different contributors are showing the author code is {Dede:field name= ' writer '/}

And the editor shows the admin ID.

That is to say, the current members of the post will have to go through the background admin audit to pass, and the responsible editor is to audit the article's administrator, there is when the administrator directly from the background of the post, the editor of the editors show that the administrator.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.