Page 1 sur 1

Upload multiple

Posté : 29 oct. 2005, 13:00
par ascari
Salut.
Excusez moi de vous déranger mais j'ai un petit service à vous demander.
Je refait entièrement mon site et j'ai un problème avec ma galerie.
C'est un script reprit sur le net qui intègre la galerie à phpbb.
Le seul problème est que je ne peux uploader qu'une image à la fois via le menu et j'aimerais avoir la possibilité d'en uploader 2.
J'ai bon chercher je tourne en rond je modifie le code dans tout les sens et il refuse d'uploader la deuxième image.
Si vous savez jeter un petit coup d'oeil au code sa serait sympa.

Et voici le lien où je fais mes test.
http://ascari.jexiste.fr/phpbb/album_up ... p?cat_id=1

Merci d'avance.

Voici le code de la page album_upload.php

Code : Tout sélectionner

<?php /*************************************************************************** * album_upload.php * ------------------- * begin : Wednesday, February 05, 2003 * copyright : (C) 2003 Smartor * email : [email protected] * * $Id: album_upload.php,v 2.1.2 2003/03/13 19:46:00 ngoctu Exp $ * ***************************************************************************/ /*************************************************************************** * * 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. * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; $album_root_path = $phpbb_root_path . 'album_mod/'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'includes/functions_validate.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_ALBUM); init_userprefs($userdata); // // End session management // // // Get general album information // include($album_root_path . 'album_common.'.$phpEx); /* +---------------------------------------------------------- | Common Check +---------------------------------------------------------- */ // ------------------------------------ // Check the request // for this Upload script, we prefer POST to GET // ------------------------------------ if( isset($HTTP_POST_VARS['cat_id']) ) { $cat_id = intval($HTTP_POST_VARS['cat_id']); } else if( isset($HTTP_GET_VARS['cat_id']) ) { $cat_id = intval($HTTP_GET_VARS['cat_id']); } else { message_die(GENERAL_ERROR, 'No categories specified'); } // ------------------------------------ // Get the current Category Info // ------------------------------------ if ($cat_id != PERSONAL_GALLERY) { $sql = "SELECT c.*, COUNT(p.pic_id) AS count FROM ". ALBUM_CAT_TABLE ." AS c LEFT JOIN ". ALBUM_TABLE ." AS p ON c.cat_id = p.pic_cat_id WHERE c.cat_id = '$cat_id' GROUP BY c.cat_id LIMIT 1"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); } $thiscat = $db->sql_fetchrow($result); } else { $thiscat = init_personal_gallery_cat($user_data['user_id']); } $current_pics = $thiscat['count']; if (empty($thiscat)) { message_die(GENERAL_ERROR, $lang['Category_not_exist']); } // ------------------------------------ // Check the permissions // ------------------------------------ $album_user_access = album_user_access($cat_id, $thiscat, 0, 1, 0, 0, 0, 0); // UPLOAD if ($album_user_access['upload'] == 0) { if (!$userdata['session_logged_in']) { redirect(append_sid("login.$phpEx?redirect=album_upload.$phpEx?cat_id=$cat_id")); } else { message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } /* +---------------------------------------------------------- | Upload Quota Check +---------------------------------------------------------- */ if ($cat_id != PERSONAL_GALLERY) { // ------------------------------------ // Check Album Configuration Quota // ------------------------------------ if ($album_config['max_pics'] >= 0) { // // $current_pics was set at "Get the current Category Info" // if( $current_pics >= $album_config['max_pics'] ) { message_die(GENERAL_MESSAGE, $lang['Album_reached_quota']); } } // ------------------------------------ // Check User Limit // ------------------------------------ $check_user_limit = FALSE; if( ($userdata['user_level'] != ADMIN) and ($userdata['session_logged_in']) ) { if ($album_user_access['moderator']) { if ($album_config['mod_pics_limit'] >= 0) { $check_user_limit = 'mod_pics_limit'; } } else { if ($album_config['user_pics_limit'] >= 0) { $check_user_limit = 'user_pics_limit'; } } } // Do the check here if ($check_user_limit != FALSE) { $sql = "SELECT COUNT(pic_id) AS count FROM ". ALBUM_TABLE ." WHERE pic_user_id = '". $userdata['user_id'] ."' AND pic_cat_id = '$cat_id'"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not count your pic', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $own_pics = $row['count']; if( $own_pics >= $album_config[$check_user_limit] ) { message_die(GENERAL_MESSAGE, $lang['User_reached_pics_quota']); } } } else { if( ($current_pics >= $album_config['personal_gallery_limit']) and ($album_config['personal_gallery_limit'] >= 0) ) { message_die(GENERAL_MESSAGE, $lang['Album_reached_quota']); } } /* +---------------------------------------------------------- | Main work here... +---------------------------------------------------------- */ if( !isset($HTTP_POST_VARS['pic_title']) ) // is it not submitted? { // -------------------------------- // Build categories select // -------------------------------- $sql = "SELECT * FROM " . ALBUM_CAT_TABLE ." ORDER BY cat_order ASC"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); } $catrows = array(); while( $row = $db->sql_fetchrow($result) ) { $thiscat_access = album_user_access($row['cat_id'], $row, 0, 1, 0, 0, 0, 0); // UPLOAD if ($thiscat_access['upload'] == 1) { $catrows[] = $row; } } $select_cat = '<select name="cat_id">'; if ($cat_id == PERSONAL_GALLERY) { $select_cat .= '<option value="$cat_id" selected="selected">'; $select_cat .= sprintf($lang['Personal_Gallery_Of_User'], $userdata['username']); $select_cat .= '</option>'; } for ($i = 0; $i < count($catrows); $i++) { $select_cat .= '<option value="'. $catrows[$i]['cat_id'] .'" '; $select_cat .= ($cat_id == $catrows[$i]['cat_id']) ? 'selected="selected"' : ''; $select_cat .= '>'. $catrows[$i]['cat_title'] .'</option>'; } $select_cat .= '</select>'; // // Start output of page // $page_title = $lang['Album']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( 'body' => 'album_upload_body.tpl') ); $template->assign_vars(array( 'U_VIEW_CAT' => ($cat_id != PERSONAL_GALLERY) ? append_sid("album_cat.$phpEx?cat_id=$cat_id") : append_sid("album_personal.$phpEx"), 'CAT_TITLE' => $thiscat['cat_title'], 'L_UPLOAD_PIC' => $lang['Upload_Pic'], 'L_USERNAME' => $lang['Username'], 'L_PIC_TITLE' => $lang['Pic_Title'], 'L_PIC_DESC' => $lang['Pic_Desc'], 'L_PLAIN_TEXT_ONLY' => $lang['Plain_text_only'], 'L_MAX_LENGTH' => $lang['Max_length'], 'S_PIC_DESC_MAX_LENGTH' => $album_config['desc_length'], 'L_UPLOAD_PIC_FROM_MACHINE' => $lang['Upload_pic_from_machine'], 'L_UPLOAD_TO_CATEGORY' => $lang['Upload_to_Category'], 'SELECT_CAT' => $select_cat, 'L_MAX_FILESIZE' => $lang['Max_file_size'], 'S_MAX_FILESIZE' => $album_config['max_file_size'], 'L_MAX_WIDTH' => $lang['Max_width'], 'L_MAX_HEIGHT' => $lang['Max_height'], 'S_MAX_WIDTH' => $album_config['max_width'], 'S_MAX_HEIGHT' => $album_config['max_height'], 'L_ALLOWED_JPG' => $lang['JPG_allowed'], 'L_ALLOWED_PNG' => $lang['PNG_allowed'], 'L_ALLOWED_GIF' => $lang['GIF_allowed'], 'S_JPG' => ($album_config['jpg_allowed'] == 1) ? $lang['Yes'] : $lang['No'], 'S_PNG' => ($album_config['png_allowed'] == 1) ? $lang['Yes'] : $lang['No'], 'S_GIF' => ($album_config['gif_allowed'] == 1) ? $lang['Yes'] : $lang['No'], 'L_UPLOAD_NO_TITLE' => $lang['Upload_no_title'], 'L_UPLOAD_NO_FILE' => $lang['Upload_no_file'], 'L_DESC_TOO_LONG' => $lang['Desc_too_long'], // Manual Thumbnail 'L_UPLOAD_THUMBNAIL' => $lang['Upload_thumbnail'], 'L_UPLOAD_THUMBNAIL_EXPLAIN' => $lang['Upload_thumbnail_explain'], 'L_THUMBNAIL_SIZE' => $lang['Thumbnail_size'], 'S_THUMBNAIL_SIZE' => $album_config['thumbnail_size'], 'L_RESET' => $lang['Reset'], 'L_SUBMIT' => $lang['Submit'], 'S_ALBUM_ACTION' => append_sid("album_upload.$phpEx?cat_id=$cat_id"), ) ); if ($album_config['gd_version'] == 0) { $template->assign_block_vars('switch_manual_thumbnail', array()); } // // Generate the page // $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); } else { // -------------------------------- // Check posted info // -------------------------------- $pic_title = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['pic_title']))); $pic_desc = str_replace("\'", "''", htmlspecialchars(substr(trim($HTTP_POST_VARS['pic_desc']), 0, $album_config['desc_length']))); $pic_username = (!$userdata['session_logged_in']) ? substr(str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['pic_username']))), 0, 32) : str_replace("'", "''", $userdata['username']); if( empty($pic_title) ) { message_die(GENERAL_ERROR, $lang['Missed_pic_title']); } if( !isset($HTTP_POST_FILES['pic_file']) ) { message_die(GENERAL_ERROR, 'Bad Upload'); } // -------------------------------- // Check username for guest posting // -------------------------------- if (!$userdata['session_logged_in']) { if ($pic_username != '') { $result = validate_username($pic_username); if ( $result['error'] ) { message_die(GENERAL_MESSAGE, $result['error_msg']); } } } // -------------------------------- // Get File Upload Info // -------------------------------- $filetype = $HTTP_POST_FILES['pic_file']['type']; $filesize = $HTTP_POST_FILES['pic_file']['size']; $filetmp = $HTTP_POST_FILES['pic_file']['tmp_name']; if ($album_config['gd_version'] == 0) { $thumbtype = $HTTP_POST_FILES['pic_thumbnail']['type']; $thumbsize = $HTTP_POST_FILES['pic_thumbnail']['size']; $thumbtmp = $HTTP_POST_FILES['pic_thumbnail']['tmp_name']; } // -------------------------------- // Prepare variables // -------------------------------- $pic_time = time(); $pic_user_id = $userdata['user_id']; $pic_user_ip = $userdata['session_ip']; // -------------------------------- // Check file size // -------------------------------- if( ($filesize == 0) or ($filesize > $album_config['max_file_size']) ) { message_die(GENERAL_MESSAGE, $lang['Bad_upload_file_size']); } if ($album_config['gd_version'] == 0) { if( ($thumbsize == 0) or ($thumbsize > $album_config['max_file_size']) ) { message_die(GENERAL_MESSAGE, $lang['Bad_upload_file_size']); } } // -------------------------------- // Check file type // -------------------------------- switch ($filetype) { case 'image/jpeg': case 'image/jpg': case 'image/pjpeg': if ($album_config['jpg_allowed'] == 0) { message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $pic_filetype = '.jpg'; break; case 'image/png': case 'image/x-png': if ($album_config['png_allowed'] == 0) { message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $pic_filetype = '.png'; break; case 'image/gif': if ($album_config['gif_allowed'] == 0) { message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } $pic_filetype = '.gif'; break; default: message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); } if ($album_config['gd_version'] == 0) { if ($filetype != $thumbtype) { message_die(GENERAL_ERROR, $lang['Filetype_and_thumbtype_do_not_match']); } } // -------------------------------- // Generate filename // -------------------------------- srand((double)microtime()*1000000); // for older than version 4.2.0 of PHP do { $pic_filename = md5(uniqid(rand())) . $pic_filetype; } while( file_exists(ALBUM_UPLOAD_PATH . $pic_filename) ); if ($album_config['gd_version'] == 0) { $pic_thumbnail = $pic_filename; } // -------------------------------- // Move this file to upload directory // -------------------------------- $ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var'; if ( @$ini_val('open_basedir') != '' ) { if ( @phpversion() < '4.0.3' ) { message_die(GENERAL_ERROR, 'open_basedir is set and your PHP version does not allow move_uploaded_file<br /><br />Please contact your server admin', '', __LINE__, __FILE__); } $move_file = 'move_uploaded_file'; } else { $move_file = 'copy'; } $move_file($filetmp, ALBUM_UPLOAD_PATH . $pic_filename); @chmod(ALBUM_UPLOAD_PATH . $pic_filename, 0777); if ($album_config['gd_version'] == 0) { $move_file($thumbtmp, ALBUM_CACHE_PATH . $pic_thumbnail); @chmod(ALBUM_CACHE_PATH . $pic_thumbnail, 0777); } // -------------------------------- // Well, it's an image. Check its image size // -------------------------------- $pic_size = getimagesize(ALBUM_UPLOAD_PATH . $pic_filename); $pic_width = $pic_size[0]; $pic_height = $pic_size[1]; if ( ($pic_width > $album_config['max_width']) or ($pic_height > $album_config['max_height']) ) { @unlink(ALBUM_UPLOAD_PATH . $pic_filename); if ($album_config['gd_version'] == 0) { @unlink(ALBUM_CACHE_PATH . $pic_thumbnail); } message_die(GENERAL_ERROR, $lang['Upload_image_size_too_big']); } if ($album_config['gd_version'] == 0) { $thumb_size = getimagesize(ALBUM_CACHE_PATH . $pic_thumbnail); $thumb_width = $thumb_size[0]; $thumb_height = $thumb_size[1]; if ( ($thumb_width > $album_config['thumbnail_size']) or ($thumb_height > $album_config['thumbnail_size']) ) { @unlink(ALBUM_UPLOAD_PATH . $pic_filename); @unlink(ALBUM_CACHE_PATH . $pic_thumbnail); message_die(GENERAL_ERROR, $lang['Upload_thumbnail_size_too_big']); } } // -------------------------------- // This image is okay, we can cache its thumbnail now // -------------------------------- if( ($album_config['thumbnail_cache'] == 1) and ($pic_filetype != '.gif') and ($album_config['gd_version'] > 0) ) { $gd_errored = FALSE; switch ($pic_filetype) { case '.jpg': $read_function = 'imagecreatefromjpeg'; break; case '.png': $read_function = 'imagecreatefrompng'; break; } $src = @$read_function(ALBUM_UPLOAD_PATH . $pic_filename); if (!$src) { $gd_errored = TRUE; $pic_thumbnail = ''; } else if( ($pic_width > $album_config['thumbnail_size']) or ($pic_height > $album_config['thumbnail_size']) ) { // Resize it if ($pic_width > $pic_height) { $thumbnail_width = $album_config['thumbnail_size']; $thumbnail_height = $album_config['thumbnail_size'] * ($pic_height/$pic_width); } else { $thumbnail_height = $album_config['thumbnail_size']; $thumbnail_width = $album_config['thumbnail_size'] * ($pic_width/$pic_height); } $thumbnail = ($album_config['gd_version'] == 1) ? @imagecreate($thumbnail_width, $thumbnail_height) : @imagecreatetruecolor($thumbnail_width, $thumbnail_height); $resize_function = ($album_config['gd_version'] == 1) ? 'imagecopyresized' : 'imagecopyresampled'; @$resize_function($thumbnail, $src, 0, 0, 0, 0, $thumbnail_width, $thumbnail_height, $pic_width, $pic_height); } else { $thumbnail = $src; } if (!$gd_errored) { $pic_thumbnail = $pic_filename; // Write to disk switch ($pic_filetype) { case '.jpg': @imagejpeg($thumbnail, ALBUM_CACHE_PATH . $pic_thumbnail, $album_config['thumbnail_quality']); break; case '.png': @imagepng($thumbnail, ALBUM_CACHE_PATH . $pic_thumbnail); break; } @chmod(ALBUM_CACHE_PATH . $pic_thumbnail, 0777); } // End IF $gd_errored } // End Thumbnail Cache else if ($album_config['gd_version'] > 0) { $pic_thumbnail = ''; } // -------------------------------- // Check Pic Approval // -------------------------------- $pic_approval = ($thiscat['cat_approval'] == 0) ? 1 : 0; // -------------------------------- // Insert into DB // -------------------------------- $sql = "INSERT INTO ". ALBUM_TABLE ." (pic_filename, pic_thumbnail, pic_title, pic_desc, pic_user_id, pic_user_ip, pic_username, pic_time, pic_cat_id, pic_approval) VALUES ('$pic_filename', '$pic_thumbnail', '$pic_title', '$pic_desc', '$pic_user_id', '$pic_user_ip', '$pic_username', '$pic_time', '$cat_id', '$pic_approval')"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not insert new entry', '', __LINE__, __FILE__, $sql); } // -------------------------------- // Complete... now send a message to user // -------------------------------- if ($thiscat['cat_approval'] == 0) { $message = $lang['Album_upload_successful']; } else { $message = $lang['Album_upload_need_approval']; } if ($cat_id != PERSONAL_GALLERY) { if ($thiscat['cat_approval'] == 0) { $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("album_cat.$phpEx?cat_id=$cat_id") . '">') ); } $message .= "<br /><br />" . sprintf($lang['Click_return_category'], "<a href=\"" . append_sid("album_cat.$phpEx?cat_id=$cat_id") . "\">", "</a>"); } else { if ($thiscat['cat_approval'] == 0) { $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("album_personal.$phpEx") . '">') ); } $message .= "<br /><br />" . sprintf($lang['Click_return_personal_gallery'], "<a href=\"" . append_sid("album_personal.$phpEx") . "\">", "</a>"); } $message .= "<br /><br />" . sprintf($lang['Click_return_album_index'], "<a href=\"" . append_sid("album.$phpEx") . "\">", "</a>"); message_die(GENERAL_MESSAGE, $message); } // +------------------------------------------------------+ // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | // +------------------------------------------------------+ ?>
Et voici la page album_upload_body.tpl

Code : Tout sélectionner

<script language="JavaScript" type="text/javascript"> <!-- function checkAlbumForm() { formErrors = false; if (document.upload.pic_title.value.length < 2) { formErrors = "{L_UPLOAD_NO_TITLE}"; } else if (document.upload.pic_file.value.length < 2) { formErrors = "{L_UPLOAD_NO_FILE}"; } else if (document.upload.pic_desc.value.length > {S_PIC_DESC_MAX_LENGTH}) { formErrors = "{L_DESC_TOO_LONG}"; } if (formErrors) { alert(formErrors); return false; } else { return true; } } // --> </script> <form name="upload" action="{S_ALBUM_ACTION}" method="post" enctype="multipart/form-data" onSubmit="return checkAlbumForm()"> <table width="100%" cellspacing="2" cellpadding="2" border="0"> <tr> <td class="nav"><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a class="nav" href="{U_ALBUM}">{L_ALBUM}</a> -> <a class="nav" href="{U_VIEW_CAT}">{CAT_TITLE}</a></span></td> </tr> </table> <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline"> <tr> <th class="thTop" height="25" colspan="2">{L_UPLOAD_PIC}</th> </tr> <!-- BEGIN switch_user_logged_out --> <tr> <td class="row1" width="30%" height="28"><span class="gen">{L_USERNAME}:</span></td> <td class="row2"><input class="post" type="text" name="pic_username" size="32" maxlength="32" /></td> </tr> <!-- END switch_user_logged_out --> <tr> <td class="row1" height="28"><span class="gen">{L_PIC_TITLE}:</span></td> <td class="row2"><input class="post" type="text" name="pic_title" size="60" /></td> </tr> <tr> <td class="row1" valign="top" height="28"><span class="gen">{L_PIC_DESC}:<br /> </span><span class="genmed">{L_PLAIN_TEXT_ONLY}<br />{L_MAX_LENGTH}: <b>{S_PIC_DESC_MAX_LENGTH}</b></span></td> <td class="row2"><textarea class="post" cols="60" rows="4" name="pic_desc" size="60"></textarea></td> </tr> <tr> <td class="row1"><span class="gen">{L_UPLOAD_PIC_FROM_MACHINE}:</span></td> <td class="row2"><input class="post" type="file" name="pic_file" size="49" /></td> </tr> <!-- BEGIN switch_manual_thumbnail --> <tr> <td class="row1"><span class="gen">{L_UPLOAD_THUMBNAIL}:<br /></span><span class="gensmall">{L_UPLOAD_THUMBNAIL_EXPLAIN}</span></td> <td class="row2"><input class="post" type="file" name="pic_thumbnail" size="49" /></td> </tr> <tr> <td class="row1" height="28"><span class="gen">{L_THUMBNAIL_SIZE}:</span></td> <td class="row2"><span class="gen"><b>{S_THUMBNAIL_SIZE}</b></span></td> </tr> <!-- END switch_manual_thumbnail --> <tr> <td height="28" class="row1"><span class="gen">{L_UPLOAD_TO_CATEGORY}:</span></td> <td class="row2">{SELECT_CAT}</td> </tr> <tr> <td class="row1" height="28"><span class="gen">{L_MAX_FILESIZE}:</span></td> <td class="row2"><span class="gen"><b>{S_MAX_FILESIZE}</b></span></td> </tr> <tr> <td class="row1" height="28"><span class="gen">{L_MAX_WIDTH}:</span></td> <td class="row2"><span class="gen"><b>{S_MAX_WIDTH}</b></span></td> </tr> <tr> <td class="row1" height="28"><span class="gen">{L_MAX_HEIGHT}:</span></td> <td class="row2"><span class="gen"><b>{S_MAX_HEIGHT}</b></span></td> </tr> <tr> <td class="row1" height="28"><span class="gen">{L_ALLOWED_JPG}:</span></td> <td class="row2"><span class="gen"><b>{S_JPG}</b></span></td> </tr> <tr> <td class="row1" height="28"><span class="gen">{L_ALLOWED_PNG}:</span></td> <td class="row2"><span class="gen"><b>{S_PNG}</b></span></td> </tr> <tr> <td class="row1" height="28"><span class="gen">{L_ALLOWED_GIF}:</span></td> <td class="row2"><span class="gen"><b>{S_GIF}</b></span></td> </tr> <tr> <td class="catBottom" align="center" height="28" colspan="2"><input type="reset" value="{L_RESET}" class="liteoption" />&nbsp;&nbsp;&nbsp;<input type="submit" name="submit" value="{L_SUBMIT}" class="mainoption" /></td> </tr> </table> </form> <br /> <!-- You must keep my copyright notice visible with its original content --> <div align="center" class="copyright">Powered by Photo Album {ALBUM_VERSION} &copy; 2002-2003 <a href="http://smartor.is-root.com" target="_blank">Smartor</a></div>

Merci encore

Posté : 29 oct. 2005, 13:10
par Cyrano
Et tu te figures qu'on va se farcir tout ça ? :shock:

Si tu nous disais ce qui se passe au juste ? TU n'as qu'une image : bon, mais laquelle ? As-tu des messages d'erreur ? Et si au lieu d'un template tu nous mettais le vrai formulaire final qu'on sache à quoi s'en tenir ?

Posté : 29 oct. 2005, 13:16
par ascari
Aucun message d'erreur quand je modifie le .tpl il effectue que l'envois d'une image et ignore la seconde.
Je pense que je dois modifier le .php aussi mais je ne vois pas que faire.
J'avais pensé renomer les variables mais vu la taille du code et mon manque d'experience en php je ne sais pas par quoi commencer et surtout lesquel modifier.

Posté : 29 oct. 2005, 13:19
par ascari
Je n'ai pas d'autre page pour l'upload.
Si je comprend bien le tpl ne sert qu'a effectuer la mise en page?
Et le php c'est lui qui gere l'upload proprement dis?

Posté : 29 oct. 2005, 13:33
par Cyrano
Si tu débutes en PHP, laisse donc de coté le code de phpBB, tu vas t'y casser les dents. Commence avec des systèmes plus conventionnels non objet et sans templates. Quand tu maîtriseras déjà ça, ce sera un progrès. Monte-toi un formulaire d'upload de fichiers en ayant plusieurs possibiités d'images en une seule fois et fais le fonctionner, ce sera déjà un progrès. Après quand tu auras bien compris le fonctionnement de cette partie, tu pourras peut-être envisager l'utilisation de templates pour arranger la mise en page à part. Sur le site de PHPFrance, tu as un bon tuto sur l'upload de fichiers, i te faudra juste adapter pour un uplaod multiple