Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
0 + 6 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: How imagemanager not to randomize image filename?
by bjuti on 2012/11/28 19:57:49

It's all working fine, but I've found restriction od imagename of 24 chars. Is it possible to override it?
Re: How imagemanager not to randomize image filename?
by bjuti on 2012/11/28 16:14:53

It works! Tnx!
Re: How imagemanager not to randomize image filename?
by trabis on 2012/11/28 0:28:44

You need to make changes in file class/uploader.php

Line 354:
le="color: #000000"><?php if (isset($this->targetFileName)) { $this->savedFileName = $this->targetFileName; } else if (isset($this->prefix)) { $this->savedFileName = uniqid($this->prefix) . '.' . strtolower($matched[1]); } else { $this->savedFileName = strtolower($this->mediaName); }


If you want to use file name:
le="color: #000000"><?php if (isset($this->targetFileName)) { $this->savedFileName = $this->targetFileName; } else { $this->savedFileName = strtolower($this->mediaName); }

Will save as: 'the_file_name.jpg'

If you want to use both file name and prefix (you should use this to prevent overwrite an already existing image with the same file name):
le="color: #000000"><?php if (isset($this->targetFileName)) { $this->savedFileName = $this->targetFileName; } else if (isset($this->prefix)) { $this->savedFileName = strtolower(str_replace($matched[0], '', $this->mediaName) . '-' . uniqid($this->prefix) . $matched[0]); } else { $this->savedFileName = strtolower($this->mediaName); }

Will save as: 'the_file_name-img50b558777727d.jpg'
Re: How imagemanager not to randomize image filename?
by bjuti on 2012/11/27 18:26:23

Well it's not working.

It is working when I use system module image manager and upload picture from it. But when I click in eg. TinyMCE to add a picture it's stil img8746we8q.jpg or something.

Any idea, please?
Re: How imagemanager not to randomize image filename?
by bjuti on 2012/11/25 10:27:35

I've found it!

In file 'modules/system/admin/images/main.php'

remove or put under comment line 438:
le="color: #000000"><?php $uploader->setPrefix('img');

Who's Online

189 user(s) are online (150 user(s) are browsing Support Forums)


Members: 0


Guests: 189


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits