I'd like to know if the captcha in registration page is off by default in XOOPS 2.3.3? if so, how do I activate it?..
ghia wrote:
To make sure everybody of the 2.3.x branch has the correct core files?
and another question just for confirmation.. when defining a function and putting for example $id = false in the brackets like this
getAll($id = false)
means that this attribute is not necessary when calling?
banesto wrote:
Thanks, that worked out!
How can i get actual results from "getObjects" function (it's in AccMembersTypeHandler class)?function getObjects($criteria = null, $id_as_key = false) {
$ret = array();
$limit = $start = 0;
$sql = 'SELECT * FROM '.$this->db->prefix('acc_member_type');
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)) {
$MembersType = new MembersType();
$MembersType->assignVars($myrow);
if (!$id_as_key) {
$ret[] =& $MembersType;
} else {
$ret[$myrow['tid']] =& $MembersType;
}
unset($MembersType);
}
return $ret;
}
$class_handler =& xoops_getmodulehandler('memberstype');
$memberstype =& $class_handler->getObjects;
... what's next? i get $ret back, right? how can i get out results from that?
banesto wrote:
how does this work? i mean how does foreach loop connects to the following operations? Variables $k and $v are not mentioned and yet somehow function can access variables like "$name", "$climit" etc..foreach ($MembersType->cleanVars as $k => $v) {
${$k} = $v;
}
if ($MembersType->isNew()) {
$tid = $this->db->genId('acc_member_type');
$sql = sprintf("INSERT INTO %s (tid, name, climit, cname) VALUES (%u, %s, %u, %s)", $this->db->prefix('acc_member_type'), $tid, $this->db->quoteString($name), $climit, $this->db->quoteString($cname));}