SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Evangelist Caesar's Avatar
    Join Date
    May 2000
    Location
    On some harddisk
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys,

    Anyone knows what I must do to have the links automatically updated for the latest posts in the forums such as on the index page of Sitepoint ?

  2. #2
    ********* *********** Jason Donald's Avatar
    Join Date
    Jun 2000
    Location
    Melbourne, Victoria, Australia
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's what we use:

    <?php
    // Set this to the max number of threads to display
    $maxthreads = 10;

    require("config.php");
    $db=mysql_connect($servername,$dbusername,$dbpassword);
    mysql_select_db($dbname);
    $query = "SELECT * FROM thread ORDER BY lastpost DESC LIMIT $maxthreads";
    $resultlatest = mysql_query($query,$db);
    while ($latest_array = mysql_fetch_array($resultlatest)) {
    echo "<FONT class=\"hotTopicsLink\" SIZE=\"-1\" FACE=\"Arial, Helvetica, sans-serif\">
    <A HREF=\"http://www.sitepointforums.com/showthread.php?threadid=$latest_array[threadid]\"><IMG SRC=\"graphics/hottopic.gif\" WIDTH=\"15\" HEIGHT=\"9\" BORDER=\"0\">$latest_array[title]</A></FONT><BR>";
    }

    ?>

  3. #3
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So it's in real time? That's cool!
    I thought it only updates once in a while.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  4. #4
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jason,

    To include this on the other sites on your network did you make that a file and include it using PHPs include?

  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)
    A change needs to be made, though, to explode links to threads in the private forums - I see links such as "Spammer Posts" and click on them, and am told I'm either ont logged in, or do not have permission to access that area.

    Some of the thread titles have also been a little revealing - just a little, though.


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
  •