Building a Site Engine with PHP, Part 4 - The Final Words (
Page 4 of 4 )
It’s not hard to create your own tags; all you have to do is send them to the
array of tags. Here’s a small example, if you wanted tags that will show the date
and time -- all you’d have to do is put in the following code, after you’ve declared
the template class.
$template->tags['date']=date("l F, j Y");
$template->tags['time']=date("g:i:sa");
Then anywhere you have the tag that looks like <!date>, it will show the date
like this: Thursday June, 10 2004, and the <!time> tag will show the time like
this: 2:17:04pm. On top of that a tag can show anything -- a tag can be an include,
a string, even an image. For example, if you do this $template->tags['test']="foo";
the tag <!test> will show the word “Foo”. It’s pretty cool if you ask me.
To add columns to your layout, all you have to do is add them to the template
file named column4, column5 and so on.
Well that’s about it for this article. In the fifth and final article I’ll show
you what you need to do to add plug-ins , modules, and blocks to the engine.
| | Discuss Building a Site Engine with PHP, Part 4 | | | | | | | Suddenly the code is no longer indented. Is there a whitespace issue with PHP5 that... | | | | | | I agree, this part 4 was really a disappointment.
Hope the finale is a... | | | | | | I must agree with the above commments.
Since part 3 the quality of the articles has... | | | | | | I hope things gets easier to understand when I've read the full article.
As posted... | | | | | | in article 3: where do I have to put the blocks and authentification plug-ins?
in... | | | | | | IN article 3:
You have code for two different plugins, "auth" and "blocks".
Now... | | | | | | what about the replace() function? where do i have to put it?
... and that... | | | | | | the load_template() function tells you exactly where your xml file... | | | | | | I plan on rewriting this article due to the fact that it's a new writing style... | | | | | | >AND yes, if you read all the articles with attention, you'd know what to do with... | | | | | | First off, I don't consider myself an extremely knowledgeable user of PHP. That... | | | | | | "What are the file names of the Templates and XML plug-ins?"
"... and XML class... | | | | | | It's like trying to plug an episode of Jerry Springer
into Oprah show, they might... | | | | | | Has anyone tried this yet? I know some are dissapointed, but I think that it's... | | | | | | Ok, well Im treating this article as a guide to how to do it. I dont run PHP5 so I... | | | | | | I agree that a download of the sample code would be FANTASTIC. I think that would... | | | | | | Yeah thats pretty much it really, not the hardest thing I'll have done this month... | | | | | | this IS a guide on how to do it, this isn't a "heres the source code for a finished... | | | | | | I would like to thank you for writing these articles, the quality is going down a... | | | | | | I'll say that- it got me thinking. Overall this has been a big eye-opener to me, as... | | | | | | That is great that you the system up and running. Would it be possible for you to... | | | | | | why would the sql function (inside sql.inc.php) not have any arrguments. I couldn't... | | | | | | To get the sql function to work declare $config global in the function sql()... | | | | | | This is my current core.inc.php, shows the changes made to support the sql inc... | | | | | | So maybe you can add source to download ? with all files and mysql dump? | | | | | | Thanks a bunch Simon. That seems to clear it all up. It’s nice to see some progress... | | | | | | Well I made some progress on the parser today, it seems to do what the simpleXML... | | | | | | simon ...wow... only 3 weeks... could you share with us what tutorials/books you've... | | | | | | I'd really like to see a completed source package also. | | | | | | as would I! | | | | | | Well I dont have any PHP books, the online suport at php.net is very good as it is,... | | | | | | a complete working package would be very helpful to understand how it works | | | | | | The author made a comment saying he didn't want this to be a "heres a site download... | | | | | | you read my mind :) | | | | | | I'm studying this articles for a couple of hours and i have a question.
You... | | | | | | Any thoughts on the above comment? | | | | | | I don't think that these articles should be always targeted toward beginners. If you... | | | | | | Exactly, this is a guide, a tutorial. If you just want to download a working CMS,... | | | | | | you can make them yourself in your core.inc.php
this is my... | | | | | | you can write small modules which creates an instance of the plugin
Lets look at... | | | | | | Hi Simon,
Ive been having some problems getting your PHP4 simple xml parser... | | | | | | >>> Post your comment now! | | | | | |
|
 |
|