Cpg1.4.2 > Cpg142 / Addpic.php

Questions? Need Help? Want to share? » PHP Forum
Script Name:
Cpg1.4.2

Download:
cpg1.4.2.zip

Category:
Image Galleries

Archive Content:

Cpg142

Cpg142 > Albums > Edit

Cpg142 > Albums

Cpg142 > Albums > Userpics

Cpg142

Cpg142 > Bridge

Cpg142

Cpg142 > Docs

Cpg142 > Docs > Pics

Cpg142 > Docs

Cpg142 > Docs > Theme

Cpg142 > Docs

Cpg142

Cpg142 > Images

Cpg142 > Images > Flags

Cpg142 > Images

Cpg142 > Images > Smiles

Cpg142 > Images

Cpg142

Cpg142 > Include

Cpg142 > Include > Makers

Cpg142 > Include

Cpg142

Cpg142 > Lang

Cpg142

Cpg142 > Logs

Cpg142

Cpg142 > Plugins > Sample

Cpg142 > Plugins > Sef Urls

Cpg142

Cpg142 > Sql

Cpg142

Cpg142 > Themes > Classic > Images

Cpg142 > Themes > Classic

Cpg142 > Themes > Eyeball > Images

Cpg142 > Themes > Eyeball

Cpg142 > Themes > Fruity > Images

Cpg142 > Themes > Fruity

Cpg142 > Themes > Hardwired > Images

Cpg142 > Themes > Hardwired

Cpg142 > Themes > Igames > Images

Cpg142 > Themes > Igames

Cpg142 > Themes > Mac Ox X > Images

Cpg142 > Themes > Mac Ox X

Cpg142 > Themes > Project Vii > Images

Cpg142 > Themes > Project Vii

Cpg142 > Themes > Rainy Day > Images

Cpg142 > Themes > Rainy Day

Cpg142 > Themes > Sample > Images

Cpg142 > Themes > Sample

Cpg142 > Themes > Water Drop > Images

Cpg142 > Themes > Water Drop

Cpg142

Addpic.php:


<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License,  or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.2
  $Source: /cvsroot/coppermine/devel/addpic.php, v $
  $Revision: 1.15 $
  $Author: gaugau $
  $Date: 2005/10/25 01:15:41 $
**********************************************/

/**
* Coppermine Photo Gallery 1.4.2 addpic.php
*
* This file file gets called in the img src when you do batch add,  there is nothing
* much to look here the grunt work is done by the function add_picture
*
* @copyright 2002, 2005 Gregory DEMAR,  Coppermine Dev Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License V2
* @package Coppermine
* @version $Id: addpic.php, v 1.15 2005/10/25 01:15:41 gaugau Exp $
*/

/**
* @ignore
*/
define('IN_COPPERMINE',  true);

define('ADDPIC_PHP',  true);

require(
'include/init.inc.php');
require(
'include/picmgmt.inc.php');

if (!
GALLERY_ADMIN_MODE) die('Access denied');

$aid = (int)$_GET['aid'];
$pic_file base64_decode($_GET['pic_file']);
$dir_name dirname($pic_file) . '/';
$file_name basename($pic_file);

# Create the holder $picture_name by translating the file name.
# Translate any forbidden character into an underscore.
$sane_name replace_forbidden($file_name);
$source './'.$CONFIG['fullpath'].$dir_name.$file_name;
rename($source,  './' $CONFIG['fullpath'] . $dir_name $sane_name);
$sql "SELECT pid FROM {$CONFIG['TABLE_PICTURES']} WHERE filepath='" addslashes($dir_name) . "' AND filename='" addslashes($file_name) . "' LIMIT 1";
$result cpg_db_query($sql);

if (
mysql_num_rows($result)) {
    
$file_name 'images/up_dup.gif';
} elseif (
add_picture($aid,  $dir_name,  $sane_name)) {
    
$file_name 'images/up_ok.gif';
} else {
    
$file_name 'images/up_pb.gif';
    echo 
$ERROR;
}

if (
ob_get_length()) {
    
ob_end_flush();
    exit;
}

header('Content-type: image/gif');
echo 
fread(fopen($file_name,  'rb'),  filesize($file_name));
ob_end_flush()
?>


Other Image Galleries Scripts:

WebMaster Resources Home

©RingsWorld.com