示例#1
0
 *   Author:    codefuture.co.uk
 *   Version:   1.6.5
 *
 *   You can download the latest version from: http://codefuture.co.uk/projects/imagehost/
 *
 *   Copyright (c) 2010-2013 CodeFuture.co.uk
 *   This file is part of the CF Image Hosting Script.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 *   COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
 *   OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 *
 *   You may not modify and/or remove any copyright notices or labels on the software on each
 *   page (unless full license is purchase) and in the header of each script source file.
 *
 *   You should have received a full copy of the LICENSE AGREEMENT along with
 *   Codefuture Image Hosting Script. If not, see http://codefuture.co.uk/projects/imagehost/license/.
 *
 *
 *   ABOUT THIS PAGE -----
 *   Used For:     Admin Bulk image uploader
 *   Last edited:  19/12/2012
 *
 *************************************************************************************************************/
// check for errors coming from other pages
if (isset($_SESSION['err'])) {
    $Err = $_SESSION['err'];
示例#2
0
/**
 * removeImage($imageDeleteCode)
 * Remove image info from the database
 */
function removeImage($imageDeleteCode = null)
{
    if (is_null($imageDeleteCode) && isset($_GET['d'])) {
        $imageDeleteCode = $_GET['d'];
    } elseif (is_null($imageDeleteCode)) {
        return null;
    }
    if (preg_replace("/[^0-9A-Za-z]/", "", $imageDeleteCode) != $imageDeleteCode || empty($imageDeleteCode)) {
        user_feedback('error', _T("site_index_delete_image_err_not_found"), 'delete_image1');
        return false;
    }
    if (!($image = db_get_image($imageDeleteCode, 'deleteid'))) {
        user_feedback('error', _T("site_index_delete_image_err_not_found"), 'delete_image2');
        $_GET['err'] = '404';
        // not found (404)page error
        return false;
    }
    // Remove Image
    if (@unlink(imageAddress(1, $image))) {
        user_feedback('success', _T("site_index_delete_image_suc"), 'delete_image');
    }
    // Remove small thumb
    @unlink(imageAddress(3, $image));
    // Remove thumb
    @unlink(imageAddress(2, $image));
    // remove cache files for this image
    $search = CFIMGCACHEPATH . $image['id'] . "*" . '.php';
    $files = glob($search);
    if (is_array($files) && count($files) > 0) {
        foreach ($files as $file) {
            @unlink($file);
        }
    }
    // Remove image info from the database
    if (!removeImageDb($image['id'])) {
        user_feedback('error', _T("site_index_delete_image_err_db"), 'delete_image3');
        return false;
    }
    // Remove bw db
    @unlink(CFBANDWIDTHPATH . $image['id'] . '_imgbw.db');
    return true;
}
示例#3
0
        }
    } else {
        user_feedback('error', _T("admin_ban_err_no_ip"), 'admin_ban_no_ip');
    }
}
//unban user
$ip_to_unban = isset($_GET['ip']) ? cl($_GET['ip']) : '';
if ($ip_to_unban != '') {
    if (db_remove_ban($ip_to_unban)) {
        user_feedback('success', _T("admin_ban_suc_unbanned", $ip_to_unban), 'unban');
    }
}
// find ip from image ID
$id_to_ban = isset($_GET['id']) ? cl($_GET['id']) : '';
if ($id_to_ban != '') {
    $BAN_IP = db_get_image($id_to_ban);
    $BAN_IP = $BAN_IP['ip'];
}
// List Banned IP's
$banned_list = '';
if ($banList = db_list_banned_uers()) {
    foreach ($banList as $k => $v) {
        $odd_class = empty($odd_class) ? ' class="odd"' : '';
        $banned_list .= '<tr' . $odd_class . '>
								<td class="textleft">
									<a href="admin.php?act=ban&ip=' . $v['ip'] . '" class="tip" title="' . _T("admin_ban_alt_unban") . '"><img src="img/User-Ok.png" height="16" width="16" border="0" alt="' . _T("admin_ban_alt_unban") . '"/></a>
									<a href="admin.php?act=images&ip=' . $v['ip'] . '" class="tip" title="' . _T("admin_ilp_ipsearch_alt", $v['ip']) . '"><img src="img/user-search.png" height="16" width="16" border="0" alt="' . _T("admin_ilp_ipsearch_alt", $v['ip']) . '" /></a>
								</td>
								<td class="textleft">' . date('d M y', $v['date']) . '</td>
								<td class="textleft">' . $v['ip'] . '</td><td class="textleft">' . $v['des'] . '</td></tr>';
    }
示例#4
0
文件: image.php 项目: xctcc/congtu
} elseif (isset($_GET['dt'])) {
    $img['id'] = $_GET['dt'];
    $img['type'] = 3;
} elseif (isset($_GET['dl'])) {
    $img['id'] = $_GET['dl'];
    $img['type'] = 4;
}
$img['id'] = cl($img['id']);
if (preg_replace("/[^0-9A-Z]/", "", $img['id']) != $img['id']) {
    if (!$debug_img) {
        header('Content-type: image/png');
    }
    readfile('img/notfound.png');
    exit;
}
if ($image = db_get_image($img['id'])) {
    $image_time = $image['added'];
    if (array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) {
        $if_modified_since = strtotime(preg_replace('/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"]));
        if ($if_modified_since >= $image_time && !$debug_img) {
            header("HTTP/1.0 304 Not Modified");
            exit;
        }
    }
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $image_time) . ' GMT', true, 200);
    header('Expires: ' . gmdate('D, d M Y H:i:s', $image_time + 86400 * 365) . ' GMT', true, 200);
    header("Pragma: public");
    header("Cache-Control: maxage=" . 86400 * 14);
    $img_address = imageAddress($img['type'], $image);
    $pathinfo = pathinfo($img_address);
    $img['ext'] = strtolower($pathinfo['extension']);
示例#5
0
 *   ABOUT THIS PAGE -----
 *   Used For:     Admin Edit Image Info
 *   Last edited:  11/01/2012
 *
 *************************************************************************************************************/
// Get Image ID
$edit_img_id = cl($_GET['id']);
// Update Image Info If Needed
if (isset($_POST['update'])) {
    $pam = array('alt' => cl($_POST['setAlt']), 'private' => cl($_POST['setPrivate']) == 1 ? true : false);
    if (db_update($edit_img_id, $pam)) {
        user_feedback('success', _T("admin_iep_suc"), 'edit_image');
    }
}
// get image info
$edit_image = db_get_image($edit_img_id);
$cdb = db_imageCounterList(null, $edit_img_id);
// page settings
$page['id'] = 'edit';
$page['title'] = _T("admin_iep_title");
$page['description'] = '';
$page['tipsy'] = true;
$page['lightbox'] = true;
require CFADMINPATH . 'admin_page_header.php';
?>
<!-- admin image edit -->
			<div class="ibox top_img"><a href="<?php 
echo imageAddress(1, $edit_image);
?>
" target="_blank" title="<?php 
echo $edit_image['alt'];