phpbb3 latest posts module

sniP

New Member
Hi! I installed this module and it look bad, so i tried for hours to edit it but i only managed to do a little bit. This is Joomla 1.5
It looks like this:
aadlkg.gif

how to make it look like this:
rwjw1t.gif


here is the code:
Code:
<?php

/**

* @version      $Id: mod_phpbb3_latest_topics.php 8813 2007-Dec-14 1:32:56 iapostolov $

* @packages   Joomla / phpBB3 / Protos Extensions

* @copyright   Copyright (C)  2007 Protos Extensions. All rights reserved.

* @author      Ivo Apostolov @ Protos Extensions

* @website      http://www.ivoapostolov.eu

* @e-mail      [email protected]

* @license      GNU/GPL v2.0

*/



// no direct access

defined('_JEXEC') or die('Restricted access');



// get global mainframe stuff

      global $mainframe;



// load the module parameters      

      $phpbb3_address            = $params->get('phpbb3_address');

      $phpbb3_post_count         = $params->get('phpbb3_post_count', 10);

      $phpbb3_target            = $params->get('phpbb3_target', '_blank');

      $phpbb3_show_replies      = $params->get('phpbb3_show_replies', 1);

      $phpbb3_show_last_poster   = $params->get('phpbb3_show_last_poster', 1);

      $phpbb3_show_profile      = $params->get('phpbb3_show_profile', 1);

      $phpbb3_show_date         = $params->get('phpbb3_show_date', 1);



// Load the database settings frot he phpBB configuration

      include_once "".$phpbb3_address."/config.php";



// Connect to the database

      $link = $link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd");

      if (!$link)

      {

// Exit, if can not connect to the database      

      die('Not connected : ' . mysql_error());

      }

// Select the database

      $db_selected = mysql_select_db("$dbname", $link);

      if (!$db_selected)

      {

// Exit, if can not select the database

      die ('Can\'t use foo : ' . mysql_error());

      }

// Set Query to UTF-8

      mysql_query("SET NAMES UTF8");



// Load the script directory (if any)

      $get_folder = "SELECT config_name, config_value FROM $table_prefix".config." WHERE config_name = 'script_path' LIMIT 0,1";

      $folder = mysql_query($get_folder);

      $folder = mysql_fetch_array($folder);

      extract($folder);      

      $folder2 = $config_value;   



// Load the script domain

      $get_url = "SELECT config_name, config_value FROM $table_prefix".config." WHERE config_name = 'server_name' LIMIT 0,1";

      $url = mysql_query($get_url);

      $url = mysql_fetch_array($url);

      extract($url);

      $url2 = $config_value;   



// starting the module output      

      echo "<ul class='forum_topics'>";

            

// Load the last topics

      $latest_topics = "SELECT * FROM $table_prefix".topics." WHERE topic_approved = '1' ORDER BY topic_last_post_time DESC LIMIT 0,$phpbb3_post_count";

      $topics = mysql_query($latest_topics);

      while($row = mysql_fetch_array($topics))

      {

      $date = date("d.m.Y", $topic_last_post_time);

      extract($row);



// Check if to show the number of replies      

      if ($phpbb3_show_replies != 0) {

      $show_replies =  " (".$topic_replies.")";

      }

      else {

      $show_replies = "";

      }



// Check if to show the last poster name

      if ($phpbb3_show_last_poster != 0) {

      $last_poster =  " ".JText::_('zadnji poster | ')." ".$topic_last_poster_name."";

      }

      else {

      $last_poster = "";

      }



// Check if to link the last poster name to his profile

      if ($phpbb3_show_profile != 0 and $last_poster != "") {

      $show_profile =  " ".JText::_('last reply by')." <a class='forum_autor' href='http://".$url2."".$folder2."/memberlist.php?mode=viewprofile&u=".$topic_last_poster_id."' target='".$phpbb3_target."' >".$topic_last_poster_name."</a>";

      }

      else {

      $show_profile = $last_poster;

      }



// Check if to show the date

      if ($phpbb3_show_date != 0) {

      $show_date =  " ".JText::_('at')." ".$date."";

      }

      else {

      $show_date = "";

      }



// Start showing the latest posts      

echo "<li class='forum_topic'><a class='topic_link' href='http://".$url2."".$folder2."/viewtopic.php?f=".$forum_id."&t=".$topic_id."' target='".$phpbb3_target."'>".$topic_title."</a>".$show_replies."".$show_date."</li>";
        echo "<ul>".$show_profile."</li>";
      }



// Ending the output

      echo "</ul>";


?>
 
Top