📄 article_move.inc.php
字号:
<?php
defined('IN_PHPCMS') or exit('Access Denied');
if($dosubmit)
{
if($totype == 1)
{
$targetcatid = isset($targetcatid) ? intval($targetcatid) : 0;
$targetcatid or showmessage($LANG['empty_category']);
$CAT = cache_read("category_$targetcatid.php");
if($CAT['child'] && !$CAT['enableadd']) showmessage($LANG['not_allowed_to_add_an_artcile']);
}
else if($totype == 2)
{
$tochannelid = isset($tochannelid) ? intval($tochannelid) : 0;
$tocatid = isset($tocatid) ? intval($tocatid) : 0;
$tochannelid && $tocatid or showmessage($LANG['empty_category_id']);
$CAT = cache_read("category_$tocatid.php");
if($CAT['child'] && !$CAT['enableadd']) showmessage($LANG['not_allowed_to_add_an_artcile']);
}
if($fromtype == 1)
{
!empty($articleids) or showmessage($LANG['invalid_parameters']);
$articleids=is_array($articleids) ? implode(',',$articleids) : $articleids;
if($totype == 1)
{
$db->query("UPDATE ".channel_table('article', $channelid)." SET catid='$targetcatid' WHERE articleid IN ($articleids) ");
}
else if($totype == 2)
{
$result = $db->query("select * from ".channel_table('article', $channelid)." WHERE articleid IN ($articleids) ");
while($r = $db->fetch_array($result))
{
$r = new_addslashes($r);
if($move_mode == 1)
{
$r['linkurl'] = linkurl($r['linkurl']);
if(!strpos($r['linkurl'], '://')) $r['linkurl'] = $PHP_SITEURL.substr($r['linkurl'], 1);
$query = "insert into ".channel_table('article', $tochannelid)." (title,linkurl,islink,status,catid,addtime,username,edittime,editor,checktime,checker) values('$r[title]','$r[linkurl]','1','3','$tocatid','$r[addtime]','$r[username]','$r[edittime]','$r[editor]','$r[checktime]','$r[checker]')";
}
else if($move_mode == 2)
{
$sql1 = $sql2 = $s = "";
$articleid_tmp = $r['articleid'];//鏌ヨ
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -