|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Article Discussion: Building a Site Engine Using PHP, Part 3
In this third article of the series, I’ll show you how the database and directories should be set up. I’ll also talk about the how to create, install, and use a content block, which mostly relies on arrays and array functions. I'll cover proper authentication methods for such a project so that multiple sites can run off the same users table in the database, while not barring a username from being used on a site because it is being use on another, all the while keeping the authentication accurate and secure from break-ins. (For part 2, see here.)
Read the full article here: Building a Site Engine Using PHP, Part 3 Last edited by edwinbrains : June 28th, 2004 at 09:02 AM. |
|
#2
|
|||
|
|||
|
This is awesome
I've enjoyed this from part 1
One question though. In part 3, on page 3 and 4, there is code for the block system and authentication, respectively. What file should this code be in? I've examined part 3 several times and don't understand where this code should go yet. Will it be explained later on in part 4 or 5? Thank you ![]() |
|
#3
|
|||
|
|||
|
Yay
I have been waiting like two weeks for this... Hopefully the final two installments won't take so long... I can't wait to see how it ends *shudders at the suspense*
|
|
#4
|
|||
|
|||
|
I am hoping for clarification on where this code needs to go as well...
Can't wait for the rest of these articles. |
|
#5
|
|||
|
|||
|
Just a ditto from 'MRYERSE':
Having some experience with CMS systems, would page 3 be something like plug_in.blk.php and located in a sub-directory named BLOCKS under the plug-in directory? Then page 4 something like login.blk.php located in a sub-directory under an AUTH plug-in. Thanks! |
|
#6
|
|||
|
|||
|
php4
Hi, firstly great article I am really enjoying it.
Secondly, my question is, how difficult is it to change the engine to run on php4.?.? Not many webservers are currently running 5 and I would like to try out this engine but can't on php4. I understand the simpleXML requirement but I could use a template system such as smarty for that, it is the use of public in the classes that is the problem. Andy Last edited by andy_974 : June 29th, 2004 at 05:23 AM. Reason: typo |
|
#7
|
|||
|
|||
|
Print article and pdf messed up
The Print article does NOT fit to page and neither does the PDF print. Can you please fix this? Thanks.
|
|
#8
|
|||
|
|||
|
Variable count?
When discussing the block system you list 6 public variables. Then you state "As you can see, we'll use nine variables through out the blocks plug-in". Are ther 6 or 9? Thanks.
|
|
#9
|
|||
|
|||
|
php4
This is a very helpful series of articles!
I share the remarks made by Andy - how difficult would it be to adapt your work to use with php4? |
|
#10
|
|||
|
|||
|
Ok I'm by no means any kind of expert but I don't think that it would be very hard at all to port to php4, as far as the public and private variables go in the classes I don't think that these will break operation in PHP$ because I have noticed a lot of differnt scripts and cms's are using this method, Then like Andy said you could use smarty or a templating engine such as that to do the templates. There is a pretty vague but very good article on a simple but effective templating system at http://www.jvmultimedia.com which I think would work very well with a system like this, It's very similar to what InvisionBoard uses for there templates. Hope I didn't break off a lot of false info here. Just thought I would note that I have seen the new versions of other systems declaring variables in the same manner as the system covered in this tutorial and they appear to work fine with PHP4.
|
|
#11
|
|||
|
|||
|
the blocks plugin and the authorization plugin, are plugins, they should be named such as.. blocks.plug.php if you named it blocks.blk.php and put it in the blocks folder the engine would try to load it as a block of the interface, not a plug-in.
it could be ported with a custom template engine, because the engine is built to be quite dependant on the template engine it's built with. the entire thing was originally developed around the template engine. for the most part all you'd have to do to port it is change all the PUBLIC declairations to VAR and make an XML parser for the templates. I've never really worried about it, so i never took it in to consideration. however, php5 will be final soon, so if you hold on a bit server should be updateing soon. Also there may be a few built in functions that are new with php5, so be on the look out for those errors. There are actually 7 variables declaired with 6 on the list, which may have been an editing mistake. $this->cur_column is the one missing from the declairations. the other 2 are variables from other classes such as the $users->user variable which is declaired in the user class, not the blocks class. lol unless i'm missing 2 variables, theres only 7.. As for the printing and PDF, theres nothing I can do about it, but I can tell some one in the administration to see if they can take care of it. what part is it thats not fitting? I'd also like to add a note, this is a system that was built for my server, on my server. it wasn't originally made to work on anything other than my system. but i'm fairly confident that with a little time and love, it will work for you too. in the mean time i'll try to help as much as possible. Also if you want to talk to me on an instant messenger about it, just leave a post in the dissicussion and i'll work with you one on one when i have the ability to do so. |
|
#12
|
|||
|
|||
|
I am awaiting the final two articles in this series so I can get to hackin code because this system is just what I need for a project I am working on and was having a lot of trouble figuring out how I was going to do it. But I need my project to determin the site by a subfolder, url, or subdomain and was wondering how hard it would be for the admin to set how it detects the page and how I would go about all of that. If you feel more comfortable discussing it in an IM I use pretty much all of them but usually use yahoo which is
ImagiCreations Thanks for the great tutorial ![]() |
|
#13
|
||||
|
||||
|
I like the basic idea of your article. It's really well written, I enjoyed the read.
![]() A few things, though. I don't know why you use globals instead of parameters or why your classes lack a factory to pass variables to a class, instead of using global. Using global is not a security issue really (if the rest of it is clean), but I don't like to polute the HEAP with uncessary data. Just my two cents, Till
__________________
-- Till Klampaeckel http://www.HTMLCenter.com http://forums.HTMLCenter.com http://www.OOCenter.com If my posts are helpful, please me. ![]() |
|
#14
|
|||
|
|||
|
it's always been my style to do it this way, it works well for me, and has never produced any problems in the past.
|
|
#15
|
|||
|
|||
|
Once again, thank you jaimz for these articles.
So to make sure I follow, the blocks script should be in a plug in directory? So I have created a new dirctory under plugins named "blocks" and in this directory I have placed the "blocks.plug.php". Would this be the same as calling it "main.plug.php" to be consistent with the rest of the plugins? And the same question goes for the auth script. Can the main.plug.php be interchanged with "plugin_name.plug.php". I am sure these questions will become much more apparant as the articles countinue, just want to keep up. Thanks again. |
![]() |
| Viewing: Dev Shed Forums > Other > Development Articles > Article Discussion: Building a Site Engine Using PHP, Part 3 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |