How to use the variables in "{}" eg:"{L_NOTIFICATIONS}" throughout my website/in different directories

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
bradhulk
Registered User
Posts: 33
Joined: Tue Sep 08, 2015 6:01 am

How to use the variables in "{}" eg:"{L_NOTIFICATIONS}" throughout my website/in different directories

Post by bradhulk » Wed Sep 16, 2015 3:45 pm

I am currently using this code as seen below to carry the session in my website

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
how would I be able th "echo" the phpbb variables in

Code: Select all

 "{}"
eg:

Code: Select all

{L_NOTIFICATIONS}
and use "{}" variables throughout my my website for instance in a different directory?
Last edited by Oyabun1 on Thu Sep 17, 2015 9:27 am, edited 1 time in total.
Reason: Moved from 3.1.x Support forum

User avatar
Lumpy Burgertushie
Registered User
Posts: 66730
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: How to use the variables in "{}" eg:"{L_NOTIFICATIONS}" throughout my website/in different directories

Post by Lumpy Burgertushie » Wed Sep 16, 2015 3:51 pm

each file would have to be a phpbb file with the required code at the top just like all of the phpbb files have.
your best thing would be to just use phpbb custom pages etc. for the rest of your website. like phpbb.com does.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

bradhulk
Registered User
Posts: 33
Joined: Tue Sep 08, 2015 6:01 am

Re: How to use the variables in "{}" eg:"{L_NOTIFICATIONS}" throughout my website/in different directories

Post by bradhulk » Wed Sep 16, 2015 3:54 pm

is there not a work around that I could use

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51865
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: How to use the variables in "{}" eg:"{L_NOTIFICATIONS}" throughout my website/in different directories

Post by Brf » Wed Sep 16, 2015 4:01 pm

phpBB Template variables are only parsed in phpBB templates. You would have to invoke the template from within a phpBB php script to have the variables parsed. You could not do that in a standard html file, browsed by a visitor's webbrowser.

bradhulk
Registered User
Posts: 33
Joined: Tue Sep 08, 2015 6:01 am

Re: How to use the variables in "{}" eg:"{L_NOTIFICATIONS}" throughout my website/in different directories

Post by bradhulk » Thu Sep 17, 2015 9:10 am

Is there no way that I could Invoke these variables outside of phpbb with php or something?

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: How to use the variables in "{}" eg:"{L_NOTIFICATIONS}" throughout my website/in different directories

Post by Oyabun1 » Thu Sep 17, 2015 9:27 am

The template variables are created and assigned values by the PHP code in phpBB. Their scope is limited to phpBB.

You could create and use template variables outside of phpBB by using something like the Twig template engine.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

bradhulk
Registered User
Posts: 33
Joined: Tue Sep 08, 2015 6:01 am

Re: How to use the variables in "{}" eg:"{L_NOTIFICATIONS}" throughout my website/in different directories

Post by bradhulk » Thu Sep 17, 2015 10:24 am

:) cool thats what I wanted to hear thanks

User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

Re: How to use the variables in "{}" eg:"{L_NOTIFICATIONS}" throughout my website/in different directories

Post by MuhClaren » Sat Sep 19, 2015 4:18 am

Lumpy Burgertushie wrote:<snip> your best thing would be to just use phpbb custom pages etc. for the rest of your website. like phpbb.com does.
robert
This is a good suggestion. It provides twig support without having to re-invent the wheel.

User avatar
Sniper_E
Registered User
Posts: 789
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: How to use the variables in "{}" eg:"{L_NOTIFICATIONS}" throughout my website/in different directories

Post by Sniper_E » Sat Sep 19, 2015 8:08 am

Isn't the {L_NOTIFICATIONS} he is asking about a language code? Defined in the language file?
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
:!: Sniper_E Styles | phpbbmodders :!:

Post Reply

Return to “Extension Writers Discussion”