{REQUEST} - Topics Anywhere for phpBB 3.x.

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Get Involved
EXEMOK
Registered User
Posts: 138
Joined: Fri Mar 29, 2002 5:48 pm
Location: Minsk

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by EXEMOK »

So, what information for today - no this mod yet for phpbb3?
sibet
Registered User
Posts: 2
Joined: Fri May 15, 2015 9:09 am

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by sibet »

Hi, I managed to get one of the scripts running for my phpbb 3.1

Code: Select all

<?
        /*** phpBB3 - Last Active Topics System ***/

        //Author: Ioan Filipov

        //Email: [email protected]

        //Date: 04.06.2007

        //------------------------------

        //Edit these parameters:

        //MySQL server adress
        $host="localhost";

        //Username
        $user="username";

        //Password
        $pass="password";

        //Database
        $db="database";

        //Table prefix
        $table="prefix";

        //Show last x topics
        $laforums="5";
     


    $link=mysql_connect($host, $user, $pass);
    $db=mysql_select_db($db);
    $query="select * from $table".topics."  WHERE topic_visibility = '1' order by topic_last_post_time desc limit 0,$laforums";
    $query2="select config_name,config_value from $table".config." where config_name = 'server_name' limit 0,1";
   $result2=mysql_query($query2);
    $row2 = mysql_fetch_array($result2);
    extract($row2);
    $result=mysql_query($query);
    while ($row=mysql_fetch_array($result)) {
    extract($row);
    $date = date("d/m/y", $topic_last_post_time);
   $query3="select forum_name from $table".forums." WHERE forum_id = ".$forum_id."";
   $result3=mysql_query($query3);
   $row2 = mysql_fetch_array($result3);
  echo "<a href='http://".$config_value."/forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."'>".$topic_title."</a> in ".$row2[forum_name]." gepost door ".$topic_last_poster_name." op ".$date." (replies: ".$topic_posts_approved.") <a href='http://".$config_value."/bb/viewtopic.php?f=".$forum_id."&p=".$topic_last_post_id."#p".$topic_last_post_id."'>go to last post<br>\n";
    }

    //-------------------------- END
    ?>

Now I would like to additionally display only the posts of 1 forum (classifieds). How would one go about coding this into the above? Any help?
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by Oyabun1 »

                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
sibet
Registered User
Posts: 2
Joined: Fri May 15, 2015 9:09 am

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by sibet »

That didn't work for me at all ...
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by ViolaF »

i dont know from where you get $forum_id, but nevermind.

just clone the complete code, you posted and change this code-part in "the clone"

Code: Select all

while ($row=mysql_fetch_array($result)) {
    extract($row);
    $date = date("d/m/y", $topic_last_post_time);
   $query3="select forum_name from $table".forums." WHERE forum_id = ".$forum_id."";
   $result3=mysql_query($query3);
   $row2 = mysql_fetch_array($result3);
  echo "<a href='http://".$config_value."/forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."'>".$topic_title."</a> in ".$row2[forum_name]." gepost door ".$topic_last_poster_name." op ".$date." (replies: ".$topic_posts_approved.") <a href='http://".$config_value."/bb/viewtopic.php?f=".$forum_id."&p=".$topic_last_post_id."#p".$topic_last_post_id."'>go to last post<br>\n";
    }
to this

Code: Select all

$forum_id = 5; // just enter the forum-id, you want to display
while ($row=mysql_fetch_array($result)) {
    extract($row);
    $date = date("d/m/y", $topic_last_post_time);
   $query3="select forum_name from $table".forums." WHERE forum_id = ".$forum_id."";
   $result3=mysql_query($query3);
   $row2 = mysql_fetch_array($result3);
  echo "<a href='http://".$config_value."/forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."'>".$topic_title."</a> in ".$row2[forum_name]." gepost door ".$topic_last_poster_name." op ".$date." (replies: ".$topic_posts_approved.") <a href='http://".$config_value."/bb/viewtopic.php?f=".$forum_id."&p=".$topic_last_post_id."#p".$topic_last_post_id."'>go to last post<br>\n";
    }

Return to “[3.0.x] MOD Requests”