當前位置: 首頁>>代碼示例>>PHP>>正文


PHP article::del方法代碼示例

本文整理匯總了PHP中article::del方法的典型用法代碼示例。如果您正苦於以下問題:PHP article::del方法的具體用法?PHP article::del怎麽用?PHP article::del使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在article的用法示例。


在下文中一共展示了article::del方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: do_del_channel

function do_del_channel($channel_id)
{
    //判斷頻道是否已存在
    $obj = new channel();
    $obj->set_where('');
    $obj->set_where("cha_id = {$channel_id}");
    $channel = $obj->get_one();
    if (count($channel)) {
        $cha_code = $channel['cha_code'];
        $obj->del();
    } else {
        return 0;
    }
    //刪除前台導航(導航管理)
    $obj = new varia();
    $obj->set_where("var_name = 'nav_stage_" . $cha_code . "'");
    $obj->del();
    //刪除後台導航(導航管理)
    $obj->set_where('');
    $obj->set_where("var_name = 'nav_admin_" . $cha_code . "'");
    $obj->del();
    //刪除後台導航菜單
    $obj = new menu();
    $obj->set_where("men_type = '{$cha_code}'");
    $obj->del();
    $obj->set_where('');
    $obj->set_where("men_type = 'admin_header'");
    $obj->set_where("men_url = '" . $cha_code . "/mod-sheet/'");
    $obj->del();
    $obj->set_where('');
    $obj->set_where("men_type = 'admin_" . $cha_code . "'");
    $obj->set_where("men_url = '" . $cha_code . "/mod-sheet/'");
    $obj->del();
    $obj->set_where('');
    $obj->set_where("men_type = 'admin_" . $cha_code . "'");
    $obj->set_where("men_url = '" . $cha_code . "/mod-add/'");
    $obj->del();
    $obj->set_where('');
    $obj->set_where("men_type = 'admin_" . $cha_code . "'");
    $obj->set_where("men_url = '" . $cha_code . "/mod-cat_list/'");
    $obj->del();
    $obj->set_where('');
    $obj->set_where("men_type = 'admin_" . $cha_code . "'");
    $obj->set_where("men_url = '" . $cha_code . "/mod-att_list/'");
    $obj->del();
    //刪除前台導航菜單
    $obj = new menu();
    $obj->set_where("men_type = 'header'");
    $obj->set_where("men_url = '" . $cha_code . "/'");
    $obj->del();
    //刪除分類
    $obj = new cat_art();
    $obj->set_where('');
    $obj->set_where("cat_channel_id = {$channel_id}");
    $obj->del();
    //刪除內容
    $obj = new article();
    $obj->set_where('');
    $obj->set_where("art_channel_id = {$channel_id}");
    $obj->del();
    //刪除屬性
    $obj = new att_art();
    $obj->set_where('');
    $obj->set_where("att_channel_id = {$channel_id}");
    $obj->del();
    //刪除語言包
    $path = 'languages/' . S_LANG . '/admin/' . $cha_code . '.txt';
    if (file_exists($path)) {
        unlink($path);
    }
    $path = 'languages/' . S_LANG . '/index/' . $cha_code . '.txt';
    if (file_exists($path)) {
        unlink($path);
    }
    //修改偽靜態文件
    $path = 'admin/module/basic/htaccess.txt';
    if (file_exists($path)) {
        $str = file_get_contents($path);
        $rule = "\n" . 'RewriteRule ^' . $cha_code . '/(.*)$ index.php?/' . $cha_code . '/$1';
        $str = str_replace($rule, '', $str);
        file_put_contents($path, $str);
    }
    return 1;
}
開發者ID:jechiy,項目名稱:xiu-cms,代碼行數:84,代碼來源:function.php

示例2: elseif

$smarty->assign("tpl_title", "Artikelverwaltung");
$smarty->assign('tpl_nav', 'settings');
$smarty->assign('tpl_subnav', 'editarticle');
$newperiod = 'false';
if ($request->GetVar('frm_period', 'post') !== $request->undefined) {
    $theperiod = $request->GetVar('frm_period', 'post');
} else {
    $actPeriod = $article->getactPeriod();
    $theperiod = $actPeriod['periodid'];
}
if ($request->GetVar('frm_action', 'post') == 'edit') {
    $smarty->assign('tpl_editid', $request->GetVar('frm_articleid', 'post'));
} elseif ($request->GetVar('frm_action', 'post') == 'addnew') {
    $smarty->assign('tpl_addnew', 'true');
} elseif ($request->GetVar('frm_action', 'post') == 'del') {
    $article->del($request->GetVar('frm_articleid', 'post'));
} elseif ($request->GetVar('frm_action', 'post') == 'new') {
    $check = $article->saveupdate();
} elseif ($request->GetVar('frm_action', 'post') == 'changeperiod') {
} elseif ($request->GetVar('frm_action', 'post') == 'saveupdatePeriod') {
    $theperiod = $article->saveupdatePeriod();
} elseif ($request->GetVar('frm_action', 'post') == 'newPeriod') {
    $theperiod = -1;
    $newperiod = 'true';
}
if ($request->GetVar('frm_thecat', 'post') !== $request->undefined) {
    $thecat = $request->GetVar('frm_thecat', 'post');
} else {
    $thecat = -1;
}
$smarty->assign('tpl_thecat', $thecat);
開發者ID:BackupTheBerlios,項目名稱:zvs,代碼行數:31,代碼來源:editarticle.php


注:本文中的article::del方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。