Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
1.3k views
in Q2A Core by
edited by

How to change USERS+TAGS order lists from left to right (like stackoverflow), now by defaut is from top to down in my site.

=>

1 Answer

+3 votes
by
selected by
 
Best answer
hI guess something like this would do the trick. Add this function to your qa-theme/<your-selected-theme>/qa-theme.php file:
 
function ranking($ranking)
{
    $this->part_title($ranking);
 
    $class=(@$ranking['type']=='users') ? 'qa-top-users' : 'qa-top-tags';
 
    $rows=min($ranking['rows'], count($ranking['items']));
 
    if ($rows>0) {
        $this->output('<table class="'.$class.'-table">');
 
        $columns=qa_opt('columns_' . $ranking['type']);
 
        for ($row=0; $row<$rows; $row++) {
            $this->set_context('ranking_row', $row);
            $this->output('<tr>');
 
            for ($column=0; $column<$columns; $column++) {
                $this->set_context('ranking_column', $column);
                $this->ranking_item(@$ranking['items'][$columns*$row+$column], $class, $column>0);
            }
 
            $this->clear_context('ranking_column');
 
            $this->output('</tr>');
        }
 
        $this->clear_context('ranking_row');
 
        $this->output('</table>');
    }
}
 
If the ranking function is already there then you're using a custom theme that has changed that behaviour, which means you will require a custom solution or ask the developer of the theme for support.
 
Anyway, it is a considerably easy fix. All I have actually done is copy/pasting the function from qa-theme-base.php and changed 2 lines from it. This gist might be clearer https://gist.github.com/pupi1985/48fbc928cfd65e38db51/revisions
by
edited by
ok thanks perfect! I edit qa theme base. I fixe everything according to your code and mine at the same time.
...