Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

phbb3 latest topics joomla 1.5 module


  • Please log in to reply

#1
sniPsarajevo

sniPsarajevo

    New Member

  • Member
  • Pip
  • 1 posts
Hi! I installed this module and it looked bad, so i tried for hours to edit it but i only managed to do a little bit.
It looks like this:
Posted Image

how to make it look like this:
Posted Image

here is the code

<?php

/**

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

* @packages Joomla / phpBB3 / Protos Extensions

* @copyright Copyright © 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>";


?>


  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP