当前位置: 首页>>代码示例>>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;未经允许,请勿转载。