function post_meta_who($post, $class) { require_once QA_INCLUDE_DIR . 'qa-app-users.php'; // for QA_USER_LEVEL_BASIC constant //echo 'MPLOG'.print_r($post, true); if (isset($post['raw']['opostid'])) { // if item refers to an answer or comment... $level = @$post['raw']['olevel']; } else { $level = @$post['raw']['level']; } // otherwise take level of the question author //if ($level>QA_USER_LEVEL_BASIC) // if level is more than basic user... $post['who']['data'] = '<SPAN CLASS="mp-badge-silver">' . @$post['who']['data'] . '</SPAN>'; // ...add italics qa_html_theme_base::post_meta_who($post, $class); }
function post_meta_who($post, $class) { if (@$post['who'] && @$post['who']['data'] && qa_opt('badge_active') && (bool) qa_opt('badge_admin_user_widget') && ($class != 'qa-q-item' || qa_opt('badge_admin_user_widget_q_item'))) { $handle = preg_replace('|.+qa-user-link" title="@([^"]+)".+|', '$1', $post['who']['data']); $post['who']['suffix'] = @$post['who']['suffix'] . ' ' . qa_badge_plugin_user_widget($handle); } qa_html_theme_base::post_meta_who($post, $class); }
function post_avatar($post, $class, $prefix = null) { if (qa_opt('it_layout_lists') == 'qlist') { qa_html_theme_base::post_avatar($post, $class, $prefix = null); return; } // check if it's a question list or question item if ($class != 'qa-q-item') { //if (!( ($this->template=='qa') or ($this->template=='questions') )) qa_html_theme_base::post_avatar($post, $class, $prefix); } else { $qlink = qa_q_path($post['raw']['postid'], $post['raw']['title'], true); $this->output('<div class="q-item-meta">'); // set avatar if (isset($post['avatar'])) { if (isset($prefix)) { $this->output($prefix); } $this->output('<section class="' . $class . '-avatar">' . $post['avatar']); $this->output('<section class="popup-user-avatar">'); qa_html_theme_base::post_meta_what($post, $class); qa_html_theme_base::post_meta_who($post, $class); $this->output('</section>'); $this->output('</section>'); } // set category if ($post["raw"]["categoryid"]) { require_once QA_INCLUDE_DIR . 'qa-db-metas.php'; $categoryid = $post["raw"]["categoryid"]; $catname = $post["raw"]["categoryname"]; $catbackpath = $post["raw"]["categorybackpath"]; $et_category = json_decode(qa_db_categorymeta_get($categoryid, 'et_category'), true); $this->output('<section class="' . $class . '-category">'); $categorypathprefix = 'questions/'; $this->output('<a class="' . $class . '-category-link" title="' . $et_category['et_cat_title'] . '" href="' . qa_path_html($categorypathprefix . implode('/', array_reverse(explode('/', $catbackpath)))) . '">'); if (!empty($et_category['et_cat_icon48'])) { $this->output('<img class="qa-category-image" width="48" height="48" alt="' . $et_category['et_cat_desc'] . '" src="' . $et_category['et_cat_icon48'] . '">'); } else { $this->output(qa_html($catname)); } $this->output('</a>'); if (!empty($et_category['et_cat_desc'])) { $this->output('<section class="' . $class . '-category-description">'); $this->output($et_category['et_cat_desc']); $this->output('</section>'); } $this->output('</section>'); } $this->output('</div>'); $this->output('<div class="qa-item-meta-bar">'); // Voting $this->voting_inner_html($post); // favourites if (qa_is_logged_in()) { $favourited = $post['favourited']; $favorite = qa_favorite_form(QA_ENTITY_QUESTION, $post['raw']['postid'], $favourited, qa_lang($favourited ? 'question/remove_q_favorites' : 'question/add_q_favorites')); if (isset($favorite)) { //$this->output('<form '.$favorite['form_tags'].'>'); $this->output('<div class="qa-favoriting qa-favoriting-' . $post['raw']['postid'] . '" ' . @$favorite['favorite_tags'] . '>'); $this->favorite_inner_html($favorite, $post['favourites']); $this->output('</div>'); $this->output('<input type="hidden" id="fav_code_' . $post['raw']['postid'] . '" name="fav_code" value="' . @$favorite['form_hidden']['code'] . '"/>'); //$this->output('</form>'); } } else { $this->output('<div class="qa-favoriting qa-favoriting-' . $post['raw']['postid'] . '" ' . @$favorite['favorite_tags'] . '>'); $this->output('<button class="btn btn-default btn-xs fa fa-heart qa-favorite" type="button" onclick="return qa_favorite_click(this);" name="favorite-login_q' . $post['raw']['postid'] . '" title="Favourite">' . $post['favourites'] . '</button>'); //<button class="btn btn-default btn-xs fa fa-heart qa-favorite" type="button" onclick="return qa_favorite_click(this);" name="favorite_Q_125_1" title="Add to my favorites">2</button> $this->output('</div>'); } // discussions $this->output('<div class="qa-list-discussions">'); $this->output('<a class="btn btn-default btn-xs fa fa-comment discussions-item-list" href="' . $qlink . '">' . ($post['comments'] + $post["answers_raw"]) . '</a>'); $this->output('</div>'); // Share $this->output('<div class="qa-list-share">'); $this->output('<button type="button" class="btn btn-default btn-xs fa fa-share-alt share-item-list" data-share-link="' . $qlink . '" data-share-title="' . $post['raw']['title'] . '"></button>'); $this->output('</div>'); $this->output('</div>'); } //qa_html_theme_base::voting_inner_html($post); }
function post_meta_who($post, $class) { if (qa_opt('badge_active') && (bool) qa_opt('badge_admin_user_widget') && ($class != 'qa-q-item' || qa_opt('badge_admin_user_widget_q_item'))) { $handle = strip_tags($post['who']['data']); $post['who']['suffix'] = @$post['who']['suffix'] . ' ' . qa_badge_plugin_user_widget($handle); } qa_html_theme_base::post_meta_who($post, $class); }