SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast ebuydrum's Avatar
    Join Date
    Jan 2001
    Location
    Berkshire UK
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can anyone explain how you access articles from a database? As far as I can see the only way would be to store the address of the text file in the table, and insert it as a variable into an include. Also how do you format the text, sitepoint have one printable version and one general version for all of the articles, how is this possible?

    Thanks in advance

    Nick

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In MySQL you can use the TEXT types which can hold massive amounts of text. They also have the advantage of being searchable. You should ask the sitepoint adviser Aspen about this. I understand he uses a database to store the whole contents of chapters of books (if I'm not mistaken).

    I believe that the issue of having different layouts for the printable and online version is more a matter of applying different templates and CSS. So its the same text being retrieved from the database just formated differently.

  3. #3
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes - sid is right.

    But I'm not an advisor.

    You simply store the entire article (or in my case book chapter) in the DB. Along with some identification fields like Article ID, Page Number, etc etc.

    Then when you want to retrieve it you simply

    Select * from Content where ArticleID = 5

    Or in my case

    Select * from Content where BookID = 'odyssey' and Chapter_Num = '13'

    As for formatting again Sid is right. You simply format the article after its pull from the database so you can format it any way you like. You simply need to make 2 templates.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  4. #4
    SitePoint Enthusiast nguip's Avatar
    Join Date
    Apr 2001
    Location
    Malaysia
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ic...

    This is a very interesting topic. As I can see they will be many ppl who would like to implement such system, can you show us some sample code for your system?
    Ngu I.P.
    Web Developer

  5. #5
    SitePoint Enthusiast ebuydrum's Avatar
    Join Date
    Jan 2001
    Location
    Berkshire UK
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also do you have to hand type all the content into mysql and does the text have to include html tags?

  6. #6
    SitePoint Enthusiast nguip's Avatar
    Join Date
    Apr 2001
    Location
    Malaysia
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I'm understanding ... we can do either by embeded HTML tab or not embeded.

    I'll expect that the your table will look something like this:-

    content
    --------
    id
    title
    date
    author
    picture
    content
    htmltemplate

    template
    --------
    id
    title_font
    title_color
    title_size
    content_font
    content_color

    Then, you use either regular expression or classes to format the HTML template Any comments ?
    Ngu I.P.
    Web Developer


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
  •