I am totally new to php, I would like to teach myself the language by jumping in head first and doing a project; but of course as a newb I dont know where to begin.
I would like to use templates and a language file much like phpBB does; that way I could change one file and have it control several others.
phpBB does something like > 'L_TOPICS' => $lang['Topics'], in the php pages and the variable is referenced from a lang_main.php file. The templages use {TOPICS} pulling again from the language file. My problem again as a newb I have not been able to decipher where and how they are calling in the info.
So I am looking for a jumpstart ... if anyone who has an extra minute or two to mentor another newbie and understands what I am attempting to accomplish could please provide me with much needed guidance I would greatly appreciate it.
Thanks.
Not another Newb!
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
This task is probably a bit, maybe more, over the head of most newbs. However if you insist, phpBB uses a variant of the Smarty template engine. The "{TOPICS}" are template variables passed in via calling one of several assignment functions that the template class provides. phpBB often calls Template::assign_vars() and Template::assign_block_vars() which fill in data for those template variables you see in the templates.
Google "introduction tutorial php" and/or buy a good introductionary php book, like PHP for the world wide web from Larry Ulman. If you start to understand the basics, you can check out the many code examples and tutorials on these forums. Then when you start to write your own scripts, post them here and there might be people who can take a look at your code.
Good luck!
[edit:] I'm definately have to learn to type faster if I ever want to keep up with feyd
o well, i'd better not even try 
Good luck!
[edit:] I'm definately have to learn to type faster if I ever want to keep up with feyd
I figured I would get a RTFM response or two
...
I would much rather jump right in and start coding, I seldom read manuals, new game - play it, new desk build it, you know learn as I go. Sure I end up playing for a few more hours, or end up with spare screws, but I learn from those mistakes and the second time around I get it perfect.
Another angle of what I want to accomplish > I want to have my php filex (index.php) for example use template files (index_header.tpl) && (index_footer.tpl) etc; and have those templates reference {WORD123} {WORDXYZ} variables from a language file (mysite_language.php) ...
I shall look into this smarty engine. Thanks.
I would much rather jump right in and start coding, I seldom read manuals, new game - play it, new desk build it, you know learn as I go. Sure I end up playing for a few more hours, or end up with spare screws, but I learn from those mistakes and the second time around I get it perfect.
Another angle of what I want to accomplish > I want to have my php filex (index.php) for example use template files (index_header.tpl) && (index_footer.tpl) etc; and have those templates reference {WORD123} {WORDXYZ} variables from a language file (mysite_language.php) ...
I shall look into this smarty engine. Thanks.
matthijs wrote:you're welcomeI figured I would get a RTFM response or two![]()
Anyway, don't forget to at least read about security issues before putting scripts on a live server. You don't want your pages be hacked/misused/etc etc
if you use any SQL that is passed from users,make sure you read about SQL injection.