?? content.php
字號:
$list .= '<td align="center" bgcolor="#FFFFFF">' . date("Y-m-d h:m:s", $data[CreationDate]) . '</td>';
$list .= '<td align="center" bgcolor="#FFFFFF">' . $data[$this->user_username] . '</td>';
$list .= '<td align="center" bgcolor="#FFFFFF"><a href=index.php?module=content&act=update&ContentID=' . $data[ContentID] . '&TableID=' . $TableID . '>' . $this->app->getSysMsg('mod') . '</a> <a href=index.php?module=content&act=delete&ContentID=' . $data[ContentID] . '&TableID=' . $TableID . '>' . $this->app->getSysMsg('del') . '</a> <a href=index.php?module=html&act=make&ContentID=' . $data[ContentID] . '&CateID=' . $CateID . '>' . $this->app->getSysMsg('make') . '</a></td></tr>';
}
}
$this->tpl->assign('Clist', $Clist);
$this->tpl->assign('list', $list);
$this->tpl->assign('TableID', $TableID);
$this->tpl->assign('title', $this->app->getSysMsg('ListContent'));
$this->tpl->assign('i', $i);
$this->tpl->display('admin/Content_List.htm');
}
function onUpdate()
{
$this->in['_GET']['CateID'] == ''?$CateID = '1':$CateID = $this->in['_GET']['CateID'];
include DIR_CACHE . 'cache_Cate.inc.php';
include DIR_CACHE . 'cache_contentmodel.inc.php';
empty($this->in['_GET']['TableID'])?$TableID = $Cate[$CateID]['TableID']:$TableID = intval(trim($this->in['_GET']['TableID']));
$Model = $Cate[$CateID][ContentModel];
$arguments = $content_model_info[$Model][Model];
if ($Model == '1') {
$arguments[] = array(FieldName => 'Content_ImgAutoLocalize',
FieldTitle => $this->app->getSysMsg('Content_ImgAutoLocalize'),
FieldInput => 'checkbox');
$value[Content_ImgAutoLocalize] = '1';
}
$arguments[] = array(FieldName => 'TableID',
FieldInput => 'hidden');
$arguments[] = array(FieldName => 'CateID',
FieldInput => 'hidden');
$arguments[] = array(FieldName => 'module',
IN => '1',
FieldInput => 'hidden');
$arguments[] = array(FieldName => 'act',
IN => '1',
FieldInput => 'hidden');
$arguments[] = array(FieldName => 'Sort',
FieldTitle => $this->app->getSysMsg('SelfSort'),
FieldInput => 'text');
$arguments[] = array(FieldName => 'Top',
FieldTitle => $this->app->getSysMsg('SelfTop'),
FieldInput => 'text');
$arguments[] = array(FieldName => 'SelfTemplate',
FieldTitle => $this->app->getSysMsg('SelfTemplate'),
FieldInputPicker => 'tpl',
FieldInput => 'picker');
$arguments[] = array(FieldName => 'SelfPublishFileName',
FieldTitle => $this->app->getSysMsg('SelfPublishFileName'),
FieldInput => 'text');
$arguments[] = array(FieldName => 'SelfPSN',
FieldName1 => 'SelfPSNURL',
FieldTitle => $this->app->getSysMsg('SelfPSN'),
FieldTitle1 => $this->app->getSysMsg('SelfPSNURL'),
FieldInputPicker => 'psn',
FieldInput => 'psn');
$arguments[] = array(FieldName => 'ContentID',
FieldInput => 'hidden');
$value = $this->objDataSet->getDataById($this->in['_GET']['ContentID'], "ContentID", $this-> {
'content_' . $TableID}
);
$value[act] = 'update';
$value[module] = 'content';
$value[TableID] = $this->in[TableID];
$this->form->formname = 'content';
if ($this->in['_POST']['act'] != '') {
foreach($arguments as $key => $name) {
$var = 'data_' . $name[FieldName];
if (is_array($this->in['_POST'][$var])&&!in_array($var, $this->Varsarray)) {
$Data[$name['FieldName']] = serialize($this->in['_POST'][$var]);
} elseif (!in_array($var, $this->Varsarray)) {
$Data[$name['FieldName']] = addslashes($this->in['_POST'][$var]);
}
}
$Data['ModifiedDate'] = time();
$Data['LastModifiedUserID'] = $_SESSION[$this->userid];
$this->objDataSet->update($Data, "ContentID = '" . $this->in['_POST']['data_ContentID'] . "'", $this-> {
'content_' . $this->in['_POST']['data_TableID']}
);
// $IndexData[ContentID]=$this->in['_POST']['data_ContentID'];
// $IndexData[CateID]=$this->in['_POST'][data_CateID];
$IndexData[PublishDate] = $Data['ModifiedDate'];
$IndexData[Type] = '1';
foreach($this->Varsarray as $k => $vars) {
if (in_array($vars, $this->Varsarrays)) {
$varss = str_replace('data_', '', $vars);
$IndexData[$varss] = addslashes($this->in['_POST'][$vars]);
}
}
$IndexData[State] = '0';
$this->objDataSet->update($IndexData, "ContentID = '" . $this->in['_POST']['data_ContentID'] . "' AND CateID ='" . $this->in['_POST'][data_CateID] . "'", $this->content_index);
$this->page_err();
header("location:index.php?module=content&act=list&CateID=" . $this->in['_POST']['data_CateID']);
}
$this->form->CreatTable($arguments, $value);
}
function onDelete()
{
$in = &$this->in;
$dataSet = &$this->objDataSet;
if (isset($in['row_select'])) {
$ids = "'" . implode("','", $in['row_select']) . "'";
} else $ids = "'" . $in['ContentID'] . "'";
$dataSet->delete("ContentID in ($ids)", $this-> {
'content_' . $this->in[TableID]}
);
$this->page_err();
header("location:" . preg_replace("/totalnum=[^&]*&?/", "", $this->fromUrl));
}
function onMenu()
{
include(DIR_CACHE . 'cache_Cate.inc.php');
include(DIR_CACHE . 'cache_Category.inc.php');
foreach($Cate as $key => $category) {
if ($category[ParentID] == '-1') {
$CList[Title] = $category[Title];
$CList[CateID] = $category[CateID];
if (is_array($cachecates[$category[CateID]]))$CList[haveSon] = '1';
$CateList[] = $CList;
}
}
$this->tpl->assign('CateList', $CateList);
$this->tpl->display('admin/tree_Content.html');
}
function onContent_xml()
{
include(DIR_CACHE . 'cache_Cate.inc.php');
include(DIR_CACHE . 'cache_Category.inc.php');
foreach($Cate as $key => $category) {
if ($category[ParentID] ==$this->in[CateID]) {
$CList[Title] = $category[Title];
$CList[CateID] = $category[CateID];
if (is_array($cachecates[$category[CateID]]))$CList[haveSon] = '1';
$CateList[] = $CList;
}
}
header("Content-type: text/xml");
echo'<?xml version="1.0" encoding="gb2312" ?' . '>' . "\r\n";
$this->tpl->assign('CateList', $CateList);
$this->tpl->display('admin/Content_xml.xml');
}
}
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -