Announcement

Collapse
No announcement yet.

PHP help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP help

    Hello, i'm working on a site soon to be opened, deviantmods.com. The site is database driven, but i cannot figure out how to make it so that it creates seperate pages. Tweaktown's reviews and articles are a perfect example. Could anyone help me out here please?

  • #2
    I think you're going to have to be a lot more specific...

    Comment


    • #3
      Hey,
      Well I actually developed the entire tweaktown site, so I guess im the one that should be answering your questions hehe. :)

      OK, firstly you need a table for the articles details. it should contain a unique identifier, title, author id (linked to author table), date added, topic, etc, etc, etc.

      THEN you need an article pages table with id, title, parent article id and content fields. When you then display an article, you query the article pages table to get the page. so for the first page its

      SELECT title, content
      FROM articlePages
      WHERE parentArticle = xxx

      then to link to another page you would use a query like this to determine if there are other pages in the article

      SELECT pageID
      FROM articlePages
      WHERE parentArticle = xxx AND pageId > currentPage

      Hope that helps...

      Comment


      • #4
        yea, i've got the tables set up with the id, author, date, and all that good stuff. Now....the whole submitted article has an id, does the author need a seperate id to go along with it?

        ok, for a very specific example, here's one of TT's reviews:

        alright, on the first page, he's got the into and specs, and then it cuts off and links to the second page, it has its own minititle type thing, and continues until the author told it to make a seperate page. Now, none of the pages are the exact same in length, so i'm wondering, how to you tell it to make a new page and then link to it?

        hope that helps to clarify it up

        thnx for your help devarticles....i'll be talking with my real programmer bout it

        Comment


        • #5
          well...good news! i got em working, thanks alot!!!!

          but now i've encountered anothe problem:
          because it sends all the data to the url address bar, it only allows a certain length of text. Well...when printed on the screen, it is NOT long. its very short, maybe 2 paragraphs max.

          how do i get around this?

          Comment


          • #6
            why not just use POST instead of GET?
            $title=$HTTP_POST_VARS['title'];

            GET has a lower character limit than POST [forget, but i think GET is limited to 80 chars]


            also, you should probably strip slashes..

            $title=stripslashes($title);

            then:
            INSERT INTO table (title,news) VALUES('$title','$news')


            easy! ;)

            Comment


            • #7
              hehe...i already got it done, thanks. devArticles helped alot :)

              Comment

              Working...
              X