3
Well here's what i'm currently trying to create for the 5 Article News Block. Any suggestions to why the "hometext" is the same on both but the rest of the content is unique?
http://hamilton-ohio.com/main/Here's the script i'm trying to use. Thanks in advance!!
global $xoopsDB, $xoopsConfig, $xoopsUser, $xoopsModule, $xoopsModuleConfig, $HTTP_SERVER_VARS;
include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
$topicid = 2;
$query = "SELECT storyid, title, topicid, hometext FROM ".XOOPS_DB_PREFIX."_stories WHERE topicid='$topicid' ORDER BY storyid ASC";
$result = mysql_query($query);
$rows = mysql_num_rows($result);
$sarray = NewsStory::getAllPublished();
$scount = count($sarray);
for ( $i = 0; $i < $scount; $i++ ) {
$storyid = $sarray[$i]->storyid();
$storytext = $sarray[$i]->hometext();
}
while ($row = mysql_fetch_object($result))
{
if ( $row->topic=$topicid)
{
echo "<table cellspacing=1 class=outer><tr align=left valign=top><th colspan=2>
<table width=100% cellspacing=0 cellpadding=0><tr>
<td width=25><img border=0 src=http://domain.com/images/headline_icon.gif></td>";
echo "<td class=subhead>$row->title</td><td class=subhead width=80>";
if (is_object($xoopsUser)) {
echo "[<a class=white href=http://domain.com/main/modules/news/admin/index.php?op=edit&storyid=$row->storyid>Edit</a>
| <a class=white href=http://domain.com/main/modules/news/admin/index.php?op=delete&storyid=$row->storyid>Delete</a>]";
}
echo "</tr></table></th></tr><tr><td valign=top align='left' class='even'>$storytext</td></tr></table><br>";
}
}