Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 28th, 2004, 08:36 AM
Admin Admin is offline
Developer Shed
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2004
Posts: 961 Admin User rank is Sergeant Major (2000 - 5000 Reputation Level)Admin User rank is Sergeant Major (2000 - 5000 Reputation Level)Admin User rank is Sergeant Major (2000 - 5000 Reputation Level)Admin User rank is Sergeant Major (2000 - 5000 Reputation Level)Admin User rank is Sergeant Major (2000 - 5000 Reputation Level)Admin User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old June 28th, 2004, 01:17 PM
mryerse mryerse is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Washington State
Posts: 2 mryerse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #3  
Old June 28th, 2004, 04:28 PM
altbs altbs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Ligonier, IN
Posts: 82 altbs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 48 sec
Reputation Power: 5
Send a message via AIM to altbs Send a message via MSN to altbs Send a message via Yahoo to altbs
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*

Reply With Quote
  #4  
Old June 28th, 2004, 09:12 PM
alexzaviar alexzaviar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Colorado
Posts: 2 alexzaviar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 39 sec
Reputation Power: 0
Red face

I am hoping for clarification on where this code needs to go as well...
Can't wait for the rest of these articles.

Reply With Quote
  #5  
Old June 29th, 2004, 02:38 AM
PbSO4 PbSO4 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 28 PbSO4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Just a ditto from 'MRYERSE':
  1. Great Article
  2. What are the file names and locations

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!

Reply With Quote
  #6  
Old June 29th, 2004, 05:22 AM
andy_974 andy_974 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 andy_974 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #7  
Old June 29th, 2004, 08:55 AM
gcfmaf gcfmaf is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 2 gcfmaf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #8  
Old June 29th, 2004, 09:10 AM
gcfmaf gcfmaf is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 2 gcfmaf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #9  
Old June 29th, 2004, 10:02 AM
dunker dunker is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 dunker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #10  
Old June 29th, 2004, 07:30 PM
altbs altbs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Ligonier, IN
Posts: 82 altbs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 48 sec
Reputation Power: 5
Send a message via AIM to altbs Send a message via MSN to altbs Send a message via Yahoo to altbs
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.

Reply With Quote
  #11  
Old June 30th, 2004, 12:06 AM
jaimz jaimz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 23 jaimz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 10 sec
Reputation Power: 0
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.

Reply With Quote
  #12  
Old June 30th, 2004, 07:45 AM
altbs altbs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Ligonier, IN
Posts: 82 altbs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 48 sec
Reputation Power: 5
Send a message via AIM to altbs Send a message via MSN to altbs Send a message via Yahoo to altbs
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

Reply With Quote
  #13  
Old June 30th, 2004, 10:57 AM
Klimpong's Avatar
Klimpong Klimpong is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Berlin, Germany
Posts: 350 Klimpong User rank is Private First Class (20 - 50 Reputation Level)Klimpong User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 10 h 5 m 14 sec
Reputation Power: 8
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.

Reply With Quote
  #14  
Old June 30th, 2004, 01:33 PM
jaimz jaimz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 23 jaimz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 10 sec
Reputation Power: 0
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.

Reply With Quote
  #15  
Old June 30th, 2004, 07:06 PM
alexzaviar alexzaviar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Colorado
Posts: 2 alexzaviar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 39 sec
Reputation Power: 0
Red face Just to make sure I follow

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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDevelopment Articles > Article Discussion: Building a Site Engine Using PHP, Part 3


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread: