SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast mildfoam's Avatar
    Join Date
    May 2010
    Location
    Australia.
    Posts
    56
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    create cms site with php - non framework based

    hi all,

    i want to create a cms site with using php it means really simple cms site that just can update, delete & create content then can have title and read more button - non framework right now, do you have some book or reference to do it

    thanks

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,028
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Build Your Own Database Driven Website with PHP & MySQL by Kevin Yank and published by SitePoint (http://www.sitepoint.com/books/phpmysql4/) is one book that covers the creation of a simple CMS which doesn't use any framework. There may be other books out there but the above book is the only one that I've read that covers the creation of a simple CMS.
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Enthusiast mildfoam's Avatar
    Join Date
    May 2010
    Location
    Australia.
    Posts
    56
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SpacePhoenix View Post
    Build Your Own Database Driven Website with PHP & MySQL by Kevin Yank and published by SitePoint (http://www.sitepoint.com/books/phpmysql4/) is one book that covers the creation of a simple CMS which doesn't use any framework. There may be other books out there but the above book is the only one that I've read that covers the creation of a simple CMS.
    Hi SpacePhoenix

    thanks for your answer, i will try to read it first.

  4. #4
    SitePoint Enthusiast mildfoam's Avatar
    Join Date
    May 2010
    Location
    Australia.
    Posts
    56
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    hi all,

    I am sorry this thread up again, I've read the book but still feel confused for one thing. I want to make that every article that I have input into the database automatically appear home page (index.php maybe?) and automatically index the article also has a maximum limit of characters and then the title of the article is a link that connects the article in full with a URL like this:

    how i can do something like this?

    thank you

  5. #5
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Create an extra field in your database call it "slug". varchar, same length as your titles.

    Take your article titles and turn them into "slugs".

    Lets say one title is "O'Reilly books that I REALLY Love!" turn that into the slug "oreilly-books-that-i-really-love".

    (search this forum for slug or slugify to find out how to do that).

    Create an articles.php file which expects a single GET argument, which will be that slug:

    domain .com/articles.php?article=oreilly-books-that-i-really-love

    articles.php will then query your database for the match to get a single article, and display it.**

    Code:
    "SELECT title, text 
    FROM articles 
    WHERE slug = '" .$_GET['article'] ."'";
    You can then create a list of articles and links by doing:

    Code:
    "SELECT title, slug 
    FROM articles 
    order by title";
    Now, you can then go on and create SEO friendlier URLS such as

    domain .com/oreilly-books-that-i-really-love

    ... by looking up and reading about Apache's mod_rewrite which turns (re-writes) that SEO friendly url into the exact link domain .com/articles.php?article=oreilly-books-that-i-really-love


    When that is done you can go back to your home page and rearrange the links so that they link to the SEO friendly version instead.

    Then you are done.

    There is a bit of a learning curve, but once done you will likely use this a lot.

    ** You need to sanitize this input, I have left this step out - but it should be easy enough - a slug should be between 4? and n chars long, and contain only letters numbers and a dash.


Bookmarks

Posting Permissions

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