SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot Wilmot's Avatar
    Join Date
    Feb 2000
    Location
    Brisbane, Queensland, Australia
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, I have a content-based site which has a lot of articles, tutorials etc. At the bottom of each piece of content, I have a "Related Items" section. I am currently updating this manually using html. I can see this is going to become impossible once the site grows much larger.

    I was wondering if anyone knows a good solution to this problem. ie. generating the links dynamically.

    I know SitePoint has something like this and from what I can see it is based on keywords in article names.

    Any suggestions would be appreciated.
    Brad Culbert
    SQL Server 2005 Books
    www.SQLServer2005Books.com - Reader-rated SQL Server 2005 Books

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd create a table to hold article categories - IE: promotion, domain names, design, navigation, blah blah blah. When you add one, you'd specify a category, and on each article pulled from the database, you would use an SQL statement to select all articles matching that category that did not have the same ID number as the current one.

    Hope that helps.

  3. #3
    SitePoint Enthusiast vworld's Avatar
    Join Date
    Nov 2000
    Location
    West of Colorado Springs
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for asking that question....I'm in the process of figuring that one out myself and it really helps.

    V

  4. #4
    SitePoint Enthusiast vworld's Avatar
    Join Date
    Nov 2000
    Location
    West of Colorado Springs
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for asking that question....I'm in the process of figuring that one out myself and it really helps.

    V

  5. #5
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did it work? Do you need me to give your some code examples of what I described in my earlier post?

  6. #6
    SitePoint Zealot Wilmot's Avatar
    Join Date
    Feb 2000
    Location
    Brisbane, Queensland, Australia
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not actually using a database at the moment, however will most likely have to move that way eventually..

    What tables etc would you have in a database which stored content for a website.. I have articles, tutorials, interviews and other different kinds of content. Also, within those tables what data types do you store the text as in the tables?

    An example content-based database would be great, but I realise this is probably out of the question

    Thanks a lot.
    Brad Culbert
    SQL Server 2005 Books
    www.SQLServer2005Books.com - Reader-rated SQL Server 2005 Books

  7. #7
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use all the fields you need for your documents, but add another called "cat" or "category" - have another table called "categories" - each record for the field "cat/category" in each document table will specify what type it is.

  8. #8
    SitePoint Enthusiast vworld's Avatar
    Join Date
    Nov 2000
    Location
    West of Colorado Springs
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm building the backend to a dynamic publishing system for my site...I've used Kevin Yanks article as the starting point.

    Examples would help me in visualizing this and implementing it...so any you have would be greatly appreciated.

    I also have a question about the grabbing text from the database...for example I have a page that displays the current stories/articles that includes the headline, body of story, and publish date....this is just the preview page for the story so the administer can decide whether they want to edit or delete it. My question is I don't want to show the entire article on this page...but just display the first paragraph...I know you can call it from the command line interface ...but can't get it to work on the web....any help would be appreciated.

    Thanks in advance,

    V

  9. #9
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After the first paragraph in your text, put [END1STPARA]

    Then call the text and store it in a variable.

    Then split the text at the [END1STPARA] using $text=split([END1STPARA], $text); then show it using echo ($text[0]);

    then when you display the article for real, just use eregi_replace([END1STPARA], "");


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
  •