[Url Rewrite] title instead of file name

seedorf

Joined: 2007-08-21
Posts: 1
Posted: Tue, 2007-08-21 03:49

Hi,

My gallary 2.2 is running fine and [URL Rewrite] is working too. And by default, the auto-rewrite is set to define the permanant link as my file name. I am wondering how can I set it to "title" of the picture rather than the file name. Can anyone help? I'd very much apprecieate it.

Thanks a lot!


Gallery version (not just "2"):2.2
PHP version (e.g. 5.1.6):5.1.*
Webserver apache
Database (e.g. MySql 5.0.32):
Activated toolkits NetPbm,
Operating system OS X
Browser firefox 2.0

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2007-08-26 06:14

find parseFileName in modules/rewrite/classes/RewriteSimpleHelper.class .. this is where the replacement is done for %fileName% token. i don't think this part is actually used in retrieving DownloadItem urls (since the ID is in the url too), so you can probably change it..

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2007-08-26 12:36

it could actually break things. core.DownloadItem interprets the string after the id-serialNumber part as the filename. it doesn't allow any string that is different from the filename to prevent phishing / social exploits. but you can remove / change this check as well, of course.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
skunker

Joined: 2005-02-04
Posts: 344
Posted: Sat, 2007-10-13 04:16

Okay, this is exactly what I was asking in another thread, but no one replied. I found the 'parseFileName' as mindless suggested, but then what do I replace this with to get my photo title to print in the URLs instead of photo filename? Is there such a thing like %title% that I can replace the %filename% with?

So, valiant, do you not recommend I do this because of the downloaditem problem? You said I can remove/change this check...but can you tell me how? Give me a step by step, if possible. Thanks!