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


PHP qa_get_public_from_userids函数代码示例

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


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

示例1: retrieve_queued_voters_flaggers

 function retrieve_queued_voters_flaggers()
 {
     if (count($this->qa_voters_flaggers_queue)) {
         require_once QA_INCLUDE_DIR . 'qa-db-votes.php';
         $postids = array_keys($this->qa_voters_flaggers_queue);
         foreach ($postids as $postid) {
             $this->qa_voters_flaggers_cache[$postid] = array();
         }
         $newvotersflaggers = qa_db_uservoteflag_posts_get($postids);
         if (QA_FINAL_EXTERNAL_USERS) {
             $keyuserids = array();
             foreach ($newvotersflaggers as $voterflagger) {
                 $keyuserids[$voterflagger['userid']] = true;
             }
             $useridhandles = qa_get_public_from_userids(array_keys($keyuserids));
             foreach ($newvotersflaggers as $index => $voterflagger) {
                 $newvotersflaggers[$index]['handle'] = @$useridhandles[$voterflagger['userid']];
             }
         }
         foreach ($newvotersflaggers as $voterflagger) {
             $this->qa_voters_flaggers_cache[$voterflagger['postid']][] = $voterflagger;
         }
         $this->qa_voters_flaggers_queue = array();
     }
 }
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:25,代码来源:qa-layer-voters-flaggers.php

示例2: qa_priv_notification

function qa_priv_notification($uid, $oid, $badge_slug)
{
    require_once QA_INCLUDE_DIR . 'qa-app-users.php';
    require_once QA_INCLUDE_DIR . 'qa-app-emails.php';
    if (QA_FINAL_EXTERNAL_USERS) {
        $publictohandle = qa_get_public_from_userids(array($uid));
        $handle = @$publictohandle[$uid];
    } else {
        $user = qa_db_single_select(qa_db_user_account_selectspec($uid, true));
        $handle = @$user['handle'];
    }
    $subject = qa_opt('badge_email_subject');
    $body = qa_opt('badge_email_body');
    $body = preg_replace('/\\^if_post_text="([^"]*)"/', $oid ? '$1' : '', $body);
    // if post text
    $site_url = qa_opt('site_url');
    $profile_url = qa_path_html('user/' . $handle, null, $site_url);
    if ($oid) {
        $post = qa_db_read_one_assoc(qa_db_query_sub('SELECT * FROM ^posts WHERE postid=#', $oid), true);
        if ($post['parentid']) {
            $parent = qa_db_read_one_assoc(qa_db_query_sub('SELECT * FROM ^posts WHERE postid=#', $post['parentid']), true);
        }
        if (isset($parent)) {
            $anchor = urlencode(qa_anchor($post['basetype'], $oid));
            $post_title = $parent['title'];
            $post_url = qa_path_html(qa_q_request($parent['postid'], $parent['title']), null, qa_opt('site_url'), null, $anchor);
        } else {
            $post_title = $post['title'];
            $post_url = qa_path_html(qa_q_request($post['postid'], $post['title']), null, qa_opt('site_url'));
        }
    }
    $subs = array('^badge_name' => qa_opt('badge_' . $badge_slug . '_name'), '^post_title' => @$post_title, '^post_url' => @$post_url, '^profile_url' => $profile_url, '^site_url' => $site_url);
    qa_send_notification($uid, '@', $handle, $subject, $body, $subs);
}
开发者ID:NoahY,项目名称:q2a-privileges,代码行数:34,代码来源:qa-plugin.php

示例3: getHandleFromId

 function getHandleFromId($userid)
 {
     require_once QA_INCLUDE_DIR . 'qa-app-users.php';
     if (QA_FINAL_EXTERNAL_USERS) {
         $publictohandle = qa_get_public_from_userids(array($userid));
         $handle = @$publictohandle[$userid];
     } else {
         $user = qa_db_single_select(qa_db_user_account_selectspec($userid, true));
         $handle = @$user['handle'];
     }
     return $handle;
 }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:12,代码来源:qa-history-check.php

示例4: qa_send_notification

function qa_send_notification($userid, $email, $handle, $subject, $body, $subs, $html = false)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    global $qa_notifications_suspended;
    if ($qa_notifications_suspended > 0) {
        return false;
    }
    require_once QA_INCLUDE_DIR . 'db/selects.php';
    require_once QA_INCLUDE_DIR . 'util/string.php';
    if (isset($userid)) {
        $needemail = !qa_email_validate(@$email);
        // take from user if invalid, e.g. @ used in practice
        $needhandle = empty($handle);
        if ($needemail || $needhandle) {
            if (QA_FINAL_EXTERNAL_USERS) {
                if ($needhandle) {
                    $handles = qa_get_public_from_userids(array($userid));
                    $handle = @$handles[$userid];
                }
                if ($needemail) {
                    $email = qa_get_user_email($userid);
                }
            } else {
                $useraccount = qa_db_select_with_pending(array('columns' => array('email', 'handle'), 'source' => '^users WHERE userid = #', 'arguments' => array($userid), 'single' => true));
                if ($needhandle) {
                    $handle = @$useraccount['handle'];
                }
                if ($needemail) {
                    $email = @$useraccount['email'];
                }
            }
        }
    }
    if (isset($email) && qa_email_validate($email)) {
        $subs['^site_title'] = qa_opt('site_title');
        $subs['^handle'] = $handle;
        $subs['^email'] = $email;
        $subs['^open'] = "\n";
        $subs['^close'] = "\n";
        return qa_send_email(array('fromemail' => qa_opt('from_email'), 'fromname' => qa_opt('site_title'), 'toemail' => $email, 'toname' => $handle, 'subject' => strtr($subject, $subs), 'body' => (empty($handle) ? '' : qa_lang_sub('emails/to_handle_prefix', $handle)) . strtr($body, $subs), 'html' => $html));
    } else {
        return false;
    }
}
开发者ID:kosmoluna,项目名称:question2answer,代码行数:47,代码来源:emails.php

示例5: qa_send_notification

function qa_send_notification($userid, $email, $handle, $subject, $body, $subs)
{
    global $qa_notifications_suspended;
    if ($qa_notifications_suspended > 0) {
        return false;
    }
    require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
    require_once QA_INCLUDE_DIR . 'qa-util-emailer.php';
    require_once QA_INCLUDE_DIR . 'qa-util-string.php';
    if (isset($userid)) {
        $needemail = !qa_email_validate(@$email);
        // take from user if invalid, e.g. @ used in practice
        $needhandle = empty($handle);
        if ($needemail || $needhandle) {
            if (QA_FINAL_EXTERNAL_USERS) {
                if ($needhandle) {
                    $handles = qa_get_public_from_userids(array($userid));
                    $handle = @$handles[$userid];
                }
                if ($needemail) {
                    $email = qa_get_user_email($userid);
                }
            } else {
                $useraccount = qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true));
                if ($needhandle) {
                    $handle = @$useraccount['handle'];
                }
                if ($needemail) {
                    $email = @$useraccount['email'];
                }
            }
        }
    }
    if (isset($email) && qa_email_validate($email)) {
        $subs['^site_title'] = qa_opt('site_title');
        $subs['^handle'] = $handle;
        $subs['^email'] = $email;
        $subs['^open'] = "\n";
        $subs['^close'] = "\n";
        return qa_send_email(array('fromemail' => qa_opt('from_email'), 'fromname' => qa_opt('site_title'), 'toemail' => $email, 'toname' => $handle, 'subject' => strtr($subject, $subs), 'body' => (empty($handle) ? '' : $handle . ",\n\n") . strtr($body, $subs), 'html' => false));
    } else {
        return false;
    }
}
开发者ID:TheProjecter,项目名称:microprobe,代码行数:44,代码来源:qa-app-emails.php

示例6: qa_userids_to_handles

function qa_userids_to_handles($userids)
{
    if (QA_FINAL_EXTERNAL_USERS) {
        $rawuseridhandles = qa_get_public_from_userids($userids);
    } else {
        require_once QA_INCLUDE_DIR . 'db/users.php';
        $rawuseridhandles = qa_db_user_get_userid_handles($userids);
    }
    $gotuseridhandles = array();
    foreach ($userids as $userid) {
        $gotuseridhandles[$userid] = @$rawuseridhandles[$userid];
    }
    return $gotuseridhandles;
}
开发者ID:kosmoluna,项目名称:question2answer,代码行数:14,代码来源:users.php

示例7: messagelist

    public function messagelist()
    {
        $offset = (int) qa_get('offset');
        $offset = isset($offset) ? $offset * 15 : 0;
        require_once QA_INCLUDE_DIR . 'qa-db-users.php';
        // Get Events
        $message_events = array('u_message', 'u_wall_post');
        $events = "'" . implode("','", $message_events) . "'";
        $userid = qa_get_logged_in_userid();
        $eventslist = qa_db_read_all_assoc(qa_db_query_sub('SELECT id, UNIX_TIMESTAMP(datetime) AS datetime, userid, postid, effecteduserid, event, params, `read` FROM ^ra_userevent WHERE effecteduserid=# AND `read` = 0 AND event IN (' . $events . ') ORDER BY id DESC LIMIT 15 OFFSET #', $userid, $offset));
        if (count($eventslist) > 0) {
            $event = array();
            $userids = array();
            foreach ($eventslist as $event) {
                $userids[$event['userid']] = $event['userid'];
                $userids[$event['effecteduserid']] = $event['effecteduserid'];
            }
            if (QA_FINAL_EXTERNAL_USERS) {
                $handles = qa_get_public_from_userids($userids);
            } else {
                $handles = qa_db_user_get_userid_handles($userids);
            }
            // get event's: time, type, parameters
            // get post id of questions
            foreach ($eventslist as $event) {
                $title = '';
                $link = '';
                $handle = $handles[$event['userid']];
                $reciever_handle = $handles[$event['effecteduserid']];
                $reciever_link = qa_path('user/' . $reciever_handle);
                $datetime = $event['datetime'];
                $event['date'] = qa_html(qa_time_to_string(qa_opt('db_time') - $datetime));
                $event['params'] = json_decode($event['params'], true);
                $message = substr($event['params']['message'], 0, 30) . '..';
                $id = ' data-id="' . $event['id'] . '"';
                $read = $event['read'] ? ' read' : ' unread';
                $url_param = array('ra_notification' => $event['id']);
                $user_link = qa_path_html('user/' . $handle, $url_param);
                switch ($event['event']) {
                    case 'u_message':
                        // related question to an answer
                        echo '<div class="event-content clearfix' . $read . '"' . $id . '>
								<div class="avatar"><a href="' . $user_link . '">' . ra_get_avatar($handle, 32, true) . '</a></div>
								<div class="event-right">
									<a href="' . qa_path_html('message/' . $handle, $url_param, QW_BASE_URL) . '">
										<div class="head">
											<strong class="user">' . $handle . '</strong>
											<span class="what">' . qa_lang_html('dude/sent_you_a_private_message') . '</span>
											<span class="message">' . $message . '</span>
										</div>
										<div class="footer">
											<span class="event-icon icon-email"></span>
											<span class="date">' . qa_lang_sub('dude/x_ago', $event['date']) . '</span>
										</div>
									</a>
								</div>
							</div>';
                        break;
                    case 'u_wall_post':
                        // user's question had been answered
                        $url = qa_path_html('user/' . $reciever_handle . '/wall', $url_param, QW_BASE_URL);
                        echo '<div class="event-content clearfix' . $read . '"' . $id . '>
								<div class="avatar"><a href="' . $user_link . '">' . ra_get_avatar($handle, 32, true) . '</a></div>
								<div class="event-right">
									<a href="' . $url . '">
										<div class="head">
											<strong class="user">' . $handle . '</strong>
											<span class="what">' . qa_lang_html('dude/posted_on_your_wall') . '</span>
											<span class="message">' . $message . '</span>
										</div>
										<div class="footer">
											<span class="event-icon icon-pin"></span>
											<span class="date">' . qa_lang_sub('dude/x_ago', $event['date']) . '</span>
										</div>
									</a>
								</div>
							</div>';
                        break;
                }
            }
        } else {
            echo '<div class="no-more-activity">' . qa_lang_html('dude/no_more_messages') . '</div>';
        }
        die;
    }
开发者ID:rahularyan,项目名称:dude-theme,代码行数:85,代码来源:addon.php

示例8: qa_post_userid_to_handle

function qa_post_userid_to_handle($userid)
{
    if (isset($userid)) {
        if (QA_FINAL_EXTERNAL_USERS) {
            require_once QA_INCLUDE_DIR . 'qa-app-users.php';
            $handles = qa_get_public_from_userids(array($userid));
            return @$handles[$userid];
        } else {
            $user = qa_db_single_select(qa_db_user_account_selectspec($userid, true));
            if (!is_array($user)) {
                qa_fatal_error('User ID could not be found: ' . $userid);
            }
            return $user['handle'];
        }
    }
    return null;
}
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:17,代码来源:qa-app-posts.php

示例9: qa_get_users_html

function qa_get_users_html($userids, $should_include_link, $relative_url_prefix)
{
    $useridtopublic = qa_get_public_from_userids($userids);
    $usershtml = array();
    foreach ($userids as $userid) {
        $publicusername = $useridtopublic[$userid];
        $usershtml[$userid] = htmlspecialchars($publicusername);
        if ($should_include_link) {
            $usershtml[$userid] = '<A HREF="' . htmlspecialchars($relative_url_prefix . 'user/' . urlencode($publicusername)) . '" CLASS="qa-user-link">' . $usershtml[$userid] . '</A>';
        }
    }
    return $usershtml;
}
开发者ID:TheProjecter,项目名称:microprobe,代码行数:13,代码来源:qa-external-users-wp.php

示例10: qa_get_users_html

function qa_get_users_html($userids, $should_include_link, $relative_url_prefix)
{
    //	By default, show the public username linked to the Q2A profile page for each user
    $useridtopublic = qa_get_public_from_userids($userids);
    $usershtml = array();
    foreach ($userids as $userid) {
        $publicusername = $useridtopublic[$userid];
        $usershtml[$userid] = htmlspecialchars($publicusername);
        if ($should_include_link) {
            $usershtml[$userid] = '<a href="' . htmlspecialchars($relative_url_prefix . 'user/' . urlencode($publicusername)) . '" class="qa-user-link">' . $usershtml[$userid] . '</a>';
        }
    }
    return $usershtml;
    /*
    	Example 1 - suitable if:
    	
    	* Your Q2A site:       http://www.mysite.com/qa/
    	* Your user pages:     http://www.mysite.com/user/[username]
    
    	$useridtopublic=qa_get_public_from_userids($userids);
    	
    	foreach ($userids as $userid) {
    		$publicusername=$useridtopublic[$userid];
    		
    		$usershtml[$userid]=htmlspecialchars($publicusername);
    		
    		if ($should_include_link)
    			$usershtml[$userid]='<a href="'.htmlspecialchars($relative_url_prefix.'../user/'.urlencode($publicusername)).
    				'" class="qa-user-link">'.$usershtml[$userid].'</a>';
    	}
    		
    	return $usershtml;
    */
    /*
    	Example 2 - suitable if:
    	
    	* Your Q2A site:       http://qa.mysite.com/
    	* Your user pages:     http://www.mysite.com/[username]/
    	* User photos (16x16): http://www.mysite.com/[username]/photo-small.jpeg
    
    	$useridtopublic=qa_get_public_from_userids($userids);
    	
    	foreach ($userids as $userid) {
    		$publicusername=$useridtopublic[$userid];
    		
    		$usershtml[$userid]='<img src="http://www.mysite.com/'.htmlspecialchars(urlencode($publicusername)).'/photo-small.jpeg" '.
    			'style="width:16px; height:16px; border:0; margin-right:4px;">'.htmlspecialchars($publicusername);
    		
    		if ($should_include_link)
    			$usershtml[$userid]='<a href="http://www.mysite.com/'.htmlspecialchars(urlencode($publicusername)).
    				'/" class="qa-user-link">'.$usershtml[$userid].'</a>';
    	}
    		
    	return $usershtml;
    */
}
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:56,代码来源:qa-external-users.php

示例11: process_request

 function process_request($request)
 {
     $qa_content = qa_content_prepare();
     $qa_content['title'] = qa_lang('badges/badge_list_title');
     $badges = qa_get_badge_list();
     $totalawarded = 0;
     $qa_content['custom'] = '<em>' . qa_lang('badges/badge_list_pre') . '</em><br />';
     $qa_content['custom2'] = '<table cellspacing="20">';
     $c = 2;
     $result = qa_db_read_all_assoc(qa_db_query_sub('SELECT user_id,badge_slug  FROM ^userbadges'));
     $count = array();
     foreach ($result as $r) {
         if (qa_opt('badge_' . $r['badge_slug'] . '_enabled') == '0') {
             continue;
         }
         if (isset($count[$r['badge_slug']][$r['user_id']])) {
             $count[$r['badge_slug']][$r['user_id']]++;
         } else {
             $count[$r['badge_slug']][$r['user_id']] = 1;
         }
         $totalawarded++;
         if (isset($count[$r['badge_slug']]['count'])) {
             $count[$r['badge_slug']]['count']++;
         } else {
             $count[$r['badge_slug']]['count'] = 1;
         }
     }
     foreach ($badges as $slug => $info) {
         if (qa_opt('badge_' . $slug . '_enabled') == '0') {
             continue;
         }
         $badge_name = qa_badge_name($slug);
         if (!qa_opt('badge_' . $slug . '_name')) {
             qa_opt('badge_' . $slug . '_name', $badge_name);
         }
         $name = qa_opt('badge_' . $slug . '_name');
         $var = qa_opt('badge_' . $slug . '_var');
         $desc = qa_badge_desc_replace($slug, $var, false);
         $type = qa_get_badge_type($info['type']);
         $types = $type['slug'];
         $typen = $type['name'];
         $qa_content['custom' . ++$c] = '<tr><td class="badge-entry"><div class="badge-entry-badge"><span class="badge-' . $types . '" title="' . $typen . '">' . $name . '</span>&nbsp;<span class="badge-entry-desc">' . $desc . '</span>' . (isset($count[$slug]) ? '&nbsp;<span title="' . $count[$slug]['count'] . ' ' . qa_lang('badges/awarded') . '" class="badge-count-link" onclick="jQuery(\'#badge-users-' . $slug . '\').slideToggle()">x' . $count[$slug]['count'] . '</span>' : '') . '</div>';
         // source users
         if (qa_opt('badge_show_source_users') && isset($count[$slug])) {
             $users = array();
             require_once QA_INCLUDE_DIR . 'qa-app-users.php';
             $qa_content['custom' . $c] .= '<div style="display:none" id="badge-users-' . $slug . '" class="badge-users">';
             foreach ($count[$slug] as $uid => $ucount) {
                 if ($uid == 'count') {
                     continue;
                 }
                 if (QA_FINAL_EXTERNAL_USERS) {
                     $handles = qa_get_public_from_userids(array($uid));
                     $handle = @$handles[$uid];
                 } else {
                     $useraccount = qa_db_select_with_pending(qa_db_user_account_selectspec($uid, true));
                     $handle = @$useraccount['handle'];
                 }
                 if (!$handle) {
                     continue;
                 }
                 $users[] = '<a href="' . qa_path_html('user/' . $handle) . '">' . $handle . ($ucount > 1 ? ' x' . $ucount : '') . '</a>';
             }
             $qa_content['custom' . $c] .= implode('<br/>', $users) . '</div>';
         }
         $qa_content['custom' . $c] .= '</td></tr>';
     }
     $qa_content['custom' . ++$c] = '<tr><td class="badge-entry"><span class="total-badges">' . count($badges) . ' ' . qa_lang('badges/badges_total') . '</span>' . ($totalawarded > 0 ? ', <span class="total-badge-count">' . $totalawarded . ' ' . qa_lang('badges/awarded_total') . '</span>' : '') . '</td></tr></table>';
     if (isset($qa_content['navigation']['main']['custom-2'])) {
         $qa_content['navigation']['main']['custom-2']['selected'] = true;
     }
     return $qa_content;
 }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:73,代码来源:qa-badge-page.php

示例12: qa_get_users_html

function qa_get_users_html($userids, $should_include_link, $relative_url_prefix)
{
    $useridtopublic = qa_get_public_from_userids($userids);
    $usershtml = array();
    foreach ($userids as $userid) {
        $publicusername = $useridtopublic[$userid];
        $usershtml[$userid] = htmlspecialchars($publicusername);
        if ($should_include_link) {
            $usershtml[$userid] = '<a href="' . qa_path_html('user/' . $publicusername) . '" class="qa-user-link">' . $usershtml[$userid] . '</a>';
        }
    }
    return $usershtml;
}
开发者ID:swuit,项目名称:swuit-q2a,代码行数:13,代码来源:external-users-wp.php

示例13: qw_activitylist

function qw_activitylist($limit)
{
    $offset = (int) qa_get('start');
    // get points for each activity
    require_once QA_INCLUDE_DIR . 'qa-db-points.php';
    require_once QA_INCLUDE_DIR . 'qa-db-users.php';
    $optionnames = qa_db_points_option_names();
    $options = qa_get_options($optionnames);
    $multi = (int) $options['points_multiple'];
    $upvote = '';
    $downvote = '';
    if (@$options['points_per_q_voted_up']) {
        $upvote = '_up';
        $downvote = '_down';
    }
    $event_point['in_q_vote_up'] = (int) $options['points_per_q_voted' . $upvote] * $multi;
    $event_point['in_q_vote_down'] = (int) $options['points_per_q_voted' . $downvote] * $multi * -1;
    $event_point['in_q_unvote_up'] = (int) $options['points_per_q_voted' . $upvote] * $multi * -1;
    $event_point['in_q_unvote_down'] = (int) $options['points_per_q_voted' . $downvote] * $multi;
    $event_point['a_vote_up'] = (int) $options['points_per_a_voted' . $upvote] * $multi;
    $event_point['in_a_vote_down'] = (int) $options['points_per_a_voted' . $downvote] * $multi * -1;
    $event_point['in_a_unvote_up'] = (int) $options['points_per_a_voted' . $upvote] * $multi * -1;
    $event_point['in_a_unvote_down'] = (int) $options['points_per_a_voted' . $downvote] * $multi;
    $event_point['in_a_select'] = (int) $options['points_a_selected'] * $multi;
    $event_point['in_a_unselect'] = (int) $options['points_a_selected'] * $multi * -1;
    $event_point['q_post'] = (int) $options['points_post_q'] * $multi;
    $event_point['a_post'] = (int) $options['points_post_a'] * $multi;
    $event_point['a_select'] = (int) $options['points_select_a'] * $multi;
    $event_point['q_vote_up'] = (int) $options['points_vote_up_q'] * $multi;
    $event_point['q_vote_down'] = (int) $options['points_vote_down_q'] * $multi;
    $event_point['a_vote_up'] = (int) $options['points_vote_up_a'] * $multi;
    $event_point['a_vote_down'] = (int) $options['points_vote_down_a'] * $multi;
    // Get Events
    $userid = qa_get_logged_in_userid();
    $eventslist = qa_db_read_all_assoc(qa_db_query_sub('SELECT id, UNIX_TIMESTAMP(datetime) AS datetime, userid, postid, effecteduserid, event, params, `read` FROM ^ra_userevent WHERE effecteduserid=# AND event NOT IN ("u_wall_post", "u_message") ORDER BY datetime DESC LIMIT # OFFSET #', $userid, $limit, $offset));
    if (count($eventslist) > 0) {
        $event = array();
        $output = '';
        $i = 0;
        //
        $userids = array();
        foreach ($eventslist as $event) {
            $userids[$event['userid']] = $event['userid'];
            $userids[$event['effecteduserid']] = $event['effecteduserid'];
        }
        if (QA_FINAL_EXTERNAL_USERS) {
            $handles = qa_get_public_from_userids($userids);
        } else {
            $handles = qa_db_user_get_userid_handles($userids);
        }
        // get event's: time, type, parameters
        // get post id of questions
        foreach ($eventslist as $event) {
            $title = '';
            $link = '';
            $vote_status = '';
            $handle = isset($handles[$event['userid']]) ? $handles[$event['userid']] : qa_lang('main/anonymous');
            $datetime = $event['datetime'];
            $event['date'] = qa_html(qa_time_to_string(qa_opt('db_time') - $datetime));
            $event['params'] = json_decode($event['params'], true);
            $id = ' data-id="' . $event['id'] . '"';
            $read = $event['read'] ? ' read' : ' unread';
            $mark_as_read = !$event['read'] ? '<span class="icon icon-tick"></span>' : '';
            $url_param = array('ra_notification' => $event['id']);
            $user_link = qa_path_html('user/' . $handle, $url_param, QW_BASE_URL);
            switch ($event['event']) {
                case 'related':
                    // related question to an answer
                    $url = qa_path_html(qa_q_request($event['postid'], $event['params']['title']), $url_param, QW_BASE_URL, null, null);
                    echo '<div class="event-content clearfix' . $read . '' . $read . '"' . $id . '>
                                                <div class="avatar"><a href="' . $user_link . '">' . qw_get_avatar($handle, 32, true) . '</a></div>
                                                <div class="event-right">
                                                      <a href="' . $url . '">
                                                            <div class="head">
                                                                  <strong class="user">' . $handle . '</strong>
                                                                  <span class="what">' . qa_lang_html('dude/asked_question_related_to_your') . '</span>
                                                                  <strong class="where">' . qa_lang_html('dude/answer') . '</strong>
                                                            </div>
                                                            <div class="footer">
                                                                  <span class="event-icon icon-link"></span>
                                                                  <span class="date">' . qa_lang_sub('dude/x_ago', $event['date']) . '</span>
                                                            </div>
                                                      </a>
                                                </div>
                                          </div>';
                    break;
                case 'a_post':
                    // user's question had been answered
                    $anchor = qa_anchor('A', $event['postid']);
                    $url = qa_path_html(qa_q_request($event['params']['qid'], $event['params']['qtitle']), $url_param, QW_BASE_URL, null, $anchor);
                    $title = qw_truncate($event['params']['qtitle'], 60);
                    echo '<div class="event-content clearfix' . $read . '"' . $id . '>
                                                <div class="avatar"><a href="' . $user_link . '">' . qw_get_avatar($handle, 32, true) . '</a></div>
                                                <div class="event-right">
                                                      <a href="' . $url . '">
                                                            <div class="head">
                                                                  <strong class="user">' . $handle . '</strong>
                                                                  <span class="what">' . qa_lang_html('dude/answered_your') . '</span>
                                                                  <strong class="where">' . qa_lang_html('dude/question') . '</strong>
                                                            </div>
//.........这里部分代码省略.........
开发者ID:rahularyan,项目名称:dude-theme,代码行数:101,代码来源:functions.php

示例14: notify

 function notify($uid, $notices)
 {
     require_once QA_INCLUDE_DIR . 'qa-app-users.php';
     require_once QA_INCLUDE_DIR . 'qa-app-emails.php';
     if (QA_FINAL_EXTERNAL_USERS) {
         $publictohandle = qa_get_public_from_userids(array($uid));
         $handle = @$publictohandle[$uid];
     } else {
         $user = qa_db_single_select(qa_db_user_account_selectspec($uid, true));
         $handle = @$user['handle'];
     }
     $subject = qa_opt('priv_email_subject');
     $body = qa_opt('priv_email_body');
     $n = explode(',', $notices);
     if (count($n) > 1) {
         $body = preg_replace('/\\^single=`([^`]+)`/', '', $body);
         preg_match('/\\^multi=`([^`]+)`/', $body, $multi);
         $m = str_replace('#', count($n), $multi[1]);
         $body = preg_replace('/\\^multi=`([^`]+)`/', $m, $body);
     } else {
         $body = preg_replace('/\\^single=`([^`]+)`/', '$1', $body);
         $body = preg_replace('/\\^multi=`([^`]+)`/', '', $body);
     }
     $site_url = qa_opt('site_url');
     $profile_url = qa_path_html('user/' . $handle, null, $site_url);
     $subs = array('^profile_url' => $profile_url, '^site_url' => $site_url);
     qa_send_notification($uid, '@', $handle, $subject, $body, $subs);
 }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:28,代码来源:qa-priv-check.php

示例15: getHandleFromID

 function getHandleFromID($uid)
 {
     require_once QA_INCLUDE_DIR . 'qa-app-users.php';
     if (QA_FINAL_EXTERNAL_USERS) {
         $publictouserid = qa_get_public_from_userids(array($uid));
         $handle = @$publictouserid[$uid];
     } else {
         $handle = qa_db_read_one_value(qa_db_query_sub('SELECT handle FROM ^users WHERE userid = #', $uid), true);
     }
     if (!isset($handle)) {
         return;
     }
     return $handle;
 }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:14,代码来源:qa-history-layer.php


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