Member
Member
RB26   22-12-2015, 17:14
#1

bonjour
could you tell me how get the current page url (zenpage, news, album, image)?
I didn't found the function
merci

Member
Member
RB26   22-12-2015, 17:36
#2

I've found: getRequestURI()
it is what I searched

Administrator
Administrator
acrylian   22-12-2015, 18:20
#3

Actually I think it would be better to use the object model, unless you want to do something specific. There are global variables available for all five main items (album, image, Zenpage page, news article and news category) that contain the object of the current item if in context:
$_zp_current_image, $_zp_current_album, $_zp_current_zenpage_page, $_zp_current_zenpage_news, $_zp_current_category
On an single image page both the album and image one are available naturally.

The object method getLink() will five you the url on all. Within functions you of course need to declare that global to be able to use it.

There are more such globals: http://www.zenphoto.org/news/zenphotos-global-variables

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