<?php // $Id: index.php,v 1.14 2001/12/06 17:27:03 rwwood Exp $ $Name: $
// ----------------------------------------------------------------------
// POST-NUKE Content Management System
// Copyright (C) 2001 by the Post-Nuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------
// Based on:
// PHP-NUKE Web Portal System - http://phpnuke.org/
// Thatware - http://thatware.org/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
// Filename: modules/Topics/index.php
// Original Author of file: Francisco Burzi
// Purpose of file: display topics on your site
// ----------------------------------------------------------------------
if (!defined("LOADED_AS_MODULE")) {
die ("You can't access this file directly...");
}
include 'mainfile.php';
$ModName = basename( dirname( __FILE__ ) );
modules_get_language();
include("header.php");
global $pntable, $dbconn, $topicsinrow; // added topicsinrow string - rwwood
$column = &$pntable['topics_column'];
$result = $dbconn->Execute("SELECT $column[topicid], $column[topicname], $column[topicimage], $column[topictext] FROM $pntable[topics] ORDER BY $column[topicname]");
if ($result->EOF) {
include("header.php");
include("footer.php");
}
else {
OpenTable();
echo "<center><font class=\"pn-title\">"._ACTIVETOPICS."</font><br>\n"
."<font class=\"pn-normal\">"._CLICK2LIST."</font></center><br>\n"
."<table border=\"0\" width=\"100%\" align=\"center\" cellpadding=\"2\"><tr>\n";
//FTO. Avoid warning for $count.
$count = 0;
//FTO : Check EOF and database error
if (!$result) {
PN_DBMsgError($dbconn, __FILE__, __LINE__, "An error ocurred");
die();
}
while(!$result->EOF) {
list($topicid, $topicname, $topicimage, $topictext) = $result->fields ;
$result->MoveNext();
if ($count == $topicsinrow) { // changed hardcoded number of topics icons - rwwood
echo "<tr>\n";
$count = 0;
}
echo "<td align=\"center\">\n"
."<a class=\"pn-normal\" href=\"modules.php?op=modload&name=Search&file=index&action=search&overview=1&active_stories=1&stories_topics[0]=$topicid\"><img src=\"$tipath$topicimage\" border=\"0\" alt=\"$topictext\"></a><br>\n"
."<font class=\"pn-normal\">$topictext</font>\n"
."</td>\n";
/* Thanks to John Hoffmann from softlinux.org for the next 5 lines ;) */
$count++;
if ($count == $topicsinrow) { // changed hardcoded number of topics icons - rwwood
echo "</tr>\n";
}
}
if ($count == $topicsinrow) { // changed hardcoded number of topics icons - rwwood
echo "</table>\n";
} else {
echo "</tr></table>\n";
}
}
CloseTable();
$result->Close();
include("footer.php");
?>