Hardcoding vs Not

Tris (or whoever)

What would be the best way to structure this URL to point to the current zenphoto install base rather than having to hardcode each time. It's getting a bit tedious with all these hardcoded links to have to change, and I thought you might have some advice. (e.g. would zp_themeroot work?)

An example URL would be (for my credits page):
`http://www.thinkdreams.com/zenphoto?p=credit`

How would you code that in PHP correctly for zenphoto to use it?

Comments

  • trisweb Administrator
    just a relative link like '?p=credit' should work; it'll always be index.php, right? And that will work in whatever folder it happens to be in.

    If you want the full path, use `<?php echo FULLWEBPATH . '/index.php?p=credit'; ?>` (edit: That may not work in 1.0.3. Darn, I should release 1.0.4 already...)

    What's changing about the link that you're worried about?
  • Well, it's when I was porting between my dev site and my main site that I noticed that the link was hardcoded with the full web path of http://www.thinkdreams.com/zenphoto, even though my dev sites root path was zensub. So I think the above answers my question that I was looking for. Just need to use relative pathnames instead.

    Thanks!
Sign In or Register to comment.