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


PHP article::clear方法代碼示例

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


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

示例1: article

 /**
  * Cnews::recycle()
  * 
  * @param integer $id
  * @param mixed $value
  * @return
  */
 function isolate_recycle($id = 0, $value)
 {
     if ($id != 0) {
         $news = new article($id);
         if (!$news->exists()) {
             show_404();
         }
         $news->recycle = ($news->recycle + 1) % 2;
         $news->save();
         $news->unset_home();
         if ($news->recycle == 1) {
             flash_message('success', "Xóa thành công.");
         } else {
             flash_message('success', "Phục hồi thành công.");
         }
     } else {
         $arr = $this->input->post('checkinput');
         foreach ($arr as $row) {
             $news = new article($row);
             $id = $news->id;
             $news->recycle = $value;
             $news->save();
             $news->unset_home();
             $news->clear();
         }
         if ($value == 1) {
             flash_message('success', "Xóa thành công.");
         } else {
             flash_message('success', "Phục hồi thành công.");
         }
     }
     $n = new Article($id);
     $newscatalogue = $n->newscatalogue;
     $this->session->set_userdata(array(config_item('session_admin') . 'menu_current' => $newscatalogue->navigation));
     if (empty($newscatalogue->menu_active)) {
         $dis['menu_active'] = "Tin";
     } else {
         $dis['menu_active'] = $newscatalogue->menu_active;
     }
     redirect($this->admin . "cnews/isolate_list_by_cat/" . $newscatalogue->id);
 }
開發者ID:lxthien,項目名稱:batdongsan,代碼行數:48,代碼來源:cnews.php

示例2: tohtml

         tohtml('show', $module);
     }
     dmsg('更新成功', $forward);
     break;
 case 'delete':
     $itemid or msg('請選擇' . $MOD['name']);
     isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid);
     dmsg('刪除成功', $forward);
     break;
 case 'restore':
     $itemid or msg('請選擇' . $MOD['name']);
     $do->restore($itemid);
     dmsg('還原成功', $forward);
     break;
 case 'clear':
     $do->clear();
     dmsg('清空成功', $forward);
     break;
 case 'level':
     $itemid or msg('請選擇' . $MOD['name']);
     $level = intval($level);
     $do->level($itemid, $level);
     dmsg('級別設置成功', $forward);
     break;
 case 'recycle':
     $lists = $do->get_list('status=0' . $condition, $dorder[$order]);
     $menuid = 4;
     include tpl('index', $module);
     break;
 case 'reject':
     if ($itemid && !$psize) {
開發者ID:hcd2008,項目名稱:destoon,代碼行數:31,代碼來源:index.inc.php


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