Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/************************************************************************/
/* Modified by Colin Holywell v0.1 */
/* */
/* cholywell@hotpop.com */
/* http://www.ehub.no-ip.com */
/************************************************************************/
/* Block to fit perfectly in the center of the site, remember that not all
blocks looks good on Center, just try and see yourself what fits your needs */
if (eregi("block-Last_10_Articles.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $prefix, $multilingual, $currentlang, $db, $dbi, $sitename;
if ($multilingual == 1) {
$querylang = "WHERE (alanguage='$currentlang' OR alanguage='')";
} else {
$querylang = "";
}
$content = "<table width=\"100%\" border=\"0\"><tr><td colspan=\"2\" align=\"center\" ><b>Latest News & Announcements</b></td></tr>";
$sql = "SELECT sid, title, comments, counter FROM ".$prefix."_stories $querylang ORDER BY sid DESC LIMIT 10";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$sid = $row[sid];
$title = $row[title];
$comtotal = $row[comments];
$counter = $row[counter];
$content .= "<tr><td align=\"left\"><img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\"> <a href=\"modules.php?name=News&file=article&sid=$sid\">$title</a></td><td align=\"right\">[ $comtotal "._COMMENTS." - $counter "._READS." ]</td></tr>";
}
$content .= "</table>";
$content .= "<br>";
$content .= "<table align=\"center\" border=\"0\"><tr><td valign=\"top\" align=\"left\"><b>New Downloads</b></td><td valign=\"top\" align=\"left\"><b>New Web Links</b></td></td><td valign=\"top\" align=\"left\"><b>Recent Forum Topics</b></td></tr>";
$content .= "<tr><td valign=\"top\" align=\"left\">";
$a = 1;
$result = sql_query("select lid, title from $prefix"._downloads_downloads." order by date DESC limit 15", $dbi);
while(list($lid, $title) = sql_fetch_row($result, $dbi)) {
$title2 = ereg_replace(" ", "_", $title);
$content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\"> <a href=\"downloads.html?amp;d_op=viewdownloaddetails&lid=$lid&ttitle=$title2\">$title</a><br>";
$a++;
}
$content .= "</td><td align=\"left\" valign=\"top\">";
$a = 1;
$result = sql_query("select lid, title from $prefix"._links_links." order by date DESC limit 15", $dbi);
while(list($lid, $title) = sql_fetch_row($result, $dbi)) {
$title2 = ereg_replace(" ", "_", $title);
$content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\"> <a href=\"links.html?amp;l_op=viewlinkdetails&lid=$lid&ttitle=$title2\">$title</a><br>";
$a++;
}
$result = sql_query("SELECT forum_id, topic_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_time DESC LIMIT 15", $dbi);
$content .= "</td><td align=\"left\" valign=\"top\">";
while(list($forum_id, $topic_id, $topic_title) = sql_fetch_row($result, $dbi)) {
$result1 = sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'", $dbi );
list( $auth_view, $auth_read ) = sql_fetch_row( $result1, $dbi );
if( ( $auth_view != 2 ) or ( $auth_read != 2 ) ) {
$content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\"> <a href=\"forums.html?amp;file=viewtopic&t=$topic_id\">$topic_title</a><br>";
}
}
$content .= "</td></tr></table>";
?>
|