XOOPS  2.6.0
smiley.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
17 
26 {
30  public function __construct()
31  {
32  $this->initVar('smiley_id', XOBJ_DTYPE_INT, null, false);
33  $this->initVar('smiley_code', XOBJ_DTYPE_TXTBOX, null, true, 100);
34  $this->initVar('smiley_url', XOBJ_DTYPE_OTHER, null, false, 30);
35  $this->initVar('smiley_emotion', XOBJ_DTYPE_TXTBOX, null, true, 100);
36  $this->initVar('smiley_display', XOBJ_DTYPE_INT, 1, false);
37  }
38 }
39 
41 {
47  public function __construct(Connection $db = null)
48  {
49  parent::__construct($db, 'smilies', 'SmiliesSmiley', 'smiley_id', 'smiley_emotion');
50  }
51 
52  public function getSmilies($start=0, $limit=0, $asobject=true)
53  {
54  $criteria = new CriteriaCompo();
55  $criteria->setSort('smiley_id');
56  $criteria->setOrder('ASC');
57  $criteria->setStart($start);
58  $criteria->setLimit($limit);
59  return parent::getall($criteria, false, $asobject);
60  }
61 
62  public function getActiveSmilies($asobject=true)
63  {
64  $criteria = new CriteriaCompo(new Criteria('smiley_display', 1));
65  return parent::getall($criteria, false, $asobject);
66  }
67 }
__construct(Connection $db=null)
Definition: smiley.php:47
getActiveSmilies($asobject=true)
Definition: smiley.php:62
getSmilies($start=0, $limit=0, $asobject=true)
Definition: smiley.php:52
$limit
Definition: findusers.php:202
$criteria
$start
initVar($key, $data_type, $value=null, $required=false, $maxlength=null, $options= '')