Variable for URL to phpBB installation?

Discussion forum for MOD Writers regarding MOD Development.
Locked
microUgly
Registered User
Posts: 88
Joined: Sat Jun 02, 2007 5:35 am

Variable for URL to phpBB installation?

Post by microUgly »

I need to use a full URL (protocol, host and path) to a file in a module I'm writing. To make sure the module is portable I need to ensure the URL is correct on all installations of phpBB. Is there a variable that is set that I can for the host and path of phpBB that I can trust to always be correct?
microUgly
Registered User
Posts: 88
Joined: Sat Jun 02, 2007 5:35 am

Re: Variable for URL to phpBB installation?

Post by microUgly »

Ok, this is what I'm using

Code: Select all

$url = $config['server_protocol'].$config['server_name'].$config['script_path'];
I'm not sure if I'll need to check the value of $config['script_path'] to see if I need to append a "/" for when I extend the URL to include a file/folder.
User avatar
david63
Registered User
Posts: 19064
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Variable for URL to phpBB installation?

Post by david63 »

Have you tried using the generate_board_url() function?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
microUgly
Registered User
Posts: 88
Joined: Sat Jun 02, 2007 5:35 am

Re: Variable for URL to phpBB installation?

Post by microUgly »

That's exactly what I needed. Thanks.

Are these functions documented somewhere or is it just a matter of knowing where to look?
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Variable for URL to phpBB installation?

Post by A_Jelly_Doughnut »

There is some basic documentation at http://area51.phpbb.com - click on code documentation :)
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
Locked

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