45 var $needed_files = Array(
47 '/ips_kernel/class_db_mysql.php',
48 '/ips_kernel/class_converge.php',
52 var $version =
'2_0_4';
54 var $command =
'fetch_row';
55 var $command_free =
'free_result';
63 function Ipb($path, $version)
65 if (!empty($path) && !empty($version)) {
66 $this->version = $version;
90 $ipb_root_path = $path;
91 $ipb_kernel_path = $ipb_root_path.
'/ips_kernel';
94 if (!is_dir($ipb_root_path) || !is_dir($ipb_kernel_path)) {
100 if (is_file($ipb_root_path.
'/conf_global.php')) {
101 include $ipb_root_path.
'/conf_global.php';
105 $this->info =& $INFO;
108 switch ($this->version) {
110 if (isset($INFO[
'html_url'])) {
111 $this->ipb_url = $INFO[
'html_url'];
112 }
else if (isset($INFO[
'board_url'])) {
113 $this->ipb_url = $INFO[
'board_url'];
119 $this->ipb_url = $INFO[
'board_url'];
123 $INFO[
'sql_driver'] = ! $INFO[
'sql_driver'] ?
'mysql' : strtolower($INFO[
'sql_driver']);
125 if ($this->version !=
'3_0_2') {
126 require_once $ipb_kernel_path.
'/class_db_'.$INFO[
'sql_driver'].
'.php';
129 switch ($this->version) {
131 if (class_exists(
'db_driver')) {
132 $this->db =
new db_driver;
139 $driver =
'db_driver_'.$INFO[
'sql_driver'];
140 $this->db =
new $driver;
143 require_once($ipb_root_path.
'/initdata.php');
144 require_once(IPS_ROOT_PATH.
'/sources/base/ipsRegistry.php');
145 $this->registry = ipsRegistry::instance();
146 $this->registry->init();
147 error_reporting(E_ALL);
148 $this->db = $this->registry->DB();
149 $this->command =
'fetch';
150 $this->command_free =
'freeResult';
154 if (!defined(
'IN_IPB')) {
155 define (
'IN_IPB', TRUE);
157 $this->db->obj[
'sql_database'] = $INFO[
'sql_database'];
158 $this->db->obj[
'sql_user'] = $INFO[
'sql_user'];
159 $this->db->obj[
'sql_pass'] = $INFO[
'sql_pass'];
160 $this->db->obj[
'sql_host'] = $INFO[
'sql_host'];
161 $this->db->obj[
'sql_tbl_prefix'] = $INFO[
'sql_tbl_prefix'];
162 $this->db->obj[
'query_cache_file'] = $ipb_root_path.
'/sources/sql/'.$INFO[
'sql_driver'].
'_queries.php';
163 if ($this->version ==
'3_0_2') {
164 $this->db->obj[
'query_cache_file'] =
'';
166 $this->db->obj[
'use_shutdown'] = 1;
168 if (is_array($this->db->connect_vars) && count($this->db->connect_vars)) {
169 foreach ($this->db->connect_vars as $k => $v) {
170 $this->db->connect_vars[$k] = (isset($INFO[$k]) ? $INFO[$k] :
'');
173 if ($this->db->connect())
return TRUE;
188 if (!is_null($this->db)) {
205 if (!is_null($this->db)) {
206 $result = $this->db->close_db();
227 return $this->ipb_url;
248 $tmp = explode(
'_', $assetid);
252 if (empty($id) || empty($prefix)) {
255 if ( $prefix ==
'u') {
258 }
else if ( $prefix ==
'g' ) {
263 if (empty($result))
return FALSE;
286 switch ($this->version) {
290 if ($is_email_login) {
291 if (!IPSMember::checkByEmail($username))
return FALSE;
292 $member_key = $username;
294 $sql =
'SELECT m.member_id FROM '.$this->db->obj[
'sql_tbl_prefix'].
'members m
295 WHERE m.name=\''.str_replace(
''',
''', htmlspecialchars($username, ENT_QUOTES)).
'\';
';
296 $member_info = $this->_getResult($sql, Array(), TRUE);
297 $member_id = array_get_index($member_info, 'member_id
', 0);
298 if (empty($member_id)) return FALSE;
299 $member_key = $member_id;
301 if (empty($member_key)) return FALSE;
302 $md5_password = md5($password);
303 $status = IPSMember::authenticateMember($member_key, $md5_password);
307 // Old method of authentication
308 require_once $bridge->attr('location
').'/ips_kernel/class_converge.php
';
309 $converge = new class_converge($this->db);
311 if ($is_email_login) {
312 if (!$converge->converge_check_for_member_by_email($username)) {
315 $converge->converge_load_member_by_email($username);
320 '.$this->db->obj['sql_tbl_prefix
'].'members
322 name=\
''.str_replace(
''',
''', htmlspecialchars($username, ENT_QUOTES)).
'\';
324 $db_result = $this->db->query($sql);
325 $this->_assertValidResult($this->db, 'Could not authenticate IPB user
');
327 while ($row = $this->db->{$this->command}($db_result)) {
330 $this->db->{$this->command_free}($db_result);
331 if (empty($test)) return FALSE;
333 @$converge->converge_load_member_by_id($test[0]['id']);
336 return $converge->converge_authenticate_member(md5($password));
339 }//end authenticateUser()
342 //-- GROUPS AND MEMBERS --//
379 function getAllInfo($cols=Array(), $id=0)
383 $custom_columns = FALSE;
384 $table_name = 'members
';
385 $table_short_name = 'm
';
386 $member_id_field = $this->_getMemberIdField();
387 $member_group_id_field = $this->_getMemberGroupIdField();
388 $m_cols = Array($member_id_field, 'name
', $member_group_id_field, 'email
', 'title
', 'member_login_key
');
389 $g_cols = Array('g_id
', 'g_title
', 'g_mem_info
', 'prefix
', 'suffix
');
392 foreach ($m_cols as $c) {
393 $columns[] = 'm.
'.$c;
395 foreach ($g_cols as $c) {
396 $columns[] = 'g.
'.$c;
399 $custom_columns = TRUE;
405 $where = 'WHERE
'.$table_short_name.'.
'.$member_id_field.'=
'.$id;
407 $join = 'LEFT JOIN
'.$this->db->obj['sql_tbl_prefix
'].'groups g ON (m.
'.$member_group_id_field.'=g.g_id)
';
408 $sql = $this->_buildQuery($columns, $table_name, $table_short_name, $where, $join);
411 $db_result = $this->db->query($sql);
412 $this->_assertValidResult($this->db, 'Could not
get IPB info
');
415 $cols = array_merge($m_cols, $g_cols);
416 while ($row = $this->db->{$this->command}($db_result)) {
417 if (!$custom_columns) {
418 $key = $row[$cols[0]];
419 $tmp_cols = array_slice($cols, 1);
421 foreach ($tmp_cols as $c) {
422 $data[$c] = $row[$c];
424 $result[$key] = $data;
427 foreach ($cols as $c) {
433 $this->db->{$this->command_free}($db_result);
435 $result = $this->_maintainDataFormat($result);
476 function getMemberGroupInfo($table_name='members
', $cols=Array(), $id=0)
480 $custom_columns = FALSE;
481 $member_id_field = $this->_getMemberIdField();
482 $member_group_id_field = $this->_getMemberGroupIdField();
484 if ($table_name == 'members
') {
485 $table_short_name='u
';
486 } else if ($table_name == 'groups
') {
487 $table_short_name='g
';
490 switch($this->version) {
493 if ($table_name == 'members
') {
494 $cols = 'u.
'.$member_id_field.', u.name, u.
'.$member_group_id_field.', u.email, u.title, u.member_login_key, u.bday_day, u.bday_month, u.bday_year, \
'\' as vdir, me.field_3 as aim_name, me.field_4 as msnname, me.field_5 as website, me.field_6 as icq_number, me.field_8 as location, me.field_9 as interests, me.field_10 as yahoo, ue.avatar_type as photo_type, ue.avatar_location as photo_location, ue.avatar_size as photo_dimensions, ue.notes, ue.links, ue.bio, ue.ta_size, ue.signature, ue.avatar_location, ue.avatar_size, ue.avatar_type
';
495 } else if ($table_name == 'groups
') {
496 $cols = 'g.g_id, g.g_title, g.g_mem_info, g.prefix, g.suffix
';
499 $custom_columns = TRUE;
502 $from = $this->db->obj['sql_tbl_prefix
'].$table_name.' '.$table_short_name;
504 if ($table_name == 'members
') {
505 $join = ' LEFT JOIN
'.$this->db->obj['sql_tbl_prefix
'].'profile_portal ue ON u.
'.$member_id_field.'=ue.pp_member_id
';
506 $join .= ' LEFT JOIN
'.$this->db->obj['sql_tbl_prefix
'].'pfields_content me ON me.member_id=u.
'.$member_id_field;
511 if ($table_name == 'members
') {
512 $where = ' WHERE
'.$table_short_name.'.
'.$member_id_field.'=
'.$id;
513 } else if ($table_name == 'groups
') {
514 $where = ' WHERE
'.$table_short_name.'.g_id=
'.$id;
517 $sql = 'SELECT
'.$cols.$from.$join.$where;
521 if ($table_name == 'members
') {
523 'u.
'.$member_id_field,
525 'u.
'.$member_group_id_field,
528 'u.member_login_key
',
543 'ue.avatar_location
',
547 } else if ($table_name == 'groups
') {
548 $cols = Array('g.g_id
', 'g.g_title
', 'g.g_mem_info
', 'g.prefix
', 'g.suffix
');
551 $custom_columns = TRUE;
557 if ($table_name == 'members
') {
558 $join = ' LEFT JOIN
'.$this->db->obj['sql_tbl_prefix
'].'member_extra ue ON u.
'.$member_id_field.'=ue.id
';
563 if ($table_name == 'members
') {
564 $where = ' WHERE
'.$table_short_name.'.
'.$member_id_field.'=
'.$id;
565 } else if ($table_name == 'groups
') {
566 $where = ' WHERE
'.$table_short_name.'.g_id=
'.$id;
569 $sql = $this->_buildQuery($columns, $table_name, $table_short_name, $where, $join);
573 $db_result = $this->db->query($sql);
574 $this->_assertValidResult($this->db, 'Could not
get IPB member group info
');
577 while ($row = $this->db->{$this->command}($db_result)) {
578 if (!$custom_columns) {
579 $tmp_col_name = explode('.
', $cols[0]);
580 $key = $row[$tmp_col_name[1]];
581 $tmp_cols = array_slice($cols, 1);
583 foreach ($tmp_cols as $c) {
584 $tmp_col_name = explode('.
', $c);
585 $data[$tmp_col_name[1]] = $row[$tmp_col_name[1]];
587 $data['type
'] = $table_name;
588 $result[$table_short_name.'_
'.$key] = $data;
590 $tmp = Array('type
' => $table_name);
591 foreach ($cols as $c) {
592 if ($c == $member_id_field || $c == 'g_id
') {
593 $tmp[$c] = $table_short_name.'_
'.$row[$c];
601 $this->db->{$this->command_free}($db_result);
603 $result = $this->_maintainDataFormat($result);
607 }//end getMemberGroupInfo()
621 function getMembers($member_id=0, $group_id=0, $cols=Array())
625 $custom_columns = FALSE;
626 $table_name = 'members
';
627 $table_short_name='m
';
628 $member_id_field = $this->_getMemberIdField();
629 $member_group_id_field = $this->_getMemberGroupIdField();
631 $cols = Array($member_id_field, 'name
', $member_group_id_field, 'email
', 'title
', 'member_login_key
');
633 $custom_columns = TRUE;
637 foreach ($cols as $c) {
638 $columns[] = $table_short_name.'.
'.$c;
643 if ($member_id || $group_id) {
646 $where .= $table_short_name.'.
'.$member_id_field.'=
'.$member_id.(($group_id) ? ' and
' : '');
649 $where .= $table_short_name.'.
'.$member_group_id_field.'=
'.$group_id;
653 $sql = $this->_buildQuery($columns, $table_name, $table_short_name, $where);
656 $db_result = $this->db->query($sql);
657 $this->_assertValidResult($this->db, 'Could not
get IPB member(s)
');
660 while ($row = $this->db->{$this->command}($db_result)) {
661 if (!$custom_columns) {
662 $key = $row[$cols[0]];
663 $tmp_cols = array_slice($cols, 1);
665 foreach ($tmp_cols as $c) {
666 if ($c == $member_group_id_field) {
667 $data[$c] = 'g_
'.$row[$c];
669 $data[$c] = $row[$c];
672 $data['type
'] = $table_name;
673 $result['u_
'.$key] = $data;
675 $tmp = Array('type
' => $table_name);
676 foreach ($cols as $c) {
677 if ($c == $member_id_field) {
678 $tmp[$c] = 'u_
'.$row[$c];
686 $this->db->{$this->command_free}($db_result);
688 $result = $this->_maintainDataFormat($result);
702 function getCustomFields()
704 $sql = $this->_buildQuery('*
', 'pfields_data
', 'pfd
');
706 return $this->_getResult($sql, Array(), FALSE);
708 }//end getCustomFields()
720 function getMemberCustomFieldData($member_id)
722 $tmp = explode(':
', $member_id);
723 if (!isset($tmp[1])) return Array();
724 $tmp = explode('_
', $tmp[1]);
727 $sql = $this->_buildQuery('*
', 'pfields_content
', 'pfc
', ' WHERE pfc.member_id=
'.$id);
729 return $this->_getResult($sql, Array(), FALSE);
731 }//end getMemberCustomFieldData()
745 function getGroupInfo($group_id)
747 $tmp = explode(':
', $group_id);
748 if (!isset($tmp[1])) return Array();
749 $tmp = explode('_
', $tmp[1]);
752 $sql = $this->_buildQuery('*
', 'groups
', 'g
', ' WHERE g.g_id=
'.$id);
753 return $this->_getResult($sql, Array(), TRUE);
755 }//end getGroupInfo()
764 function getListOfGroups()
771 $sql = $this->_buildQuery($fields, 'groups
', 'g
');
773 return $this->_getResult($sql, Array('g_id
' => 'id'), FALSE);
775 }//end getListOfGroups()
790 function canViewBoard($username)
792 $member_group_id_field = $this->_getMemberGroupIdField();
794 m.name, g.g_view_board
796 '.$this->db->obj['sql_tbl_prefix
'].'members m,
797 '.$this->db->obj['sql_tbl_prefix
'].'groups g
799 m.
'.$member_group_id_field.'=g.g_id and
800 m.name=\
''.str_replace(
''',
''', htmlspecialchars($username, ENT_QUOTES)).
'\'
802 return $this->_getResult($sql, Array(), TRUE);
804 }//end canViewBoard()
815 function getMemberInfo($member_id)
817 $tmp = explode(':
', $member_id);
818 if (!isset($tmp[1])) return Array();
819 $tmp = explode('_
', $tmp[1]);
821 switch ($this->version) {
823 $sql = 'SELECT m.*, \
'\' as vdir, me.field_3 as aim_name, me.field_4 as msnname, me.field_5 as website, me.field_6 as icq_number, me.field_8 as location, me.field_9 as interests, me.field_10 as yahoo, ue.avatar_type as photo_type, ue.avatar_location as photo_location, ue.avatar_size as photo_dimensions, ue.notes, ue.links, ue.bio, ue.ta_size, ue.signature, ue.avatar_location, ue.avatar_size, ue.avatar_type FROM
'.$this->db->obj['sql_tbl_prefix
'].'members m LEFT JOIN
'.$this->db->obj['sql_tbl_prefix
'].'profile_portal ue ON ue.pp_member_id=m.member_id LEFT JOIN
'.$this->db->obj['sql_tbl_prefix
'].'pfields_content me ON me.member_id=m.member_id WHERE m.member_id=
'.$id;
826 $sql = $this->_buildQuery('*
', 'members
', 'm
', ' WHERE m.id=
'.$id, ' LEFT JOIN
'.$this->db->obj['sql_tbl_prefix
'].'member_extra me ON me.id=m.id
');
829 $data = $this->_getResult($sql, Array(), TRUE, TRUE);
833 }//end getMemberInfo()
844 function getMemberInfoByName($member_name)
846 switch ($this->version) {
848 $member_id_field = $this->_getMemberIdField();
849 $sql = 'SELECT m.*, \
'\' as vdir, me.field_3 as aim_name, me.field_4 as msnname, me.field_5 as website, me.field_6 as icq_number, me.field_8 as location, me.field_9 as interests, me.field_10 as yahoo, ue.avatar_type as photo_type, ue.avatar_location as photo_location, ue.avatar_size as photo_dimensions, ue.notes, ue.links, ue.bio, ue.ta_size, ue.signature, ue.avatar_location, ue.avatar_size, ue.avatar_type FROM
'.$this->db->obj['sql_tbl_prefix
'].'members m LEFT JOIN
'.$this->db->obj['sql_tbl_prefix
'].'profile_portal ue ON ue.pp_member_id=m.member_id LEFT JOIN
'.$this->db->obj['sql_tbl_prefix
'].'pfields_content me ON me.member_id=m.member_id WHERE m.name=\
''.str_replace(
''',
''', htmlspecialchars($member_name, ENT_QUOTES)).
'\'';
852 $sql = $this->
_buildQuery(
'*',
'members',
'm',
' WHERE m.name=\''.str_replace(
''',
''', htmlspecialchars($member_name, ENT_QUOTES)).
'\'',
' LEFT JOIN '.$this->db->obj[
'sql_tbl_prefix'].
'member_extra me ON me.id=m.id');
855 $data = $this->
_getResult($sql, Array(), TRUE, TRUE);
874 switch ($this->version) {
876 $member_id_field =
'member_id';
877 $member_group_id_field =
'member_group_id';
880 $member_id_field =
'id';
881 $member_group_id_field =
'mgroup';
883 $tmp = explode(
':', $member_id);
884 if (!isset($tmp[1]))
return Array();
885 $tmp = explode(
'_', $tmp[1]);
888 $sql = $this->
_buildQuery(Array($member_group_id_field),
'members',
'm',
' WHERE m.'.$member_id_field.
'='.$id);
890 $data = $this->
_getResult($sql, Array(), TRUE, TRUE);
910 'u.'.$member_id_field,
912 'u.'.$member_group_id_field,
916 $sql = $this->
_buildQuery($fields,
'members',
'u');
918 $tmp = explode(
':', $group_id);
919 if (!isset($tmp[1]))
return Array();
920 $tmp = explode(
'_', $group_id);
922 $sql = $this->
_buildQuery($fields,
'members',
'u',
' WHERE u.'.$member_group_id_field.
'='.$id);
925 $results = $this->
_getResult($sql, Array(), FALSE);
928 foreach ($results as $index => $result) {
950 $tmp = explode(
':', $forum_id);
951 if (!isset($tmp[1]))
return Array();
952 $tmp = explode(
'_', $tmp[1]);
960 $sql = $this->
_buildQuery($fields,
'forums',
'f',
' WHERE f.id='.$id);
962 return $this->
_getResult($sql, Array(), TRUE);
979 $sql = $this->
_buildQuery($fields,
'forums',
'f',
' WHERE f.parent_id=-1');
981 return $this->
_getResult($sql, Array(), FALSE);
999 $tmp = explode(
':', $forum_id);
1000 if (!isset($tmp[1]))
return Array();
1001 $tmp = explode(
'_', $tmp[1]);
1011 'f.last_poster_name',
1013 $sql = $this->
_buildQuery($fields,
'forums',
'f',
' WHERE f.id='.$id);
1015 return $this->
_getResult($sql, Array(), TRUE);
1030 $tmp = explode(
':', $forum_id);
1031 if (!isset($tmp[1]))
return Array();
1032 $tmp = explode(
'_', $tmp[1]);
1035 $sql = $this->
_buildQuery(Array(
'parent_id'),
'forums',
'f',
' WHERE f.id='.$id);
1037 return $this->
_getResult($sql, Array(), TRUE);
1052 $tmp = explode(
'_', $root_forum_id);
1060 $sql = $this->
_buildQuery($fields,
'forums',
'f',
' WHERE f.parent_id='.$id);
1062 return $this->
_getResult($sql, Array(), FALSE);
1080 $tmp = explode(
':', $topic_id);
1081 if (!isset($tmp[1]))
return Array();
1082 $tmp = explode(
'_', $tmp[1]);
1093 't.last_poster_name',
1097 $sql = $this->
_buildQuery($fields,
'topics',
't',
' WHERE t.tid='.$id);
1099 return $this->
_getResult($sql, Array(
'title' =>
'name'), TRUE);
1114 $tmp = explode(
':', $topic_id);
1115 if (!isset($tmp[1]))
return Array();
1116 $tmp = explode(
'_', $tmp[1]);
1123 '.$this->db->obj[
'sql_tbl_prefix'].
'topics t,
1124 '.$this->db->obj[
'sql_tbl_prefix'].
'forums f
1130 return $this->
_getResult($sql, Array(), TRUE);
1145 $tmp = explode(
'_', $forum_id);
1153 $where =
' WHERE t.forum_id='.$id.
' AND o.pid IS NULL';
1154 $join =
' LEFT JOIN '.$this->db->obj[
'sql_tbl_prefix'].
'polls o ON t.tid=o.tid';
1155 $sql = $this->
_buildQuery($fields,
'topics',
't', $where, $join);
1157 return $this->
_getResult($sql, Array(
'tid' =>
'id'));
1175 $tmp = explode(
':', $post_id);
1176 if (!isset($tmp[1]))
return Array();
1177 $tmp = explode(
'_', $tmp[1]);
1188 t.title as topic_name,
1189 f.name as forum_name
1191 '.$this->db->obj[
'sql_tbl_prefix'].
'posts p,
1192 '.$this->db->obj[
'sql_tbl_prefix'].
'topics t,
1193 '.$this->db->obj[
'sql_tbl_prefix'].
'forums f
1196 and p.topic_id = t.tid
1197 and t.forum_id = f.id
1201 return $this->
_getResult($sql, Array(), TRUE);
1216 $tmp = explode(
':', $post_id);
1217 if (!isset($tmp[1]))
return Array();
1218 $tmp = explode(
'_', $tmp[1]);
1226 '.$this->db->obj[
'sql_tbl_prefix'].
'posts p,
1227 '.$this->db->obj[
'sql_tbl_prefix'].
'topics t,
1228 '.$this->db->obj[
'sql_tbl_prefix'].
'forums f
1231 and p.topic_id=t.tid
1235 return $this->
_getResult($sql, Array(), TRUE);
1252 if (is_null($forum_id)) {
1253 $tmp = explode(
'_', $topic_id);
1259 $sql = $this->
_buildQuery($fields,
'posts',
'p',
' WHERE p.topic_id='.$id,
' LIMIT '.$limit);
1261 $sql = $this->
_buildQuery($fields,
'posts',
'p',
' WHERE p.topic_id='.$id);
1265 p.pid, t.tid, p.author_id, p.post_date
1267 '.$this->db->obj[
'sql_tbl_prefix'].
'posts p,
1268 '.$this->db->obj[
'sql_tbl_prefix'].
'topics t
1270 p.topic_id=t.tid AND
1271 t.forum_id='.$forum_id.
'
1275 if ($limit != 0) $sql .=
' LIMIT '.$limit;
1279 return $this->
_getResult($sql, Array(
'pid' =>
'id'));
1297 $tmp = explode(
':', $poll_id);
1298 if (!isset($tmp[1]))
return Array();
1299 $tmp = explode(
'_', $tmp[1]);
1311 't.poll_state as poll_state',
1313 $join =
' LEFT JOIN '.$this->db->obj[
'sql_tbl_prefix'].
'topics t ON t.tid=o.tid';
1314 $sql = $this->
_buildQuery($fields,
'polls',
'o',
' WHERE o.pid='.$id, $join);
1316 return $this->
_getResult($sql, Array(), TRUE);
1331 return $this->
_getResult($sql, Array(
'pid' =>
'id'));
1353 function _buildQuery($columns, $table_name, $table_short_name, $where=
'', $join=
'', $order_by=
'', $limit=
'')
1355 if ($columns ==
'*') {
1358 $sql =
'SELECT '.implode(
', ', $columns);
1361 $sql .=
' FROM '.$this->db->obj[
'sql_tbl_prefix'].$table_name.
' '.$table_short_name;
1364 if (!empty($join)) $sql .= $join;
1367 if (!empty($where)) $sql .= $where;
1370 if (!empty($order_by)) $sql .= $order_by;
1373 if (!empty($limit)) $sql .= $limit;
1394 function _getResult($sql, $key_change=Array(), $one_element=FALSE, $backward=FALSE)
1396 $db_result = $this->db->query($sql);
1400 while ($row = $this->db->{$this->command}($db_result)) {
1401 if (!empty($key_change)) {
1402 foreach ($key_change as $old_key => $new_key) {
1403 $row[$new_key] = $row[$old_key];
1408 $this->db->{$this->command_free}($db_result);
1409 if (empty($result))
return Array();
1410 if ($one_element) $result = array_pop($result);
1436 function _htmlDecode($result)
1440 $html_code_table = Array(
1460 'javascript' =>
'javascript',
1461 'alert' =>
'alert',
1462 'alert' =>
'about:',
1463 'onmouseover' =>
'onmouseover',
1464 'onclick' =>
'onclick',
1465 'onload' =>
'onload',
1466 'onsubmit' =>
'onsubmit',
1469 foreach ($result as $key => $value) {
1470 if (is_string($value)) {
1471 foreach ($html_code_table as $html_code => $char) {
1472 $new_result[$key] = str_replace($html_code, $char, $value);
1473 $value = $new_result[$key];
1476 $new_result[$key] = $value;
1496 protected function _assertValidResult($db, $message)
1498 if (!empty($db->error)) {
1499 trigger_error($message.
': '.$db->error, E_USER_ERROR);
1511 protected function _getMemberIdField()
1513 switch ($this->version) {
1529 protected function _getMemberGroupIdField()
1531 switch ($this->version) {
1533 return 'member_group_id';
1549 protected function _maintainDataFormat($data=Array())
1551 switch ($this->version) {
1553 if (isset($data[
'member_id'])) {
1554 $data[
'id'] = $data[
'member_id'];
1556 if (isset($data[
'member_group_id'])) {
1557 $data[
'mgroup'] = $data[
'member_group_id'];