SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member jhanson's Avatar
    Join Date
    Feb 2010
    Location
    In the Forest
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Best design for Article Directories

    Hello,

    I was wondering if anyone had any advice or ideas on how the best way to set up articles on a website? Or possibly point me in the right direction to some good resources on the subject?

    Thanks!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,216
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    best design: one web page per article
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member jhanson's Avatar
    Join Date
    Feb 2010
    Location
    In the Forest
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So the best would be to design a static page for each article and name the page the same as the article name?

    I suppose then I could store the name, category, path etc. in a DB to generate links on specific pages with specific articles dynamically.

    This might seem like a trivial question...but what if I just put the article itself in a HERE doc, in it's own file and just include it in a multipurpose page(say articles.php) depending on which generated link the user clicked(with a query string identifying it in the DB)?

    Would that be more overhead on queries and screw with the search bots?

    Thanks!

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,216
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    oh dear me

    you seem to have asked a very general question about back end construction of a dynamic storage mechanism for an article directory

    i seem to have answered a different question

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Member jhanson's Avatar
    Join Date
    Feb 2010
    Location
    In the Forest
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't have a large amount of articles yet. I am just starting out but just wanted to know what the best practice would be with as little maintenance as possible down the road.

    I guess I am asking if it would be better to store the articles in a DB all formatted for html and just pull them out on demand or build the pages all individually and just generate the links to them.

    Thanks again!

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,216
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by jhanson View Post
    I guess I am asking if it would be better to store the articles in a DB all formatted for html and just pull them out on demand or build the pages all individually and just generate the links to them.
    this depends on the complexity of the html
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    SitePoint Member jhanson's Avatar
    Join Date
    Feb 2010
    Location
    In the Forest
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is what I initially thought...Create a directory name articles with a default index page and put the actual articles in a sub directory named by subject.
    Example:
    articles
    -foo
    -how_to_get_foo.php
    -more articles....
    -bar
    -how_to_get_bar.php
    -more articles....

    The actual articles would then just be in a here doc all formatted for output.
    Example:
    <?php
    print <<<HERE
    <div id="someCSSClass">
    <h1>How to get foo</h1>
    <p>This is how you can get <a href="#"><strong>foo</strong> </a>etc..</p>
    </div>

    HERE;

    ?>

    Then make a table for articles with the name, src, category etc, so depending on the page I can generate random links by category depending on which page they are in and adding the article source to the query string.
    Example on the foo page:
    ....All the db code here....The query would be specific to the page's subject
    while($row = mysql_fetch_array($result)){

    print "<a href =\"../articles/?art_src=$row[art_src]\">$row[art_name]</a><br/>

    Where art_src would be foo/how_to_get_foo.php
    }

    So then on the default article page I would run a check to see if $_GET[art_src] was set and if it was put it to a shortcut var $art_src=$_GET[art_src]

    and then...

    include "$art_src";

    else {
    output the standard page
    }

    Then have the directives for bots to not go into any of the actual article pages to get indexed(This is where I am not quite sure how articles would get indexed because of them being generated by the query string). The html would just be for all the styles, anchors and such.

    Hope this explains what I was thinking better. Thanks again!


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
  •