当前位置: 首页>>代码示例>>PHP>>正文


PHP get_group_name函数代码示例

本文整理汇总了PHP中get_group_name函数的典型用法代码示例。如果您正苦于以下问题:PHP get_group_name函数的具体用法?PHP get_group_name怎么用?PHP get_group_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_group_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_time_n_query

function get_time_n_query($line)
{
    include 'config.php';
    $pos_log = strpos($line, $delimiter_for_query);
    $pos_log = $pos_log + strlen($delimiter_for_query);
    $trimmed_line = substr($line, $pos_log);
    $time = substr($trimmed_line, 0, strpos($trimmed_line, ' '));
    //first occurence of select
    $query = substr($trimmed_line, strpos($trimmed_line, 'SELECT'));
    $query = substr($query, 0, $max_query_len);
    $sql_token = tokenize_query($query);
    $where_tokens = count_where_str_token($sql_token['where']);
    $assigned_grp = get_group_name($where_tokens);
    $hash = create_hash($sql_token['select'] . $sql_token['table'] . $assigned_grp);
    $response = array('group' => $assigned_grp, 'time' => $time, 'hash' => $hash, 'query' => $query, 'token' => $sql_token, 'where_tokens' => $where_tokens);
    return $response;
}
开发者ID:neerajgupta2407,项目名称:Postgres_slowquery_parser,代码行数:17,代码来源:utils.php

示例2: do_detail

 function do_detail($info = array(), $info_lang = array())
 {
     global $ttH;
     $data = array_merge($info, $info_lang);
     $data["link_action"] = $ttH->site->get_link('product', '', $info_lang['friendly_link']);
     $data["picture"] = $ttH->func->get_src_mod('product/' . $info["picture"], 300, 300, 1, 0, array('fix_width' => 1));
     $data["brand_name"] = get_brand_name($info["brand_id"], 'link');
     $data["group_name"] = get_group_name($info["group_id"], 'link');
     $data["price"] = $ttH->func->get_price_format($info["price"]);
     $sql = "select option_id,title  \n\t\t\t\t\t\tfrom product_option \n\t\t\t\t\t\twhere is_show=1 \n\t\t\t\t\t\torder by show_order desc, date_create asc";
     //echo $sql;
     $result = $ttH->db->query($sql);
     $html_row = "";
     while ($row = $ttH->db->fetch_row($result)) {
         if (isset($data['arr_option'][$row['option_id']])) {
             $row['content'] = $data['arr_option'][$row['option_id']];
             $ttH->temp_act->assign('row', $row);
             $ttH->temp_act->parse("detail.info_row");
         }
     }
     $ttH->temp_act->assign('data', $data);
     $ttH->temp_act->parse("detail.btn_add_cart");
     $data['other'] = list_other(" and a.item_id!='" . $data['item_id'] . "'");
     $ttH->temp_act->assign('data', $data);
     $ttH->temp_act->parse("detail");
     $nd = array('title' => $data['title'], 'content' => $ttH->temp_act->text("detail"));
     return $ttH->html->temp_box("box_main", $nd);
 }
开发者ID:duonghoaikhanh,项目名称:shophoa,代码行数:28,代码来源:product.php

示例3: main


//.........这里部分代码省略.........
						        OR b.ban_exclude = 1)';
                        $sql_ary['LEFT_JOIN'] = array(array('FROM' => array(BANLIST_TABLE => 'b'), 'ON' => 'u.user_id = b.ban_userid'));
                    }
                    $sql = $db->sql_build_query('SELECT', $sql_ary);
                }
                $result = $db->sql_query($sql);
                $row = $db->sql_fetchrow($result);
                if (!$row) {
                    $db->sql_freeresult($result);
                    trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
                }
                $i = $j = 0;
                // Send with BCC, no more than 50 recipients for one mail (to not exceed the limit)
                $max_chunk_size = 50;
                $email_list = array();
                $old_lang = $row['user_lang'];
                $old_notify_type = $row['user_notify_type'];
                do {
                    if ($row['user_notify_type'] == NOTIFY_EMAIL && $row['user_email'] || $row['user_notify_type'] == NOTIFY_IM && $row['user_jabber'] || $row['user_notify_type'] == NOTIFY_BOTH && ($row['user_email'] || $row['user_jabber'])) {
                        if ($i == $max_chunk_size || $row['user_lang'] != $old_lang || $row['user_notify_type'] != $old_notify_type) {
                            $i = 0;
                            if (sizeof($email_list)) {
                                $j++;
                            }
                            $old_lang = $row['user_lang'];
                            $old_notify_type = $row['user_notify_type'];
                        }
                        $email_list[$j][$i]['lang'] = $row['user_lang'];
                        $email_list[$j][$i]['method'] = $row['user_notify_type'];
                        $email_list[$j][$i]['email'] = $row['user_email'];
                        $email_list[$j][$i]['name'] = $row['username'];
                        $email_list[$j][$i]['jabber'] = $row['user_jabber'];
                        $i++;
                    }
                } while ($row = $db->sql_fetchrow($result));
                $db->sql_freeresult($result);
                // Send the messages
                include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
                include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
                $messenger = new messenger($use_queue);
                $errored = false;
                for ($i = 0, $size = sizeof($email_list); $i < $size; $i++) {
                    $used_lang = $email_list[$i][0]['lang'];
                    $used_method = $email_list[$i][0]['method'];
                    for ($j = 0, $list_size = sizeof($email_list[$i]); $j < $list_size; $j++) {
                        $email_row = $email_list[$i][$j];
                        $messenger->{sizeof($email_list[$i]) == 1 ? 'to' : 'bcc'}($email_row['email'], $email_row['name']);
                        $messenger->im($email_row['jabber'], $email_row['name']);
                    }
                    $messenger->template('admin_send_email', $used_lang);
                    $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
                    $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
                    $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
                    $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
                    $messenger->subject(htmlspecialchars_decode($subject));
                    $messenger->set_mail_priority($priority);
                    $messenger->assign_vars(array('CONTACT_EMAIL' => $config['board_contact'], 'MESSAGE' => htmlspecialchars_decode($message)));
                    if (!$messenger->send($used_method)) {
                        $errored = true;
                    }
                }
                unset($email_list);
                $messenger->save_queue();
                if ($usernames) {
                    $usernames = explode("\n", $usernames);
                    add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames)));
                } else {
                    if ($group_id) {
                        $group_name = get_group_name($group_id);
                    } else {
                        // Not great but the logging routine doesn't cope well with localising on the fly
                        $group_name = $user->lang['ALL_USERS'];
                    }
                    add_log('admin', 'LOG_MASS_EMAIL', $group_name);
                }
                if (!$errored) {
                    $message = $use_queue ? $user->lang['EMAIL_SENT_QUEUE'] : $user->lang['EMAIL_SENT'];
                    trigger_error($message . adm_back_link($this->u_action));
                } else {
                    $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=logs&amp;mode=critical') . '">', '</a>');
                    trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
                }
            }
        }
        // Exclude bots and guests...
        $sql = 'SELECT group_id
			FROM ' . GROUPS_TABLE . "\n\t\t\tWHERE group_name IN ('BOTS', 'GUESTS')";
        $result = $db->sql_query($sql);
        $exclude = array();
        while ($row = $db->sql_fetchrow($result)) {
            $exclude[] = $row['group_id'];
        }
        $db->sql_freeresult($result);
        $select_list = '<option value="0"' . (!$group_id ? ' selected="selected"' : '') . '>' . $user->lang['ALL_USERS'] . '</option>';
        $select_list .= group_select_options($group_id, $exclude);
        $s_priority_options = '<option value="' . MAIL_LOW_PRIORITY . '">' . $user->lang['MAIL_LOW_PRIORITY'] . '</option>';
        $s_priority_options .= '<option value="' . MAIL_NORMAL_PRIORITY . '" selected="selected">' . $user->lang['MAIL_NORMAL_PRIORITY'] . '</option>';
        $s_priority_options .= '<option value="' . MAIL_HIGH_PRIORITY . '">' . $user->lang['MAIL_HIGH_PRIORITY'] . '</option>';
        $template->assign_vars(array('S_WARNING' => sizeof($error) ? true : false, 'WARNING_MSG' => sizeof($error) ? implode('<br />', $error) : '', 'U_ACTION' => $this->u_action, 'S_GROUP_OPTIONS' => $select_list, 'USERNAMES' => $usernames, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&amp;form=acp_email&amp;field=usernames'), 'SUBJECT' => $subject, 'MESSAGE' => $message, 'S_PRIORITY_OPTIONS' => $s_priority_options));
    }
开发者ID:noprom,项目名称:cryptdb,代码行数:101,代码来源:acp_email.php

示例4: foreach

" /> 
			</div>
		</td>
	</tr>
	</tfoot>
	<tbody>

<?php 
    foreach ($categories as $id => $row) {
        if (!empty($row['cat_name'])) {
            $parent_cat_name = '';
            if ($row['cat_parent']) {
                $row_cat = queryDB('SELECT name, owner_id, owner_type FROM %slinks_categories WHERE cat_id=%d', array(TABLE_PREFIX, $row['cat_parent']), true);
                $parent_cat_name = AT_print($row_cat['name'], 'links_categories.name');
                if (empty($parent_cat_name)) {
                    $parent_cat_name = get_group_name($row_cat['owner_id']);
                }
            } else {
                $parent_cat_name = '<strong>' . _AT('none') . '</strong>';
            }
            ?>
		<tr onmousedown="document.form['m<?php 
            echo $id;
            ?>
'].checked = true;rowselect(this);" id="r_<?php 
            echo $id;
            ?>
">
			<td width="10"><input type="radio" name="cat_id" value="<?php 
            echo $id;
            ?>
开发者ID:vicentborja,项目名称:ATutor,代码行数:31,代码来源:categories.php

示例5: startAction

    /**
     * Starts the chat.
     *
     * @param Request $request Incoming request.
     * @return string|\Symfony\Component\HttpFoundation\RedirectResponse
     *   Rendered page content or a redirect response.
     * @todo Split the action into pieces.
     */
    public function startAction(Request $request)
    {
        // Check if we should force the user to use SSL
        $ssl_redirect = $this->sslRedirect($request);
        if ($ssl_redirect !== false) {
            return $ssl_redirect;
        }

        // Initialize client side application
        $this->getAssetManager()->attachJs('js/compiled/chat_app.js');

        $thread = null;
        // Try to get thread from the session
        if (isset($_SESSION[SESSION_PREFIX . 'threadid'])) {
            $thread = Thread::reopen($_SESSION[SESSION_PREFIX . 'threadid']);
        }

        // Create new thread
        if (!$thread) {
            // Load group info
            $group_id = '';
            $group_name = '';
            $group = null;
            if (Settings::get('enablegroups') == '1') {
                $group_id = $request->query->get('group');
                if (!preg_match("/^\d{1,10}$/", $group_id)) {
                    $group_id = false;
                }

                if ($group_id) {
                    $group = group_by_id($group_id);
                    if (!$group) {
                        $group_id = false;
                    } else {
                        $group_name = get_group_name($group);
                    }
                }
            }

            // Get operator code
            $operator_code = $request->query->get('operator_code');
            if (!preg_match("/^[A-z0-9_]+$/", $operator_code)) {
                $operator_code = false;
            }

            // Get visitor info
            $visitor = visitor_from_request();
            $info = $request->query->get('info');
            $email = $request->query->get('email');

            // Get referrer
            $referrer = $request->query->get('url', $request->headers->get('referer'));
            if ($request->query->get('referrer')) {
                $referrer .= "\n" . $request->query->get('referrer');
            }

            // Check if there are online operators
            if (!has_online_operators($group_id)) {
                // Display leave message page
                $page = array_merge_recursive(
                    setup_logo($group),
                    setup_leavemessage(
                        $visitor['name'],
                        $email,
                        $group_id,
                        $info,
                        $referrer
                    )
                );
                $page['leaveMessageOptions'] = $page['leaveMessage'];

                $this->getAssetManager()->attachJs(
                    $this->startJsApplication($request, $page),
                    AssetManagerInterface::INLINE,
                    1000
                );

                return $this->render('chat', $page);
            }

            // Get invitation info
            if (Settings::get('enabletracking') && !empty($_SESSION[SESSION_PREFIX . 'visitorid'])) {
                $invitation_state = invitation_state($_SESSION[SESSION_PREFIX . 'visitorid']);
                $visitor_is_invited = $invitation_state['invited'];
            } else {
                $visitor_is_invited = false;
            }

            // Get operator info
            $requested_operator = false;
            if ($operator_code) {
                $requested_operator = operator_by_code($operator_code);
//.........这里部分代码省略.........
开发者ID:nico13051995,项目名称:IntITA,代码行数:101,代码来源:UserChatController.php

示例6: reverse_ids

 function reverse_ids()
 {
     if (!is_null($this->pilot_id)) {
         $this->pilot = get_pilot_name($this->pilot_id);
     }
     if (!is_null($this->alliance_id)) {
         $this->alliance = get_alliance_name($this->alliance_id);
     }
     if (!is_null($this->corp_id)) {
         $this->corp = get_corp_name($this->corp_id);
         $this->corp_ticker = get_corp_ticker($this->corp_id, 1);
     }
     if (!is_null($this->ship_id)) {
         $this->ship = get_item_name($this->ship_id);
     }
     if (!is_null($this->group_id)) {
         $this->group = get_group_name($this->group_id);
     }
     if (!is_null($this->weapon_id)) {
         $this->weapon = get_item_name($this->weapon_id);
     }
 }
开发者ID:Covert-Inferno,项目名称:fortissimo,代码行数:22,代码来源:parser.php

示例7: main


//.........这里部分代码省略.........
                        $email_list[$j][$i]['name'] = $row['username'];
                        $email_list[$j][$i]['jabber'] = $row['user_jabber'];
                        $i++;
                    }
                } while ($row = $db->sql_fetchrow($result));
                $db->sql_freeresult($result);
                // Send the messages
                include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
                include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
                $messenger = new messenger($use_queue);
                $errored = false;
                $email_template = 'admin_send_email';
                $template_data = array('CONTACT_EMAIL' => phpbb_get_board_contact($config, $phpEx), 'MESSAGE' => htmlspecialchars_decode($message));
                $generate_log_entry = true;
                /**
                 * Modify email template data before the emails are sent
                 *
                 * @event core.acp_email_send_before
                 * @var	string	email_template		The template to be used for sending the email
                 * @var	string	subject				The subject of the email
                 * @var	array	template_data		Array with template data assigned to email template
                 * @var	bool	generate_log_entry	If false, no log entry will be created
                 * @var	array	usernames			Usernames which will be displayed in log entry, if it will be created
                 * @var	int		group_id			The group this email will be sent to
                 * @var	bool	use_queue			If true, email queue will be used for sending
                 * @var	int		priority			Priority of sent emails
                 * @since 3.1.3-RC1
                 */
                $vars = array('email_template', 'subject', 'template_data', 'generate_log_entry', 'usernames', 'group_id', 'use_queue', 'priority');
                extract($phpbb_dispatcher->trigger_event('core.acp_email_send_before', compact($vars)));
                for ($i = 0, $size = sizeof($email_list); $i < $size; $i++) {
                    $used_lang = $email_list[$i][0]['lang'];
                    $used_method = $email_list[$i][0]['method'];
                    for ($j = 0, $list_size = sizeof($email_list[$i]); $j < $list_size; $j++) {
                        $email_row = $email_list[$i][$j];
                        $messenger->{sizeof($email_list[$i]) == 1 ? 'to' : 'bcc'}($email_row['email'], $email_row['name']);
                        $messenger->im($email_row['jabber'], $email_row['name']);
                    }
                    $messenger->template($email_template, $used_lang);
                    $messenger->anti_abuse_headers($config, $user);
                    $messenger->subject(htmlspecialchars_decode($subject));
                    $messenger->set_mail_priority($priority);
                    $messenger->assign_vars($template_data);
                    if (!$messenger->send($used_method)) {
                        $errored = true;
                    }
                }
                unset($email_list);
                $messenger->save_queue();
                if ($generate_log_entry) {
                    if (!empty($usernames)) {
                        $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MASS_EMAIL', false, array(implode(', ', utf8_normalize_nfc($usernames))));
                    } else {
                        if ($group_id) {
                            $group_name = get_group_name($group_id);
                        } else {
                            // Not great but the logging routine doesn't cope well with localising on the fly
                            $group_name = $user->lang['ALL_USERS'];
                        }
                        $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MASS_EMAIL', false, array($group_name));
                    }
                }
                if (!$errored) {
                    $message = $use_queue ? $user->lang['EMAIL_SENT_QUEUE'] : $user->lang['EMAIL_SENT'];
                    trigger_error($message . adm_back_link($this->u_action));
                } else {
                    $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=logs&amp;mode=critical') . '">', '</a>');
                    trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
                }
            }
        }
        // Exclude bots and guests...
        $sql = 'SELECT group_id
			FROM ' . GROUPS_TABLE . "\n\t\t\tWHERE group_name IN ('BOTS', 'GUESTS')";
        $result = $db->sql_query($sql);
        $exclude = array();
        while ($row = $db->sql_fetchrow($result)) {
            $exclude[] = $row['group_id'];
        }
        $db->sql_freeresult($result);
        $select_list = '<option value="0"' . (!$group_id ? ' selected="selected"' : '') . '>' . $user->lang['ALL_USERS'] . '</option>';
        $select_list .= group_select_options($group_id, $exclude);
        $s_priority_options = '<option value="' . MAIL_LOW_PRIORITY . '">' . $user->lang['MAIL_LOW_PRIORITY'] . '</option>';
        $s_priority_options .= '<option value="' . MAIL_NORMAL_PRIORITY . '" selected="selected">' . $user->lang['MAIL_NORMAL_PRIORITY'] . '</option>';
        $s_priority_options .= '<option value="' . MAIL_HIGH_PRIORITY . '">' . $user->lang['MAIL_HIGH_PRIORITY'] . '</option>';
        $template_data = array('S_WARNING' => sizeof($error) ? true : false, 'WARNING_MSG' => sizeof($error) ? implode('<br />', $error) : '', 'U_ACTION' => $this->u_action, 'S_GROUP_OPTIONS' => $select_list, 'USERNAMES' => implode("\n", $usernames), 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&amp;form=acp_email&amp;field=usernames'), 'SUBJECT' => $subject, 'MESSAGE' => $message, 'S_PRIORITY_OPTIONS' => $s_priority_options);
        /**
         * Modify custom email template data before we display the form
         *
         * @event core.acp_email_display
         * @var	array	template_data		Array with template data assigned to email template
         * @var	array	exclude				Array with groups which are excluded from group selection
         * @var	array	usernames			Usernames which will be displayed in form
         *
         * @since 3.1.4-RC1
         */
        $vars = array('template_data', 'exclude', 'usernames');
        extract($phpbb_dispatcher->trigger_event('core.acp_email_display', compact($vars)));
        $template->assign_vars($template_data);
    }
开发者ID:hgchen,项目名称:phpbb,代码行数:101,代码来源:acp_email.php

示例8: setup_redirect_links

function setup_redirect_links(UrlGeneratorInterface $url_generator, $threadid, $operator, $token)
{
    $result = array();

    $operator_in_isolation = in_isolation($operator);

    $list_options = $operator_in_isolation
        ? array('isolated_operator_id' => $operator['operatorid'])
        : array();
    $operators = get_operators_list($list_options);
    $operators_count = count($operators);

    $groups_count = 0;
    $groups = array();
    if (Settings::get('enablegroups') == "1") {
        $groupslist = $operator_in_isolation
            ? get_groups_for_operator($operator, true)
            : get_groups(true);
        foreach ($groupslist as $group) {
            if ($group['inumofagents'] == 0) {
                continue;
            }
            $groups[] = $group;
        }
        $groups_count = count($groups);
    }

    $p = pagination_info(max($operators_count, $groups_count), 8);
    $result['pagination'] = $p;

    $operators = array_slice($operators, $p['start'], $p['end'] - $p['start']);
    $groups = array_slice($groups, $p['start'], $p['end'] - $p['start']);

    $agent_list = "";
    $params = array('thread_id' => $threadid, 'token' => $token);
    foreach ($operators as $agent) {
        $params['nextAgent'] = $agent['operatorid'];
        $status = $agent['time'] < Settings::get('online_timeout')
            ? ($agent['istatus'] == 0
                ? getlocal("(online)")
                : getlocal("(away)"))
            : "";
        $agent_list .= "<li><a href=\"" . $url_generator->generate('chat_operator_redirect', $params)
            . "\" title=\"" . get_operator_name($agent) . "\">"
            . get_operator_name($agent)
            . "</a> $status</li>";
    }
    $result['redirectToAgent'] = $agent_list;

    $group_list = "";
    if (Settings::get('enablegroups') == "1") {
        $params = array('thread_id' => $threadid, 'token' => $token);
        foreach ($groups as $group) {
            $params['nextGroup'] = $group['groupid'];
            $status = group_is_online($group)
                ? getlocal("(online)")
                : (group_is_away($group) ? getlocal("(away)") : "");
            $group_list .= "<li><a href=\"" . $url_generator->generate('chat_operator_redirect', $params)
                . "\" title=\"" . get_group_name($group) . "\">"
                . get_group_name($group)
                . "</a> $status</li>";
        }
    }
    $result['redirectToGroup'] = $group_list;

    return $result;
}
开发者ID:nico13051995,项目名称:IntITA,代码行数:67,代码来源:operator.php

示例9: threadAction

 /**
  * Generates a page with thread history (thread log).
  *
  * @param Request $request
  * @return string Rendered page content
  */
 public function threadAction(Request $request)
 {
     $operator = $this->getOperator();
     $page = array();
     // Load thread info
     $thread = Thread::load($request->attributes->get('thread_id'));
     $group = group_by_id($thread->groupId);
     $thread_info = array('userName' => $thread->userName, 'userAddress' => get_user_addr($thread->remote), 'userAgentVersion' => get_user_agent_version($thread->userAgent), 'agentName' => $thread->agentName, 'chatTime' => $thread->modified - $thread->created, 'chatStarted' => $thread->created, 'groupName' => get_group_name($group));
     $page['threadInfo'] = $thread_info;
     // Build messages list
     $last_id = -1;
     $messages = array_map('sanitize_message', $thread->getMessages(false, $last_id));
     $page['title'] = getlocal("Chat log");
     $page = array_merge($page, prepare_menu($operator, false));
     $this->getAssetManager()->attachJs('js/compiled/thread_log_app.js');
     $this->getAssetManager()->attachJs(sprintf('jQuery(document).ready(function(){Mibew.Application.start(%s);});', json_encode(array('messages' => $messages))), \Mibew\Asset\AssetManagerInterface::INLINE, 1000);
     return $this->render('history_thread', $page);
 }
开发者ID:KulturedKitsch,项目名称:kulturedkitsch.info-store,代码行数:24,代码来源:HistoryController.php

示例10: syncgroups

 private function syncgroups()
 {
     // Si l'utilisateur est login alors voir les groups qu'il a et les ajouter s'il n'existe pas.
     // En profiter pour maj l'user
     //todo: code la maj du realname
     // maj des groups
     if (!function_exists('get_group_id')) {
         include $this->phpbb_root_path . 'includes/functions_convert.' . $this->php_ext;
     }
     if (!function_exists('group_memberships')) {
         include $this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext;
     }
     if (!function_exists('get_group_name')) {
         include $this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext;
     }
     $passage_groups = explode(' ', get_apache_header($this->config['passage_groups']));
     $phpbb_groups = group_memberships(false, $this->user->data['user_id'], false);
     // Append
     if (!empty($phpbb_groups) and !empty($passage_groups)) {
         foreach ($passage_groups as $p_grg) {
             if (is_array($phpbb_groups)) {
                 if (false == in_array($p_grg, $phpbb_groups)) {
                     group_user_add(get_group_id($p_grg), $this->user->data['user_id']);
                 }
             }
         }
         // Clean
         if (is_array($phpbb_groups)) {
             foreach ($phpbb_groups as $bb_grp) {
                 if (false == in_array(get_group_name($bb_grp['group_id']), $passage_groups)) {
                     group_user_del($bb_grp['group_id'], $this->user->data['user_id']);
                 }
             }
         }
     }
 }
开发者ID:41px,项目名称:bmpn,代码行数:36,代码来源:passage.php

示例11: redirectAction

 /**
  * Process chat thread redirection.
  *
  * @param Request $request Incoming request.
  * @return string|\Symfony\Component\HttpFoundation\RedirectResponse Rendered
  *   page content or a redirect response.
  * @throws NotFoundException If the thread with specified ID and token is
  * not found.
  * @throws BadRequestException If one or more arguments have a wrong format.
  */
 public function redirectAction(Request $request)
 {
     $thread_id = $request->attributes->get('thread_id');
     $token = $request->attributes->get('token');
     $thread = Thread::load($thread_id, $token);
     if (!$thread) {
         throw new NotFoundException('The thread is not found.');
     }
     $page = array('errors' => array());
     if ($request->query->has('nextGroup')) {
         // The thread was redirected to a group.
         $next_id = $request->query->get('nextGroup');
         if (!preg_match("/^\\d{1,10}\$/", $next_id)) {
             throw new BadRequestException('Wrong value of "nextGroup" argument.');
         }
         $next_group = group_by_id($next_id);
         if ($next_group) {
             $page['message'] = getlocal('The visitor has been placed in a priorty queue of the group {0}.', array(get_group_name($next_group)));
             if (!$this->redirectToGroup($thread, (int) $next_id)) {
                 $page['errors'][] = getlocal('You are not chatting with the visitor.');
             }
         } else {
             $page['errors'][] = 'Unknown group';
         }
     } else {
         // The thread was redirected to an operator.
         $next_id = $request->query->get('nextAgent');
         if (!preg_match("/^\\d{1,10}\$/", $next_id)) {
             throw new BadRequestException('Wrong value of "nextAgent" argument.');
         }
         $next_operator = operator_by_id($next_id);
         if ($next_operator) {
             $page['message'] = getlocal('The visitor has been placed in the priorty queue of the operator {0}.', array(get_operator_name($next_operator)));
             if (!$this->redirectToOperator($thread, $next_id)) {
                 $page['errors'][] = getlocal('You are not chatting with the visitor.');
             }
         } else {
             $page['errors'][] = 'Unknown operator';
         }
     }
     $page = array_merge_recursive($page, setup_logo());
     if (count($page['errors']) > 0) {
         return $this->render('error', $page);
     } else {
         return $this->render('redirected', $page);
     }
 }
开发者ID:seodom,项目名称:mibew,代码行数:57,代码来源:RedirectController.php

示例12: reopen_thread

if (!isset($_GET['token']) || !isset($_GET['thread'])) {
    $thread = NULL;
    if (isset($_SESSION['threadid'])) {
        $thread = reopen_thread($_SESSION['threadid']);
    }
    if (!$thread) {
        $groupid = "";
        $groupname = "";
        if ($settings['enablegroups'] == '1') {
            $groupid = verifyparam("group", "/^\\d{1,10}\$/", "");
            if ($groupid) {
                $group = group_by_id($groupid);
                if (!$group) {
                    $groupid = "";
                } else {
                    $groupname = get_group_name($group);
                }
            }
        }
        $visitor = visitor_from_request();
        if (isset($_POST['survey']) && $_POST['survey'] == 'on') {
            $firstmessage = getparam("message");
            $info = getparam("info");
            $email = getparam("email");
            $referrer = urldecode(getparam("referrer"));
            if ($settings["surveyaskcaptcha"] == "1") {
                $captcha = getparam('captcha');
                $original = isset($_SESSION["mibew_captcha"]) ? $_SESSION["mibew_captcha"] : "";
                $survey_captcha_failed = empty($original) || empty($captcha) || $captcha != $original;
                unset($_SESSION['mibew_captcha']);
            }
开发者ID:kuell,项目名称:chat,代码行数:31,代码来源:client.php

示例13: manage_row

    function manage_row($row, $is_show = '')
    {
        global $ttH;
        $output = '';
        $row["link_edit"] = $ttH->admin->get_link_admin($this->modules, $this->action, "edit", array("id" => $row['group_id']));
        $row["link_trash"] = $ttH->admin->get_link_admin($this->modules, $this->action, $this->sub, array("do_action" => "do_trash", "id" => $row['group_id']));
        $row["link_restore"] = $ttH->admin->get_link_admin($this->modules, $this->action, $this->sub, array("do_action" => "do_restore", "id" => $row['group_id']));
        $row["link_del"] = $ttH->admin->get_link_admin($this->modules, $this->action, $this->sub, array("do_action" => "do_del", "id" => $row['group_id']));
        $row["link_pic"] = $ttH->admin->get_link_admin($this->modules, $this->modules . '_pic', 'manage', array("type" => "group", "type_id" => $row['group_id']));
        if (!empty($row["picture"])) {
            $row["picture"] = '<a class="fancybox-effects-a" title="' . $row["picture"] . '" href="' . DIR_UPLOAD . $row["picture"] . '">
				' . $ttH->func->get_pic_mod($row["picture"], 50, 50, '', 1, 0, array('fix_width' => 1)) . '
			</a>';
        }
        $row['name_action'] = $this->modules . '-group-' . $row["group_id"];
        $row["link_add_menu"] = $ttH->admin->get_link_admin_popup('layout', 'menu', 'add_menu', array("name_action" => $row['name_action']));
        //$row['link'] = (isset($ttH->data["modules"][$this->modules]["arr_friendly_link"][$ttH->conf['lang_cur']])) ? $ttH->data["modules"][$this->modules]["arr_friendly_link"][$ttH->conf['lang_cur']] : '';
        $row['link'] = $row["friendly_link"];
        $row['parent'] = get_group_name($row['parent_id'], 'link');
        $row['date_create'] = date('d/m/Y', $row['date_create']);
        //$row['is_focus'] = $ttH->admin->list_yesno ("is_focus[".$row['group_id']."]", $row['is_focus'], "  onchange=\"do_check (".$row['group_id'].")\"");
        //$row['is_focus_checked'] = ($row['is_focus'] == 1) ? ' checked="checked"' : '';
        $row['html_checkbox'] = '';
        foreach ($this->arr_checkbox as $k => $v) {
            if (isset($v['muti'])) {
                continue;
            }
            $row[$k . '_checked'] = $row[$k] == 1 ? ' checked="checked"' : '';
            $row['html_checkbox'] .= '<div><label for="' . $k . '_' . $row['group_id'] . '"><strong>' . (isset($ttH->lang[$this->modules][$k]) ? $ttH->lang[$this->modules][$k] : (isset($ttH->lang['global'][$k]) ? $ttH->lang['global'][$k] : $k)) . ':</strong></label> <input type="checkbox" value="1" id="' . $k . '_' . $row['group_id'] . '" name="' . $k . '[' . $row['group_id'] . ']" ' . $row[$k . '_checked'] . ' onchange="do_check(\'' . $row['group_id'] . '\')" /></div>';
        }
        $ttH->temp_act->assign('row', $row);
        if ($is_show == "trash") {
            $ttH->temp_act->reset("manage.row_item.row_button_manage");
            $ttH->temp_act->parse("manage.row_item.row_button_manage");
            if ($row['is_show'] == 0) {
                $ttH->temp_act->parse("manage.row_item");
                $output = $ttH->temp_act->text("manage.row_item");
                $ttH->temp_act->reset("manage.row_item");
            } else {
                $row["link_edit"] = 'javascript:void(0);';
                $row["link_trash"] = 'javascript:void(0);';
                $row["link_restore"] = 'javascript:void(0);';
                $row["link_del"] = 'javascript:void(0);';
                $ttH->temp_act->parse("manage.row_item_no_control");
                $output = $ttH->temp_act->text("manage.row_item_no_control");
                $ttH->temp_act->reset("manage.row_item_no_control");
            }
        } else {
            $ttH->temp_act->parse("manage.row_item.row_button_trash");
            $ttH->temp_act->parse("manage.row_item");
            $output = $ttH->temp_act->text("manage.row_item");
            $ttH->temp_act->reset("manage.row_item");
        }
        return $output;
    }
开发者ID:duonghoaikhanh,项目名称:shophoa,代码行数:55,代码来源:group_.php

示例14: group_user_attributes

/**
* This is used to promote (to leader), demote or set as default a member/s
*/
function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)
{
    global $db, $auth, $user, $phpbb_container, $phpbb_log, $phpbb_dispatcher;
    // We need both username and user_id info
    $result = user_get_id_name($user_id_ary, $username_ary);
    if (!sizeof($user_id_ary) || $result !== false) {
        return 'NO_USERS';
    }
    if (!$group_name) {
        $group_name = get_group_name($group_id);
    }
    switch ($action) {
        case 'demote':
        case 'promote':
            $sql = 'SELECT user_id
				FROM ' . USER_GROUP_TABLE . "\n\t\t\t\tWHERE group_id = {$group_id}\n\t\t\t\t\tAND user_pending = 1\n\t\t\t\t\tAND " . $db->sql_in_set('user_id', $user_id_ary);
            $result = $db->sql_query_limit($sql, 1);
            $not_empty = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);
            if ($not_empty) {
                return 'NO_VALID_USERS';
            }
            $sql = 'UPDATE ' . USER_GROUP_TABLE . '
				SET group_leader = ' . ($action == 'promote' ? 1 : 0) . "\n\t\t\t\tWHERE group_id = {$group_id}\n\t\t\t\t\tAND user_pending = 0\n\t\t\t\t\tAND " . $db->sql_in_set('user_id', $user_id_ary);
            $db->sql_query($sql);
            $log = $action == 'promote' ? 'LOG_GROUP_PROMOTED' : 'LOG_GROUP_DEMOTED';
            break;
        case 'approve':
            // Make sure we only approve those which are pending ;)
            $sql = 'SELECT u.user_id, u.user_email, u.username, u.username_clean, u.user_notify_type, u.user_jabber, u.user_lang
				FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug
				WHERE ug.group_id = ' . $group_id . '
					AND ug.user_pending = 1
					AND ug.user_id = u.user_id
					AND ' . $db->sql_in_set('ug.user_id', $user_id_ary);
            $result = $db->sql_query($sql);
            $user_id_ary = array();
            while ($row = $db->sql_fetchrow($result)) {
                $user_id_ary[] = $row['user_id'];
            }
            $db->sql_freeresult($result);
            if (!sizeof($user_id_ary)) {
                return false;
            }
            $sql = 'UPDATE ' . USER_GROUP_TABLE . "\n\t\t\t\tSET user_pending = 0\n\t\t\t\tWHERE group_id = {$group_id}\n\t\t\t\t\tAND " . $db->sql_in_set('user_id', $user_id_ary);
            $db->sql_query($sql);
            /* @var $phpbb_notifications \phpbb\notification\manager */
            $phpbb_notifications = $phpbb_container->get('notification_manager');
            $phpbb_notifications->add_notifications('notification.type.group_request_approved', array('user_ids' => $user_id_ary, 'group_id' => $group_id, 'group_name' => $group_name));
            $phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id);
            $log = 'LOG_USERS_APPROVED';
            break;
        case 'default':
            // We only set default group for approved members of the group
            $sql = 'SELECT user_id
				FROM ' . USER_GROUP_TABLE . "\n\t\t\t\tWHERE group_id = {$group_id}\n\t\t\t\t\tAND user_pending = 0\n\t\t\t\t\tAND " . $db->sql_in_set('user_id', $user_id_ary);
            $result = $db->sql_query($sql);
            $user_id_ary = $username_ary = array();
            while ($row = $db->sql_fetchrow($result)) {
                $user_id_ary[] = $row['user_id'];
            }
            $db->sql_freeresult($result);
            $result = user_get_id_name($user_id_ary, $username_ary);
            if (!sizeof($user_id_ary) || $result !== false) {
                return 'NO_USERS';
            }
            $sql = 'SELECT user_id, group_id
				FROM ' . USERS_TABLE . '
				WHERE ' . $db->sql_in_set('user_id', $user_id_ary, false, true);
            $result = $db->sql_query($sql);
            $groups = array();
            while ($row = $db->sql_fetchrow($result)) {
                if (!isset($groups[$row['group_id']])) {
                    $groups[$row['group_id']] = array();
                }
                $groups[$row['group_id']][] = $row['user_id'];
            }
            $db->sql_freeresult($result);
            foreach ($groups as $gid => $uids) {
                remove_default_rank($gid, $uids);
                remove_default_avatar($gid, $uids);
            }
            group_set_user_default($group_id, $user_id_ary, $group_attributes);
            $log = 'LOG_GROUP_DEFAULTS';
            break;
    }
    /**
     * Event to perform additional actions on setting user group attributes
     *
     * @event core.user_set_group_attributes
     * @var	int		group_id			ID of the group
     * @var	string	group_name			Name of the group
     * @var	array	user_id_ary			IDs of the users to set group attributes
     * @var	array	username_ary		Names of the users to set group attributes
     * @var	array	group_attributes	Group attributes which were changed
     * @var	string	action				Action to perform over the group members
     * @since 3.1.10-RC1
//.........这里部分代码省略.........
开发者ID:phpbb,项目名称:phpbb,代码行数:101,代码来源:functions_user.php

示例15: array

include 'lib/fortissimo.php';
# show the last 50 somethings
$which = $_GET['show'];
if (!$which) {
    $which = 'kill';
}
if ($which == 'kill') {
    $ft->message('Last 50 Kills');
    $ft->title('Last 50 Kills');
    # also show the finalblows/lossrecv by group
    $groups = $ft->dbh->_select_rows_as_objects('SELECT var1, killrecv, lossrecv FROM tbl:stats ' . 'WHERE type = "group" AND dtype = "week" AND var2 = ?', array(this_week()));
    $gout = array();
    if ($groups) {
        foreach ($groups as $grow) {
            $name = get_group_name($grow->var1);
            if ($name) {
                $gout[$name] = array($grow->killrecv, $grow->lossrecv, $grow->var1);
            }
        }
    }
} elseif ($which == 'loss') {
    $ft->message('Last 50 Losses');
    $ft->title('Last 50 Losses');
} else {
    $which = 'murder';
    $ft->message('Last 50 Murders');
    $ft->title('Last 50 Murders');
}
$ids = $ft->dbh->_select_column('SELECT killid FROM tbl:summary WHERE type = ? ORDER BY killtime DESC LIMIT 50', array($which));
# now prepare the page
开发者ID:Covert-Inferno,项目名称:fortissimo,代码行数:30,代码来源:index.php


注:本文中的get_group_name函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。