+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    May 2008
    Posts
    248

    phpBB latest post script.

    Okay, Maybe you guys know better than me, with google searches and such. But I honestly couldn't find a really easy copy and code code for 10 most recent topics. So I coded this and here you go.
    Its basic, I know. If it was too advanced people would come here and be confused, I prefer releasing code people can copy, paste, and thank.

    #Class_MySQL.php
    PHP Code:
    <?php

    class C_MySQL 
    {
        function 
    Query$sql )
            {
                
    mysql_connect"dbhost""dbuser""dbpassword" );
                
    mysql_select_dbdatabasename );
                return 
    mysql_query $sql );
            }
    }
    ?>
    #TopTen.php
    PHP Code:
    <?php
    require_once("class_mysql.php");
    $sql = new C_MySQL;
    echo 
    "<body link=blue vlink=blue alink=blue>";
    $result $sql->Query("SELECT `forum_id`, `topic_id` , `topic_title` , `topic_poster` , `topic_time` FROM `phpbb_topics` ORDER BY topic_time DESC LIMIT 10");
    if ( 
    mysql_num_rows$result ) > )
    {
        while ( 
    $row mysql_fetch_array$result ) )
        {
            echo 
    "<font face=Verdana><a href=your_site_url/your_forum_folder/viewtopic.php?f="$row['forum_id'] . "&t=" $row['topic_id'] . ">" $row['topic_title']. "</a>";
            echo 
    "<br>";
        }
    }
    else
    {
        die(
    mysql_error());
    }

    ?>
    Currently deployed in support of OEF XI-XII

  2. #2
    Site Technician
    Join Date
    Apr 2008
    Posts
    76
    Quote Originally Posted by Nightmare View Post
    Okay, Maybe you guys know better than me, with google searches and such....
    Not a bad little script here Nightmare; you should make a little write up for it, to show people how it works. Possibly show them how you've figured out what tables to look for in the database, and such.

  3. #3
    Senior Member
    Join Date
    May 2008
    Posts
    248
    I r look in the database and it r seem logical which tables to use <3phpmyadmin
    Currently deployed in support of OEF XI-XII


 

Posting Permissions

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