SoFunction
Updated on 2025-04-11

dedecms content page editor-in-charge call code

The second step: The file to be modified is the variable output code (open inc_archives_view.php in 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;

Added below this code:

var $Adminname;

Find again:

//Popular keywords
else if($tagname=="hotwords"){
$this->dtp->Assign($tagid,
GetHotKeywords($this->dsql,$ctag->GetAtt('num'),$ctag->GetAtt('subday'),$ctag->GetAtt('maxlength')));
}
Add in the following code

//Responsible editor call
else if($tagname=="adminname"){
$this->dtp->Assign($tagid,$this->GetAdminname());
}

Looking for:
//----------------------
// Obtain information on the submission author of 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."/?u'>View <font color='red'><b>";
$minfo .= $this->MemberInfos['uname']."</font></b> Personal Space</a>
";
return $minfo;
}
}

Add in this code

//--------------------------
//Responsible editor call
//----------------------
function GetAdminname()
{
$adm = "";
$rid = $this->ArcID;
$query = "Select ,,, from #@__archives a left join #@__admin b on = where  order by =$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/?u'>{$editor['uname']}</a>
";
}

}
return $adm;
}

This step is OK.

Step 3: Modify the background file (open article_eidt_action.php in the dede directory)

Note: The purpose of modifying this step is that if the article is re-edited by another administrator, the editor in charge will update the current editor ID. If this step is not modified, the editor-in-charge will always show that it is the ID of the original publisher or the ID of the article reviewer administrator.

Find this code:

$inQuery = "
update #@__archives set
typeid='$typeid',
typeid2='$typeid2',
sortrank='$sortrank',
redirecturl='$redirecturl',
iscommend='$iscommend',
ismake='$ismake',
arcrank='$arcrank',
money='$money',
title='$title',
color='$color',
writer='$writer',
source='$source',
litpic='$litpic',
pubdate='$pubdate',

Add in the following code
adminID='$adminID',

The mission is done.

If you see it clearly and then make corrections step by step, there should be no mistakes.



Special reminder: The editor in charge and the front-end contributor are completely different. The contributor shows the author. The code is {dede:field name='writer'/}

The editor-in-charge shows that it is the administrator ID

In other words, when a current station member submits an article, he must pass the review by the backend administrator before he can pass it. The editor-in-charge shows the administrator who reviews the article, and when the administrator publishes the article directly from the background, the editor-in-charge shows the administrator.