That should be better like this
that is the step by step for the member.php file
i prevent, i'am not a programmeur, so use this carrefully
this mod soesn't run for moment, just try to start a mod
didn't have change anything to the upload.php file, that why there is some prob for the moment i think
and at least but not the last, backup your file STEP2 in
member.php find :
//////////////////////////////////////////////////////////////////////////
$remote_media_file = format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['remote_media_file'])));
$remote_thumb_file = format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['remote_thumb_file'])));
$image_name = un_htmlspecialchars(trim($HTTP_POST_VARS['image_name']));
$image_description = un_htmlspecialchars(trim($HTTP_POST_VARS['image_description']));
$image_keywords = un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords']));
$image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
$image_keywords = str_replace(","," ",$image_keywords);
$image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);
$image_active = (isset($HTTP_POST_VARS['image_active']) && $HTTP_POST_VARS['image_active'] == 0) ? 0 : 1;
$image_allow_comments = (isset($HTTP_POST_VARS['image_allow_comments']) && $HTTP_POST_VARS['image_allow_comments'] == 0) ? 0 : 1;
$image_download_url = (isset($HTTP_POST_VARS['image_download_url'])) ? format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['image_download_url']))) : "";
replace with :
//////////////////////////////////////////////////////////////////////////
for ($i = 1; $i <= $nbr_pics; $i++) {
$remote_media_file = format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['remote_media_file'.$i])));
$remote_thumb_file = format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['remote_thumb_file'.$i])));
$image_name = un_htmlspecialchars(trim($HTTP_POST_VARS['image_name'.$i]));
$image_description = un_htmlspecialchars(trim($HTTP_POST_VARS['image_description'.$i]));
$image_keywords = un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords'.$i]));
$image_keywords = preg_replace("/[\n\r]/is", " ", $image_keywords);
$image_keywords = str_replace(","," ",$image_keywords);
$image_keywords = ereg_replace("( ){2,}", " ", $image_keywords);
$image_active = (isset($HTTP_POST_VARS['image_active_'.$i]) && $HTTP_POST_VARS['image_active'.$i] == 0) ? 0 : 1;
$image_allow_comments = (isset($HTTP_POST_VARS['image_allow_comments'.$i]) && $HTTP_POST_VARS['image_allow_comments'.$i] == 0) ? 0 : 1;
$image_download_url = (isset($HTTP_POST_VARS['image_download_url'.$i])) ? format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['image_download_url'.$i]))) : "";
Find :
/////////////////////////////////////////////////////////
if ($cat_id == 0) {
$error = 1;
$field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $lang['category']), $lang['field_required']);
$msg .= (($msg != "") ? "<br />" : "").$field_error;
}
if ((empty($HTTP_POST_FILES['media_file']['tmp_name']) || $HTTP_POST_FILES['media_file']['tmp_name'] == "none") && ($remote_media_file == "" || !check_remote_media($remote_media_file))) {
$error = 1;
$msg .= (($msg != "") ? "<br />" : "").$lang['image_file_required'];
}
if ($image_name == "") {
$error = 1;
$field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $lang['image_name']), $lang['field_required']);
$msg .= (($msg != "") ? "<br />" : "").$field_error;
}
replace with
////////////////////////////////////////////////////////////////////
if ($cat_id == 0) {
$error = 1;
$field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", "<span class='green'>".$lang['category'].$i."</span>"), $lang['field_required']);
$msg .= (($msg != "") ? "<br />" : "")."$ico_green ".$field_error;
}
if ((empty($HTTP_POST_FILES['media_file'.$i]['tmp_name']) || $HTTP_POST_FILES['media_file'.$i]['tmp_name'] == "none") && ($remote_media_file == "" || !check_remote_media($remote_media_file))) {
$error = 1;
$msg .= (($msg != "") ? "<br />" : "")."$ico_green ".$lang['image_file_required'];
}
if ($image_name == "") {
$error = 1;
$field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "","<span class='green'>". $lang['image_name'].$i."</span>"), $lang['field_required']);
$msg .= (($msg != "") ? "<br />" : "")."$ico_green ".$field_error;
}
Find
/////////////////////////////////////////////////////////////////////////
// Upload Media file
if (!empty($HTTP_POST_FILES['media_file']['tmp_name']) && $HTTP_POST_FILES['media_file']['tmp_name'] != "none") {
$new_name = $site_upload->upload_file("media_file", "media", $upload_cat);
if (!$new_name) {
$msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name."</b><br />".$site_upload->get_upload_errors();
$uploaderror = 1;
}
}
Replace with
////////////////////////////////////////////////////////////
// Upload Media file
for ($i = 1; $i <= $nbr_pics; $i++) {
if (!empty($HTTP_POST_FILES['media_file'.$i]['tmp_name']) && $HTTP_POST_FILES['media_file'.$i]['tmp_name'] != "none") {
$new_name = $site_upload->upload_file("media_file".$i, "media", $upload_cat);
if (!$new_name) {
$msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].$i.": ".$new_name."</b><br />".$site_upload->get_upload_errors();
$uploaderror = 1;
}
}
Find
/////////////////////////////////////////////////////////////////////////
$new_thumb_name = "";
if (!empty($HTTP_POST_FILES['thumb_file']['tmp_name']) && $HTTP_POST_FILES['thumb_file']['tmp_name'] != "none" && !$uploaderror) {
$new_thumb_name = $site_upload->upload_file("thumb_file", "thumb", $upload_cat, basename($new_name));
if (!$new_thumb_name) {
$msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['thumb_upload_error'].": ".$new_thumb_name."</b><br />".$site_upload->get_upload_errors();
@unlink(MEDIA_TEMP_PATH."/".$new_name);
$uploaderror = 1;
}
}
Replace with
////////////////////////////////////////////////////////////
} for ($i = 1; $i <= $nbr_pics; $i++) {
$new_thumb_name = "";
if (!empty($HTTP_POST_FILES['thumb_file'.$i]['tmp_name']) && $HTTP_POST_FILES['thumb_file'.$i]['tmp_name'] != "none" && !$uploaderror) {
$new_thumb_name = $site_upload->upload_file("thumb_file".$i, "thumb", $upload_cat, basename($new_name));
if (!$new_thumb_name) {
$msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['thumb_upload_error'].$i.": ".$new_thumb_name."</b><br />".$site_upload->get_upload_errors();
@unlink(MEDIA_TEMP_PATH."/".$new_name);
$uploaderror = 1;
}
}
Find and erase
(Carefully,
backup your files, i have erase it cause it make probleme
the mailing function is declare 2times and make a probleme. But this function must be modified after)
///////////////////////////////////////////////////////////////////////////////
if ($config['upload_notify'] == 1 && !$direct_upload) {
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$config['upload_emails'] = str_replace(" ", "", $config['upload_emails']);
$emails = explode(",", $config['upload_emails']);
$validation_url = $script_url."/admin/index.php?goto=".urlencode("validateimages.php?action=validateimages");
$site_email->set_to($config['site_email']);
$site_email->set_subject($lang['new_upload_emailsubject']);
$site_email->register_vars(array(
"image_name" => stripslashes($image_name),
"file_name" => $new_name,
"cat_name" => $cat_cache[$cat_id]['cat_name'],
"validation_url" => $validation_url,
"site_name" => $config['site_name']
));
$site_email->set_body("upload_notify", $config['language_dir_default']);
$site_email->set_bcc($emails);
$site_email->send_email();
}
Find :
///////////////////////////////////////////////////////////////:
if ($action == "uploadform") {
else {
$action = "uploadform";
$sendprocess = 1;
Add before :
}
Find :
///////////////////////////////////////////////////////////////:
if ($action == "uploadform") {
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
show_error_page($lang['no_permission']);
exit;
}
$txt_clickstream = "";
if ($cat_id && isset($cat_cache[$cat_id])) {
$txt_clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$txt_clickstream .= $lang['user_upload'];
ADD After
///////////////////////////////////////////////////////////////:
$nbr_pics="$nbr_pics";
for ($i = 1; $i <= $nbr_pics; $i++) {
$printform .="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><strong>pics nbr : <span class='new'>$i</span></strong></td><td width=\"50%\"><div align=\"right\"><a href=\"#\">go_top</a></div></td></tr></table><br><br><table>";
$printform .="<tr><td >$ico_arrow <b>{lang_category}</b></td><td >".get_category_dropdown($cat_id)."</td></tr>";
$printform .="<tr><td valign=\"top\"><b>{lang_media_file}</b><br /><span class=\"smalltext\">{lang_max_filesize}<b>{max_media_filsize}</b><br />{lang_max_imagewidth}<b>{max_media_imagewidth}</b><br />{lang_max_imageheight}<b>{max_media_imageheight}</b><br /></span></td><td ><b>Upload:</b><br /><input type=\"file\" name=\"media_file".$i."\" class=\"input\" /><br /><b>URL:</b><br /><input type=\"text\" name=\"remote_media_file".$i."\" size=\"30\" class=\"input\" /><br /><span class=\"smalltext\"><b>{lang_allowed_file_types}</b>{allowed_media_types}</span></td></tr>";
$printform .="<tr><td valign=\"top\"><b>{lang_thumb_file}</b><br /><span class=\"smalltext\">{lang_max_filesize}<b>{max_thumb_filsize}</b><br />{lang_max_imagewidth}<b>{max_thumb_imagewidth}</b><br />{lang_max_imageheight}<b>{max_thumb_imageheight}</b><br /></span></td><td ><b>Upload:</b><br /><input type=\"file\" name=\"thumb_file".$i."\" class=\"input\" /><br /><b>URL:</b><br /><input type=\"text\" name=\"remote_thumb_file".$i."\" size=\"30\" class=\"input\" /><br /><span class=\"smalltext\"><b>{lang_allowed_file_types}</b>{allowed_thumb_types}</span></td></tr>";
$printform .="<tr><td > <b>{lang_image_name}</b></td><td ><input type=\"text\" name=\"image_name".$i."\" size=\"30\" value=\"{image_name".$i."}\" class=\"input\" /></td></tr>";
$printform .="<tr><td valign=\"top\"><b>{lang_description}</b></td><td ><textarea name=\"image_description".$i."\" cols=\"30\" class=\"row2\" rows=\"10\" wrap=\"VIRTUAL\">{image_description".$i."}</textarea></td></tr>";
$printform .="<tr><td valign=\"top\"><b>{lang_keywords}</b></td> <td ><textarea cols=\"30\" class=\"row2\" rows=\"10\" wrap=\"VIRTUAL\" name=\"image_keywords".$i."\">{image_keywords".$i."}</textarea></td></tr>";
//----------------------------------
$printform .="</table>";
}
Find :
///////////////////////////////////////////////////////////////:
if (!$sendprocess) {
$remote_media_file = "";
$remote_thumb_file = "";
$image_name = "";
$image_description = "";
$image_keywords = "";
$image_download_url = "";
$image_allow_comments = 1;
}
$site_template->register_vars(array(
"cat_id" => $cat_id
ADD After
///////////////////////////////////////////////////////////////:
"printform" => $printform,
"nbr_pics" => $nbr_pics,