XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
Settings.class.php
1<?php
12
13if (!defined('XOOPS_ROOT_PATH')) {
14 exit();
15}
16
18{
19 public function __construct()
20 {
21 $mModuleConfig = XCube_Root::getSingleton()->mContext->mModuleConfig;
22
23 $this->initVar('uid', XOBJ_DTYPE_INT, 0);
24 $this->initVar('usepm', XOBJ_DTYPE_INT, $mModuleConfig['usepm'], true);
25 $this->initVar('tomail', XOBJ_DTYPE_INT, $mModuleConfig['tomail'], true);
26 $this->initVar('viewmsm', XOBJ_DTYPE_INT, $mModuleConfig['viewmsm'], true);
27 $this->initVar('pagenum', XOBJ_DTYPE_INT, 0, true);
28 $this->initVar('blacklist', XOBJ_DTYPE_STRING, '');
29 }
30}
31
33{
34 public $mTable = 'message_users';
35 public $mPrimary = 'uid';
36 public $mClass = 'MessageSettingsObject';
37
38// public function __construct(&$db)
39// {
40// parent::__construct($db);
41// }
42
43 public function chkUser($uid)
44 {
45 $sql = 'SELECT `uname` FROM `' . $this->db->prefix('users') . '` ';
46 $sql.= 'WHERE `uid` = ' . $uid;
47 $result = $this->db->query($sql);
48 return !(1 !== $this->db->getRowsNum($result));
49 }
50
51 public function getuidTouname($uname)
52 {
53 $uid = -1;
54 $sql = 'SELECT `uid` FROM `' . $this->db->prefix('users') . '` ';
55 $sql.= 'WHERE `uname` = ' . $this->db->quoteString($uname);
56 $result = $this->db->query($sql);
57 [$uid] = $this->db->fetchRow($result);
58 return $uid;
59 }
60}