varible for website url

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
DanielT
Former Team Member
Posts: 3324
Joined: Tue Aug 27, 2002 10:55 am
Contact:

varible for website url

Post by DanielT » Sat Oct 05, 2002 11:11 pm

i just wanted to know for a mod im making is there a variable that holds the site url (eg. www.thissite.com/)

also it must be usable in the viewtopic.tpl


thanks

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic » Sat Oct 05, 2002 11:28 pm

i don't belive there is one that you could use in viewtopic.tpl

there is a number of ways you could add it...
  1. use the global servername variable $_SERVER_NAME
  2. use the cookie domain name variable $board_config['cookie_domain']
Defend the game:
Image

DanielT
Former Team Member
Posts: 3324
Joined: Tue Aug 27, 2002 10:55 am
Contact:

Post by DanielT » Sat Oct 05, 2002 11:31 pm

ah ok thanks i think they will do

:)

DanielT
Former Team Member
Posts: 3324
Joined: Tue Aug 27, 2002 10:55 am
Contact:

Post by DanielT » Sat Oct 05, 2002 11:33 pm

ohhh btw how do i put that in to a template

like the other variables
eg.
{SITENAME}
{SITE_DESCRIPTION}
{PAGE_TITLE}

?

thanks

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic » Sat Oct 05, 2002 11:44 pm

You'll have to add a variable to the template.

in viewtopic.php
find

Code: Select all

$template->assign_vars(array(
you want to add a line like

Code: Select all

'SITE_URL' => $board_config['cookie_domain'],
Defend the game:
Image

DanielT
Former Team Member
Posts: 3324
Joined: Tue Aug 27, 2002 10:55 am
Contact:

Post by DanielT » Sat Oct 05, 2002 11:46 pm

ok
thanks for all your help

off to get started on my mod..

DanielT
Former Team Member
Posts: 3324
Joined: Tue Aug 27, 2002 10:55 am
Contact:

Post by DanielT » Sat Oct 05, 2002 11:50 pm

ohh..
sorry to bother you

but is there a variable for the php root path

eg.

/phpbb/
/forum/


also is there a list of all the variables?... it would help me alot

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic » Sat Oct 05, 2002 11:55 pm

Yes, it's called $phpbb_root_path. I don't believe it's added to the templates anywhere though. Although you shouldn't need it, i would expect a '/' would do the trick, though i stand to be corrected ;)
Defend the game:
Image

Bananeweizen
Registered User
Posts: 46
Joined: Tue Sep 25, 2001 9:42 pm

Post by Bananeweizen » Sun Oct 06, 2002 1:05 pm

netclectic wrote: Yes, it's called $phpbb_root_path. I don't believe it's added to the templates anywhere though. Although you shouldn't need it, i would expect a '/' would do the trick, though i stand to be corrected ;)


Never assume anything in programming.

Ciao, Michael.

Post Reply

Return to “[2.0.x] MOD Writers Discussion”