Update gnuboard.dbt.php
This commit is contained in:
parent
8293d849b0
commit
a6c0566652
|
|
@ -113,11 +113,11 @@ if(!function_exists("gnb_set_post_parameters")) {
|
|||
|
||||
// get member data
|
||||
if(!function_exists("gnb_get_member")) {
|
||||
function gnb_get_member($mb_id, $tablename="member") {
|
||||
function gnb_get_member($user_name, $tablename="member") {
|
||||
$result = array();
|
||||
|
||||
$bind = array(
|
||||
"mb_id" => $mb_id,
|
||||
"mb_id" => $user_name,
|
||||
);
|
||||
|
||||
$member_table = gnb_get_db_prefix() . $tablename;
|
||||
|
|
@ -179,6 +179,11 @@ if(!function_exists("gnb_join_member")) {
|
|||
// load network helper
|
||||
loadHelper("networktool");
|
||||
|
||||
// get member info
|
||||
$member_info = gnb_get_member($user_name);
|
||||
|
||||
// allow join if not exists duplicated members
|
||||
if(array_key_empty("mb_id", $member_info)) {
|
||||
$member_fields = array();
|
||||
$member_default_fields = array(
|
||||
"mb_id" => $user_name,
|
||||
|
|
@ -238,6 +243,7 @@ if(!function_exists("gnb_join_member")) {
|
|||
$sql = get_bind_to_sql_insert($member_table, $member_fields);
|
||||
$result = exec_db_query($sql, $member_fields);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user