Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    Location
    The Pleiades
    Posts
    924
    Thanks
    76
    Thanked 29 Times in 29 Posts

    Custom CMS for my website

    Good evening,

    I have just finished my personal website and want to create a CMS for it so that I don't have to keep logging in the cPanel to access the database.

    What are the 'rules' to follow when creating a CMS?

    I've seen the structure of WordPress and if I'm correct, they have an 'admin' directory will all the CMS files/directories in there.

    Do I just need to keep those specific files out of the main directory and is it just a case of setting up a user/pass login to access the 'back-end' files? (ie preventing users accessing these files by asking for a login/session)

    It only has to be very very basic as in literally just being able to retrieve and display the database data. Over time I may improve on this.

    Thank you for your time.

    BTW - LOVE THE NEW FORUMS!

    Kind regards,

    LC.

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,536
    Thanks
    45
    Thanked 259 Times in 256 Posts
    There are no particular "rules", just conventions. And by in large, it depends on what you want to do.

    When building your own CMS, organization is key. As you've noticed, wordpress splits files down very particularly. Within those files, they follow very specific conventions. This means that as they expand/update, they don't have to rebase constantly.

    If you're familiar with MVC frameworks, the conventions followed there are a good start. I would create an admin folder that contains most/all of your admin content. If you're going to have anything outside, make it assets, like images, or shared content like libraries.

    You definitely want a user/pass system. The simplest is to go by apache locking (assuming you're using apache) or use a DB to store user/pass. Of course, on that side, you gotta watch out for other security concerns.

    Its a deep topic, and I found as I started building my first CMS, I did a lot wrong, and my second version was almost a complete rebase. The third less so, and so on.

  • Users who have thanked Keleth for this post:

    LearningCoder (03-01-2014)

  • #3
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    Location
    The Pleiades
    Posts
    924
    Thanks
    76
    Thanked 29 Times in 29 Posts
    Good evening Keleth,

    Thank you for your reply.

    I was intending to create a table within my existing DB and then have just 1 user and pass stored in there. Create a login page within /maindir/admin/index.php (for example), which on successful login allows me access to a couple of functions (a form) which will allow me to see the DB contents at the click of the button.

    Kind regards,

    LC.

  • #4
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,536
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Yah, that works. Remember that database values should be salted and hashed. Avoid MD5 (I had fun with that recently at work), go for blowfish or SHA or something similar.

  • Users who have thanked Keleth for this post:

    LearningCoder (03-01-2014)

  • #5
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    Location
    The Pleiades
    Posts
    924
    Thanks
    76
    Thanked 29 Times in 29 Posts
    Good morning Keleth,

    Thank you for confirming the above. I've used PHPass in the past to handle my password hashing and just checking the username string values against one another from the user input.

    Going to get to work on this!

    Thank you for all your input and help.

    Kind regards,

    LC.

  • #6
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    Location
    The Pleiades
    Posts
    924
    Thanks
    76
    Thanked 29 Times in 29 Posts
    Good afternoon,

    Just had another question.

    In terms of creating a CMS for the purposes of changing page content, does the website have to be database driven (i.e all pages content pulled from the database, so that when 'admin' changes content in CMS, it updates the table fields)?

    Thank you again.

    Kind regards,

    LC.

  • #7
    Regular Coder
    Join Date
    Sep 2002
    Posts
    462
    Thanks
    0
    Thanked 20 Times in 20 Posts
    No, you can make it like a file editor. Just recode to load files from a directory then open, edit or append like you normally would. Create a new page could just
    create a new file.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #8
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    Location
    The Pleiades
    Posts
    924
    Thanks
    76
    Thanked 29 Times in 29 Posts
    Good morning c1lonewolf,

    I did think the only other way would be write/append to the existing files.

    Do some CMS's use the database method and some use the file appending method or is there 1 common method of achieving this?

    Kind regards,

    LC.

  • #9
    Regular Coder
    Join Date
    Sep 2002
    Posts
    462
    Thanks
    0
    Thanked 20 Times in 20 Posts
    Depends on the programmer. Some use only a database, some only files and some use both. It depends on what you're trying to achieve.
    I built a database system on my other system using only files and javascript because I didn't understand or want to install xampp to handle
    database stuff. Then I found about sqlite, but I was too far gone.hehehe Additcted to my system. Now I'm learning php mysql. Which is
    way more intense than my own system. With mine, I could create a new database app in seconds...with these and db protection etc.
    just more complicated.

    Simple method:
    Whatever works for you! You're the user and programmer!
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • Users who have thanked c1lonewolf for this post:

    LearningCoder (03-10-2014)

  • #10
    Regular Coder
    Join Date
    Sep 2002
    Posts
    462
    Thanks
    0
    Thanked 20 Times in 20 Posts
    When building your own CMS, organization is key.
    ....
    I found as I started building my first CMS, I did a lot wrong, and my second version was almost a complete rebase. The third less so, and so on.
    Keleth, what kind of problems did you have? Mine seem to be mostly organization. While I have all my scripts working to some extent, in building our
    system I'm finding that organizing all the options and adjusting areas according to master admin, admin, users etc. and how things work for each is
    presenting problems. Any tips?
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •