當前位置: 首頁>>代碼示例>>PHP>>正文


PHP qa_html_theme_base::post_avatar方法代碼示例

本文整理匯總了PHP中qa_html_theme_base::post_avatar方法的典型用法代碼示例。如果您正苦於以下問題:PHP qa_html_theme_base::post_avatar方法的具體用法?PHP qa_html_theme_base::post_avatar怎麽用?PHP qa_html_theme_base::post_avatar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在qa_html_theme_base的用法示例。


在下文中一共展示了qa_html_theme_base::post_avatar方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: post_avatar

 function post_avatar($post, $class, $prefix = null)
 {
     if (isset($post['avatar']) && ($class == 'qa-q-view' && qa_opt('marker_plugin_a_qv') || $class == 'qa-q-item' && qa_opt('marker_plugin_a_qi') || $class == 'qa-a-item' && qa_opt('marker_plugin_a_a') || $class == 'qa-c-item' && qa_opt('marker_plugin_a_c'))) {
         $uid = $post['raw']['userid'];
         $image = $this->get_role_marker($uid, 1);
         $post['avatar'] = $image . @$post['avatar'];
     }
     qa_html_theme_base::post_avatar($post, $class, $prefix);
 }
開發者ID:ruuttt,項目名稱:question2answer_sandbox,代碼行數:9,代碼來源:qa-marker-layer.php

示例2: post_avatar

 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);
 }
開發者ID:swuit,項目名稱:swuit-q2a,代碼行數:82,代碼來源:qa-layer-base.php


注:本文中的qa_html_theme_base::post_avatar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。