当前位置: 首页>>代码示例>>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;未经允许,请勿转载。