Results 1 to 12 of 12

Thread: article system

  1. #1

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919

    article system

    i want to make a article system with multiple pages, you can submit an article, itll email it to me, and i can add the article in using a page on the site.

    the problem is, i dont know how to organize the db for multiple page.

    ill have:

    name | user_id | article_name | len_pages | ...

    the user id is their forums registration id, im using the same scheme

    any suggestions?

    thanks
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Are you using a flat-file database or SQL?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    sql
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  4. #4
    Member
    Join Date
    Apr 2002
    Posts
    52

    Re: article system

    Originally posted by nabeels786
    i want to make a article system with multiple pages, you can submit an article, itll email it to me, and i can add the article in using a page on the site.

    the problem is, i dont know how to organize the db for multiple page.

    ill have:

    name | user_id | article_name | len_pages | ...

    the user id is their forums registration id, im using the same scheme

    any suggestions?

    thanks

    i don't think i got ur question exactly - but do u want to store multiple page articles in a db and then display them pagewise?
    are you storing each page in a separate field/row in which case your prob would be to design the db fields?
    or are you storing the entire article in one field and ur prob is to paginate the article?

    sorry if i got U confused! but let me know - i think i can help...

  5. #5

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919

    Re: Re: article system

    Originally posted by thexchord

    i don't think i got ur question exactly - but do u want to store multiple page articles in a db and then display them pagewise?
    are you storing each page in a separate field/row in which case your prob would be to design the db fields?
    or are you storing the entire article in one field and ur prob is to paginate the article?

    sorry if i got U confused! but let me know - i think i can help...
    yeah, i want to display each article page by page, but i have to idea how to store it...i dont know whether to store the whole article and paginate the article, or put each page in a seperate key, but there wont be a definate or max number of pages...either is fine. i just need some ideas on how to do it.

    i hope that explains it
    thanks
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  6. #6
    Member
    Join Date
    Apr 2002
    Posts
    52
    hi nabeels

    i can definitely help u with that. but give me a couple of hrs from now, to post an answer since i m at work!


    btw.. i'll be telling u how to design the db so that an article can be any no. of pages, and all pages will be stored in separate rows...

    thanks

  7. #7

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    ok thanks alot

    take your time
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  8. #8
    Member
    Join Date
    Apr 2002
    Posts
    52
    hi nabeel,

    here's what i propose:

    Two tables :

    tblArticles :
    user_id | art_id | art_title



    tblArticleContents
    art_id | art_pageno | art_content


    When a new article is input :
    1. Create a new row in the tblArticles table for this article. art_id is an auto_increment field, and art_title can be the name/Title of the article

    2. Say the art_id generated for this article, is "aid"

    3. Suppose you want each page to show up as 300 words long - make that a constant, say ART_WORDS_PER_PAGE

    4. Then for the content that is input for this article, run a loop over the content text, and for each block of text ART_WORDS_PER_PAGE long, make a new row in the tblArticleContents table, putting:
    a. art_id = aid
    b. art_pageno = the loop counter (starting at 0, or 1, preferable)
    c. art_content = the current block read


    Get It? Now the article has been divided into several pages, each ART_WORDS_PER_PAGE long. Each row is numbered in the art_pageno field.

    Suppose you want page 2 of some article with art_id = 'artidy' by a user 'useridx', then search for 'useridx' in user_id field, and 'artidy' in art_id in tblArticles - you'll get the title.

    Now you need the first page of this article - search for art_id = artidy and art_pageno = 0 in tblArticleContents.


    I hope that makes things clear. Please let me know if you have any questions. Or if i puked over the problem.

  9. #9

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    that sounds perfect

    gimme a few days to work something up, got school work to finish

    thanks alot

    (btw, you can check out what ive got already, http://fbgforums.jniv.net )
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  10. #10
    Member
    Join Date
    Apr 2002
    Posts
    52
    ok! keep me posted!

  11. #11

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    i will, thanks for the help, i appreciate it
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  12. #12
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819
    You'll probably want to do some additional checking. For example, if the last page is less than 1/2 your defined page length, then include it with the last page of your article. In the examples in previous posts (300 words) then if you have 1600 words in the article then it would be 4 pages of 300 words and page 5 would have 400 words.

    My other thought is that you should at least end on a paragraph. 300 words will probably end in the middle of a sentance 70% of the time. So you'll want to find the end of the paragraph that includes the 300th word and break the page there.

Posting Permissions

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



Click Here to Expand Forum to Full Width