How to get site URL

Sorry for this question, as I think it should be enough simple to find the answer, but quick look through search results didn't help me.

The question is, how can I get the URL of the site for use in my theme? I plan to use it like:

...

Comments

  • acrylian Administrator, Developer
    I don't understand what you mean. What site?
  • If the url of my website is http://mysite.com/smth/ (opening mysite.com doesn't give user anything), and I need to place links like
    a href="$mysiteurl/pages/page" or a href="$mysiteurl/something",

    how do I get $mysiteurl?

    Does this make sense?
  • acrylian Administrator, Developer
    First, why do you have `mysite.com/something` when `mysite.com` means nothing? Why don't you just use the root of your domain then? (Zenphoto can be installed in the root of course).

    Second, Zenphoto provides several functions to get these links (`$mysiteurl/pages/page` is a Zenpage page named "page" and `$mysiteurl/something` is an album named `something`).

    There are also some constants WEBPATH and SERVERPATH, or FULLSERVERPATH available:http://www.zenphoto.org/documentation/functions/_functions-basic.php.html
  • Post erased
  • acrylian Administrator, Developer
    @Michel: Why do you erase your post?
  • WEBPATH is just perfect.

    Thank you.
  • For "why do you need that, when you can just...", I'd say I'd like to have some extra transfer freedom. For example, now my site lives at demo.mysite.com/thesite and in several days it'll move to anothersite.com
  • acrylian Administrator, Developer
    Ok, I just didn't understand so I asked.
  • @acrylian,

    I had started to write something while you were writing your post. When I completed my entry, I noticed that your answer was better than mine.
Sign In or Register to comment.