<?php
// File: $Id: relatedstory.php,v 1.17 2001/12/04 00:50:23 gregorrothfuss 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
// ----------------------------------------------------------------------
// Original Author of file: Patrick Kellum
// Purpose of file: Display releated stories. Only displayed when reading articles.
// ----------------------------------------------------------------------
$blocks_modules['related'] = array(
'func_display' => 'blocks_related_block',
'text_type' => 'Related',
'text_type_long' => 'Story Related Links',
'allow_multiple' => false,
'form_content' => false,
'form_refresh' => false,
'show_preview' => false
);
function blocks_related_block($row) {
global
$sid,
$pntable,
$dbconn,
$story // set by advarticle.php
;
if($story['topic']) {
$row['content'] = '<font class="pn-normal">';
$column = &$pntable['stories_column'];
$sql = "SELECT $column[sid] as sid, $column[title] as title FROM $pntable[stories] WHERE $column[topic]=$story[topic] ORDER BY $column[counter] DESC";
$result = $dbconn->SelectLimit($sql,1);
$mrow = $result->GetRowAssoc(false);
$result->MoveNext();
$column = &$pntable['related_column'];
$result = $dbconn->Execute("SELECT $column[name] as name, $column[url] as url FROM $pntable[related] WHERE $column[tid]=$story[topic]");
while(!$result->EOF) {
$lrow = $result->GetRowAssoc(false);
$result->MoveNext();
$row['content'] .= "<strong><big>·</big></strong> <a href=\"$lrow[url]\" target=\"_blank\">$lrow[name]</a><br>\n";
}
$row['content'] .= "<strong><big>·</big></strong> <a href=\"advtopics.php?topic=$story[topic]\">"._MOREABOUT." $story[topicname]</a><br>\n"
."<strong><big>·</big></strong> <a class=\"pn-normal\" href=\"modules.php?op=modload&name=Search&file=index&action=search&overview=1&active_stories=1&stories_author=$story[aid]\">"._NEWSBY." $story[aid]</a><br>\n"
.'</font><br><hr noshade width="95%" size="1"><b>'._MOSTREAD." $story[topicname]:</b><br>\n"
."<center><a href=\"advarticle.php?sid=$mrow[sid]\">$mrow[title]</a></center><br><br>\n"
.'<div align="right">'
."<a href=\"print.php?sid=$mrow[sid]\"><img src=\"images/global/print.gif\" border=\"0\" alt=\""._PRINTER."\" width=\"15\" height=\"11\"></a> "
."<a class=\"pn-normal\" href=\"modules.php?op=modload&name=Recommend_Us&file=index&req=FriendSend&sid=$sid\"><img src=\"images/global/friend.gif\" border=\"0\" Alt=\""._FRIEND."\" width=\"15\" height=\"11\"></a>\n"
.'</div>'
;
themesideblock($row);
}
}
?>