4
You're right Mith.
This is the code of last_news.php
<?php
//include '../../include/cp_header.php';
include_once XOOPS_ROOT_PATH . "/class/xoopstopic.php";
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
include_once XOOPS_ROOT_PATH . "/modules/news/class/class.newsstory.php";
/*
* Shows last 10 published stories
*/
function lastStories()
{
global $xoopsDB, $xoopsConfig, $xoopsModule;
echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class="odd">";
echo "<div style='text-align: center;'><b>" . _AM_LAST10ARTS . "</b><br />";
$storyarray = NewsStory :: getAllPublished( 10, 0, 0, 1 );
echo "<table border='1' width='50%'><tr class='bg3'><td align='center'>" . _AM_STORYID . "</td><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center' class='nw'>" . _AM_PUBLISHED . "</td><td align='center' class='nw'>" . _AM_EXPIRED . "</td><td align='center'>" . _AM_ACTION . "</td></tr>";
foreach( $storyarray as $eachstory )
{
$published = formatTimestamp( $eachstory -> published() );
$expired = ( $eachstory -> expired() > 0 ) ? formatTimestamp( $eachstory -> expired() ) : '---';
$topic = $eachstory -> topic();
echo "
<tr><td align='center'><b>" . $eachstory -> storyid() . "</b>
</td><td align='left'><a href='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/article.php?storyid=" . $eachstory -> storyid() . "'>" . $eachstory -> title() . "</a>
</td><td align='center'>" . $topic -> topic_title() . "
</td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $eachstory -> uid() . "'>" . $eachstory -> uname() . "</a></td><td align='center' class='nw'>" . $published . "</td><td align='center'>" . $expired . "</td><td align='center'><a href='" . XOOPS_URL . "/modules/news/admin/index.php?op=edit&storyid=" . $eachstory -> storyid() . "'>" . _AM_EDIT . "</a>-<a href='" . XOOPS_URL . "/modules/news/admin/index.php?op=delete&storyid=" . $eachstory -> storyid() . "'>" . _AM_DELETE . "</a>";
echo "</td></tr>n";
}
echo "</table><br />";
echo "<form action='index.php' method='post'>
" . _AM_STORYID . " <input type='text' name='storyid' size='10' />
<select name='op'>
<option value='edit' selected='selected'>" . _AM_EDIT . "</option>
<option value='delete'>" . _AM_DELETE . "</option>
</select>
<input type='submit' value='" . _AM_GO . "' />
</form>
</div>
";
echo"</td></tr></table>";
}
//xoops_cp_header();
//echo "<h4>" . _AM_CONFIG . "</h4>";
include_once XOOPS_ROOT_PATH . "/class/module.textsanitizer.php";
// $xoopsModule->printAdminMenu();
// echo "<br />";
lastStories();
echo "<br />";
echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class="odd">";
echo"all articvle";
echo"</td></tr></table>";
//xoops_cp_footer();
?>
and i placed it in xoops_install/modules/system/ folder.
This file works fine (aexcept for the lang defines)if included in
xoops_install/modules/system/admin.php
with this line:
include XOOPS_ROOT_PATH . "/modules/system/last_news.php";
The same file gives me the error reported in my first post
if it's included in
xoops_install/admin.php
Hope i was more clear now and you can help.