Ghia thank you for the help and the tip about creating other references/routines beyond the originals. I´m using them in other situations! Once I´m not so good in php, these are gold.
Thank You!
http://www.esterecomendo.com.br/portal/
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
$limit = $criteria->getLimit();
$start = $criteria->getStart();
}
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement'))
{
$sql .= ' '.$criteria->renderWhere();
$limit = 4;//number of itens in droplist
$start = 1;//it gives groups 2,3,4,.... except ADMIN }
else {
foreach ($groups as $key => $group) {
$group_select[] = new XoopsFormHidden('groups[' . $key .
']', $group);
}
else {
if ($uid_value == '1') {$group_select[] = new
XoopsFormHidden('groups[' . $key . ']', $group); } else
{$group_select[] = new XoopsFormSelectGroup('<font
style="font-size: 17px; color: #A65700">
(!)'._US_GROUPS.'</font>', 'groups', false, $groups, 5, true);}}
/**
* retrieve groups from the database
* @param object $criteria {@link CriteriaElement} with conditions for the groups
* @param bool $id_as_key should the groups' IDs be used as keys for the associative array?
* @return mixed Array of groups
*/
function getObjects($criteria = null, $id_as_key = false)
{
$ret = array();
$limit = $start = 0;
$sql = 'SELECT * FROM '.$this->db->prefix('groups');
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
$limit = $criteria->getLimit();
$start = $criteria->getStart();
}
$result = $this->db->query($sql, $limit, $start);
if (!$result) {
return $ret;
}
while ($myrow = $this->db->fetchArray($result)) {
$group = new XoopsGroup();
$group->assignVars($myrow);
if (!$id_as_key) {
$ret[] =& $group;
} else {
$ret[$myrow['groupid']] =& $group;
}
unset($group);
}
return $ret;
}*/
/**
* retrieve groups from the database
*
* @param object $criteria {@link CriteriaElement} with conditions for the groups
* @param bool $id_as_key should the groups' IDs be used as keys for the associative array?
* @return mixed Array of groups
*/
function getObjects($criteria = null, $id_as_key = false)
{
$ret = array();
$limit = $start = 0;
$sql = 'SELECT * FROM '.$this->db->prefix('groups');
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' '.$criteria->renderWhere();
////////////////////HERE///////////////////////
$limit = 4;
$start = 1;
/////////////////////////////////////////////////
}
$result = $this->db->query($sql, $limit, $start);
if (!$result) {
return $ret;
}
while ($myrow = $this->db->fetchArray($result)) {
$group = new XoopsGroup();
$group->assignVars($myrow);
if (!$id_as_key) {
$ret[] =& $group;
} else {
$ret[$myrow['groupid']] =& $group;
}
unset($group);
}
return $ret;
}
$group_select[] = new XoopsFormSelectGroup('<font style="font-size: 17px; color: #A65700">(!)'._US_GROUPS.'</font>', 'groups', false, $groups, 5, true);
<tr align="left" valign="top"><td class="head"><div class="xoops-form-element-caption"><span class="caption-text"><font style="font-size: 17px; color: rgb(166, 87, 0);">(!)Grupos de Usuários</font></span><span class="caption-marker">*</span></div></td><td class="even"><select size="5" name="groups[]" id="groups[]" multiple="multiple">
<option value="1">ADMINISTRATOR</option>
<option value="2" selected="selected">USER</option>
<option value="5">SELECIONADOR</option>
<option value="6">COLABORADOR</option>
<option value="7">ALUNO</option>
<option value="9">PROFESSOR</option>
</select></td></tr>
$result = mysql_query("SELECT * FROM 3b5s_stories ORDER BY -storyid"); if($row = mysql_fetch_array($result)){
$dada = $row["created"];
echo $dada; // returns "1234567890" instead of "19 de fevereiro de 2009"
...
}