Update gnuboard.dbt.php

This commit is contained in:
Namhyeon Go 2018-04-15 00:13:06 +09:00 committed by GitHub
parent 8293d849b0
commit a6c0566652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}