Member
Member
aleks63   2013-10-25, 14:30
#1

Hi!

I have the same address: site.com/?album=XXX&image=YYY.png
Where YYY.png - the name of the file.
How to make a file name instead of the ID of this image?

Administrator
Administrator
acrylian   2013-10-25, 14:37
#2

[i]How to make a file name instead of the ID of this image?[/i]
You mean vice versa according to your topic title as this is what you have. Anyway, it is not possible.

Besides the url example is a non modrewrite link which is not really nice anyway.

Member
Member
aleks63   2013-10-25, 14:41
#3

Yes, I was wrong.

A friend asked me to help him with that. He says for him it is very important.
Help please.

Administrator
Administrator
acrylian   2013-10-25, 14:46
#4

It is not possible to use an id in the url. Zenphoto is file system based and requires the file name.

Member
Member
sbillard   2013-10-25, 16:23
#5

You can actually make a "tiny" url to the image by using the proper functions if that is what you mean. But maybe you just want a user friendly URL such as site.com/XXX/YYY. If so you need to be using mod_rewrite. There is an option for that, but maybe since it is apparently not set your server does not support it. (BTW, the "tiny" urls will not work without mod_rewrite either.)

Member
Member
aleks63   2013-12-19, 13:23
#6

I wanna make page of picture: http://site.com/album/image.jpg, where image.png - field to select from db, and i wanna replace it to ID: http://site.com/album/1

Administrator
Administrator
acrylian   2013-12-19, 15:59
#7

Sorry, not possible, not the way Zenphoto works. See above.

Member
Member
sbillard   2013-12-19, 18:59
#8

Not possible is of course meant as not without some programming work. It would be possible to filter the URL via a plugin and turn that link into the appropriate Zenphoto parameters internally.

But there would be some drawbacks--you could then never have an album where the name was simply digits.

Anyway, maybe a better approach to this is to describe what you want to accomplish. The URL you originally complained about is caused by not using mod_rewrite. If you enable mod_rewrite the links look much more friendly. Is that all you need to do or is there some intrinsic reason why the link needs to be a number?

Unless you enable mod_rewrite there is in fact no possible solution as there is no means of intervention by Zenphoto--all links must point to an actual file.

If you really want a link that looks like http://site.com/album name/# and your site supports mod_rewrite, a plugin can attach to load_request filter and provide the mapping.

Member
Member
aleks63   2013-12-19, 21:29
#9

which file contains rewrite (mod_rewrite) to page with a picture? in zenphoto-rewrite.txt it isn't!
for example i want to replace /{albumname}/{imagename}.{ext} to /{albumname}/images/{imagename}.{ext}

Administrator
Administrator
acrylian   2013-12-19, 21:38
#10

As my colleague explain it is not that simple. The urls are generally created internally and not by mod_rewrite direclty.

As already suggested maybe explain first why you need to do this actually. I mean is the "images" really needed as naturally an album may contain those?

Member
Member
aleks63   2013-12-19, 21:40
#11

It is clear that the inside, and in what file is it?

Member
Member
aleks63   2013-12-19, 21:47
#12

I replaced filename to ID.
But it only works without mod_rewrite: /?album={albumname}& image={imageid} - OK
And with mod_rewrite: /{albumname}/{imageid} - FAIL

Administrator
Administrator
acrylian   2013-12-19, 21:58
#13

It is strongely recommended to never modify a core file unless you want the fun to do it all over again with every update.

The proper way is creating a plugin as mentioned above.

Member
Member
aleks63   2013-12-19, 22:09
#14

If you do not take much of your time, you can write this plugin?
In order to address the album and the name of the image replaced by the ids respectively.
It does not take much time.

Member
Member
sbillard   2013-12-19, 23:02
#15

Please see: http://www.zenphoto.org/pages/paid-support

I should warn you that such customization does not come cheep. So if it is worth several hundreds of dollars for this feature make a request of one of the parties on the page.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.