Page 1 of 1
A nice feature might
Posted: 03 May 2008, 18:00
by pjdevries
A nice feature might be an automatic rename function when uploading multiple images. I am thinking of regular expressions that translates directory and file names into user friendly category and gallery image names. Can't be that hard to implement I think
I think will be not
Posted: 05 May 2008, 12:32
by Jan
I think will be not to hard, but it will be hard to find time for it
Can you give a few p
Posted: 05 May 2008, 16:02
by pjdevries
Can you give a few pointers where to look for? I'm quite occupied myself so I can't make any pro misses, but if I know where to look and it's not too complicated, I'll try to squeeze in a couple of minutes to see if I can implement it.
it starts with store
Posted: 05 May 2008, 16:11
by Jan
it starts with store function:
administrator\components\com_phocagallery\models\phocagallerym.php
hepers you find here:
administrator\components\com_phocagallery\helpers\phocagallery.php
Re: Auto renaming with batch upload
Posted: 23 Sep 2011, 09:25
by erioch
Hi,
I was able to hack the file in administrator\components\com_phocagallery\models\phocagallery.php to generate a random ID whenever the title is missing instead of picking the file name... Below is the hack approximately line 112 to 126...
Cheers
//If there is no title and no alias, use filename as title and alias
if ($data['title'] == '') {
//$random_number = rand (5,10000000) ;
$error = 1;
// this while clause will loop until it has a unique number
while ($error) {
$num = rand(0, 10000000);
if (mysql_num_rows(mysql_query("SELECT * FROM jos_phocagallery WHERE jos_phocagallery=$title")) != 0)
$error = 1;
else
$error = 0;
}
$data['title'] = 'image ID_00'.$num;
}
}
Re: Auto renaming with batch upload
Posted: 26 Sep 2011, 17:07
by Jan
Hi, thank you for the info.
Jan