<?php
// $Id: storytopic.php,v 1.1 2004/07/11 10:28:53 Farsus Exp $
// -------------------------------------------------------------------------//
//			       RUNCMS                                                   //
//                                                                          //
//	 reliable - Unique - Nocost &  Simplicity & ease off use                //
//                       < http://www.runcms.org >                          //
// -------------------------------------------------------------------------//
// Original Author: Half-Dead
// Author Website : http://www.e-xoops.com
// License Type   : Proprietary: See /manual/LICENSES/E-Xoops.txt
// ------------------------------------------------------------------------- //

// Story Topics

function get_meta($id, $limit) {
global $db;

$SQL = "SELECT
	T.topic_title,
	S.title,
	S.hometext,
	S.bodytext
	FROM
	".$db->prefix("stories")." S
	INNER JOIN
	".$db->prefix("topics")." T
	ON
	S.topicid = T.topic_id
	WHERE
	(S.topicid = $id AND T.topic_id = $id)
	ORDER BY
	S.storyid
	DESC";


$query = $db->query($SQL, $limit);

while (list($topic, $title, $hometext, $bodytext) = $db->fetch_row($query)) {
	$result["title"]     = $topic;
	$result["keywords"] .= $topic ." ". $title ." ". $hometext ." ". $bodytext;
}

return $result;
}
?>
