Beispiel #1
0
 function delete($itemid)
 {
     global $MOD, $DT_PRE;
     if (is_array($itemid)) {
         foreach ($itemid as $v) {
             $this->delete($v);
         }
     } else {
         $this->itemid = $itemid;
         $r = $this->get_one();
         if ($r) {
             $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
             $this->db->query("DELETE FROM {$DT_PRE}know_vote WHERE aid={$itemid}");
             if ($r['content']) {
                 delete_local($r['content'], get_user($r['username']));
             }
             if ($r['username'] && $MOD['credit_del_answer']) {
                 credit_add($r['username'], -$MOD['credit_del_answer']);
                 credit_record($r['username'], -$MOD['credit_del_answer'], 'system', lang('my->credit_record_answer_del'), 'ID:' . $r['qid']);
             }
         }
     }
 }
Beispiel #2
0
 function _delete($itemid)
 {
     $this->itemid = $itemid;
     $r = $this->get_one();
     if ($r['fromuser']) {
         $userid = get_user($r['fromuser']);
         if ($r['content']) {
             delete_local($r['content'], $userid);
         }
     }
     $this->db->query("DELETE FROM {$this->pre}message WHERE itemid='{$itemid}' ");
 }
Beispiel #3
0
 function delete($itemid, $all = true)
 {
     global $MOD, $L;
     if (is_array($itemid)) {
         foreach ($itemid as $v) {
             $this->delete($v);
         }
     } else {
         $this->itemid = $itemid;
         $r = $this->get_one();
         $userid = get_user($r['username']);
         if ($r['content']) {
             delete_local($r['content'], $userid);
         }
         $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
         $this->db->query("DELETE FROM {$this->table_data} WHERE itemid={$itemid}");
         if ($r['username'] && $MOD['credit_del_page']) {
             credit_add($r['username'], -$MOD['credit_del_page']);
             credit_record($r['username'], -$MOD['credit_del_page'], 'system', $L['page_record_del'], 'ID:' . $this->itemid);
         }
     }
 }
Beispiel #4
0
 function delete($itemid, $all = true)
 {
     if (is_array($itemid)) {
         foreach ($itemid as $v) {
             $this->delete($v, $all);
         }
     } else {
         $this->itemid = $itemid;
         $r = $this->get_one();
         if (!$r['islink']) {
             $_file = DT_ROOT . '/' . $r['linkurl'];
             if (is_file($_file)) {
                 unlink($_file);
             }
         }
         if ($all) {
             $userid = get_user($r['editor']);
             if ($r['content']) {
                 delete_local($r['content'], $userid);
             }
             $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
         }
     }
 }
Beispiel #5
0
 function delete($itemid)
 {
     if (is_array($itemid)) {
         foreach ($itemid as $v) {
             $this->delete($v, $all);
         }
     } else {
         $this->itemid = $itemid;
         $r = $this->get_one();
         $userid = get_user($r['editor']);
         if ($r['content']) {
             delete_local($r['content'], $userid);
         }
         $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
         $this->db->query("DELETE FROM {$this->table_item} WHERE formid={$itemid}");
         $this->db->query("DELETE FROM {$this->table_record} WHERE formid={$itemid}");
     }
 }
Beispiel #6
0
 function delete($itemid, $all = true)
 {
     global $MOD;
     if (is_array($itemid)) {
         foreach ($itemid as $v) {
             $this->delete($v, $all);
         }
     } else {
         $this->itemid = $itemid;
         $r = $this->get_one();
         if ($MOD['show_html']) {
             $_file = DT_ROOT . '/' . $MOD['moduledir'] . '/' . $r['linkurl'];
             if (is_file($_file)) {
                 unlink($_file);
             }
         }
         if ($all) {
             $userid = get_user($r['username']);
             if ($r['thumb']) {
                 delete_upload($r['thumb'], $userid);
             }
             if ($r['video']) {
                 delete_upload($r['video'], $userid);
             }
             if ($r['content']) {
                 delete_local($r['content'], $userid);
             }
             $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
             $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data);
             $this->db->query("DELETE FROM {$content_table} WHERE itemid={$itemid}");
             if ($MOD['cat_property']) {
                 $this->db->query("DELETE FROM {$this->db->pre}category_value WHERE moduleid={$this->moduleid} AND itemid={$itemid}");
             }
             if ($r['username'] && $MOD['credit_del']) {
                 credit_add($r['username'], -$MOD['credit_del']);
                 credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:' . $this->itemid);
             }
         }
     }
 }
Beispiel #7
0
 function delete($itemid, $all = true)
 {
     global $DT;
     if (is_array($itemid)) {
         foreach ($itemid as $v) {
             $this->delete($v, $all);
         }
     } else {
         $this->itemid = $itemid;
         $r = $this->get_one();
         if ($all) {
             $userid = get_user($r['editor']);
             if ($r['content']) {
                 delete_local($r['content'], $userid);
             }
             $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
             $fileurl = DT_ROOT . '/announce/' . $itemid . '.' . $DT['file_ext'];
             if (is_file($fileurl)) {
                 unlink($fileurl);
             }
         }
     }
 }
Beispiel #8
0
 function delete($itemid, $all = true)
 {
     global $MOD;
     if (is_array($itemid)) {
         foreach ($itemid as $v) {
             $this->delete($v, $all);
         }
     } else {
         $this->itemid = $itemid;
         $r = $this->get_one();
         if ($all) {
             $userid = get_user($r['username']);
             if ($r['thumb']) {
                 delete_upload($r['thumb'], $userid);
             }
             if ($r['content']) {
                 delete_local($r['content'], $userid);
             }
             $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
             $this->db->query("DELETE FROM {$this->table_data} WHERE itemid={$itemid}");
             if ($r['username'] && $MOD['credit_del_resume']) {
                 credit_add($r['username'], -$MOD['credit_del_resume']);
                 credit_record($r['username'], -$MOD['credit_del_resume'], 'system', lang('my->credit_record_resume_del'), 'ID:' . $this->itemid);
             }
         }
     }
 }
Beispiel #9
0
 function delete($itemid)
 {
     global $MOD, $L;
     if (is_array($itemid)) {
         foreach ($itemid as $v) {
             $this->delete($v);
         }
     } else {
         $this->itemid = $itemid;
         $r = $this->get_one();
         $userid = get_user($r['username']);
         if ($r['content']) {
             delete_local($r['content'], $userid);
         }
         $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
     }
 }
Beispiel #10
0
 function delete($itemid)
 {
     global $MOD, $DT_PRE;
     if (is_array($itemid)) {
         foreach ($itemid as $v) {
             $this->delete($v);
         }
     } else {
         $this->itemid = $itemid;
         $item = $this->get_one();
         if ($item) {
             $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
             if ($item['content']) {
                 delete_local($item['content'], get_user($item['username']));
             }
             if ($item['username'] && $MOD['credit_del_reply']) {
                 credit_add($item['username'], -$MOD['credit_del_reply']);
                 credit_record($item['username'], -$MOD['credit_del_reply'], 'system', lang('my->credit_record_reply_del'), 'ID:' . $itemid);
             }
             $this->tohtml($item['tid']);
         }
     }
 }