2003-05-09 12:42:42 +00:00
|
|
|
|
<?php
|
2004-02-07 19:36:44 +00:00
|
|
|
|
// +-----------------------------------------------------------------------+
|
2004-11-06 21:12:59 +00:00
|
|
|
|
// | PhpWebGallery - a PHP based picture gallery |
|
|
|
|
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
2005-01-07 23:10:51 +00:00
|
|
|
|
// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
|
2004-02-07 19:36:44 +00:00
|
|
|
|
// +-----------------------------------------------------------------------+
|
2004-11-06 21:12:59 +00:00
|
|
|
|
// | branch : BSF (Best So Far)
|
2004-02-07 19:36:44 +00:00
|
|
|
|
// | file : $RCSfile$
|
|
|
|
|
// | last update : $Date$
|
|
|
|
|
// | last modifier : $Author$
|
|
|
|
|
// | revision : $Revision$
|
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
// | 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 |
|
|
|
|
|
// | |
|
|
|
|
|
// | This program is distributed in the hope that it will be useful, but |
|
|
|
|
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
|
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
|
|
// | General Public License for more details. |
|
|
|
|
|
// | |
|
|
|
|
|
// | You should have received a copy of the GNU General Public License |
|
|
|
|
|
// | along with this program; if not, write to the Free Software |
|
|
|
|
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
|
|
|
|
// | USA. |
|
|
|
|
|
// +-----------------------------------------------------------------------+
|
2004-02-19 00:31:09 +00:00
|
|
|
|
define('PHPWG_ROOT_PATH','./');
|
|
|
|
|
include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
|
2004-02-02 00:55:18 +00:00
|
|
|
|
|
2003-05-17 10:49:14 +00:00
|
|
|
|
//------------------------------------------------------------------- functions
|
2003-05-09 12:42:42 +00:00
|
|
|
|
// The validate_upload function checks if the image of the given path is valid.
|
|
|
|
|
// A picture is valid when :
|
|
|
|
|
// - width, height and filesize are not higher than the maximum
|
|
|
|
|
// filesize authorized by the administrator
|
|
|
|
|
// - the type of the picture is among jpg, gif and png
|
|
|
|
|
// The function returns an array containing :
|
|
|
|
|
// - $result['type'] contains the type of the image ('jpg', 'gif' or 'png')
|
|
|
|
|
// - $result['error'] contains an array with the different errors
|
|
|
|
|
// found with the picture
|
|
|
|
|
function validate_upload( $temp_name, $my_max_file_size,
|
|
|
|
|
$image_max_width, $image_max_height )
|
|
|
|
|
{
|
2004-10-25 20:35:35 +00:00
|
|
|
|
global $conf, $lang;
|
2003-05-09 12:42:42 +00:00
|
|
|
|
|
|
|
|
|
$result = array();
|
|
|
|
|
$result['error'] = array();
|
|
|
|
|
//echo $_FILES['picture']['name']."<br />".$temp_name;
|
|
|
|
|
$extension = get_extension( $_FILES['picture']['name'] );
|
2004-10-25 20:35:35 +00:00
|
|
|
|
if (!in_array($extension, $conf['picture_ext']))
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
2003-05-27 20:56:13 +00:00
|
|
|
|
array_push( $result['error'], $lang['upload_advise_filetype'] );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
return $result;
|
|
|
|
|
}
|
|
|
|
|
if ( !isset( $_FILES['picture'] ) )
|
|
|
|
|
{
|
|
|
|
|
// do we even have a file?
|
2003-05-27 20:56:13 +00:00
|
|
|
|
array_push( $result['error'], "You did not upload anything!" );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
else if ( $_FILES['picture']['size'] > $my_max_file_size * 1024 )
|
|
|
|
|
{
|
2003-05-27 20:56:13 +00:00
|
|
|
|
array_push( $result['error'],
|
2004-10-25 20:35:35 +00:00
|
|
|
|
$lang['upload_advise_filesize'].$my_max_file_size.' KB' );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// check if we are allowed to upload this file_type
|
|
|
|
|
// upload de la photo sous un nom temporaire
|
|
|
|
|
if ( !move_uploaded_file( $_FILES['picture']['tmp_name'], $temp_name ) )
|
|
|
|
|
{
|
2003-05-27 20:56:13 +00:00
|
|
|
|
array_push( $result['error'], $lang['upload_cannot_upload'] );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$size = getimagesize( $temp_name );
|
|
|
|
|
if ( isset( $image_max_width )
|
2003-05-17 10:49:14 +00:00
|
|
|
|
and $image_max_width != ""
|
|
|
|
|
and $size[0] > $image_max_width )
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
2003-05-27 20:56:13 +00:00
|
|
|
|
array_push( $result['error'],
|
|
|
|
|
$lang['upload_advise_width'].$image_max_width.' px' );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
if ( isset( $image_max_height )
|
2003-05-17 10:49:14 +00:00
|
|
|
|
and $image_max_height != ""
|
|
|
|
|
and $size[1] > $image_max_height )
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
2003-05-27 20:56:13 +00:00
|
|
|
|
array_push( $result['error'],
|
|
|
|
|
$lang['upload_advise_height'].$image_max_height.' px' );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
// $size[2] == 1 means GIF
|
|
|
|
|
// $size[2] == 2 means JPG
|
|
|
|
|
// $size[2] == 3 means PNG
|
2003-05-27 20:56:13 +00:00
|
|
|
|
switch ( $size[2] )
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
2003-05-27 20:56:13 +00:00
|
|
|
|
case 1 : $result['type'] = 'gif'; break;
|
|
|
|
|
case 2 : $result['type'] = 'jpg'; break;
|
|
|
|
|
case 3 : $result['type'] = 'png'; break;
|
|
|
|
|
default :
|
|
|
|
|
array_push( $result['error'], $lang['upload_advise_filetype'] );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( sizeof( $result['error'] ) > 0 )
|
|
|
|
|
{
|
|
|
|
|
// destruction de l'image avec le nom temporaire
|
|
|
|
|
@unlink( $temp_name );
|
|
|
|
|
}
|
2004-02-02 00:55:18 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2004-10-30 15:42:29 +00:00
|
|
|
|
@chmod( $temp_name, 0644);
|
2004-02-02 00:55:18 +00:00
|
|
|
|
}
|
2003-05-09 12:42:42 +00:00
|
|
|
|
return $result;
|
|
|
|
|
}
|
2004-02-02 00:55:18 +00:00
|
|
|
|
|
2003-05-09 12:42:42 +00:00
|
|
|
|
//-------------------------------------------------- access authorization check
|
|
|
|
|
check_login_authorization();
|
|
|
|
|
check_cat_id( $_GET['cat'] );
|
2003-05-17 10:49:14 +00:00
|
|
|
|
if ( isset( $page['cat'] ) and is_numeric( $page['cat'] ) )
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
|
|
|
|
check_restrictions( $page['cat'] );
|
|
|
|
|
$result = get_cat_info( $page['cat'] );
|
2003-09-08 18:59:11 +00:00
|
|
|
|
$page['cat_dir'] = get_complete_dir( $page['cat'] );
|
2003-07-25 21:33:41 +00:00
|
|
|
|
$page['cat_site_id'] = $result['site_id'];
|
|
|
|
|
$page['cat_name'] = $result['name'];
|
|
|
|
|
$page['cat_uploadable'] = $result['uploadable'];
|
2004-12-30 08:10:46 +00:00
|
|
|
|
if ($page['cat_site_id'] != 1 or !$page['cat_uploadable'])
|
|
|
|
|
{
|
|
|
|
|
echo '<div style="text-align:center;">'.$lang['upload_forbidden'].'<br />';
|
2006-01-15 12:52:55 +00:00
|
|
|
|
echo '<a href="./category.php">';
|
2004-12-30 08:10:46 +00:00
|
|
|
|
echo $lang['thumbnails'].'</a></div>';
|
|
|
|
|
exit();
|
|
|
|
|
}
|
2004-02-02 00:55:18 +00:00
|
|
|
|
}
|
2003-05-09 12:42:42 +00:00
|
|
|
|
|
|
|
|
|
$error = array();
|
|
|
|
|
$page['upload_successful'] = false;
|
|
|
|
|
if ( isset( $_GET['waiting_id'] ) )
|
|
|
|
|
{
|
|
|
|
|
$page['waiting_id'] = $_GET['waiting_id'];
|
|
|
|
|
}
|
|
|
|
|
//-------------------------------------------------------------- picture upload
|
2003-07-21 19:47:14 +00:00
|
|
|
|
// verfying fields
|
2003-05-17 10:49:14 +00:00
|
|
|
|
if ( isset( $_POST['submit'] ) and !isset( $_GET['waiting_id'] ) )
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
|
|
|
|
$path = $page['cat_dir'].$_FILES['picture']['name'];
|
|
|
|
|
if ( @is_file( $path ) )
|
|
|
|
|
{
|
2003-07-21 19:47:14 +00:00
|
|
|
|
array_push( $error, $lang['upload_file_exists'] );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
// test de la pr<70>sence des champs obligatoires
|
2004-02-22 02:43:13 +00:00
|
|
|
|
if ( empty($_FILES['picture']['name']))
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
2003-07-21 19:47:14 +00:00
|
|
|
|
array_push( $error, $lang['upload_filenotfound'] );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
if ( !ereg( "([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+)",
|
|
|
|
|
$_POST['mail_address'] ) )
|
|
|
|
|
{
|
2003-07-21 19:47:14 +00:00
|
|
|
|
array_push( $error, $lang['reg_err_mail_address'] );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
2004-02-22 02:43:13 +00:00
|
|
|
|
if ( empty($_POST['username']) )
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
2003-07-21 19:47:14 +00:00
|
|
|
|
array_push( $error, $lang['upload_err_username'] );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
2004-02-02 00:55:18 +00:00
|
|
|
|
|
|
|
|
|
$date_creation = '';
|
2004-02-22 02:43:13 +00:00
|
|
|
|
if ( !empty($_POST['date_creation']) )
|
2003-07-21 19:47:14 +00:00
|
|
|
|
{
|
|
|
|
|
list( $day,$month,$year ) = explode( '/', $_POST['date_creation'] );
|
|
|
|
|
// int checkdate ( int month, int day, int year)
|
2004-08-21 13:03:49 +00:00
|
|
|
|
if (checkdate($month, $day, $year))
|
2003-07-21 19:47:14 +00:00
|
|
|
|
{
|
2004-08-21 13:03:49 +00:00
|
|
|
|
$date_creation = $year.'-'.$month.'-'.$day;
|
2003-07-21 19:47:14 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
array_push( $error, $lang['err_date'] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// creation of the "infos" field :
|
|
|
|
|
// <infos author="Pierrick LE GALL" comment="my comment"
|
2004-08-21 13:03:49 +00:00
|
|
|
|
// date_creation="2004-08-14" name="" />
|
2003-07-21 19:47:14 +00:00
|
|
|
|
$xml_infos = '<infos';
|
|
|
|
|
$xml_infos.= ' author="'.htmlspecialchars($_POST['author'],ENT_QUOTES).'"';
|
|
|
|
|
$xml_infos.= ' comment="'.htmlspecialchars($_POST['comment'],ENT_QUOTES).'"';
|
|
|
|
|
$xml_infos.= ' date_creation="'.$date_creation.'"';
|
|
|
|
|
$xml_infos.= ' name="'.htmlspecialchars( $_POST['name'], ENT_QUOTES).'"';
|
|
|
|
|
$xml_infos.= ' />';
|
2004-02-02 00:55:18 +00:00
|
|
|
|
|
|
|
|
|
if ( !preg_match( '/^[a-zA-Z0-9-_.]+$/', $_FILES['picture']['name'] ) )
|
|
|
|
|
{
|
|
|
|
|
array_push( $error, $lang['update_wrong_dirname'] );
|
|
|
|
|
}
|
2003-07-21 19:47:14 +00:00
|
|
|
|
|
2003-05-09 12:42:42 +00:00
|
|
|
|
if ( sizeof( $error ) == 0 )
|
|
|
|
|
{
|
|
|
|
|
$result = validate_upload( $path, $conf['upload_maxfilesize'],
|
|
|
|
|
$conf['upload_maxwidth'],
|
|
|
|
|
$conf['upload_maxheight'] );
|
|
|
|
|
for ( $j = 0; $j < sizeof( $result['error'] ); $j++ )
|
|
|
|
|
{
|
2003-07-21 19:47:14 +00:00
|
|
|
|
array_push( $error, $result['error'][$j] );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( sizeof( $error ) == 0 )
|
|
|
|
|
{
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$query = 'insert into '.WAITING_TABLE;
|
2003-08-30 15:54:37 +00:00
|
|
|
|
$query.= ' (storage_category_id,file,username,mail_address,date,infos)';
|
|
|
|
|
$query.= ' values ';
|
|
|
|
|
$query.= '('.$page['cat'].",'".$_FILES['picture']['name']."'";
|
2003-05-09 12:42:42 +00:00
|
|
|
|
$query.= ",'".htmlspecialchars( $_POST['username'], ENT_QUOTES)."'";
|
2003-07-21 19:47:14 +00:00
|
|
|
|
$query.= ",'".$_POST['mail_address']."',".time().",'".$xml_infos."')";
|
2003-05-09 12:42:42 +00:00
|
|
|
|
$query.= ';';
|
2004-10-30 15:42:29 +00:00
|
|
|
|
pwg_query( $query );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
$page['waiting_id'] = mysql_insert_id();
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-02-22 02:43:13 +00:00
|
|
|
|
|
2003-05-09 12:42:42 +00:00
|
|
|
|
//------------------------------------------------------------ thumbnail upload
|
2003-05-17 10:49:14 +00:00
|
|
|
|
if ( isset( $_POST['submit'] ) and isset( $_GET['waiting_id'] ) )
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
|
|
|
|
// upload of the thumbnail
|
|
|
|
|
$query = 'select file';
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$query.= ' from '.WAITING_TABLE;
|
2003-05-09 12:42:42 +00:00
|
|
|
|
$query.= ' where id = '.$_GET['waiting_id'];
|
|
|
|
|
$query.= ';';
|
2004-10-30 15:42:29 +00:00
|
|
|
|
$result= pwg_query( $query );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
$row = mysql_fetch_array( $result );
|
|
|
|
|
$file = substr ( $row['file'], 0, strrpos ( $row['file'], ".") );
|
|
|
|
|
$extension = get_extension( $_FILES['picture']['name'] );
|
|
|
|
|
$path = $page['cat_dir'].'thumbnail/';
|
2003-05-27 20:56:13 +00:00
|
|
|
|
$path.= $conf['prefix_thumbnail'].$file.'.'.$extension;
|
2003-05-09 12:42:42 +00:00
|
|
|
|
$result = validate_upload( $path, $conf['upload_maxfilesize'],
|
|
|
|
|
$conf['upload_maxwidth_thumbnail'],
|
|
|
|
|
$conf['upload_maxheight_thumbnail'] );
|
|
|
|
|
for ( $j = 0; $j < sizeof( $result['error'] ); $j++ )
|
|
|
|
|
{
|
2003-07-21 19:47:14 +00:00
|
|
|
|
array_push( $error, $result['error'][$j] );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
if ( sizeof( $error ) == 0 )
|
|
|
|
|
{
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$query = 'update '.WAITING_TABLE;
|
2003-05-09 12:42:42 +00:00
|
|
|
|
$query.= " set tn_ext = '".$extension."'";
|
|
|
|
|
$query.= ' where id = '.$_GET['waiting_id'];
|
|
|
|
|
$query.= ';';
|
2004-10-30 15:42:29 +00:00
|
|
|
|
pwg_query( $query );
|
2003-05-09 12:42:42 +00:00
|
|
|
|
$page['upload_successful'] = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-02-22 02:43:13 +00:00
|
|
|
|
//
|
|
|
|
|
// Start output of page
|
|
|
|
|
//
|
|
|
|
|
$title= $lang['upload_title'];
|
|
|
|
|
include(PHPWG_ROOT_PATH.'include/page_header.php');
|
|
|
|
|
$template->set_filenames(array('upload'=>'upload.tpl'));
|
|
|
|
|
|
2004-09-11 10:36:03 +00:00
|
|
|
|
$u_form = PHPWG_ROOT_PATH.'upload.php?cat='.$page['cat'];
|
2004-02-22 02:43:13 +00:00
|
|
|
|
if ( isset( $page['waiting_id'] ) )
|
|
|
|
|
{
|
|
|
|
|
$u_form.= '&waiting_id='.$page['waiting_id'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( isset( $page['waiting_id'] ) )
|
|
|
|
|
{
|
|
|
|
|
$advise_title=$lang['upload_advise_thumbnail'].$_FILES['picture']['name'];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$advise_title = $lang['upload_advise'];
|
2004-12-12 21:06:39 +00:00
|
|
|
|
$advise_title.= get_cat_display_name($page['cat_name']);
|
2004-02-22 02:43:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$username = !empty($_POST['username'])?$_POST['username']:$user['username'];
|
2005-08-24 22:22:29 +00:00
|
|
|
|
$mail_address = !empty($_POST['mail_address'])?$_POST['mail_address']:@$user['mail_address'];
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$name = !empty($_POST['name'])?$_POST['name']:'';
|
|
|
|
|
$author = !empty($_POST['author'])?$_POST['author']:'';
|
|
|
|
|
$date_creation = !empty($_POST['date_creation'])?$_POST['date_creation']:'';
|
|
|
|
|
$comment = !empty($_POST['comment'])?$_POST['comment']:'';
|
|
|
|
|
|
|
|
|
|
$template->assign_vars(array(
|
|
|
|
|
'ADVISE_TITLE' => $advise_title,
|
|
|
|
|
'NAME' => $username,
|
|
|
|
|
'EMAIL' => $mail_address,
|
|
|
|
|
'NAME_IMG' => $name,
|
|
|
|
|
'AUTHOR_IMG' => $author,
|
|
|
|
|
'DATE_IMG' => $date_creation,
|
|
|
|
|
'COMMENT_IMG' => $comment,
|
|
|
|
|
|
|
|
|
|
'L_TITLE' => $lang['upload_title'],
|
|
|
|
|
'L_USERNAME' => $lang['upload_username'],
|
|
|
|
|
'L_EMAIL' => $lang['mail_address'],
|
|
|
|
|
'L_NAME_IMG' => $lang['upload_name'],
|
|
|
|
|
'L_SUBMIT' => $lang['submit'],
|
|
|
|
|
'L_AUTHOR' => $lang['upload_author'],
|
|
|
|
|
'L_CREATION_DATE' => $lang['upload_creation_date'],
|
2005-01-06 16:33:04 +00:00
|
|
|
|
'L_COMMENT' => $lang['comment'],
|
2004-11-18 14:57:00 +00:00
|
|
|
|
'L_RETURN' => $lang['home'],
|
|
|
|
|
'L_RETURN_HINT' => $lang['home_hint'],
|
2004-02-22 02:43:13 +00:00
|
|
|
|
'L_UPLOAD_DONE' => $lang['upload_successful'],
|
|
|
|
|
'L_MANDATORY' => $lang['mandatory'],
|
|
|
|
|
|
2006-01-15 12:52:55 +00:00
|
|
|
|
'F_ACTION' => $u_form,
|
2004-02-22 02:43:13 +00:00
|
|
|
|
|
2006-01-15 12:52:55 +00:00
|
|
|
|
'U_RETURN' => PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING']
|
2004-02-22 02:43:13 +00:00
|
|
|
|
));
|
|
|
|
|
|
2003-05-09 12:42:42 +00:00
|
|
|
|
if ( !$page['upload_successful'] )
|
|
|
|
|
{
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$template->assign_block_vars('upload_not_successful',array());
|
2003-05-09 12:42:42 +00:00
|
|
|
|
//-------------------------------------------------------------- errors display
|
2004-02-22 02:43:13 +00:00
|
|
|
|
if ( sizeof( $error ) != 0 )
|
|
|
|
|
{
|
|
|
|
|
$template->assign_block_vars('upload_not_successful.errors',array());
|
|
|
|
|
for ( $i = 0; $i < sizeof( $error ); $i++ )
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$template->assign_block_vars('upload_not_successful.errors.error',array('ERROR'=>$error[$i]));
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
2004-02-22 02:43:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-05-09 12:42:42 +00:00
|
|
|
|
//--------------------------------------------------------------------- advises
|
2004-02-22 02:43:13 +00:00
|
|
|
|
if ( !empty($conf['upload_maxfilesize']) )
|
2003-05-09 12:42:42 +00:00
|
|
|
|
{
|
|
|
|
|
$content = $lang['upload_advise_filesize'];
|
|
|
|
|
$content.= $conf['upload_maxfilesize'].' KB';
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$content));
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
2004-02-22 02:43:13 +00:00
|
|
|
|
|
2003-05-09 12:42:42 +00:00
|
|
|
|
if ( isset( $page['waiting_id'] ) )
|
|
|
|
|
{
|
|
|
|
|
if ( $conf['upload_maxwidth_thumbnail'] != '' )
|
|
|
|
|
{
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$content = $lang['upload_advise_width'];
|
2003-05-09 12:42:42 +00:00
|
|
|
|
$content.= $conf['upload_maxwidth_thumbnail'].' px';
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$content));
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
if ( $conf['upload_maxheight_thumbnail'] != '' )
|
|
|
|
|
{
|
|
|
|
|
$content = $lang['upload_advise_height'];
|
|
|
|
|
$content.= $conf['upload_maxheight_thumbnail'].' px';
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$content));
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if ( $conf['upload_maxwidth'] != '' )
|
|
|
|
|
{
|
|
|
|
|
$content = $lang['upload_advise_width'];
|
|
|
|
|
$content.= $conf['upload_maxwidth'].' px';
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$content));
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
if ( $conf['upload_maxheight'] != '' )
|
|
|
|
|
{
|
|
|
|
|
$content = $lang['upload_advise_height'];
|
|
|
|
|
$content.= $conf['upload_maxheight'].' px';
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$content));
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$template->assign_block_vars('upload_not_successful.advise',array('ADVISE'=>$lang['upload_advise_filetype']));
|
|
|
|
|
|
2003-05-09 12:42:42 +00:00
|
|
|
|
//----------------------------------------- optionnal username and mail address
|
|
|
|
|
if ( !isset( $page['waiting_id'] ) )
|
|
|
|
|
{
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$template->assign_block_vars('upload_not_successful.fields',array());
|
|
|
|
|
$template->assign_block_vars('note',array());
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-02-22 02:43:13 +00:00
|
|
|
|
$template->assign_block_vars('upload_successful',array());
|
2003-05-09 12:42:42 +00:00
|
|
|
|
}
|
|
|
|
|
//----------------------------------------------------------- html code display
|
2005-01-13 10:18:49 +00:00
|
|
|
|
$template->parse('upload');
|
2004-02-22 02:43:13 +00:00
|
|
|
|
include(PHPWG_ROOT_PATH.'include/page_tail.php');
|
2004-02-11 23:20:38 +00:00
|
|
|
|
?>
|