Author Topic: how to replace "Image Name" with "Image File" name?  (Read 12353 times)

0 Members and 1 Guest are viewing this topic.

that Dude

  • Guest
how to replace "Image Name" with "Image File" name?
« on: March 20, 2005, 07:32:41 PM »
In the UPLOAD page - how do I set it up so that the Image Name automically get filled out by the Image File Name? Thanks.

Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: how to replace "Image Name" with "Image File" name?
« Reply #1 on: March 20, 2005, 11:06:15 PM »
like this:  :wink:

Code: [Select]
<form method="post" action="{url_member}" enctype="multipart/form-data" onsubmit="uploadbutton.disabled=true;">
  <input type="hidden" name="action" value="uploadimage" />
  <input type="hidden" name="cat_id" value="{cat_id}" />
  <table width="100%" border="1" cellspacing="0" cellpadding="1">
<tr>
  <td valign="top" class="head1">
<table width="100%" border="0" cellpadding="4" cellspacing="0">
  <tr>
<td colspan="2" valign="top" class="head1">{lang_user_upload}</td>
  </tr>
  <tr>
<td class="row1"><b>{lang_category}</b></td>
<td class="row1">{cat_name}</td>
  </tr>
  <tr>
<td class="row2" 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 class="row2">
  <b>Upload:</b><br />
  <input type="file" name="media_file" class="input" /><br />
  <span class="smalltext"><b>{lang_allowed_file_types}</b> {allowed_media_types}</span>
</td>
  </tr>
  <tr>
<td class="row1" valign="top"><b>{lang_description}</b></td>
<td class="row1">
  <textarea name="image_description" cols="30" class="textarea" rows="10" wrap="VIRTUAL">{image_description}</textarea>
</td>
  </tr>
  <tr>
<td class="row2" valign="top"><b>{lang_keywords}</b></td>
<td class="row2">
  <textarea cols="30" class="textarea" rows="3" wrap="VIRTUAL" name="image_keywords">{image_keywords}</textarea>
</td>
  </tr>
</table>
  </td>
</tr>
  </table>
   <p align="center"><input type="submit" name="uploadbutton" value="{lang_submit}" class="button" />
<input type="reset" value="{lang_reset}" class="button" /></p>
</form>

I simplyfied the member_uploadform.html so that the user does not have to enter the image_name and the image_filename is used for this...
MAяTRIX


that Dude

  • Guest
Re: how to replace "Image Name" with "Image File" name?
« Reply #2 on: March 20, 2005, 11:52:31 PM »
Thank you for your quick response. My problem is not the page layout using html. The problem is regardless whether I keep an "Image Name:" field or not, without filling out that filled 4images doesn't allow me to upload any images. It gives me an error saying "Please fill out the Image Name field!” I think I have to set up a condition for it to take the "Image File" name as "Image Name", I just don't know where.

Also when an unregistered guest tries to upload images it get's stuck, it doesn't upload anything (even though I gave authorization for an unregistered guest to upload in that section)!

Any help will be appreciated. Thanks

Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: how to replace "Image Name" with "Image File" name?
« Reply #3 on: March 21, 2005, 12:44:11 AM »
well, yes - sorry I forgot to mention, that you have to comment these lines in member.php

Code: [Select]
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;
  }


so it should look like this:

Code: [Select]
//  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;
//  }

I guess that could do the trick...
MAяTRIX


that Dude

  • Guest
Re: how to replace "Image Name" with "Image File" name?
« Reply #4 on: March 21, 2005, 07:55:21 AM »
Thank you martrix. It worked.

that Dude

  • Guest
Re: how to replace "Image Name" with "Image File" name?
« Reply #5 on: March 22, 2005, 05:56:41 PM »
Now how can I do the same thing for the Admin "Add Images" screen. I mean the one in control panel? So in the absence of "Image Name" the system uses the "Image File" name.

Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: how to replace "Image Name" with "Image File" name?
« Reply #6 on: March 22, 2005, 09:34:57 PM »
I don't know - I did not feel the need to change that in the admin-section, because if I'd like to upload more pics at once and don't want to bother about the name, then I use FTP  8)
MAяTRIX


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: how to replace "Image Name" with "Image File" name?
« Reply #7 on: March 23, 2005, 12:16:10 AM »
I don't know - I did not feel the need to change that in the admin-section, because if I'd like to upload more pics at once and don't want to bother about the name, then I use FTP 8)
I agree. In my oppinion image upload in ACP is useless...;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

that Dude

  • Guest
Re: how to replace "Image Name" with "Image File" name?
« Reply #8 on: March 23, 2005, 05:35:36 AM »
Thank you all for your response. I am working on a group website which is in my friend's server space so our domain is a sub-domain. The host provider allows only one ftp access and I don't feel comfortable asking him for the ftp password, as he is running his personal site in the same server space.

That’s why I was looking for the mod. I guess I will have live with the problem.

One of my classmates was using the method that I was looking for. He got all the information as far as how to modify the mod - from this board but I couldn't find the posting anywhere and my friend didn't remember the process either.

Anyway, thanks.

Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: how to replace "Image Name" with "Image File" name?
« Reply #9 on: March 23, 2005, 07:53:14 AM »
Did you ask the host-provider explicitly?

My also "allows" only one FTP account, but when I asked for another one to a specific category (to be sure, that nobody may cause any harm, when I give the id and pass out) he opened another account without any problem  :o
MAяTRIX