示例#1
0
文件: ajax.php 项目: philum/cms
 //meta::new
 case "metall":
     req('meta');
     $ret = meta_all($id);
     break;
 case "editag":
     req('meta');
     $ret = edit_tags($id, $va, $opt);
     break;
 case "addtag":
     req('meta');
     $ret = addtag($id, $va, $opt, $optb);
     break;
 case "deltag":
     req('meta');
     $ret = deltag($id, $va, $opt, $optb);
     break;
 case "slctag":
     req('meta');
     $ret = slctag($id, $va, $opt);
     break;
 case "savtag":
     req('meta');
     $ret = savtag($id, $va, $opt);
     break;
 case "matchtag":
     req('pop,tri,spe,meta');
     $ret = match_tags($id, $va);
     break;
 case "slctfrm":
     req('meta');
示例#2
0
function delContent($id, $mid, $uid = '0', $postype = '1')
{
    $uid && ($sql = "and `userid`='{$uid}' and `postype`='{$postype}'");
    $model = model::data($mid);
    $table = $model['tbn'];
    $FArray = model::field($mid);
    $MF = explode(',', $model['field']);
    $rs = iCMS_DB::getRow("SELECT * FROM `#iCMS@__{$table}` where `id`='{$id}' {$sql}", ARRAY_A);
    foreach ($MF as $field) {
        if ($FArray[$field]['type'] == 'upload') {
            $rs[$field] && ($msg .= delpic($rs[$field]));
        }
    }
    $rs['tags'] && ($msg .= deltag($rs['tags']));
    iCMS_DB::query("DELETE FROM `#iCMS@__comment` WHERE indexId='{$id}' and mid='{$mid}'");
    $msg .= '评论数据删除…<span style=\'color:green;\'>√</span><br />';
    iCMS_DB::query("DELETE FROM `#iCMS@__{$table}` WHERE id='{$id}'");
    iCMS_DB::query("DELETE FROM `#iCMS@__vlink` WHERE indexId='{$id}' AND modelId='{$mid}'");
    $msg .= '内容数据删除…<span style=\'color:green;\'>√</span><br />';
    iCMS_DB::query("UPDATE `#iCMS@__forum` SET `count` = count-1 WHERE `fid` ='" . $rs['fid'] . "' LIMIT 1");
    $msg .= '栏目数据更新…<span style=\'color:green;\'>√</span><br />';
    $msg .= '删除完成…<span style=\'color:green;\'>√</span><hr />';
    return $msg;
}