Ok!
Now the code for the objects in this class is:
include_once XOOPS_ROOT_PATH.'/class/xoopsstory.php';
include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
include_once NW_MODULE_PATH . '/include/functions.php';
class Nw_NewsStory extends XoopsObject
{
var $newstopic; // XoopsTopic object
var $rating; // news rating
var $votes; // Number of votes
var $description; // META, desciption
var $keywords; // META, keywords
var $picture;
var $topic_imgurl;
var $topic_title;
var $tags;
//var $imagerows;
//var $pdfrows;
// Default constructor by Timgno
function __construct()
{
$this->XoopsObject();
$this->initVar("storyid",XOBJ_DTYPE_INT,null,false,8);
$this->initVar("uid",XOBJ_DTYPE_INT,null,false,5);
$this->initVar("title",XOBJ_DTYPE_TXTBOX,null,false);
$this->initVar("created",XOBJ_DTYPE_INT, null, false,10);
$this->initVar("published",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("expired",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("hostname",XOBJ_DTYPE_TXTBOX,null,false);
$this->initVar("nohtml",XOBJ_DTYPE_INT,null,false,1);
$this->initVar("nosmiley",XOBJ_DTYPE_TXTBOX,null,false,1);
$this->initVar("hometext",XOBJ_DTYPE_TXTAREA, null, false);
$this->initVar("bodytext",XOBJ_DTYPE_TXTAREA, null, false);
$this->initVar("keywords",XOBJ_DTYPE_TXTBOX,null,false);
$this->initVar("description",XOBJ_DTYPE_TXTBOX,null,false);
$this->initVar("counter",XOBJ_DTYPE_INT,null,false,8);
$this->initVar("topicid",XOBJ_DTYPE_INT,null,false,4);
$this->initVar("ihome",XOBJ_DTYPE_INT, null, false,1);
$this->initVar("notifypub",XOBJ_DTYPE_INT,null,false,1);
$this->initVar("story_type",XOBJ_DTYPE_TXTBOX,null,false);
$this->initVar("topicdisplay",XOBJ_DTYPE_INT,null,false,1);
$this->initVar("topicalign",XOBJ_DTYPE_TXTBOX,null,false);
$this->initVar("comments",XOBJ_DTYPE_INT,null,false,5);
$this->initVar("rating",XOBJ_DTYPE_DECIMAL, null, false,10);
$this->initVar("votes",XOBJ_DTYPE_INT,null,false,11);
$this->initVar("picture",XOBJ_DTYPE_TXTBOX,null,false);
$this->initVar("dobr",XOBJ_DTYPE_INT,null,false,1);
$this->initVar("tags",XOBJ_DTYPE_TXTBOX,null,false);
$this->initVar("imagerows",XOBJ_DTYPE_INT,null,false,4);
$this->initVar("pdfrows",XOBJ_DTYPE_INT, null, false,4);
}
/**
* Constructor
*/
function Nw_NewsStory($storyid=-1)
{
$this->__construct(); // by Timgno
$this->db =& Database::getInstance();
$this->table = $this->db->prefix('nw_stories');
$this->topicstable = $this->db->prefix('nw_topics');
if (is_array($storyid)) {
$this->makeStory($storyid);
} elseif($storyid != -1) {
$this->getStory(intval($storyid));
}
}
....
ed il mio codice per prelevare è:
include_once $GLOBALS['xoops']->path('modules/xnews/class/class.newstopic.php');
//include_once $GLOBALS['xoops']->path('modules/xnews/class/class.newsstory.php');
include_once $GLOBALS['xoops']->path('modules/xnews/class/nw_stories.php');
include_once $GLOBALS['xoops']->path('include/functions.php');
/**************************** Variables for module xnews *************************/
$nw_storiesHandler =& xoops_getModuleHandler('nw_stories', 'xnews');
//$nw_storiesHandler = new Nw_NewsStory();
$criteria = new CriteriaCompo();
$criteria->setSort("storyid");
$criteria->setOrder("DESC");
$nwrows = $nw_storiesHandler->getCount();
if (isset($_REQUEST['limit'])) {
$criteria->setLimit($_REQUEST['limit']);
$limit = $_REQUEST['limit'];
//$GLOBALS['xoopsTpl']->assign('xnews_limit', $limit);
}
$nw_stories_arr = $nw_storiesHandler->getAll($criteria);
if ($nwrows>0)
{
foreach (array_keys($nw_stories_arr) as $i)
{
$xnews_title = $nw_stories_arr[$i]->getVar("title");
$xnews_description = $nw_stories_arr[$i]->getVar("description");
$xnews_picture = $nw_stories_arr[$i]->getVar("picture");
$GLOBALS['xoopsTpl']->append('last_news', array('title' => $xnews_title,
'description' => $xnews_description,'picture' => $xnews_picture));
}
}
no positive results.
P.S: The object of type decimal, what value should it have?