$message = array('user_id' => $user_id, 'user_name' => $_SESSION['user_name'], 'user_email' => $_SESSION['email'], 'msg_type' => isset($_POST['msg_type']) ? intval($_POST['msg_type']) : 0, 'msg_title' => isset($_POST['msg_title']) ? trim($_POST['msg_title']) : '', 'msg_content' => isset($_POST['msg_content']) ? trim($_POST['msg_content']) : '', 'order_id' => empty($_POST['order_id']) ? 0 : intval($_POST['order_id']), 'upload' => isset($_FILES['message_img']['error']) && $_FILES['message_img']['error'] == 0 || !isset($_FILES['message_img']['error']) && isset($_FILES['message_img']['tmp_name']) && $_FILES['message_img']['tmp_name'] != 'none' ? $_FILES['message_img'] : array());
    if (add_message($message)) {
        show_message($_LANG['add_message_success'], $_LANG['message_list_lnk'], 'user.php?act=message_list&order_id=' . $message['order_id'], 'info');
    } else {
        $err->show($_LANG['message_list_lnk'], 'user.php?act=message_list');
    }
} elseif ($action == 'tag_list') {
    include_once ROOT_PATH . 'includes/lib_clips.php';
    $good_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
    $smarty->assign('tags', get_user_tags($user_id));
    $smarty->assign('tags_from', 'user');
    $smarty->display('user_clips.dwt');
} elseif ($action == 'act_del_tag') {
    include_once ROOT_PATH . 'includes/lib_clips.php';
    $tag_words = isset($_GET['tag_words']) ? trim($_GET['tag_words']) : '';
    delete_tag($tag_words, $user_id);
    ecs_header("Location: user.php?act=tag_list\n");
    exit;
} elseif ($action == 'booking_list') {
    include_once ROOT_PATH . 'includes/lib_clips.php';
    $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
    /* 获取缺货登记的数量 */
    $sql = "SELECT COUNT(*) " . "FROM " . $ecs->table('booking_goods') . " AS bg, " . $ecs->table('goods') . " AS g " . "WHERE bg.goods_id = g.goods_id AND user_id = '{$user_id}'";
    $record_count = $db->getOne($sql);
    $pager = get_pager('user.php', array('act' => $action), $record_count, $page);
    $smarty->assign('booking_list', get_booking_list($user_id, $pager['size'], $pager['start']));
    $smarty->assign('pager', $pager);
    $smarty->display('user_clips.dwt');
} elseif ($action == 'add_booking') {
    include_once ROOT_PATH . 'includes/lib_clips.php';
    $goods_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
Exemple #2
0
                 $crud_operation['message'] .= ui_print_result_message($result, __('Tag updated successsfully'), __('There was an error updating the tag'), '', true);
             } catch (Exception $e) {
                 $crud_operation['message'] .= ui_print_error_message($e->getMessage(), '', true);
             }
         } else {
             $crud_operation['message'] .= ui_print_error_message(__('The name already exists'), '', true);
         }
     } else {
         $crud_operation['message'] .= ui_print_error_message(__('Some required values are missing'), '', true);
     }
 } else {
     if ($delete) {
         // id required
         if (!empty($id)) {
             try {
                 $result = delete_tag($id);
                 $crud_operation['result'] = $result;
                 // Result can be 0 if the target does not exist
                 if ($result !== false) {
                     $result = true;
                     // Prepare the values for another creation
                     $id = 0;
                     $name = '';
                     $colour = '';
                 }
                 $crud_operation['message'] .= ui_print_result_message($result, __('Tag deleted successsfully'), __('There was an error deleting the tag'), '', true);
             } catch (Exception $e) {
                 $crud_operation['message'] .= ui_print_error_message($e->getMessage(), '', true);
             }
         } else {
             $crud_operation['message'] .= ui_print_error_message(__('Some required values are missing'), '', true);
Exemple #3
0
function action_act_del_tag()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    include_once ROOT_PATH . 'includes/lib_clips.php';
    $tag_words = isset($_GET['tag_words']) ? trim($_GET['tag_words']) : '';
    delete_tag($tag_words, $user_id);
    ecs_header("Location: user.php?act=tag_list\n");
    exit;
}
Exemple #4
0
 function delReply($replydb, $recycle = false, $delCredit = true, $recount = false, $extra = array())
 {
     global $credit, $windid, $timestamp, $onlineip, $db_creditset;
     !$credit && (require_once R_P . 'require/credit.php');
     $tids = $pids = $_tids = $_pids = $ptable_a = $recycledb = $delfids = $deltids = $deluids = $attachdb = $deltpc = array();
     foreach ($replydb as $key => $reply) {
         $tids[$reply['tid']] = 1;
         if ($reply['pid'] == 'tpc') {
             $reply['pid'] = 0;
         }
         if ($recycle) {
             $recycledb[] = array('pid' => $reply['pid'], 'tid' => $reply['tid'], 'fid' => $reply['fid'], 'deltime' => $timestamp, 'admin' => $windid);
         }
         if ($reply['pid'] > 0) {
             /*回复*/
             $isInRecycle = $reply['fid'] == 0 && $reply['tid'] == 0;
             if ($reply['aid']) {
                 $_tids[$reply['tid']] = $reply['tid'];
                 $_pids[$reply['pid']] = $reply['pid'];
             }
             if (!$isInRecycle) {
                 $deluids[$reply['authorid']]++;
                 if ($reply['ifcheck']) {
                     $delfids[$reply['fid']]['replies']++;
                     $deltids[$reply['tid']]++;
                 }
             }
             $ptable_a[$reply['ptable']] = 1;
             $pids[] = $reply['pid'];
             $creditType = 'Deleterp';
             $logType = 'delrp_descrip';
         } else {
             /* 主题 */
             $isInRecycle = $reply['fid'] == 0 && $reply['ifcheck'] == 1;
             !$isInRecycle && $deluids[$reply['authorid']]++;
             $deltpc[] = $reply['tid'];
             $creditType = 'Delete';
             $logType = 'del_descrip';
         }
         $msg_delrvrc = $msg_delmoney = 0;
         if ($delCredit && !$isInRecycle) {
             $creditset = $this->getcreditset($reply['fid']);
             $credit->addLog("topic_{$creditType}", $creditset[$creditType], array('uid' => $reply['authorid'], 'username' => $reply['author'], 'ip' => $onlineip, 'fname' => strip_tags($this->getForumInfo($reply['fid'], 'name')), 'operator' => $windid));
             $credit->sets($reply['authorid'], $creditset[$creditType], false);
             $msg_delrvrc = abs($creditset[$creditType]['rvrc']);
             $msg_delmoney = abs($creditset[$creditType]['money']);
         }
         /*操作日志 */
         $logdb[] = array('type' => 'delete', 'username1' => $reply['author'], 'username2' => $windid, 'field1' => $reply['fid'], 'field2' => '', 'field3' => '', 'descrip' => $logType, 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $reply['tid'], 'subject' => substrs($reply['subject'] ? $reply['subject'] : $reply['content'], 28), 'affect' => "{$GLOBALS[db_rvrcname]}:-{$msg_delrvrc},{$GLOBALS[db_moneyname]}:-{$msg_delmoney}", 'reason' => $extra['reason']);
     }
     if (!$tids) {
         return true;
     }
     require_once R_P . 'require/updateforum.php';
     $delpids = S::sqlImplode($pids);
     if ($recycle) {
         foreach ($ptable_a as $key => $val) {
             $pw_posts = GetPtable($key);
             //$this->db->update("UPDATE $pw_posts SET tid='0',fid='0' WHERE pid IN($delpids)");
             pwQuery::update($pw_posts, 'pid IN(:pid)', array($pids), array('tid' => '0', 'fid' => '0'));
         }
         if ($recycledb) {
             $this->db->update("REPLACE INTO pw_recycle (pid,tid,fid,deltime,admin) VALUES " . S::sqlMulti($recycledb));
         }
     } else {
         foreach ($ptable_a as $key => $val) {
             $pw_posts = GetPtable($key);
             //$this->db->update("DELETE FROM $pw_posts WHERE pid IN($delpids)");
             pwQuery::delete($pw_posts, 'pid IN(:pid)', array($pids));
         }
     }
     if ($delpids) {
         $this->resetReplayToppedFloor($replydb, '', '', $extra['tpcstatus']);
     }
     /*前台删主题,默认将其设为屏蔽*/
     if ($deltpc) {
         //$this->db->update("UPDATE pw_threads SET ifshield='2' WHERE tid IN (" . S::sqlImplode($deltpc) . ')');
         pwQuery::update('pw_threads', 'tid IN (:tid)', array($deltpc), array('ifshield' => 2));
         $pw_attachs = L::loadDB('attachs', 'forum');
         $attachdb += $pw_attachs->getByTid($deltpc, 0);
         !$recycle && delete_tag(S::sqlImplode($deltpc));
         /* 删除微博 */
         $weiboService = L::loadClass('weibo', 'sns');
         /* @var $weiboService PW_Weibo */
         $weibos = $weiboService->getWeibosByObjectIdsAndType($deltpc, 'article');
         if ($weibos) {
             $mids = array();
             foreach ($weibos as $key => $weibo) {
                 $mids[] = $weibo['mid'];
             }
             $weiboService->deleteWeibos($mids);
         }
     }
     if ($_tids) {
         $pw_attachs = L::loadDB('attachs', 'forum');
         $attachdb += $pw_attachs->getByTid($_tids, $_pids);
     }
     if ($attachdb) {
         delete_att($attachdb, !$recycle);
         require_once R_P . 'require/functions.php';
         pwFtpClose($GLOBALS['ftp']);
     }
     $userService = L::loadClass('UserService', 'user');
     /* @var $userService PW_UserService */
     foreach ($deluids as $uid => $value) {
         $userService->updateByIncrement($uid, array(), array('postnum' => -$value));
     }
     if ($deltopic = $this->delReplyTopic(array_keys($tids), $deltpc, $recount, $recycle)) {
         foreach ($deltopic as $fid => $value) {
             $delfids[$fid]['topic'] = $value;
         }
     }
     if ($delfids) {
         //* $threadlist = L::loadClass("threadlist", 'forum');
         foreach ($delfids as $fid => $value) {
             //* $threadlist->refreshThreadIdsByForumId($fid);
             Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
             updateForumCount($fid, -$value['topic'], -$value['replies']);
         }
     }
     if ($deltids && !$recount) {
         foreach ($deltids as $tid => $value) {
             //$this->db->update("UPDATE pw_threads SET replies=replies-" . S::sqlEscape($value) . " WHERE tid=" . S::sqlEscape($tid));
             $this->db->update(pwQuery::buildClause("UPDATE :pw_table SET replies=replies-:replies WHERE tid=:tid", array('pw_threads', $value, $tid)));
         }
     }
     /*写操作日志 */
     require_once R_P . 'require/writelog.php';
     foreach ($logdb as $log) {
         writelog($log);
     }
     /*扣除积分*/
     $credit->runsql();
     return !empty($deltopic);
 }
Exemple #5
0
function recycle($ids)
{
    global $db, $fid;
    $delids = array();
    foreach ($ids as $key => $value) {
        if (is_numeric($value)) {
            $delids[] = $value;
        }
    }
    if ($delids) {
        $delids = pwImplode($delids);
    } else {
        Showmsg('forumcp_recycle_nodata');
    }
    $query = $db->query("SELECT r.*,t.special,t.ifshield,t.ifupload,t.ptable,t.replies,t.fid AS ckfid FROM pw_recycle r LEFT JOIN pw_threads t ON r.tid=t.tid WHERE r.tid IN ({$delids}) AND r.pid='0' AND r.fid=" . pwEscape($fid));
    $taid_a = $ttable_a = $ptable_a = array();
    $delids = $pollids = $actids = $delaids = $rewids = $ids = array();
    while (@extract($db->fetch_array($query))) {
        $ids[] = $tid;
        ($ifshield != '2' || $replies == '0' || $ckfid == '0') && ($delids[] = $tid);
        $special == 1 && ($pollids[] = $tid);
        $special == 2 && ($actids[] = $tid);
        $special == 3 && ($rewids[] = $tid);
        if ($ifshield != '2' || $replies == '0' || $ckfid == '0') {
            $ptable_a[$ptable] = 1;
            $ttable_a[GetTtable($tid)][] = $tid;
        }
        if ($ifupload) {
            $taid_a[GetTtable($tid)][] = $tid;
            if ($ifshield != '2' || $replies == '0' || $ckfid == '0') {
                $pw_posts = GetPtable($ptable);
                $query2 = $db->query("SELECT aid FROM {$pw_posts} WHERE tid=" . pwEscape($tid) . " AND aid!=''");
                while (@extract($db->fetch_array($query2))) {
                    if (!$aid) {
                        continue;
                    }
                    $attachs = unserialize(stripslashes($aid));
                    foreach ($attachs as $key => $value) {
                        is_numeric($key) && ($delaids[] = $key);
                        pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
                        $value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
                    }
                }
            }
        }
    }
    foreach ($taid_a as $pw_tmsgs => $value) {
        $value = pwImplode($value);
        $query = $db->query("SELECT aid FROM {$pw_tmsgs} WHERE tid IN({$value}) AND aid!=''");
        while (@extract($db->fetch_array($query))) {
            if (!$aid) {
                continue;
            }
            $attachs = unserialize(stripslashes($aid));
            foreach ($attachs as $key => $value) {
                is_numeric($key) && ($delaids[] = $key);
                pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
                $value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
            }
        }
    }
    if ($pollids) {
        $pollids = pwImplode($pollids);
        $db->update("DELETE FROM pw_polls WHERE tid IN({$pollids})");
    }
    if ($actids) {
        $actids = pwImplode($actids);
        $db->update("DELETE FROM pw_activity WHERE tid IN({$actids})");
        $db->update("DELETE FROM pw_actmember WHERE actid IN({$actids})");
    }
    if ($rewids) {
        $rewids = pwImplode($rewids);
        $db->update("DELETE FROM pw_reward WHERE tid IN({$rewids})");
    }
    if ($delaids) {
        $pw_attachs = L::loadDB('attachs');
        $pw_attachs->delete($delaids);
    }
    $delids = pwImplode($delids);
    if ($delids) {
        # $db->update("DELETE FROM pw_threads	WHERE tid IN($delids)");
        # ThreadManager
        $threadManager = L::loadClass("threadmanager");
        $threadManager->deleteByThreadIds($fid, $delids);
    }
    foreach ($ttable_a as $pw_tmsgs => $val) {
        $val = pwImplode($val);
        $db->update("DELETE FROM {$pw_tmsgs} WHERE tid IN({$val})");
    }
    foreach ($ptable_a as $key => $val) {
        $pw_posts = GetPtable($key);
        $db->update("DELETE FROM {$pw_posts} WHERE tid IN({$delids})");
    }
    delete_tag($delids);
    if ($ids) {
        $ids = pwImplode($ids);
        $db->update("DELETE FROM pw_recycle WHERE tid IN ({$ids})");
    }
    pwFtpClose($GLOBALS['ftp']);
}
 function delReply($replydb, $recount = true, $recycle = false)
 {
     $tids = $pids = $_tids = $_pids = $ptable_a = $recycledb = $delfids = $deltids = $deluids = $attachdb = $deltpc = array();
     foreach ($replydb as $key => $reply) {
         $tids[$reply['tid']] = 1;
         if ($reply['pid'] == 'tpc') {
             $reply['pid'] = 0;
         }
         if ($recycle) {
             $recycledb[] = array('pid' => $reply['pid'], 'tid' => $reply['tid'], 'fid' => $reply['fid'], 'deltime' => $GLOBALS['timestamp'], 'admin' => $GLOBALS['windid']);
         }
         if ($reply['pid'] > 0) {
             if ($reply['aid']) {
                 $_tids[$reply['tid']] = $reply['tid'];
                 $_pids[$reply['pid']] = $reply['pid'];
             }
             if ($reply['fid'] > 0) {
                 $deluids[$reply['authorid']]++;
                 if ($reply['ifcheck']) {
                     $delfids[$reply['fid']]['replies']++;
                     $deltids[$reply['tid']]++;
                 }
             }
             $ptable_a[$reply['ptable']] = 1;
             $pids[] = $reply['pid'];
         } else {
             $reply['fid'] > 0 && $reply['ifcheck'] && $deluids[$reply['authorid']]++;
             $deltpc[] = $reply['tid'];
         }
     }
     if (!$tids) {
         return true;
     }
     require_once R_P . 'require/updateforum.php';
     $delpids = pwImplode($pids);
     if ($recycle) {
         foreach ($ptable_a as $key => $val) {
             $pw_posts = GetPtable($key);
             $this->db->update("UPDATE {$pw_posts} SET tid='0',fid='0' WHERE pid IN({$delpids})");
         }
         if ($recycledb) {
             $this->db->update("REPLACE INTO pw_recycle (pid,tid,fid,deltime,admin) VALUES " . pwSqlMulti($recycledb));
         }
     } else {
         foreach ($ptable_a as $key => $val) {
             $pw_posts = GetPtable($key);
             $this->db->update("DELETE FROM {$pw_posts} WHERE pid IN({$delpids})");
         }
     }
     if ($delpids) {
         $this->resetReplayToppedFloor($replydb);
     }
     if ($deltpc) {
         $this->db->update("UPDATE pw_threads SET ifshield='2' WHERE tid IN (" . pwImplode($deltpc) . ')');
         $pw_attachs = L::loadDB('attachs');
         $attachdb += $pw_attachs->getByTid($deltpc, 0);
         !$recycle && delete_tag(pwImplode($deltpc));
     }
     if ($_tids) {
         $pw_attachs = L::loadDB('attachs');
         $attachdb += $pw_attachs->getByTid($_tids, $_pids);
     }
     if ($attachdb) {
         delete_att($attachdb, !$recycle);
         pwFtpClose($GLOBALS['ftp']);
     }
     foreach ($deluids as $uid => $value) {
         $this->db->update("UPDATE pw_memberdata SET postnum=postnum-" . pwEscape($value) . " WHERE uid=" . pwEscape($uid));
     }
     if ($deltopic = $this->delReplyTopic(array_keys($tids), $deltpc, $recount, $recycle)) {
         foreach ($deltopic as $fid => $value) {
             $delfids[$fid]['topic'] = $value;
         }
     }
     if ($delfids) {
         $threadlist = L::loadClass("threadlist");
         foreach ($delfids as $fid => $value) {
             $threadlist->refreshThreadIdsByForumId($fid);
             updateForumCount($fid, -$value['topic'], -$value['replies']);
         }
     }
     if ($deltids && !$recount) {
         foreach ($deltids as $tid => $value) {
             $this->db->update("UPDATE pw_threads SET replies=replies-" . pwEscape($value) . " WHERE tid=" . pwEscape($tid));
         }
     }
     return !empty($deltopic);
 }
Exemple #7
0
    }
    foreach ($tags as $id) {
        $tag = new MWTag($id);
        if ($tag->isNew()) {
            continue;
        }
        $tag->update_posts();
    }
    redirectMsg('tags.php?page=' . $page, __('Tags updated!', 'mywords'), 0);
}
$action = rmc_server_var($_REQUEST, 'action', '');
switch ($action) {
    case 'new':
        save_tag(false);
        break;
    case 'saveedit':
        save_tag(true);
        break;
    case 'edit':
        edit_form();
        break;
    case 'delete':
        delete_tag();
        break;
    case 'update':
        update_tag();
        break;
    default:
        show_tags();
        break;
}
Exemple #8
0
             $delaids = pwImplode($delaids);
             $db->update("DELETE FROM pw_attachs WHERE aid IN({$delaids})");
         }
         # $db->update("DELETE FROM pw_threads WHERE tid IN ($delids)");
         # ThreadManager
         $threadManager = L::loadClass("threadmanager");
         $threadManager->deleteByThreadIds($fid, $delids);
         if ($delids) {
             $db->update("DELETE FROM pw_feed WHERE type='post' AND typeid IN(" . $delids . ")");
         }
         foreach ($ptable_a as $key => $val) {
             $pw_posts = GetPtable($key);
             $db->update("DELETE FROM {$pw_posts} WHERE tid IN ({$delids})");
         }
         $db->update("DELETE FROM {$pw_tmsgs} WHERE tid IN ({$delids})");
         delete_tag($delids);
         /**
          * 数据更新
          */
         foreach ($fidarray as $fid) {
             updateforum($fid);
         }
         foreach ($delnum as $key => $value) {
             $db->update("UPDATE pw_memberdata SET postnum=postnum-" . pwEscape($value) . "WHERE uid=" . pwEscape($key));
         }
         P_unlink(D_P . 'data/bbscache/c_cache.php');
         adminmsg('operate_success', "{$admin_file}?adminjob=superdel&admintype=article&action={$action}&fid={$_POST['fid']}&ifkeep={$ifkeep}&pstarttime={$pstarttime}&pendtime={$pendtime}&lstarttime={$lstarttime}&lendtime={$lendtime}&tstart={$tstart}&tend={$tend}&hits={$_POST['hits']}&replies={$_POST['replies']}&author=" . rawurlencode($author) . "&keyword=" . rawurlencode($keyword) . "&userip={$userip}&lines={$lines}&ttable={$ttable}&tcounts={$tcounts}&counts={$counts}&page={$page}");
     }
 } elseif ($action == 'delrpl') {
     InitGP(array('ptable'));
     is_numeric($ptable) && ($dbptable = $ptable);
Exemple #9
0
function delete_tag_action($session_uid, $uid)
{
    //check if the user is admin
    if (user_is_admin($session_uid)) {
        delete_tag($uid);
        // Redirect browser
        header("Location: http://" . $_SERVER['SERVER_NAME'] . "/tags");
        // Make sure that code below does not get executed when we redirect
        exit;
    } else {
        require 'templates/login.php';
    }
}
Exemple #10
0
function can_delete($selected_id)
{
    if ($selected_id == -1) {
        return false;
    }
    $result = get_records_associated_with_tag($selected_id);
    if (db_num_rows($result) > 0) {
        display_error(_("Cannot delete this tag because records have been created referring to it."));
        return false;
    }
    return true;
}
//-----------------------------------------------------------------------------------
if ($Mode == 'Delete') {
    if (can_delete($selected_id)) {
        delete_tag($selected_id);
        display_notification(_('Selected tag has been deleted'));
    }
    $Mode = 'RESET';
}
//-----------------------------------------------------------------------------------
if ($Mode == 'RESET') {
    $selected_id = -1;
    $_POST['name'] = $_POST['description'] = '';
}
//-----------------------------------------------------------------------------------
$result = get_tags($_POST['type'], check_value('show_inactive'));
start_form();
start_table(TABLESTYLE);
$th = array(_("Tag Name"), _("Tag Description"), "", "");
inactive_control_column($th);
Exemple #11
0
    }
}
// update tag
if (isset($_POST['update_tag']) && $_POST['update_tag'] == 'update') {
    $tag_id = (int) $_GET['tag_id'];
    $update_status = update_tag($tag_id);
    if ($update_status === true) {
        header('Location: ' . $url);
    } else {
        $error = $update_status;
    }
}
// delete tag
if (isset($_POST['confirm_delete_tag']) && $_POST['confirm_delete_tag'] == 'Yes') {
    $tag_id = (int) $_GET['tag_id'];
    $delete_status = delete_tag($tag_id);
    if ($delete_status === true) {
        header('Location: ' . $_SERVER["PHP_SELF"] . '?page_name=tags');
    } else {
        $error = $delete_status;
    }
}
// cancel delete tag
if (isset($_POST['cancel_delete_tag']) && $_POST['cancel_delete_tag'] == 'No') {
    $tag_id = (int) $_GET['tag_id'];
    header('Location: ' . $_SERVER["PHP_SELF"] . '?page_name=tags&tag_id=' . $tag_id);
}
// get main data
$tag_id = isset($_GET['tag_id']) ? (int) $_GET['tag_id'] : 0;
if (empty($tag_id)) {
    $left_text = 'Tags';
Exemple #12
0
         $threadService->deleteByThreadIds($delids);
         Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
         foreach ($ptable_a as $key => $val) {
             $pw_posts = GetPtable($key);
             //$db->update("DELETE FROM $pw_posts WHERE tid IN($delids)");
             pwQuery::delete($pw_posts, 'tid IN(:tid)', array($delids));
         }
     }
     foreach ($ttable_a as $pw_tmsgs => $val) {
         if ($val) {
             //* $val = S::sqlImplode($val,false);
             //* $db->update("DELETE FROM $pw_tmsgs WHERE tid IN($val)");
             pwQuery::delete($pw_tmsgs, 'tid IN(:tid)', array($val));
         }
     }
     delete_tag(S::sqlImplode($delids, false));
     if ($ids) {
         $ids = S::sqlImplode($ids, false);
         $db->update("DELETE FROM pw_recycle WHERE tid IN ({$ids})");
     }
 } else {
     S::gp(array('ptable'));
     !is_numeric($ptable) && ($ptable = $db_ptable);
     $pw_posts = GetPtable($ptable);
     if ($action == 'del') {
         $sql = "WHERE p.pid IN ({$selids}) AND p.tid='0'";
     } else {
         $sql = "WHERE p.tid='0'";
     }
     $query = $db->query("SELECT p.pid,p.aid,r.tid FROM {$pw_posts} p LEFT JOIN pw_recycle r ON p.pid=r.pid {$sql} LIMIT 100");
     while ($rt = $db->fetch_array($query)) {
Exemple #13
0
     remove_achievement(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_action":
     delete_action(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_note":
     delete_note(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_relation":
     delete_relation(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_requirement":
     delete_requirement(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_tag":
     delete_tag(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_todo":
     delete_todo(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "delete_top_action":
     delete_top_action(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "display_history":
     display_history(filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT));
     break;
 case "display_queue":
     display_queue();
     break;
 case "fetch_required_filter_status":
     fetch_required_filter_status();
Exemple #14
0
function service_delete_tags($args)
{
    if (count($args) == 0) {
        err_bad_input_format("expected at least 1 argument in URL (one or more tags)");
    }
    // validate tag arguments (don't start deleting just to stop half-way)
    foreach ($args as $tag) {
        if (!get_tag_info($tag)) {
            err_bad_input_data('tag', $tag, "not a valid tag");
        }
    }
    // delete tags
    foreach ($args as $tag) {
        delete_tag($tag);
    }
}