what a poor developper i make ;)
Tdldp
function &getTypeList()
{
$type_list = array (
"1" => "Chasse Petit Gibier Sedentaire",
"2" => "Chasse du Grand Gibier",
"3" => "Chasse du Gibier d'eau",
"4" => "Chasse Petit Gibier Migrateur",
"5" => "Chasse à Courre",
"6" => "Chasse à L'arc",
);
asort($type_list);
reset($type_list);
return $type_list;
}
function &getDeptList()
{
$db =& Database::getInstance();
$myts =& MyTextSanitizer::getInstance();
$sql = "SELECT dept, intitule FROM ".$db->prefix("departements")." ORDER BY dept";
$result = $db->query($sql);
$dept_list = array();
while ( $myrow = $db->fetchArray($result) ) {
$dept_list[$myrow['dept']] = $myts->makeTboxData4Show($myrow['intitule']);
}
return $dept_list;
}
function activateUser(&$user)
{
$dateus = date("Y-m-d");
$heure = date("H:i:s");
$lejour = "$dateus "."$heure";
if ($user->getVar('level') != 0) {
return true;
}
$user->setVar('level', 1);
if ($user->getVar('valide') != 0) {
return true;
}
$user->setVar('valide', 1);
if ($user->getVar('date') != 0) {
return true;
}
$user->setVar('date', $lejour);
if ($user->getVar('ip') != 0) {
return true;
}
$user->setVar('ip', $REMOTE_ADDR);
return $this->_uHandler->insert($user, true);
}
function activateUser(&$user)
{
if ($user->getVar('level') != 0) {
return true;
}
$user->setVar('level', 1);
return $this->_uHandler->insert($user, true);
}
function insert(&$user, $force = false)
{
if (get_class($user) != 'xoopsuser') {
return false;
}
if (!$user->isDirty()) {
return true;
}
if (!$user->cleanVars()) {
return false;
}
foreach ($user->cleanVars as $k => $v) {
${$k} = $v;
}
// RMV-NOTIFY
// Added two fields, notify_method, notify_mode
if ($user->isNew()) {
$uid = $this->db->genId($this->db->prefix('users').'_uid_seq');
$sql = sprintf("INSERT INTO %s (uid, uname, name, email, url, user_avatar, user_regdate, user_icq, user_from, user_sig, user_viewemail, actkey, user_aim, user_yim, user_msnm, pass, posts, attachsig, rank, level, theme, timezone_offset, last_login, umode, uorder, notify_method, notify_mode, user_occ, bio, user_intrest, user_mailok, date, ip, prenom, dept, type, mailing, valide) VALUES (%u, %s, %s, %s, %s, %s, %u, %s, %s, %s, %u, %s, %s, %s, %s, %s, %u, %u, %u, %u, %s, %.2f, %u, %s, %u, %u, %u, %s, %s, %s, %u, %u, %u, %s, %u, %u, %u, %u)", $this->db->prefix('users'), $uid, $this->db->quoteString($uname), $this->db->quoteString($name), $this->db->quoteString($email), $this->db->quoteString($url), $this->db->quoteString($user_avatar), time(), $this->db->quoteString($user_icq), $this->db->quoteString($user_from), $this->db->quoteString($user_sig), $user_viewemail, $this->db->quoteString($actkey), $this->db->quoteString($user_aim), $this->db->quoteString($user_yim), $this->db->quoteString($user_msnm), $this->db->quoteString($pass), $posts, $attachsig, $rank, $level, $this->db->quoteString($theme), $timezone_offset, 0, $this->db->quoteString($umode), $uorder, $notify_method, $notify_mode, $this->db->quoteString($user_occ), $this->db->quoteString($bio), $this->db->quoteString($user_intrest), $user_mailok, $date, $ip, $this->db->quoteString($prenom), $dept, $type, $mailing, $valide);
} else {
$sql = sprintf("UPDATE %s SET uname = %s, name = %s, email = %s, url = %s, user_avatar = %s, user_icq = %s, user_from = %s, user_sig = %s, user_viewemail = %u, user_aim = %s, user_yim = %s, user_msnm = %s, posts = %d, pass = %s, attachsig = %u, rank = %u, level= %u, theme = %s, timezone_offset = %.2f, umode = %s, last_login = %u, uorder = %u, notify_method = %u, notify_mode = %u, user_occ = %s, bio = %s, user_intrest = %s, user_mailok = %u, date = %u, ip = %u, prenom = %s, dept = %u, type = %u, mailing = %u, valide = %u WHERE uid = %u", $this->db->prefix('users'), $this->db->quoteString($uname), $this->db->quoteString($name), $this->db->quoteString($email), $this->db->quoteString($url), $this->db->quoteString($user_avatar), $this->db->quoteString($user_icq), $this->db->quoteString($user_from), $this->db->quoteString($user_sig), $user_viewemail, $this->db->quoteString($user_aim), $this->db->quoteString($user_yim), $this->db->quoteString($user_msnm), $posts, $this->db->quoteString($pass), $attachsig, $rank, $level, $this->db->quoteString($theme), $timezone_offset, $this->db->quoteString($umode), $last_login, $uorder, $notify_method, $notify_mode, $this->db->quoteString($user_occ), $this->db->quoteString($bio), $this->db->quoteString($user_intrest), $user_mailok, $date, $ip, $this->db->quoteString($prenom), $dept, $type, $mailing, $valide, $uid);
}
if (false != $force) {
$result = $this->db->queryF($sql);
} else {
$result = $this->db->query($sql);
}
if (!$result) {
return false;
}
if (empty($uid)) {
$uid = $this->db->getInsertId();
}
$user->assignVar('uid', $uid);
return true;
}
e-mail envoyé à :
PM envoyé à :
e-mail envoyé à :
PM envoyé à :
e-mail envoyé à :
PM envoyé à :
e-mail envoyé à :
PM envoyé à :
e-mail envoyé à :
PM envoyé à :
if ( $this->isMail ) {
if ( !$this->sendMail($user->getVar("email"), $subject, $text, $headers) ) {
if ($debug) {
$this->errors[] = sprintf(_MAIL_SENDMAILNG, $user->getVar("uname"));
}
} else {
if ($debug) {
$this->success[] = sprintf(_MAIL_MAILGOOD, $user->getVar("uname"));
}
}
}
// send private message
if ( $this->isPM ) {
if ( !$this->sendPM($user->getVar("uid"), $subject, $text) ) {
if ($debug) {
$this->errors[] = sprintf(_MAIL_SENDPMNG, $user->getVar("uname"));
}
} else {
if ($debug) {
$this->success[] = sprintf(_MAIL_PMGOOD, $user->getVar("uname"));
}
}
}