Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
884 views
in Q2A Core by

How do I move the bit that contains the users info from the bottom to the top? I am using the Donut theme. Thanks for your guys help!

Q2A version: 1.8.3

2 Answers

+2 votes
by
selected by
 
Best answer

Well, you just need to change 3 lines, but in order to do so you need to override 3 big methods in the Donut theme, to avoid getting the core hacked.

1. Edit file qa-theme/Donut-theme/qa-donut-layer.php

2. Add these big functions to it:

public function q_view_main($q_view) {
  $this->output('<div class="qa-q-view-main">');

  if (isset($q_view['main_form_tags'])) {
    $this->output('<form ' . $q_view['main_form_tags'] . '>'); // form for buttons on question
  }

  $this->view_count($q_view);
  $this->post_avatar_meta($q_view, 'qa-q-view');
  $this->q_view_content($q_view);
  $this->q_view_extra($q_view);
  $this->q_view_follows($q_view);
  $this->q_view_closed($q_view);
  $this->post_tags($q_view, 'qa-q-view');
  $this->q_view_buttons($q_view);

  if (isset($q_view['main_form_tags'])) {
    $this->form_hidden_elements(@$q_view['buttons_form_hidden']);
    $this->output('</form>');
  }

  $this->c_list(@$q_view['c_list'], 'qa-q-view');
  $this->c_form(@$q_view['c_form']);

  $this->output('</div> <!-- END qa-q-view-main -->');
}

public function a_item_main($a_item) {
  $this->output('<div class="qa-a-item-main">');

  if (isset($a_item['main_form_tags'])) {
    $this->output('<form ' . $a_item['main_form_tags'] . '>'); // form for buttons on answer
  }

  if ($a_item['hidden'])
    $this->output('<div class="qa-a-item-hidden">');
  elseif ($a_item['selected'])
    $this->output('<div class="qa-a-item-selected">');

  $this->a_selection($a_item);
  $this->error(@$a_item['error']);
  $this->post_avatar_meta($a_item, 'qa-a-item');
  $this->a_item_content($a_item);

  if ($a_item['hidden'] || $a_item['selected'])
    $this->output('</div>');

  $this->a_item_buttons($a_item);

  if (isset($a_item['main_form_tags'])) {
    $this->form_hidden_elements(@$a_item['buttons_form_hidden']);
    $this->output('</form>');
  }

  $this->c_list(@$a_item['c_list'], 'qa-a-item');
  $this->c_form(@$a_item['c_form']);

  $this->output('</div> <!-- END qa-a-item-main -->');
}

public function c_item_main($c_item) {
  if (isset($c_item['main_form_tags'])) {
    $this->output('<form ' . $c_item['main_form_tags'] . '>'); // form for buttons on comment
  }

  $this->error(@$c_item['error']);

  $this->post_avatar_meta($c_item, 'qa-c-item');
  if (isset($c_item['expand_tags']))
    $this->c_item_expand($c_item);
  elseif (isset($c_item['url']))
    $this->c_item_link($c_item);
  else
    $this->c_item_content($c_item);

  $this->output('<div class="qa-c-item-footer">');
  $this->c_item_buttons($c_item);
  $this->output('</div>');

  if (isset($c_item['main_form_tags'])) {
    $this->form_hidden_elements(@$c_item['buttons_form_hidden']);
    $this->output('</form>');
  }
}
by
Oh. I didn't see the other user's answer (I had the question open and didn't see the answer up to now). Your comment is for them... mine covers that :)
by
Thanks I got it to work but one more thing how do I add a separator line/line between the user question and the info? I am asking because it will make it look cleaner. Thanks.
by
+1
Add this at the end of qa-theme/Donut-theme/css/donut.css (or donut.min.css, depending on your configuration):

.qa-q-view-avatar-meta, .qa-a-item-avatar-meta, .qa-c-item-avatar-meta  {
  padding-bottom: 5px;
}

.qa-q-view-avatar-meta, .qa-a-item-avatar-meta {
  border-bottom: 1px solid lightgray;
}

Note lines in comments will not look as expected so I suggest just leaving the space there.
0 votes
by

Add the following function to the qa-donut-layer.php file:

public function q_view_main($q_view)
{
$this->output('<div class="qa-q-view-main">');
if (isset($q_view['main_form_tags'])) {
$this->output('<form ' . $q_view['main_form_tags'] . '>'); // form for buttons on question
}
$this->view_count($q_view);
$this->post_avatar_meta($q_view, 'qa-q-view');
$this->q_view_content($q_view);
$this->q_view_extra($q_view);
$this->q_view_follows($q_view);
$this->q_view_closed($q_view);
$this->post_tags($q_view, 'qa-q-view');
$this->q_view_buttons($q_view);
if (isset($q_view['main_form_tags'])) {
$this->form_hidden_elements(@$q_view['buttons_form_hidden']);
$this->output('</form>');
}
$this->c_list(@$q_view['c_list'], 'qa-q-view');
$this->c_form(@$q_view['c_form']);
$this->output('</div> <!-- END qa-q-view-main -->');
}
...