Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.1k views
in Plugins by
I want to add a quora style information where the is brief explanation under name in answer page. How do i do it? I'm using snow theme.
by
Which field do you use for bio information?
e.g. "About" field of each user
by
I'm sorry i have no idea.
It is a default bio field in user page.
Please check http://pitakonan.com/user/zakifalimbany
by
I understood that you are using extra field NO-4.

1 Answer

+1 vote
by
edited by

There is also an easy way to deal with only layer module, but it will be worse the performance of your site. I will show fastest and flexible logic (This is a program for advanced users). I wonder it is difficult for you?

  1. Add new plugin.
  2. Add override module *1
  3. Add lines below in overrided function (qa_db_posts_basic_selectspec()). *2
  4. Add layer module
  5. Add function in layer module *3

*1: qa_db_posts_basic_selectspec() in qa-include/db/selects.php L127
*2: Add lines at L189

$selectspec['source'].=' LEFT JOIN ^users ON ^posts.userid=^users.userid';

$selectspec['columns']['bio']='^userprofile.content';
$selectspec['source'].=' LEFT JOIN ^userprofile ON ^posts.userid=^userprofile.userid AND ^userprofile.title="bio"';

                
if ($full) {

*3: Add function

function post_meta($post, $class, $prefix=null, $separator='<br/>')
{
  $this->output('<span class="'.$class.'-meta">');
  if (isset($prefix))
      $this->output($prefix);
            $order=explode('^', @$post['meta_order']);
            foreach ($order as $element)
                switch ($element) {
                    case 'what':
                        $this->post_meta_what($post, $class);
                        break;
                    case 'when':
                        $this->post_meta_when($post, $class);
                        break;
                    case 'where':
                        $this->post_meta_where($post, $class);
                        break;
                    case 'who':
                        $this->post_meta_who($post, $class);
                        break;
                }
            $this->post_meta_flags($post, $class);
            if (!empty($post['what_2'])) {
                $this->output($separator);
                foreach ($order as $element)
                    switch ($element) {
                        case 'what':
                            $this->output('<span class="'.$class.'-what">'.$post['what_2'].'</span>');
                            break;
                        case 'when':
                            $this->output_split(@$post['when_2'], $class.'-when');
                            break;
                        case 'who':
                            $this->output_split(@$post['who_2'], $class.'-who');
                            break;
                    }
            }
            if($class=='qa-a-item') {
                if(!empty($post['raw']['bio'])) {
                    $this->output('<span style="display:block" class="'.$class.'-bio">');
                    $this->output(qa_shorten_string_line(str_replace("\n", '<br/>', strip_tags($post['raw']['bio'])),120));
                    $this->output('</span>');
                }
            }

            $this->output('</span>');
        }

by
Let say i don't really understand it (which i did), is it possible to hire a freelancer - for example: you - to do it? and how much i have to pay for it?
by
My answer is a answer for the purpose that you do not change Q2A core. If you want to hack the Q2A core directly, it is not so difficult. If it is also difficult, please ask me to technical support under procedure. Members of ASKIVE ask me a customization of Q2A well. Job scale is different. Large, small, etc. However, most things are developed in one day.

(1) If you do not yet have an account of ASKIVE. please register.
(2) There is a pricing page for technical support in my site.
http://askive.cmsbox.jp/pricing#tabs-service-4
(3) Please contact me with contact page or PM in ASKIVE
http://askive.cmsbox.jp/contact
http://askive.cmsbox.jp/message/webmaster
by
Got it sir. Waiting approval on your website. Thanks
by
could you share this code with us?  thanks in advance
...