当前位置: 首页>>代码示例>>PHP>>正文


PHP article::delete方法代码示例

本文整理汇总了PHP中article::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP article::delete方法的具体用法?PHP article::delete怎么用?PHP article::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在article的用法示例。


在下文中一共展示了article::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: article

<?php

if (isset($_REQUEST['i']) && !empty($_REQUEST['i'])) {
    $object_article = new article();
    $object_article->setId($_REQUEST['i']);
    if ($object_article->delete()) {
        print 'sucess';
    } else {
        print 'error';
    }
} else {
    print 'error';
}
开发者ID:DaniJCV,项目名称:BO2-BOxygen,代码行数:13,代码来源:article_del.php

示例2: article

 /**
  * Cnews::copy_2_cat()
  * 
  * @param mixed $id
  * @return
  */
 function copy_2_cat($id)
 {
     $this->load->helper('remove_vn_helper');
     $news = new article($id);
     if (!$news->exists()) {
         show_404();
     }
     $cat_id = $news->newscatalogue_id;
     $copy_newscatalogue = $this->input->post('copy_newscatalogue');
     $copy_type = $this->input->post('copy_type');
     $copy_amount = $this->input->post('copy_amount');
     $flag_error = false;
     if ($copy_newscatalogue == 0) {
         $newscatalogue = new newscatalogue();
         $newscatalogue->where('id !=', $news->newscatalogue_id);
         $newscatalogue->get();
         $vb = new article();
         $vb->hot = 0;
         $vb->home_hot = 0;
         foreach ($newscatalogue as $row) {
             for ($i = 0; $i < $copy_amount; $i++) {
                 $vb = $news->get_copy();
                 $vb->code = "";
                 if (!$vb->save(array($row))) {
                     foreach ($vb->error->all as $r) {
                         flash_message('error', $r);
                         $flag_error = true;
                     }
                 } else {
                     $vb->title_vietnamese = $vb->code . ": " . $vb->title_vietnamese;
                     $vb->title_none = remove_vn($vb->title_vietnamese) . "-" . md5($vb->id);
                     $vb->save();
                 }
                 $vb->clear();
             }
         }
     } else {
         $newscatalogue = new newscatalogue($copy_newscatalogue);
         $vb = new article();
         $vb->hot = 0;
         $vb->home_hot = 0;
         for ($i = 0; $i < $copy_amount; $i++) {
             $vb = $news->get_copy();
             $vb->code = "";
             if (!$vb->save(array($newscatalogue))) {
                 foreach ($vb->error->all as $r) {
                     flash_message('error', $r);
                     $flag_error = true;
                 }
             } else {
                 $vb->title_vietnamese = $vb->code . ": " . $vb->title_vietnamese;
                 $vb->title_none = remove_vn($vb->title_vietnamese) . "-" . md5($vb->id);
                 $vb->save();
             }
             $vb->clear();
         }
     }
     if ($copy_type == "move") {
         $news->delete();
     }
     if ($flag_error == false) {
         flash_message('success', "Thực hiện thành công xong copy/move");
     } else {
         flash_message('info', "Có 1 vài lỗi trên");
     }
     redirect($this->admin . 'cnews/edit/' . $cat_id . '/' . $id);
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:73,代码来源:cnews.php

示例3: foreach

     foreach ($itemid as $v) {
         $do->update($v);
     }
     dmsg('更新成功', $forward);
     break;
 case 'tohtml':
     is_array($itemid) or msg('请选择' . $MOD['name']);
     $html_itemids = $itemid;
     foreach ($html_itemids as $itemid) {
         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);
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:index.inc.php


注:本文中的article::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。