does phpbb use SMARTY ? {}?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
numerical25
Registered User
Posts: 23
Joined: Sat Jul 05, 2008 5:52 am

does phpbb use SMARTY ? {}?

Post by numerical25 » Mon Jul 07, 2008 2:42 am

I notice that alot of the templates use {} brackets. I know that SMARTY uses brackets to parse data into the page. Is it smarty or something that PHPBB made up ? either or, how do I declare those varibles and where would be the best suitable place to put declared varibles. ?

numerical25
Registered User
Posts: 23
Joined: Sat Jul 05, 2008 5:52 am

Re: does phpbb use SMARTY ? {}?

Post by numerical25 » Mon Jul 07, 2008 3:02 am

OK, i dont think its SMARTY but i did find out where they declare the varibles. At data_globals.php . but its not saving my declaring varibles. it keeps reseting the code back to the orignal. which makes me believe i cant hardcode code in the data_globals.php. Is there another way to implement varibles ?? is there a language page where i can declare varibles through a interface or possibly turn off the setting that makes the document reset ?

User avatar
david63
Registered User
Posts: 16321
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: does phpbb use SMARTY ? {}?

Post by david63 » Mon Jul 07, 2008 11:58 am

If you look in the docs folder > authors you will see that there is an acknowledgement to Smarty so it is using some of Smarty code.

From memory data_globals.php is in the cache folder so making changes in there will never be permanent. I am not sure why you want to declare variables in this way - they are usually done as and when needed but you could always put them in an include file somewhere.
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

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

Re: does phpbb use SMARTY ? {}?

Post by Brf » Mon Jul 07, 2008 12:00 pm

Yes. If you want a template tag to be available on every page, you should declare it in includes/functions.php, in the page_header function.

numerical25
Registered User
Posts: 23
Joined: Sat Jul 05, 2008 5:52 am

Re: does phpbb use SMARTY ? {}?

Post by numerical25 » Mon Jul 07, 2008 2:12 pm

so would I do that by throwing it in the assign_vars() function in the include functions directory. cause I did it and its not working at least when i try to call it like this {varible}

Code: Select all

page_header($user->lang['LOGIN']);

	$template->assign_vars(array(
		'S_HIDDEN_FIELDS'		=> build_hidden_fields(array('f' => $forum_data['forum_id'])),
 'varible' => 'hell0') /*right here*/
	);

	$template->set_filenames(array(
		'body' => 'login_forum.html')
	);

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

Re: does phpbb use SMARTY ? {}?

Post by Brf » Mon Jul 07, 2008 2:55 pm

Your template tags should be upper-case.

Also, you are putting it in the login_forum_box() function, rather than the page_header() function.

Locked

Return to “[3.0.x] Support Forum”