Apologies in advance - this seems like something that would have been asked many times before but my searches were not fruitful.
I would like to adopt the filename as the title of an image if no title has been specified. I see that this can be done using the admin tools after the fact, but no setting to use this rule on upload. I swear I'd seen that somewhere before.
Why: I'm streaming via RSS and by default, most of my images have no titles. This looks odd in an RSS reader, and I'd like to at least output something.
Any help pointing me to the answer would be appreciated.
Cheers,
Pete
include/picmgmt.inc.php
$title = $title ? $title : $filename;
Just after the globals should do the trick.
Quote from: Nibbler on January 10, 2005, 07:09:28 PM
include/picmgmt.inc.php
$title = $title ? $title : $filename;
Just after the globals should do the trick.
I do'nt understand what you mean by the "glbals". would you please point it out? Thank you
look in the file for the word global. "global" is a declaration statement that makes those variables available on a global scope.
Hi !
there are two sections related to "alobal":
(1)
// Add a picture to an album
function add_picture($aid, $filepath, $filename, $title = '', $caption = '', $keywords = '', $user1 = '', $user2 = '', $user3 = '', $user4 = '', $category = 0, $raw_ip = '', $hdr_ip = '',$iwidth=0,$iheight=0)
{
global $CONFIG, $ERROR, $USER_DATA, $PIC_NEED_APPROVAL;
global $lang_errors;
$title = $title ? $title : $filename;
and
(2)
* @return 'true' in case of success
*/
function resize_image($src_file, $dest_file, $new_size, $method, $thumb_use)
{
global $CONFIG, $ERROR;
global $lang_errors;
$title = $title ? $title : $filename;
$imginfo = getimagesize($src_file);
and I put $title = $title ? $title : $filename; in both sections. Is it correct ?
Great ! It seems work! How about batch_add files? It also works ?
Quote from: wbc on January 27, 2005, 11:49:00 AM
and I put $title = $title ? $title : $filename; in both sections. Is it correct ?
It's probably only needed once, but tt least it won't hurt if it's in there twice.
Quote from: wbc on January 27, 2005, 11:49:00 AMGreat ! It seems work! How about batch_add files? It also works ?
No, the batch-add is not controlled by upload.php, but by searchnew.php
Joachim
so, how to do it for batch_add ????
Great ! It also work for batch_add !
but there is a problem that there are ***.jpg(file type), .jpg can't be removed !
Can it be removed?
How ?
Thank you.
I don't understand your question, please re-phrase and use more words - a screenshot might help as well to illustrate your problem.
Joachim
hi - is there any way to make this change to image already uploaded?
Use admin tools.
I found something that shows the filename in an info box under the pic, that will do, thanks.