I want to add a variable to the following($eid). Problem is that rewrite_path adds it as the last item. so it will not show the images(image context). whats the workaround.
This: rewrite_path("/" . pathurlencode($albumname) . "/", "/index.php?album=" . urlencode($albumname)."&id=$eid");
Results to :
http://localhost/Zenphoto/index.php?album=poly-parent/subalbum-ya-poli&image=262.jpg&eid=86when i exchange the &eid=86, it works.
Comments
Anway, you nede to do it differently for both url types:
- nonmodrewrite: &eid=123
- modrewrite: ?eid=123
For example: rewrite_path("/" . pathurlencode($albumname) . "/", "/index.php?album=" . urlencode($albumname)."&id=90");
Results in: http://localhost/Zenphoto/index.php?album=poly-parent/subalbum-ya-poli&image=262.jpg&eid=90
Required output: http://localhost/Zenphoto/index.php?album=poly-parent/subalbum-ya-poli&eid=90&image=262.jpg
That is my variables should come before 262.jpg to display images correctly. They dont
Regards all
Jackson
Why do you need to pass the parent's album via the url at all when you can get it easily via the object model?
Query parameters (what you are trying to set with the "&eid=xxx" must always follow the url, so indeed they go at the end of the url when mod_rewrite is in effect.
If mod_rewrite is not set it makes absolutely no difference what order the query parameters are in--infact, unless you analize the $_SERVER array you will not even know the order.
So just exactly why is this a problem for you? Anyway, if it is a problem you just have to manually create the url. Or use acrylian's suggestion and retrieve the id from the object model and don't pass it at all.