Reply
Making a PHP based CMS
Old 06-30-2009, 04:36 PM Making a PHP based CMS
Joshy D's Avatar
Extreme Talker

Posts: 178
Name: Josh
Trades: 0
So heres the thing. For my computing summer project Ive been asked to create a simple PHP based CMS.

So i need:
to add/edit/delete pages/sections/news-articles.
and i need obviously login security.
basic template controls.

cant think of anything else atm.


BUT HERES THE THING, IVE NEVER DONE PHP BEFORE.

now i will follow tutorials etc to learn it but can anyone link me to a 'crash-course' on the basics of PHP.
like, how PHP works, so what different things do. like ive noticed the $ comes up alot, what does that do etc... etc...

thanks.

(and i know, harsh tutor or what)
__________________
Personal UK Webhosting
Joshy D is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 06-30-2009, 04:50 PM Re: Making a PHP based CMS
thomasfrank09's Avatar
Experienced Talker

Posts: 44
Name: Thomas Frank
Trades: 0
If you've got 25 bucks, grab a used copy of Head First PHP and MySQL at Amazon.com. I love it's approach to teaching. If you're looking for free online stuff, check out the PHP intro tutorial at W3Schools. Also, if this forum isn't helping you, you might also try PHPtalk. It's more focused, so you might get faster help.

All that said, you'll need to be learning at a pretty hardcore pace to make a CMS from scratch over the summer, if you truly want to understand PHP.

BUT, I did find this video on Youtube http://www.youtube.com/watch?v=Mm-cndhvkEA&feature=fvw. Haven't watched it yet, but it's a series on how to make a PHP based CMS, if you really just want a crash course.
__________________
Radiant Web Design - my website design company
thomasfrank09 is offline
Reply With Quote
View Public Profile
 
Old 06-30-2009, 05:01 PM Re: Making a PHP based CMS
Joshy D's Avatar
Extreme Talker

Posts: 178
Name: Josh
Trades: 0
Awesome, thank you very very much.

Okay, yeah, i know... gunna spend every waking moment doing it i think.

I would love to 'truly understand PHP' but for the summer i only want to understand what i need to understand cause thats what gunna get me the grade.

So thank you for all your advice, i will look into that book and try finding it at a discount as i dont have a job anymore and so im broke aswell. isnt life just swell.

ok, thanks.
__________________
Personal UK Webhosting
Joshy D is offline
Reply With Quote
View Public Profile
 
Old 06-30-2009, 05:12 PM Re: Making a PHP based CMS
thomasfrank09's Avatar
Experienced Talker

Posts: 44
Name: Thomas Frank
Trades: 0
Dude just donate plasma haha
__________________
Radiant Web Design - my website design company
thomasfrank09 is offline
Reply With Quote
View Public Profile
 
Old 06-30-2009, 07:25 PM Re: Making a PHP based CMS
orionoreo's Avatar
Extreme Talker

Posts: 238
Name: Jerry
Trades: 0
w3 school is a great way to learn. It takes a lot of testing and trying to learn coding but if you have another programming background then its a lot easier to pickup... good luck!
orionoreo is online now
Reply With Quote
View Public Profile
 
Old 07-01-2009, 05:58 AM Re: Making a PHP based CMS
Super Talker

Posts: 120
Name: vikas
Trades: 0
google some basic example you can also download some code
__________________
Free Online Books Collection of free online books and free ebooks |Online pdf Books - Free online pdf books and free pdf eBooks
vikas1234 is offline
Reply With Quote
View Public Profile
 
Old 07-01-2009, 11:50 AM Re: Making a PHP based CMS
Lashtal's Avatar
PHP Learner

Posts: 480
Name: Lashtal
Trades: 0
1) watch videos, you will learn faster. (at least I do)

2) go to hotscripts.com and search for "CMS" or "Content Management System" in the PHP section of the search bar, and reference scripts that have already been made, so you can get a feel for what you need to do include (and how you might wish to go about doing it)

3) if you prefer to read books versus watch vids, you can always use scribd.com (use their search feature, you will find tons- but I recommend vid tutorials if you are on a time frame)

4) here's a good short answer on that $ question of your's: http://wiki.answers.com/Q/What_is_th...ar_sign_in_php

5) perhaps after you have finished making this script, you can sell it for mass-distribution, or create a site for it and distribute it feely to the opensource community

Curious: what programming language(s) are you already familiar with?
__________________
AmandaRodrigues.com
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 07-01-2009, 01:12 PM Re: Making a PHP based CMS
angele803's Avatar
Perfectly Imperfect

Posts: 1,766
Name: Stephanie
Location: Oklahoma
Trades: 2
They are asking you to create a CMS with PHP, but they aren't teaching you PHP??? I don't understand...

Anyway, check out this screencast series on diving into php: http://blog.themeforest.net/screenca...-video-series/

It might help. Good luck!
__________________
Webmaster-Talk Rules
angele803 is offline
Reply With Quote
View Public Profile
 
Old 07-06-2009, 03:19 AM Re: Making a PHP based CMS
Average Talker

Posts: 25
Name: Prithwiraj Bose
Location: Kalyani, West Bengal, India
Trades: 0
Whenever the concept of section/category and template arrive, the CMS doesn't remain easy any more. You should have thorow knowledge in PHP, MySQL, Apache and Smarty for developing such CMS.
__________________
Web Hosting Company in Kolkata | Cheap Web Design
Professional Website developer | Become a Domain Registrar for Free.
techbongo is offline
Reply With Quote
View Public Profile
 
Old 07-06-2009, 07:47 AM Re: Making a PHP based CMS
Joshy D's Avatar
Extreme Talker

Posts: 178
Name: Josh
Trades: 0
Quote:
Originally Posted by angele803 View Post
They are asking you to create a CMS with PHP, but they aren't teaching you PHP??? I don't understand...

Anyway, check out this screencast series on diving into php: http://blog.themeforest.net/screenca...-video-series/

It might help. Good luck!
I know right, makes no sense, everyone else is staying with VB but ,e and 1 other person was personally asked to do PHP, he's done PHP before, I haven't, we are both making a CMS but he won't help me. I have 3 weeks left before I go away.

Im thinking for security I might use a pre-made login script and jsut tell them I have done that then make the rest my self using all the tutorials and stuff you guys have given me. Thank you all.

First problem, (really small thing, but with no experience its got me baffled for a minute) is:
EDIT: PROBLEM SOLVED. DONT ASK ME HOW. I JUST DID EXACTLY THE SAME THING AGAIN.

Code:
   /* Class constructor */
   function MySQLDB(){
      /* Make connection to database */
      $this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());
      mysql_select_db(DB_NAME, $this->connection) or die(mysql_error());
      
      /**
       * Only query database to find out number of members
       * when getNumMembers() is called for the first time,
       * until then, default value set.
       */
      $this->num_members = -1;
      
      if(TRACK_VISITORS){
         /* Calculate number of users at site */
         $this->calcNumActiveUsers();
      
         /* Calculate number of guests at site */
         $this->calcNumActiveGuests();
      }
   }
This is following a tutorial on secure login script.

But that bit in red, when I fill in the details for DB_SERVER DB_USER DB_PASS and DB_NAME i get this error:
Code:
Parse error: syntax error, unexpected ')' in /home/jdavison/public_html/include/database.php on line 24
the red line being line 24.

there is clearly no unexpected ')' anywhere so what is it actually complaining about.
__________________
Personal UK Webhosting

Last edited by Joshy D; 07-06-2009 at 07:55 AM..
Joshy D is offline
Reply With Quote
View Public Profile
 
Old 07-06-2009, 07:48 AM Re: Making a PHP based CMS
Joshy D's Avatar
Extreme Talker

Posts: 178
Name: Josh
Trades: 0
Quote:
Originally Posted by techbongo View Post
Whenever the concept of section/category and template arrive, the CMS doesn't remain easy any more. You should have thorow knowledge in PHP, MySQL, Apache and Smarty for developing such CMS.
I figured this will be the case.

Thanks for the warning.

EDIT : sorry, double post.
__________________
Personal UK Webhosting

Last edited by Joshy D; 07-06-2009 at 08:45 AM..
Joshy D is offline
Reply With Quote
View Public Profile
 
Old 07-08-2009, 06:10 AM Re: Making a PHP based CMS
Joshy D's Avatar
Extreme Talker

Posts: 178
Name: Josh
Trades: 0
okay, so getting on to doing it now, finished little researching.

this is the basic outline plan... is it right??

Control Pages – Add a page –
• Create new document (give document title: e.g welcome.php) - how?
• Give page title (e.g welcome to this site.)
• Apply page style, and layout (include html & css)

Control Pages – Edit a page –
• Open file – append
• Submit modified title (renaming)
• Save (overwrite) original file

Control Pages – Delete a page
• Delete???? – how?

Control Articles – Add an article –
• Create new database entry (give id integer)
• Submit content and save
• Declare page to be displayed on
• Declare where to place article??? – how?

Control Articles – Edit an article –
• Open database entry
• Submit modified content
• Save (overwrite) original

Control Articles – Move an article
• Delete current position
• Declare new page to be displayed on
• Declare where to place article??? – how?

Control Articles – Delete an article
• Delete???? – how?

Anything missing?
Anyone answer the hows?

Thanks, Josh.
__________________
Personal UK Webhosting
Joshy D is offline
Reply With Quote
View Public Profile
 
Old 07-09-2009, 12:56 PM Re: Making a PHP based CMS
amw_drizz's Avatar
Ultra Talker

Posts: 338
Name: Jon
Location: New York
Trades: 0
Hi Josh,

I hope to shed some light on a few things here.

If your teacher is asking you to build a CMS from scratch he/she is a moron, When I was taught coding in school last year the teacher said, USE PRE MADE SCRIPTS if you can while coding(Alter what you need and go). I wouldn't use something like Joomla or similar but I would grab what I can that made making the app/script so much easier to begin with.

But if you are new to PHP and need a crash course check out tizag.com they have a great tutorial there (and I found it easy to follow)

Even for a basic CMS I would use a framework like CI to do the heavy lifting and write out the rest. (See notation)

For articles/pages do you plan on having them in a file?? or MySQL Database, Either or can be difficult if you never dealt with it before. My suggestion is get a hold of your teacher who assigned this project to you and ask if you can use a framework to build the CMS off of, then code the CMS with the framework. Other wise you will be pulling your hair out to build the CMS completely from scratch, Esp when it comes to the MySQL Database queries or File queries (which every method you use)

For a CMS I like to use CI since it is very easy to pick up and go if your a new to php. They have a well written User guide and it is very easy to build a CMS out of using a MySQL DB.

Also for users do you plan on having them in a db or flat file? DB Is more secure, just md5 the password on registration and on login to the site to keep it secure (keep in mind that MD5 is a one encryption and can not be decrypted easily (ie it may take years to decrypt))

EDIT :: For hows?
for mysql (this is CI since that is what I am working with right now)
PHP Code:
$this->db->delete('table_name_here',array('id_field_of_row_to_be_deleted'=>'id_of_row_to_be_deleted')); 
or
PHP Code:
$this->db->where('id',$id);
$this->db->delete('mytable'); 
Okay let me try and explain on how that works
The first one is one method which is one line of code Both do the same thing
'table_name_here' is the table name containing the item which is to be deleted (article,content,users,comment,etc)
'id_field_of_row_to_be_deleted' is the coloum name in the table (usually it is id it is what most people use)
'id_of_row_to_be_deleted' is the id of the row you wish to remove eg 1

I don't deal with files since they are alot more difficult to implement than a MySQL database for adding/updating/deleting content frequently

HTH Like I said I use CI, and by now you are probably wondering WTF is CI, It is CodeIgniter it is a php framework.

Notation : What I mean by a using a framework is just that it provides you with necessary calls to complete your application like database, file, security, and more.

A suggestion is to keep all your code you write, ESP if you plan on doing PHP coding more and more. If you save it your development time in future projects will go down since you will have code in the bank as they say for reuse. And focus on reusable code if you can. I would use functions to create reusable code blocks for your adding/updating/deleting calls that you will need to handle. For example I would use a function for add, update, delete so then every time you want to add some thing you just pass the needed info in to it, and it will reuse what is there with the new information for example
PHP Code:
function add_to_db($table,$data_to_insert_into_table){
if(!
$table || !$data_to_insert_into_table){
  exit(
"No table or data to insert"); // Terminate the script form continuing.
}
// db or file queries to add the info

I would do something like that so then I can reuse that every time I needed to insert stuff into a different table
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1

Last edited by amw_drizz; 07-09-2009 at 01:17 PM..
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Reply     « Reply to Making a PHP based CMS
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.25533 seconds with 13 queries