So I noticed that when a member does not add a name to thier uploaded image, it uses the imags defult name.... what I end up seing is 35+ characters in the file image name.
Then, what this does is break the layout in members profile and other misc. mods that use tables.
things start looking wacky.
Is there a way to automaticly shorten these long names when they get uploaded?
like say cut it off at 10 characters, for example...
SOLVED FAP CUSTOMIZATION - Shorten Auto Character Length Name
Subject: FAP CUSTOMIZATION - Shorten Auto Character Length Name
Last edited by Pete_Z on Sat 02 Feb, 2008 11:55; edited 1 time in total
Last edited by Pete_Z on Sat 02 Feb, 2008 11:55; edited 1 time in total
Subject: Re: Shorten Auto Character Length Name
See if this will give you the result you are seeking....
OPEN album_mod/abum_functions.php
FIND (2 separate places)
BEFORE ADD (2 separate places)
OPEN album_mod/abum_functions.php
FIND (2 separate places)
BEFORE ADD (2 separate places)
Subject: Re: Shorten Auto Character Length Name
Your welcome Pete_Z....err I mean buldo :icy_lol_flag:
Subject: Re: Shorten Auto Character Length Name
Last edited by Pete_Z on Tue 12 Feb, 2008 11:38; edited 1 time in total
No no, I read you a coulple days ago, I wasn't able to test yet and give feed back.
What happned was that it kept my titlels short no matter what. ie: uploading. Would it be easier to prevent an upload with javascript when there is no title added?
What happned was that it kept my titlels short no matter what. ie: uploading. Would it be easier to prevent an upload with javascript when there is no title added?
Artie wrote: [View Post]
Last edited by Pete_Z on Tue 12 Feb, 2008 11:38; edited 1 time in total
Subject: Re: Shorten Auto Character Length Name
Not a problem Pete_Z, I meant nothing personal. It was just my attempt at humor. :mrblue:
It shouldn't be difficult to make the title input mandatory using either php or js.
It shouldn't be difficult to make the title input mandatory using either php or js.
Subject: Re: Shorten Auto Character Length Name
Yeah it would probably be easier to have a manditory name then to use huge file name extention as a name... I am experimenting with javascript, but I can not have two onsubmit's in one forum... unless i am doing something wrong.
Where exactly can I find the code inside {S_ON_SUBMIT} ? Maybe I can fit the javascript in there...
onsubmit="return validate_form(this);"
album_upload_body.tpl
I even tried using two
Well if anyone reads this and wants to share ideas please post. :mrorange:
Source
http://www.w3schools.com/js/js_form_validation.asp
Where exactly can I find the code inside {S_ON_SUBMIT} ? Maybe I can fit the javascript in there...
onsubmit="return validate_form(this);"
album_upload_body.tpl
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{
alert(alerttxt);return false;
}
else
{
return true;
}
}
}
</script>
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{
alert(alerttxt);return false;
}
else
{
return true;
}
}
}
</script>
I even tried using two
<form name="upload" action="{S_ALBUM_ACTION}" method="post" onsubmit="return validate_form(this)">
<form name="upload" action="{S_ALBUM_ACTION}" method="post" enctype="multipart/form-data" onSubmit="{S_ON_SUBMIT}">
<form name="upload" action="{S_ALBUM_ACTION}" method="post" enctype="multipart/form-data" onSubmit="{S_ON_SUBMIT}">
Well if anyone reads this and wants to share ideas please post. :mrorange:
Source
http://www.w3schools.com/js/js_form_validation.asp
Subject: Re: Shorten Auto Character Length Name
Javascript is not my strong suit (neither is php for that matter), but from what I can tell the js function for the form validation already exist......
It seems only to check for a title when your ACP setting is limited to 1 pic upload at a time. If you allow multiple uploads then it does not check for title input.
In the upload tpl file if you place var gFileuploadCounter = 1; just after
function checkAlbumForm()
{
it will test for title input always ... of course this may cause other problems .... dunno
In answer to you question the code for {S_ON_SUBMIT} is in album_upload.php and is return(checkAlbumForm()) unless you have nuffload enabled.
Hope this helps 8)
It seems only to check for a title when your ACP setting is limited to 1 pic upload at a time. If you allow multiple uploads then it does not check for title input.
In the upload tpl file if you place var gFileuploadCounter = 1; just after
function checkAlbumForm()
{
it will test for title input always ... of course this may cause other problems .... dunno
In answer to you question the code for {S_ON_SUBMIT} is in album_upload.php and is return(checkAlbumForm()) unless you have nuffload enabled.
Hope this helps 8)
Subject: Re: Shorten Auto Character Length Name
doh.... a big Homer Simpson doh! ... thank you Artie.. it works. Yes I just now tryed it. it does exactly what I wanted it to do.
thanks!
thanks!
Page 1 of 1
You cannot post new topicsYou cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Generation Time: 0.1155s (PHP: 15% SQL: 85%)
SQL queries: 10 - Debug Off - GZIP Enabled