Exemple #1
0
 } else {
     $add = ImageCache2_ImageInfo::getExtraInfo($img);
     if ($mode == 1) {
         $chk = ImageCache2_EditForm::imgChecker($img);
         $add += $chk;
     } elseif ($mode == 2) {
         $mng = ImageCache2_EditForm::imgManager($img, $status);
         $add += $mng;
     }
 }
 // オリジナル画像が存在しないレコードを自動で削除
 if ($ini['Viewer']['delete_src_not_exists'] && !file_exists($add['src'])) {
     $add['thumb_k'] = $add['thumb'] = 'img/ic_removed.png';
     $add['t_width'] = $add['t_height'] = 32;
     $to_blacklist = false;
     $removed_files = array_merge($removed_files, ImageCache2_DatabaseManager::remove(array($img['id'], $to_blacklist)));
     $flexy->setData('toBlackList', $to_blacklist);
 } else {
     // サムネイルのパスのみdevicePixelRatioが影響するので再取得
     $add['thumb'] = $thumb->thumbUrl($icdb->size, $icdb->md5, $icdb->mime);
     if (!file_exists($add['thumb'])) {
         // レンダリング時に自動でhtmlspecialchars()されるので&にしない
         $add['thumb'] = 'ic2.php?r=' . $r_type . "&t={$thumb->mode}";
         if (file_exists($add['src'])) {
             $add['thumb'] .= '&id=' . $img['id'];
         } else {
             $add['thumb'] .= '&uri=' . rawurlencode($img['uri']);
         }
         if ($dpr === 1.5 || $dpr === 2.0) {
             $add['thumb'] .= '&d=' . $dpr;
         }
Exemple #2
0
         // ブラックリストに登録する
         $to_blacklist = !empty($_POST['dropZeroToBlackList']);
     } else {
         // あぼーん画像を削除し、ブラックリストに登録する
         $where = $db->quoteIdentifier('rank') . ' < 0';
         $to_blacklist = true;
     }
     $sql = sprintf('SELECT %s FROM %s WHERE %s;', $db->quoteIdentifier('id'), $db->quoteIdentifier($ini['General']['table']), $where);
     $result = $db->getAll($sql, null, DB_FETCHMODE_ORDERED | DB_FETCHMODE_FLIPPED);
     if (DB::isError($result)) {
         P2Util::pushInfoHtml($result->getMessage());
         break;
     }
     if ($result) {
         $target = $result[0];
         $removed_files = ImageCache2_DatabaseManager::remove($target, $to_blacklist);
     } else {
         $removed_files = array();
     }
     $flexy->setData('toBlackList', $to_blacklist);
     break;
     // PC用以外の作成済みサムネイルを消去する
 // PC用以外の作成済みサムネイルを消去する
 case 'clearThumb':
     $thumb_dir2 = $ini['General']['cachedir'] . '/' . $ini['Thumb2']['name'];
     $thumb_dir3 = $ini['General']['cachedir'] . '/' . $ini['Thumb3']['name'];
     $result_files2 = P2Util::garbageCollection($thumb_dir2, -1, '', '', true);
     $result_files3 = P2Util::garbageCollection($thumb_dir3, -1, '', '', true);
     $removed_files = array_merge($result_files2['successed'], $result_files3['successed']);
     $failed_files = array_merge($result_files2['failed'], $result_files3['failed']);
     if (!empty($failed_files)) {
Exemple #3
0
if ($finder->find(1)) {
    if ($rank != -5) {
        $setter = new ImageCache2_DataObject_Images();
        $setter->rank = $rank;
        $setter->whereAddQuoted('size', '=', $finder->size);
        $setter->whereAddQuoted('md5', '=', $finder->md5);
        $setter->whereAddQuoted('mime', '=', $finder->mime);
        if ($setter->update()) {
            $code = 1;
        } else {
            $code = 0;
        }
    }
    if ($remove) {
        $orig_info_msg_ht = P2Util::getInfoHtml();
        $removed_files = ImageCache2_DatabaseManager::remove(array($finder->id), $rank < 0);
        if ($code != 0 && !P2Util::hasInfoHtml()) {
            $code = 1;
        } else {
            $code = 0;
        }
        P2Util::pushInfoHtml($orig_info_msg_ht);
    }
}
echo $code;
exit;
// }}}
/*
 * Local Variables:
 * mode: php
 * coding: cp932