also i write a very simple no cloneable and no permission sensitive plugin for
whatsnew.
just create a file with the name "data.inc.php"
and upload it in modules/whatsnew/plugins/article:
// $Id: data.inc.php,v 1.4 2005/10/22 08:37:48 ohwada Exp $
// 2005-10-01 K.OHWADA
// category, counter
// 2005-06-20 K.OHWADA
// get and set image width, height
// 2005-06-06 K.OHWADA
// small change for plugin.
//================================================================
// What's New Module
// get aritciles from module
// for Article 1.0 final (without permission)
// plugin by irmtfan
//================================================================
include XOOPS_ROOT_PATH."/modules/article/include/vars.php";
function article_new($limit=0, $offset=0)
{
global $xoopsDB;
$myts =& MyTextSanitizer::getInstance();
$i = 0;
$ret = array();
$time = time();
// check the showing property
$sql = "SELECT a.art_id, a.uid, a.art_title as atitle, a.art_summary, t.dohtml, t.dosmiley, t.doxcode, t.doimage, t.dobr, a.art_time_create, a.art_time_submit, a.art_time_publish, a.art_counter, cat.cat_id as catid, cat.cat_title as cattitle FROM ".$xoopsDB->prefix($GLOBALS["ART_DB_PREFIX"]."_article")." a, ".$xoopsDB->prefix($GLOBALS["ART_DB_PREFIX"]."_text")." t, ".$xoopsDB->prefix($GLOBALS["ART_DB_PREFIX"]."_category")." cat WHERE a.art_id=t.art_id AND a.cat_id=cat.cat_id AND a.art_time_publish > 0 AND a.art_time_publish <= $time ORDER BY a.art_time_publish DESC";
$URL_MOD = XOOPS_URL."/modules/".$GLOBALS["artdirname"];
$result = $xoopsDB->query($sql, $limit, $offset);
while( $row = $xoopsDB->fetchArray($result) )
{
$id = $row['art_id'];
// link
$ret[$i]['link'] = $URL_MOD."/view.article.php/".$id;
$ret[$i]['pda'] = $URL_MOD."/transfer.php/".$id."/print";
$ret[$i]['cat_link'] = $URL_MOD."/view.category.php/".$row['catid'];
// title
$ret[$i]['title'] = $row['atitle'];
$ret[$i]['cat_name'] = $row['cattitle'];
// counter
$ret[$i]['hits'] = $row['art_counter'];
// atom
$ret[$i]['id'] = $id;
$ret[$i]['uid'] = $row['uid'];
$ret[$i]['time'] = $row['art_time_submit'];
$ret[$i]['issued'] = $row['art_time_publish'];
$ret[$i]['created'] = $row['art_time_create'];
$html = 0;
$smiley = 0;
$xcode = 0;
$br = 0;
$image = 0;
if ( $row['dohtml'] ) $html = 1;
if ( $row['dosmiley'] ) $smiley = 1;
if ( $row['dobr'] ) $br = 1;
if ( $row['doxcode'] ) $xcode = 1;
if ( $row['doimage'] ) $image = 1;
$maintext = $myts->displayTarea($row['art_summary'], $html, $smiley, $xcode, $image, $br);
$ret[$i]['description'] = $maintext;
$i++;
}
return $ret;
}
function article_num()
{
global $xoopsDB;
$sql = "SELECT count(*) FROM ".$xoopsDB->prefix($GLOBALS["ART_DB_PREFIX"]."_article")." ORDER BY art_id";
$array = $xoopsDB->fetchRow( $xoopsDB->query($sql) );
$num = $array[0];
if (empty($num)) $num = 0;
return $num;
}
function article_data($limit=0, $offset=0)
{
global $xoopsDB;
$i = 0;
$ret = array();
$sql = "SELECT * FROM ".$xoopsDB->prefix($GLOBALS["ART_DB_PREFIX"]."_article")." ORDER BY art_id";
$result = $xoopsDB->query($sql,$limit,$offset);
while($myrow = $xoopsDB->fetchArray($result))
{
$id = $myrow['art_id'];
$ret[$i]['id'] = $id;
$ret[$i]['link'] = XOOPS_URL."/modules/".$GLOBALS["artdirname"]."/view.article.php/".$id;
$ret[$i]['title'] = $myrow['art_title']." ".$myrow['art_summary'];
$ret[$i]['time'] = $myrow['art_time_publish'];
$i++;
}
return $ret;
}
?>
i repeat:
1- it use no permission for select articles.
2- it is just for "article" module dirname.