예제 #1
0
 function logged_in()
 {
     qa_html_theme_base::logged_in();
     if (qa_is_logged_in()) {
         $userpoints = qa_get_logged_in_points();
         $pointshtml = $userpoints == 1 ? qa_lang_html_sub('main/1_point', '1', '1') : qa_lang_html_sub('main/x_points', qa_html(number_format($userpoints)));
         $this->output('<SPAN CLASS="qa-logged-in-points">', '(' . $pointshtml . ')', '</SPAN>');
     }
 }
예제 #2
0
 function logged_in()
 {
     if (isset($this->content['loggedin']['data']) && qa_opt('buddypress_integration_enable') && qa_opt('buddypress_display_names')) {
         $handle = qa_get_logged_in_handle();
         $name = bp_core_get_user_displayname($handle);
         $this->content['loggedin']['data'] = str_replace('>' . $handle . '<', ' title="@' . $handle . '">' . $name . '<', $this->content['loggedin']['data']);
     }
     qa_html_theme_base::logged_in();
 }
예제 #3
0
 function logged_in()
 {
     qa_html_theme_base::logged_in();
     $qa_login_userid = qa_get_logged_in_userid();
     if (isset($qa_login_userid)) {
         $currentcourse = mp_get_categoryinfo(mp_get_categoryid());
         //$this->output('Course: '.$currentcourse['title'] );
         //$this->output('<A HREF="'.qa_path_html('mp-change-course-page').'" class="qa-user-link">Change Course</a>');
         $this->output('course: <A HREF="' . qa_path_html('mp-change-course-page') . '" class="qa-user-link">' . $currentcourse['title'] . '</a>');
     }
 }
예제 #4
0
 function logged_in()
 {
     if (qa_is_logged_in()) {
         // output user avatar to login bar
         $this->output('<div class="qa-logged-in-avatar">', QA_FINAL_EXTERNAL_USERS ? qa_get_external_avatar_html(qa_get_logged_in_userid(), 24, true) : qa_get_user_avatar_html(qa_get_logged_in_flags(), qa_get_logged_in_email(), qa_get_logged_in_handle(), qa_get_logged_in_user_field('avatarblobid'), qa_get_logged_in_user_field('avatarwidth'), qa_get_logged_in_user_field('avatarheight'), 24, true), '</div>');
     }
     qa_html_theme_base::logged_in();
     if (qa_is_logged_in()) {
         // adds points count after logged in username
         $userpoints = qa_get_logged_in_points();
         $pointshtml = $userpoints == 1 ? qa_lang_html_sub('main/1_point', '1', '1') : qa_lang_html_sub('main/x_points', qa_html(number_format($userpoints)));
         $this->output('<span class="qa-logged-in-points">', '(' . $pointshtml . ')', '</span>');
     }
 }
    function logged_in()
    {
        if (qa_get_logged_in_userid()) {
            if ($this->template == "question") {
                $qnum = qa_request_part("0");
                qa_db_query_sub("UPDATE ^userevents SET lastview = NOW() WHERE questionid = {$qnum} AND userid = " . qa_get_logged_in_userid());
            }
            $questions = qa_db_read_all_assoc(qa_db_query_sub("SELECT DISTINCT(questionid), lastpostid FROM ^userevents WHERE lastview < updated OR lastview IS NULL"));
            $count = count($questions);
            $notifyclass = "qa-notification-none";
            if ($count > 0) {
                $notifyclass = "qa-notification-new";
            }
            $this->output('
				<span class="qa-notification-counter ' . $notifyclass . '">' . $count . '</span>
				');
            $this->output('<div class="qa-notification-dialog">');
            foreach ($questions as $question) {
                $q = qa_post_get_full($question["questionid"]);
                $post = qa_post_get_full($question["lastpostid"]);
                $type = "";
                if ($post["type"] == "A") {
                    $type = "answer";
                } else {
                    if ($post["type"] == "C") {
                        $type = "comment";
                    }
                }
                if ($post["userid"] == NULL) {
                    $user = "******";
                } else {
                    $user = qa_userids_to_handles(array($post["userid"]));
                    $user = $user[$post["userid"]];
                }
                $this->output('<div class="qa-notification-dialog-entry">', '<a href="' . qa_q_path($question["questionid"], $q["title"]) . '">' . $q["title"] . '</a>', '<div>New ' . $type . ' by ' . $user . ': "' . substr($post["content"], 0, 100) . '"</div>', '</div>');
            }
            $this->output('</div>');
        }
        qa_html_theme_base::logged_in();
    }
예제 #6
0
 function logged_in()
 {
     if (qa_opt('badge_active') && (bool) qa_opt('badge_admin_loggedin_widget') && @$this->content['loggedin']['data'] != null) {
         $handle = preg_replace('|.+qa-user-link" title="@([^"]+)".+|', '$1', $this->content['loggedin']['data']);
         $this->content['loggedin']['data'] = $this->content['loggedin']['data'] . '&nbsp;' . qa_badge_plugin_user_widget($handle);
     }
     qa_html_theme_base::logged_in();
 }
예제 #7
0
 /**
  * Adding point count for logged in user
  *
  * @since Snow 1.4
  */
 public function logged_in()
 {
     parent::logged_in();
     if (qa_is_logged_in()) {
         $userpoints = qa_get_logged_in_points();
         $pointshtml = $userpoints == 1 ? qa_lang_html_sub('main/1_point', '1', '1') : qa_html(number_format($userpoints));
         $this->output('<div class="qam-logged-in-points">' . $pointshtml . '</div>');
     }
 }
예제 #8
0
 /**
  * Adding point count for logged in user
  *
  * @since Snow 1.4
  * @global array $qam_snow
  */
 public function logged_in()
 {
     global $qam_snow;
     qa_html_theme_base::logged_in();
     $this->output($qam_snow->headers['user_points']);
 }
예제 #9
0
 function logged_in()
 {
     qa_html_theme_base::logged_in();
     if (qa_is_logged_in()) {
         $userpoints = qa_get_logged_in_points();
         $username = qa_html(qa_get_logged_in_handle());
         $userid = qa_get_logged_in_userid();
         $user = qa_db_select_with_pending(qa_db_user_rank_selectspec($userid));
         $userrank = '';
         if (is_array($user)) {
             if (array_key_exists('rank', $user)) {
                 $userrank = '(#' . number_format((int) $user['rank']) . ')';
             }
         }
         $pointshtml = $userpoints == 1 ? qa_lang_html_sub('main/1_point', '1', '1') : qa_lang_html_sub('main/x_points', qa_html(number_format($userpoints)));
         $this->output('<SPAN><a CLASS="qa-logged-in-points" href="index.php?qa=user&qa_1=' . $username . '#activity">' . $pointshtml . $userrank . '</a></SPAN>');
     }
 }