xoops forums

sugar

Just popping in
Posted on: 2009/11/6 10:56
sugar
sugar (Show more)
Just popping in
Posts: 26
Since: 2003/8/24
#1

RBFramework & RBTool - create module prototype eazy~

Chinese talking here please

RB Framework - simple manipulate sql order for XOOPS object handler
http://code.google.com/p/xoops-rb-framework/

RB Tool - Create XOOPS module prototype and use RB Framework object handler
http://code.google.com/p/xoops-rb-framework/wiki/rbTool

Resized Image


Resized Image

Mamba

Moderator
Posted on: 2009/11/6 12:28
Mamba
Mamba (Show more)
Moderator
Posts: 10499
Since: 2004/4/23
#2

Re: RBFramework & RBTool - create module prototype eazy~

I've installed, but the module is not accessible, i.e. when I click on the module image, nothing happens.

I tried to start it manually:

http://localhost/xoops240/modules/rbtool/

but I'm getting:

Quote:
Fatal error: Cannot redeclare load_object() (previously declared in S:\wamp\www\xoops240\Frameworks\rb\functions.ini.php:11) in S:\wamp\www\xoops240\Frameworks\art\functions.ini.php on line 45


Another thing - where can I download your ToDo Module? The link is broken now.

sugar

Just popping in
Posted on: 2009/11/6 13:07
sugar
sugar (Show more)
Just popping in
Posts: 26
Since: 2003/8/24
#3

Re: RBFramework & RBTool - create module prototype eazy~

Fatal errorCannot redeclare load_object()

I fix this bug and upload new files
or you can
edit Frameworks/rb/functions.ini.php
find load_object replace to rb_load_object
find load_functions replace to rb_load_functions

edit Frameworks/rb/functions.php
find load_functions replace to rb_load_functions

edit modules/rbtool/include/functions.php
find load_object replace to rb_load_object

edit modules/rbtool/sample/functions.txt
find load_object replace to rb_load_object


=================

todo module can download here now
http://code.google.com/p/xoops-rb-framework/downloads/list

sugar

Just popping in
Posted on: 2009/11/16 4:15
sugar
sugar (Show more)
Just popping in
Posts: 26
Since: 2003/8/24
#4

PHP5 Method Chaining

SQL
$sql 'SELECT * FROM '.$xoopsDB->prefix('article').' WHERE uid = 1 AND status = 1 ORDER BY created DESC LIMIT 0, 10';



with XoopsPersistableObjectHandler
$article_handler =& xoops_getmodulehandler('article''news');
$criteria = new CriteriaCompo(new Criteria('uid'1));
$criteria->add(new Criteria('status'1));
$criteria->setLimit(10);
$criteria->setStart(0);
$criteria->setSort('created''DESC');
$articles $article_handler->getObjects($criteriatrue);



with RbCrudHandler
$article_handler =& xoops_getmodulehandler('article''news');
$articles $article_handler->where('uid = 1 AND status = 1')->order_by('created DESC')->limit(100)->getObjects();


or
$article_handler =& xoops_getmodulehandler('article''news');
$article_handler->where('uid = 1');
$article_handler->where('status = 1');
$article_handler->order_by('created DESC');
$article_handler->limit(100);
$articles $article_handler->getObjects();


or
$condition = array();
$condition[] = 'uid = 1';
$condition[] = 'status = 1';

$article_handler =& xoops_getmodulehandler('article''news');
$article_handler->where($condition)->order_by('created DESC')->limit(100);
$articles $article_handler->getObjects();


or
$condition = array();
$condition[] = 'uid = 1';
$condition[] = 'status = 1';

$article_handler =& xoops_getmodulehandler('article''news');
$articles $article_handler->getObjects($condition'created DESC'10 ,0);


do as you like

bumciach

Not too shy to talk
Posted on: 2010/2/9 9:48
bumciach
bumciach (Show more)
Not too shy to talk
Posts: 153
Since: 2007/6/25
#5

Re: RBFramework & RBTool - create module prototype eazy~

And what about joining tables? Does RBFramework will be brought something in this area.