
$not_config =& $module->getInfo('notification');
function ¬ificationCategoryInfo ($category_name='', $module_id=null)
{
if (!isset($module_id)) {
global $xoopsModule;
$module_id = !empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0;
$module =& $xoopsModule;
} else {
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->get($module_id);
}
$not_config =& $module->getInfo('notification');
if (empty($category_name)) {
return $not_config['category'];
}
foreach ($not_config['category'] as $category) {
if ($category['name'] == $category_name) {
return $category;
}
}
$ret = false;
return $ret;
}
///////////////////////////////////////////////////////////////////////////////
// ACTIVE_TOPICS.PHP
///////////////////////////////////////////////////////////////////////////////
// Copyright: (C) 2002 Matthijs van de Water
// Version: 1.1
// Date: 03/02/2002
///////////////////////////////////////////////////////////////////////////////
// Show phpBB 2.0 Active Topics List
// Output format can be any HTML or XML
// This script must be able to access vital phpBB 2.0 configuration scripts
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// CUSTOM SETTINGS
///////////////////////////////////////////////////////////////////////////////
// Amount of active topics to show
define("TOPIC_COUNT", 20);
// Path to the phpBB 2.0 root directory
define("PHPBB_PATH", "foro/");
// URL to the phpBB 2.0 installation
define("PHPBB_LOCATION", "http://localhost/foro/");
// Time format to output the date/time (for format see PHP manual)
define("TIME_FORMAT", "H:i");
///////////////////////////////////////////////////////////////////////////////
// Includes of phpBB scripts
$phpbb_root_path = PHPBB_PATH;
if ( !defined('IN_PHPBB') )
{
define('IN_PHPBB', true);
include(PHPBB_PATH . 'extension.inc');
include(PHPBB_PATH . 'config.'.$phpEx);
include(PHPBB_PATH . 'includes/constants.'.$phpEx);
include(PHPBB_PATH . 'includes/db.'.$phpEx);
}
///////////////////////////////////////////////////////////////////////////////
// HTML header start
///////////////////////////////////////////////////////////////////////////////
?>
Tema
Vistas
Respuestas
Ultima respuesta
///////////////////////////////////////////////////////////////////////////////
// HTML header end
///////////////////////////////////////////////////////////////////////////////
// sql statement to fetch active topics of public forums
$sql = "SELECT DISTINCT t.topic_title, t.topic_id,t.topic_views,t.topic_replies, t.topic_last_post_id, p.post_time,p.poster_id, f.forum_name, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f, " . USERS_TABLE . " AS u
WHERE
t.forum_id = f.forum_id
AND f.auth_view = " . AUTH_ALL . "
AND p.topic_id = t.topic_id
AND p.poster_id = u.user_id
AND p.post_id = t.topic_last_post_id
ORDER BY p.post_time DESC LIMIT " . TOPIC_COUNT;
$nt_result = $db->sql_query($sql);
if(!$nt_result)
{
die("Failed obtaining list of active topics".mysql_error());
}
else
{
$nt_data = $db->sql_fetchrowset();
}
if ( count($nt_data) == 0 )
{
die("No topics found");
}
else
{
$cq = 1;
$cc = 333333;
// $nt_data contains all interesting data
for ($i = 0; $i < count($nt_data); $i++)
{
$title = $nt_data[$i]['topic_title'];
$Turl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id'];
$LPurl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?" . POST_POST_URL . "=" . $nt_data[$i]['topic_last_post_id'] . "#" . $nt_data[$i]['topic_last_post_id'];
$on_forum = 'En el foro ' . $nt_data[$i]['forum_name'];
$post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']);
//Profile profile.php?mode=viewprofile&u=23
$profile = PHPBB_LOCATION . 'profile.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id'] ;
$usrname = $nt_data[$i]['username'];
// As of now you can actually do anything with the data
// I chose to output in XML
///////////////////////////////////////////////////////////////////////////////
// Item HTML start
///////////////////////////////////////////////////////////////////////////////
if($cq%2 == 0){$cc = "FFFFFF";$cq++;} else{$cc = "CCCCCC";$cq++;}?>
echo $cc;?>" align="left">echo $Turl; ?>" title="echo $on_forum; ?>">echo $title; ?>
echo $cc;?>" align="left">echo $nt_data[$i]['topic_views'] ?>
echo $cc;?>" align="left">echo $nt_data[$i]['topic_replies'] ?>
echo $cc;?>" align="left">Por echo $profile; ?>">echo $usrname?>echo $LPurl; ?>">
echo PHPBB_LOCATION;?>/templates/subSilver/images/icon_latest_reply.gif" border="0" />
///////////////////////////////////////////////////////////////////////////////
// Item HTML end
///////////////////////////////////////////////////////////////////////////////
}
}
///////////////////////////////////////////////////////////////////////////////
// Footer HTML start
///////////////////////////////////////////////////////////////////////////////
?>
///////////////////////////////////////////////////////////////////////////////
// Footer HTML end
///////////////////////////////////////////////////////////////////////////////
// EOF
?>