本文整理汇总了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;
}
示例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);