Exemplo n.º 1
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 = IC2_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)) {
Exemplo n.º 2
0
if ($finder->find(1)) {
    if ($rank != -5) {
        $setter = new IC2_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 = IC2_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
Exemplo n.º 3
0
 } else {
     $add = IC2_ImageInfo::getExtraInfo($img);
     if ($mode == 1) {
         $chk = IC2_EditForm::imgChecker($img);
         $add += $chk;
     } elseif ($mode == 2) {
         $mng = IC2_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, IC2_DatabaseManager::remove(array($img['id'], $to_blacklist)));
     $flexy->setData('toBlackList', $to_blacklist);
 } else {
     if (!file_exists($add['thumb'])) {
         // レンダリング時に自動でhtmlspecialchars()されるので&amp;にしない
         $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 ($_conf['ktai']) {
         $add['thumb_k'] = 'ic2.php?r=0&t=2';
         if (file_exists($add['src'])) {
             $add['thumb_k'] .= '&id=' . $img['id'];