PHP script help

Discussion in 'OT Technology' started by sianews, Feb 17, 2003.

  1. sianews

    sianews Guest

    I'm trying to modify a portal system which can been seen at .

    My problem is with the "read full" function. Everytime a new article is posted, the URL to the previous submissions change (the newest one is always 0, the next 1, and so on) - click the above link for an example.

    These are the two files for the script:

    I think the problem lines in portal.txt at line 198:

    I just want $i to equal the topic id, which I've been calling with "$fetchposts[$i]['topic_id']" but without success.

    Any ideas?
    Last edited by a moderator: Feb 17, 2003
  2. Astro

    Astro Code Monkey

    Mar 18, 2000
    Likes Received:
    Cleveland Ohio
    I think you're going to have some work on your hands...

    In portal.php:
    $fetchposts phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], 0);
    This sets up fetchposts. Fetchposts is an array and it references all its articles by the array index. I didn't look at the code to try to understand why this approach was taken, but thats what its doing.

    The only thing I can think of:

    - Rewrite portal.php to use the article IDs themselves instead of the index.

    - Create a function to figure out what ID belongs to which index.

    - Modify the SQL statement to pull out the article ID and in the for loop, check the article ID for the one you are looking for.

Share This Page