SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Ideas on a CMS

  1. #1
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ideas on a CMS

    Hi,

    In a few weeks time, after my exams have finished, my site is getting a complete overhaul from the design, to the backend coding. What I need your help on is creating a fast and efficient CMS so I've got a few questions:

    1. How should I split pages? Using one or more records in the database.

    2. Should I allow rating an article (no comments though)?

    3. Should I enter HTML directly into the database or should I use a structured self code like and ?

    4. Should I add how many times an article has been viewed?

    5. Should authors have pictures?

    6. Should it be a template driven CMS or should it be just like code in separate files, etc?

    7. Should I give links in articles to the previous page?

    8. Should I have a drop down menu to go to the other pages?

    9. How many queries per page should I use as a maximum? (currently I'm using one for the article, yet phpAdsNew uses 4 which is a pity)?

    10. SHould I have categories and subcategories to make it easily intergratable if I were to add new features? (currently categories only)

    11. Should the articles URLs be search engine friendly?

    12. SHould I have, print and email this article links?

    13. Are there any other features this CMS for my site should have?

    Thanks allot for your opinions
    -Peter

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'll find varying answers on these, for sure. But IMO:

    1) You should create a table "pages" in your DB to hold pages, and link it to your "articles" table.

    2) It depends on the situation, but these are good for creating a "top ten" list of articles.

    3) Use your own code so you can translate it into different formats, like AvantGo, RSS, etc.

    4) Only if you're not concerned with people knowing your site's popularity.

    5) I think yes--it creates more of a personal atmosphere.

    6) If you are only going to output HMTL, then use code in separate files. If you want to be able to output to different formats (like I've said, AvantGo, your own protocol, etc), then use templates.

    7) Of course--why wouldn't you?

    8) Sure, why not? It adds another method of navigation...

    9) Depends on your resource allocation.

    10) Yes--don't hardcode the categories in the script or anything.

    11) Make it so you can do either: (examples) script.php?aid=3&pid=7 or script.php/3/7.

    12) "Print" might be better substituted as "Text-only view". "Email this article": only if you want...don't make it possible for people to be spammed through this, though.

    13) Open up the code, just so curious people can learn from your work. Make an AvantGo channel, too. ( http://avantgo.com/ ).

  3. #3
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Your comments are greatly appreciated, but I'd like to look into the page splitting a little more.

    Do you recommend something like this:

    Articles
    -------
    ID
    Date
    AuthoID
    Title
    Description

    Page:
    --------
    AID
    PageID
    Title
    Content

    ???

    That idea makes allot of sense but say I make an error and miss a page out so there is a gap in the PageID. How would I make PHP get the result for the next page?

    How would I also go about printing out the page and the titles for the select box? And how many queries would it be best to use? 1 or 2?

  4. #4
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use a table layout like this:
    Code:
    Articles 
    ------- 
    AID - PRIMARY KEY
    Date 
    AuthorID 
    Title
    [...]
    Description 
    
    Pages: 
    --------
    PageID - PRIMARY KEY
    AID 
    PageNum
    Title 
    Content
    So instead of finding the page by finding previouspage+1, find it by doing:
    SELECT pages.content, pages.title FROM pages WHERE AID = $article_id AND pagenum = $page_id

    In this case, it wouldn't matter if PageID had a gap in it. You'd use PageNum to address the pages instead of PageID.

    This is sort of hard to explain...but do you get it?


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
  •