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


PHP image::removeimage方法代碼示例

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


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

示例1: COUNT

     $query = "SELECT COUNT(*) FROM {$note_table} WHERE post_id='{$id}' AND id='{$note_id}'";
     $result = $db->query($query);
     $row = $result->fetch_assoc();
     if ($row['COUNT(*)'] == 1) {
         $result->free_result();
         $query = "DELETE FROM {$note_table} WHERE post_id='{$id}' AND id='{$note_id}'";
         $db->query($query);
         $query = "DELETE FROM {$note_history_table} WHERE post_id='{$id}' AND id='{$note_id}'";
         $db->query($query);
         $cache->destroy("cache/" . $id . "/post.cache");
         print $note_id;
     }
 } else {
     if (isset($_GET['removepost']) && $_GET['removepost'] == 1) {
         $image = new image();
         if ($image->removeimage($id) == true) {
             $cache->destroy_page_cache("cache/" . $id);
             $query = "SELECT id FROM {$post_table} WHERE id < {$id} ORDER BY id DESC LIMIT 1";
             $result = $db->query($query);
             $row = $result->fetch_assoc();
             $prev_id = $row['id'];
             $result->free_result();
             $query = "SELECT id FROM {$post_table} WHERE id > {$id} ORDER BY id ASC LIMIT 1";
             $result = $db->query($query);
             $row = $result->fetch_assoc();
             $next_id = $row['id'];
             $date = date("Ymd");
             if (is_dir("{$main_cache_dir}" . "" . "cache/" . $prev_id) && "{$main_cache_dir}" . "" . "cache/" . $prev_id != "{$main_cache_dir}" . "" . "cache/") {
                 $cache->destroy_page_cache("cache/" . $prev_id);
             }
             if (is_dir("{$main_cache_dir}" . "" . "cache/" . $next_id) && "{$main_cache_dir}" . "" . "cache/" . $next_id != "{$main_cache_dir}" . "" . "cache/") {
開發者ID:logtcn,項目名稱:gelbooru-fork,代碼行數:31,代碼來源:remove.php

示例2: tag

$sql_query = "SELECT id,tags,title from {$post_table} WHERE {$where_clause};";
if ($debug) {
    echo "<strong>SQL query:</strong><br/>{$sql_query}<br/><br/>";
}
if ($results = $db->query($sql_query)) {
    $tag_obj = new tag();
    $user = new user();
    $cache = new cache();
    $image = new image();
    echo "Query returned " . $results->num_rows . " rows<br/>";
    $post = $results->fetch_assoc();
    while (!is_null($post)) {
        if ($debug || isset($_GET['display_ids'])) {
            echo "ID: '" . $post['id'] . "' Title: '" . $post['title'] . "'<br/>&nbsp;&nbsp;&nbsp;&nbsp;Tags: " . $post['tags'] . "<br/><br/>";
        } else {
            if ($image->removeimage($post['id']) == true) {
                $delete_count++;
                echo "<span style=\"color: rgb(0, 255, 0);\">Image " . $post['id'] . " successfully deleted!</span><br/>";
                //copied the rest from remove.php
                $cache->destroy_page_cache("cache/" . $post['id']);
                $query = "SELECT id FROM {$post_table} WHERE id < " . $post['id'] . " ORDER BY id DESC LIMIT 1";
                if ($result = $db->query($query)) {
                    $row = $result->fetch_assoc();
                    $prev_id = $row['id'];
                    $result->free_result();
                } else {
                    echo "<strong>No previous ID, Cannot remove image from cache!</strong><br/>\r\n\t\t\t\t\t\tHere's the query: {$query}<br/>\r\n\t\t\t\t\t\tand here's the error(" . $db->errno . "): " . $db->error . "<br/><br/>";
                    $post = $results->fetch_assoc();
                    continue;
                }
                $query = "SELECT id FROM {$post_table} WHERE id > " . $post['id'] . " ORDER BY id ASC LIMIT 1";
開發者ID:Jerglekakan,項目名稱:someGelbooruScripts,代碼行數:31,代碼來源:remove_posts.php


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