コード例 #1
0
ファイル: my_join.inc.php プロジェクト: hiproz/zhaotaoci.cc
 if ($MG['club_join_limit'] && $limit_used >= $MG['club_join_limit']) {
     dalert(lang($L['info_limit'], array($MG['club_join_limit'], $limit_used)), $MODULE[2]['linkurl'] . $DT['file_my'] . '?mid=' . $mid . '&job=' . $job);
 }
 $gid = isset($gid) ? intval($gid) : 0;
 $gid or message($L['my_choose_group'], $MOD['linkurl']);
 $GRP = get_group($gid);
 $GRP && $GRP['status'] == 3 or message($L['my_not_group']);
 $M = $db->get_one("SELECT * FROM {$table}_fans WHERE gid={$gid} AND username='******'");
 if ($M) {
     if ($M['status'] == 3) {
         message($L['my_join_repeat'], $MOD['linkurl'] . $GRP['linkurl']);
     }
     message($L['my_join_check']);
 }
 if ($submit) {
     if ($do->pass($post)) {
         $post['gid'] = $gid;
         $post['status'] = get_status(3, $GRP['join_type']);
         $do->add($post);
         $msg = $post['status'] == 2 ? $L['success_check'] : $L['success_add'];
         set_cookie('dmsg', $msg);
         $forward = $MODULE[2]['linkurl'] . $DT['file_my'] . '?mid=' . $mid . '&job=' . $job . '&status=' . $post['status'];
         dalert('', '', 'window.onload=function(){parent.window.location="' . $forward . '";}');
     } else {
         dalert($do->errmsg);
     }
 } else {
     $reason = '';
     $status = 0;
 }
 break;