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


PHP delete_attachment函数代码示例

本文整理汇总了PHP中delete_attachment函数的典型用法代码示例。如果您正苦于以下问题:PHP delete_attachment函数的具体用法?PHP delete_attachment怎么用?PHP delete_attachment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: prune

function prune($forum_id, $prune_date, $prune_all = false)
{
    global $db, $lang;
    $prune_all = $prune_all ? '' : 'AND t.topic_vote = 0 AND t.topic_type <> ' . POST_ANNOUNCE;
    //
    // Those without polls and announcements ... unless told otherwise!
    //
    $sql = "SELECT t.topic_id FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t\n\t\tWHERE t.forum_id = {$forum_id}\n\t\t\t{$prune_all}\n\t\t\tAND ( p.post_id = t.topic_last_post_id OR t.topic_last_post_id = 0 )";
    if ($prune_date != '') {
        $sql .= " AND p.post_time < {$prune_date}";
    }
    $result = $db->sql_query($sql);
    $sql_topics = '';
    while ($row = $db->sql_fetchrow($result)) {
        $sql_topics .= ($sql_topics != '' ? ', ' : '') . $row['topic_id'];
    }
    $db->sql_freeresult($result);
    if ($sql_topics != '') {
        $sql = "SELECT post_id FROM " . POSTS_TABLE . "\n\t\t\tWHERE forum_id = {$forum_id} AND topic_id IN ({$sql_topics})";
        $result = $db->sql_query($sql);
        $sql_post = '';
        while ($row = $db->sql_fetchrow($result)) {
            $sql_post .= ($sql_post != '' ? ', ' : '') . $row['post_id'];
        }
        $db->sql_freeresult($result);
        if ($sql_post != '') {
            $db->sql_query("DELETE FROM " . TOPICS_WATCH_TABLE . " WHERE topic_id IN ({$sql_topics})");
            $db->sql_query("DELETE FROM " . TOPICS_TABLE . " WHERE topic_id IN ({$sql_topics})");
            $pruned_topics = $db->sql_affectedrows();
            $db->sql_query("DELETE FROM " . POSTS_TABLE . " WHERE post_id IN ({$sql_post})");
            $pruned_posts = $db->sql_affectedrows();
            $db->sql_query("DELETE FROM " . POSTS_TEXT_TABLE . " WHERE post_id IN ({$sql_post})");
            remove_search_post($sql_post);
            //			if (defined('BBAttach_mod')) {
            delete_attachment($sql_post);
            return array('topics' => $pruned_topics, 'posts' => $pruned_posts);
        }
    }
    return array('topics' => 0, 'posts' => 0);
}
开发者ID:cbsistem,项目名称:nexos,代码行数:40,代码来源:prune.php

示例2: privmsgs_attachment_mod

 /**
  * For Private Messaging
  */
 function privmsgs_attachment_mod($mode)
 {
     global $config, $template, $user, $lang, $db;
     global $confirm, $delete, $delete_all, $post_id, $privmsgs_id, $privmsg_id, $submit, $refresh, $mark_list, $folder;
     if ($folder != 'outbox') {
         $this->display_attach_box_limits();
     }
     if (!intval($config['allow_pm_attach'])) {
         return;
     }
     if (!$refresh) {
         $add_attachment_box = !empty($_POST['add_attachment_box']) ? true : false;
         $posted_attachments_box = !empty($_POST['posted_attachments_box']) ? true : false;
         $refresh = $add_attachment_box || $posted_attachments_box;
     }
     $post_id = $privmsgs_id;
     $result = $this->handle_attachments($mode, PAGE_PRIVMSGS);
     if ($result === false) {
         return;
     }
     $mark_list = request_var('mark', array(0));
     if (($this->pm_delete_attachments || $delete) && sizeof($mark_list)) {
         if (!$user->data['session_logged_in']) {
             $header_location = @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ? 'Refresh: 0; URL=' : 'Location: ';
             header($header_location . append_sid(IP_ROOT_PATH . CMS_PAGE_LOGIN . '?redirect=privmsg.' . PHP_EXT . '&folder=inbox', true));
             exit;
         }
         if (sizeof($mark_list)) {
             $delete_sql_id = '';
             for ($i = 0; $i < sizeof($mark_list); $i++) {
                 $delete_sql_id .= ($delete_sql_id != '' ? ', ' : '') . intval($mark_list[$i]);
             }
             if (($this->pm_delete_attachments || $confirm) && !$delete_all) {
                 delete_attachment($delete_sql_id, 0, PAGE_PRIVMSGS);
             }
         }
     }
     if ($submit || $refresh || $mode != '') {
         $this->display_attachment_bodies();
     }
 }
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:44,代码来源:pm_attachments.php

示例3: array

if ($confirm && sizeof($delete_id_list) > 0) {
    $attachments = array();
    for ($i = 0; $i < sizeof($delete_id_list); $i++) {
        $sql = 'SELECT post_id, privmsgs_id 
			FROM ' . ATTACHMENTS_TABLE . ' 
			WHERE attach_id = ' . intval($delete_id_list[$i]) . '
				AND (user_id_1 = ' . intval($profiledata['user_id']) . '
					OR user_id_2 = ' . intval($profiledata['user_id']) . ')';
        $result = $db->sql_query($sql);
        if ($result) {
            $row = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);
            if ($row['post_id'] != 0) {
                delete_attachment(0, intval($delete_id_list[$i]));
            } else {
                delete_attachment(0, intval($delete_id_list[$i]), PAGE_PRIVMSGS, intval($profiledata['user_id']));
            }
        }
    }
} else {
    if ($delete && sizeof($delete_id_list) > 0) {
        // Not confirmed, show confirmation message
        $hidden_fields = '<input type="hidden" name="view" value="' . $view . '" />';
        $hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />';
        $hidden_fields .= '<input type="hidden" name="order" value="' . $sort_order . '" />';
        $hidden_fields .= '<input type="hidden" name="' . POST_USERS_URL . '" value="' . intval($profiledata['user_id']) . '" />';
        $hidden_fields .= '<input type="hidden" name="start" value="' . $start . '" />';
        $hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
        for ($i = 0; $i < sizeof($delete_id_list); $i++) {
            $hidden_fields .= '<input type="hidden" name="delete_id_list[]" value="' . intval($delete_id_list[$i]) . '" />';
        }
开发者ID:nmpetkov,项目名称:ZphpBB2,代码行数:31,代码来源:uacp.php

示例4: edit_attachment

    if ($_POST['action'] == 'edit_attachment') {
        edit_attachment($_POST['sample_id'], $_POST['attachment_id']);
    }
    if ($_POST['action'] == 'add_attachment') {
        add_attachment($_POST['sample_id']);
    }
    if ($_POST['action'] == 'save_attachment') {
        if (isset($_FILES)) {
            save_attachment($_POST, $_FILES);
        }
        list_attachment($_POST['sample_id']);
    }
    if ($_POST['action'] == 'insert_attachment') {
        if (isset($_FILES)) {
            insert_attachment($_POST, $_FILES);
        }
        update_cross_reference($_POST['sample_id']);
        list_attachment($_POST['sample_id']);
    }
    if ($_POST['action'] == 'delete_attachment') {
        if (isset($_FILES)) {
            delete_attachment($_POST['sample_id'], $_POST['attachment_id']);
        }
        update_cross_reference($_POST['sample_id']);
        list_attachment($_POST['sample_id']);
    }
    if ($_POST['action'] == 'print_attachment') {
        echo '<h2 style="page-break-before: always;"></h2>';
        print_attachment($_POST['sample_id']);
    }
}
开发者ID:nishishailesh,项目名称:myLIS,代码行数:31,代码来源:attachment.php

示例5: isset

if (!empty($sort_order)) {
    $select_sort_order = '<select name="order">';
    if ($sort_order == 'ASC') {
        $select_sort_order .= '<option value="ASC" selected="selected">' . $lang['Sort_Ascending'] . '</option><option value="DESC">' . $lang['Sort_Descending'] . '</option>';
    } else {
        $select_sort_order .= '<option value="ASC">' . $lang['Sort_Ascending'] . '</option><option value="DESC" selected="selected">' . $lang['Sort_Descending'] . '</option>';
    }
    $select_sort_order .= '</select>';
}
$submit_change = isset($_POST['submit_change']) ? TRUE : FALSE;
$delete = isset($_POST['delete']) ? TRUE : FALSE;
$delete_id_list = isset($_POST['delete_id_list']) ? $_POST['delete_id_list'] : array();
$confirm = isset($_POST['confirm']) ? TRUE : FALSE;
if ($confirm && count($delete_id_list) > 0) {
    $attachments = array();
    delete_attachment(-1, $delete_id_list);
} else {
    if ($delete && count($delete_id_list) > 0) {
        //
        // Not confirmed, show confirmation message
        //
        $hidden_fields = '<input type="hidden" name="view" value="' . $view . '" />';
        $hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />';
        $hidden_fields .= '<input type="hidden" name="order" value="' . $sort_order . '" />';
        $hidden_fields .= '<input type="hidden" name="u_id" value="' . $uid . '" />';
        $hidden_fields .= '<input type="hidden" name="start" value="' . $start . '" />';
        for ($i = 0; $i < count($delete_id_list); $i++) {
            $hidden_fields .= '<input type="hidden" name="delete_id_list[]" value="' . $delete_id_list[$i] . '" />';
        }
        $template->assign_vars(array('MESSAGE_TITLE' => $lang['Confirm'], 'MESSAGE_TEXT' => $lang['Confirm_delete_attachments'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'S_CONFIRM_ACTION' => URL::admin('&amp;do=attach_cp'), 'S_HIDDEN_FIELDS' => $hidden_fields));
        $template->set_filenames(array('body' => 'confirm_body.html'));
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:admin_attach_cp.php

示例6: posting_attachment_mod

 /**
  * Handle Attachments (Add/Delete/Edit/Show) - This is the first function called from every message handler
  */
 function posting_attachment_mod()
 {
     global $mode, $confirm, $is_auth, $post_id, $delete, $refresh, $HTTP_POST_VARS;
     if (!$refresh) {
         $add_attachment_box = !empty($HTTP_POST_VARS['add_attachment_box']) ? TRUE : FALSE;
         $posted_attachments_box = !empty($HTTP_POST_VARS['posted_attachments_box']) ? TRUE : FALSE;
         $refresh = $add_attachment_box || $posted_attachments_box;
     }
     // Choose what to display
     $result = $this->handle_attachments($mode);
     if ($result === false) {
         return;
     }
     if ($confirm && ($delete || $mode == 'delete' || $mode == 'editpost') && ($is_auth['auth_delete'] || $is_auth['auth_mod'])) {
         if ($post_id) {
             delete_attachment($post_id);
         }
     }
     $this->display_attachment_bodies();
 }
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:23,代码来源:posting_attachments.php

示例7: api_get_path

/* For licensing terms, see /license.txt */
/**
 * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
 * @author Julio Montoya <gugli100@gmail.com> UI Improvements + lots of bugfixes
 * @copyright Ghent University
 * @package chamilo.forum
 */
require_once api_get_path(SYS_CODE_PATH) . 'forum/forumfunction.inc.php';
// Are we in a lp ?
$origin = '';
if (isset($_GET['origin'])) {
    $origin = Security::remove_XSS($_GET['origin']);
}
//delete attachment file
if (isset($_GET['action']) && $_GET['action'] == 'delete_attach' && isset($_GET['id_attach'])) {
    delete_attachment(0, $_GET['id_attach']);
}
$rows = get_posts($_GET['thread']);
$rows = calculate_children($rows);
$count = 0;
$clean_forum_id = intval($_GET['forum']);
$clean_thread_id = intval($_GET['thread']);
$group_id = api_get_group_id();
$locked = api_resource_is_locked_by_gradebook($clean_thread_id, LINK_FORUM_THREAD);
foreach ($rows as $post) {
    // The style depends on the status of the message: approved or not.
    if ($post['visible'] == '0') {
        $titleclass = 'forum_message_post_title_2_be_approved';
        $messageclass = 'forum_message_post_text_2_be_approved';
        $leftclass = 'forum_message_left_2_be_approved';
    } else {
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:viewthread_nested.inc.php

示例8: attach_delete_post

function attach_delete_post($id = 0)
{
    global $db;
    $data = array(':id' => $id);
    $ps = $db->run('SELECT a.id FROM ' . $db->prefix . 'attachments AS a WHERE a.post_id=:id', $data);
    if ($ps->rowCount()) {
        $ps->setFetchMode(PDO::FETCH_COLUMN, 0);
        foreach ($ps as $attach_id) {
            if (!delete_attachment($attach_id)) {
                continue;
            }
        }
    }
}
开发者ID:mtechnik,项目名称:pantherforum,代码行数:14,代码来源:functions.php

示例9: del_info

function del_info($id, $rs)
{
    global $db, $_pre;
    $rsdb = $db->get_one("SELECT B.*,A.* FROM `{$_pre}content` A LEFT JOIN `{$_pre}content_{$rs['mid']}` B ON A.id=B.id WHERE A.id='{$id}'");
    delete_attachment($rsdb[uid], tempdir($rsdb[picurl]));
    foreach ($rsdb as $value) {
        if (strlen($value) > 10) {
            delete_attachment($rsdb[uid], $value);
            //删除在线编辑器中上传的内容
        }
    }
    $db->query("DELETE FROM `{$_pre}content` WHERE id='{$id}' ");
    $db->query("DELETE FROM `{$_pre}content_{$rs['mid']}` WHERE id='{$id}' ");
    $rsdb[comments] && $db->query("DELETE FROM `{$_pre}comments` WHERE id='{$id}' ");
    if ($rsdb[picnum] > 1) {
        $query = $db->query("SELECT * FROM `{$_pre}pic` WHERE id='{$id}'");
        while ($rs = $db->fetch_array($query)) {
            delete_attachment($rs[uid], tempdir($rs[imgurl]));
            delete_attachment($rs[uid], tempdir("{$rs['imgurl']}.gif"));
        }
    }
}
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:22,代码来源:function.php

示例10: delete_attachment

    if ($step == 2) {
        if ($rsdb[picurl] && $rsdb[picurl] != $postdb[picurl]) {
            delete_attachment($lfjdb[uid], $rsdb[picurl]);
        }
        $db->query("UPDATE {$pre}special SET title='{$postdb['title']}',fid='{$postdb['fid']}',picurl='{$postdb['picurl']}',content='{$postdb['content']}',allowpost='{$postdb['allowpost']}',banner='{$postdb['banner']}' WHERE uid={$lfjuid} AND id='{$id}'");
        refreshto("special.php?job=listsp", "修改成功", 1);
    }
    $group_post = group_box("postdb[allowpost]", explode(",", $rsdb[allowpost]));
    $sort_fid = $Guidedb->Select("{$pre}spsort", "postdb[fid]", $rsdb[fid], "");
    $MSG = '修改专题';
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/special/editsp.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($job == 'delsp') {
    $rsdb = $db->get_one("SELECT * FROM {$pre}special WHERE uid='{$lfjuid}' AND id='{$id}'");
    delete_attachment($lfjdb[uid], $rsdb[picurl]);
    $db->query("DELETE FROM {$pre}special WHERE uid={$lfjuid} AND id='{$id}'");
    refreshto("special.php?job=listsp", "删除成功", 1);
} elseif ($job == 'addsp') {
    if ($step == 2) {
        $yz = $groupdb[PassContributeSP] || $web_admin ? 1 : 0;
        $db->query("INSERT INTO `{$pre}special` ( `fid` , `title` ,  `style` , `template` , `picurl` , `content`  ,`uid` , `username` , `posttime` , `list`, `allowpost`, `yz`, `banner` ) VALUES ('{$postdb['fid']}','{$postdb['title']}','{$style}','','{$postdb['picurl']}','{$postdb['content']}','{$lfjuid}','{$lfjid}','{$timestamp}','{$timestamp}','{$postdb['allowpost']}','{$yz}','{$postdb['banner']}')");
        refreshto("special.php?job=listsp", "创建专题成功", 1);
    }
    $group_post = group_box("postdb[allowpost]", explode(",", $rsdb[allowpost]));
    $MSG = '创建专题';
    $sort_fid = $Guidedb->Select("{$pre}spsort", "postdb[fid]", $rsdb[fid], "");
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/special/editsp.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($job == "edit_atc") {
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:special.php

示例11: is_array

EOT;
if ($postfile) {
    //其中..与/开头都是不允许的
    if (!ereg("^[0-9a-z_/]+\$", $dir) || ereg("^/", $dir)) {
        $dir = "other";
    }
    $array[name] = is_array($postfile) ? $_FILES[postfile][name] : $postfile_name;
    $array[path] = $webdb[updir] . "/" . $dir;
    $array[size] = is_array($postfile) ? $_FILES[postfile][size] : $postfile_size;
    $array[updateTable] = 1;
    //统计用户上传的文件占用空间大小
    $filename = upfile(is_array($postfile) ? $_FILES[postfile][tmp_name] : $postfile, $array);
    //删除用户反复上传的图片
    if ($ISone) {
        delete_attachment($lfjuid, tempdir("{$oldfile}"));
    }
    $newfile = "{$dir}/{$filename}";
    echo "上传成功,<A HREF='?fn={$fn}&dir={$dir}&label={$_GET['label']}&ISone={$_GET['ISone']}&oldfile={$newfile}&showDomain={$showDomain}'>你可以继续或重新上传</A>";
    $fn || ($fn = "upfile");
    $weburl = tempdir($newfile);
    echo "<script>\n\t\t\t\tif(self==top){\n\t\t\t\t\twindow.opener.{$fn}('{$newfile}','{$array['name']}','{$array['size']}','{$_GET['label']}','{$weburl}');\n\t\t\t\t\twindow.self.close();\n\t\t\t\t}else{\n\t\t\t\t\twindow.parent.{$fn}('{$newfile}','{$array['name']}','{$array['size']}','{$_GET['label']}','{$weburl}');\n\t\t\t\t}\n\t\t </script>";
    exit;
}
print <<<EOT

<form name="form1" method="post" action="" enctype="multipart/form-data">
  <input id="postfile" type="file" name="postfile" style="height:20px; background-color:#EBEBEB; border:1 solid black;" onMouseOver ="this.style.backgroundColor='#F0F0F0'" onMouseOut ="this.style.backgroundColor='#FAFAFA'"  onblur="post('')">
  <input  type="submit" name="Submit" value="上传文件" style="height:20px; background-color:#EBEBEB; border:1 solid black;" onMouseOver ="this.style.backgroundColor='#F0F0F0'" onMouseOut ="this.style.backgroundColor='#FAFAFA'" >
  <input type="hidden" name="action" value="uploadfile">
  <input type="hidden" name="showDomain" value="{$showDomain}">
开发者ID:GHubgenius,项目名称:qbbj,代码行数:30,代码来源:upfile.php

示例12: get_htmltype

    $postdb[template] = @serialize($postdb[tpl]);
    $postdb[allowpost] = @implode(",", $postdb[allowpost]);
    $db->query("UPDATE `{$pre}special` SET fid='{$postdb['fid']}',title='{$postdb['title']}',picurl='{$postdb['picurl']}',content='{$postdb['content']}',style='{$postdb['style']}',template='{$postdb['template']}',list='{$postdb['list']}',banner='{$postdb['banner']}',allowpost='{$postdb['allowpost']}',ifbase='{$postdb['ifbase']}',htmlname='{$postdb['htmlname']}',keywords='{$postdb['keywords']}' WHERE id='{$id}' ");
    get_htmltype();
    jump("修改成功!", "{$FROMURL}");
} elseif ($action == "delete" && $Apower[special_list]) {
    if ($id) {
        $idDB[] = $id;
    }
    if (!$idDB) {
        showmsg("请选择一个专题");
    }
    $query = $db->query("SELECT * FROM `{$pre}special` WHERE id IN (" . implode(",", $idDB) . ")");
    while ($rs = $db->fetch_array($query)) {
        delete_attachment($rs[uid], tempdir($rs[picurl]));
        delete_attachment($rs[uid], tempdir($rs[banner]));
        $fidDB = $db->get_one("SELECT * FROM {$pre}spsort WHERE fid='{$rs['fid']}'");
        $array = get_SPhtml_url($fidDB, $rs[id], $rs[posttime]);
        $array[showurl] = str_replace("{$webdb['www_url']}/", ROOT_PATH, $array[showurl]);
        $array[listurl] = str_replace("{$webdb['www_url']}/", ROOT_PATH, $array[listurl]);
        @unlink($array[showurl]);
        @unlink($array[listurl]);
        $db->query(" DELETE FROM `{$pre}special` WHERE id='{$rs['id']}' ");
        $db->query(" DELETE FROM `{$pre}label` WHERE ch='0' AND pagetype='11' AND module='0' AND fid='{$rs['id']}' AND chtype='0' ");
    }
    jump("删除成功", $FROMURL);
} elseif ($job == "com" && $Apower[special_list]) {
    $db->query("UPDATE `{$pre}special` SET levels='{$levels}',levelstime='{$timestamp}' WHERE id='{$id}' ");
    jump("处理成功", $FROMURL, 0);
} elseif ($job == "yz" && $Apower[special_list]) {
    $db->query("UPDATE `{$pre}special` SET yz='{$yz}' WHERE id='{$id}' ");
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:special.php

示例13: dowork

function dowork($id, $job)
{
    global $db, $_pre, $timestamp, $userdb, $webdb;
    $rsdb = $db->get_one("SELECT * FROM {$_pre}content WHERE id='{$id}' ");
    if ($job == "delete") {
        $rsdb[picurl] = tempdir($rsdb[picurl]);
        delete_attachment($rsdb[uid], $rsdb[picurl]);
        $db->query("DELETE FROM {$_pre}content WHERE id='{$id}' ");
        $db->query("DELETE FROM {$_pre}content_1 WHERE id='{$id}' ");
        $db->query("DELETE FROM {$_pre}comments WHERE id='{$id}' ");
    } elseif ($job == "move") {
        global $fid;
        if ($fid) {
            $rs = $db->get_one("SELECT name,mid FROM {$_pre}sort WHERE fid='{$fid}'");
            //if($rs[mid]==$rsdb[mid]){
            $db->query("UPDATE {$_pre}content SET fid='{$fid}',fname='{$rs['name']}',lastfid='{$rsdb['fid']}' WHERE id='{$id}' ");
            $db->query("UPDATE {$_pre}content_1 SET fid='{$fid}' WHERE id='{$id}' ");
            //$db->query("UPDATE `{$_pre}sort` SET contents=contents-1 WHERE fid='$rsdb[fid]'");
            //$db->query("UPDATE `{$_pre}sort` SET contents=contents+1 WHERE fid='$fid'");
            //}
        }
    } elseif ($job == "movesp") {
        global $spfiddb;
        if ($spfiddb) {
            $db->query("DELETE FROM `{$_pre}special` WHERE id='{$id}'");
            foreach ($spfiddb as $key => $value) {
                $db->query("INSERT INTO `{$_pre}special` (`fid` , `id`) VALUES ('{$value}', '{$id}')");
            }
        }
    } elseif ($job == "color") {
        global $color;
        $db->query("UPDATE {$_pre}content SET titlecolor='{$color}' WHERE id='{$id}' ");
    } elseif ($job == "yz") {
        $db->query("UPDATE {$_pre}content SET yz='1',yzer='{$userdb['username']}',yztime='{$timestamp}' WHERE id='{$id}' ");
    } elseif ($job == "setdelete") {
        $db->query("UPDATE {$_pre}content SET yz='2'  WHERE id='{$id}' ");
    } elseif ($job == "undelete") {
        $db->query("UPDATE {$_pre}content SET yz='1'  WHERE id='{$id}' ");
    } elseif ($job == "unyz") {
        $db->query("UPDATE {$_pre}content SET yz='0',yzer='{$userdb['username']}',yztime='{$timestamp}' WHERE id='{$id}' ");
    } elseif ($job == "com") {
        global $levels;
        if ($levels == 1) {
            $SQL = ",yz=1";
        }
        $db->query("UPDATE {$_pre}content SET levels='{$levels}',levelstime='{$timestamp}'{$SQL} WHERE id='{$id}' ");
    } elseif ($job == "uncom") {
        $db->query("UPDATE {$_pre}content SET levels='0',levelstime='0' WHERE id='{$id}' ");
    } elseif ($job == "top") {
        global $toptime;
        $db->query("UPDATE {$_pre}content SET list=list+'{$toptime}' WHERE id='{$id}' ");
    } elseif ($job == "untop") {
        $db->query("UPDATE {$_pre}content SET list='{$timestamp}' WHERE id='{$id}' ");
    } elseif ($job == "front") {
        global $topid;
        if ($topid) {
            $rs = $db->get_one("SELECT list FROM {$_pre}content WHERE id='{$topid}' ");
            $list = $rs["list"] + 1;
            $db->query("UPDATE {$_pre}content SET list='{$list}' WHERE id='{$id}' ");
        } else {
            $db->query("UPDATE {$_pre}content SET list='{$timestamp}' WHERE id='{$id}' ");
        }
    } elseif ($job == "bottom") {
        global $bottomid;
        if ($bottomid) {
            $rs = $db->get_one("SELECT list FROM {$_pre}content WHERE id='{$bottomid}' ");
            $list = $rs["list"] - 1;
            $db->query("UPDATE {$_pre}content SET list='{$list}' WHERE id='{$id}' ");
        } else {
            $db->query("UPDATE {$_pre}content SET list='0' WHERE id='{$id}' ");
        }
    }
}
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:73,代码来源:list.php

示例14: delete_torrent

function delete_torrent($attach_id, $mode = '')
{
    global $lang, $userdata;
    global $reg_mode, $topic_id;
    $attach_id = intval($attach_id);
    $reg_mode = $mode;
    if (!($torrent = get_torrent_info($attach_id))) {
        message_die(GENERAL_ERROR, 'Torrent not found');
    }
    $post_id = $torrent['post_id'];
    $topic_id = $torrent['topic_id'];
    $forum_id = $torrent['forum_id'];
    $poster_id = $torrent['poster_id'];
    if ($torrent['extension'] !== TORRENT_EXT) {
        message_die(GENERAL_ERROR, $lang['Not_torrent']);
    }
    torrent_auth_check($forum_id, $torrent['poster_id']);
    tracker_unregister($attach_id);
    delete_attachment(0, $attach_id);
    return;
}
开发者ID:forummaks,项目名称:forum_maks,代码行数:21,代码来源:functions_torrent.php

示例15: prune_attachments

/**
* Prune Attachments (includes/prune.php)
*/
function prune_attachments($sql_post)
{
    // prune it.
    delete_attachment($sql_post);
}
开发者ID:puring0815,项目名称:OpenKore,代码行数:8,代码来源:functions_includes.php


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