Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
696 views
in Q2A Core by
Hy,

I would like to ad more layout before every question and after questions on every page. And it would be nice to ad layout behind every fifth question on the main page. This is for advertisement.

Can someone help me ad this to this script.

Thanks

1 Answer

+1 vote
by

I found the way to ad the text at the begining of the page and at the end of page and

in the file qa-theme-base.php in the function main() you haw to ad it like this 

for begining page:
 

 

$this->output('<DIV CLASS="qa-main'.(@$this->content['hidden'] ? ' qa-main-hidden' : '').'">');
$this->output('<DIV>TEST</DIV>'); // On the begining of page ads (<<<ad this)
$this->page_title();

and for end :

 

 

$this->main_parts($content);
$this->output('<DIV>TEST</DIV>');  // at the end of page ads (<<<ad this)
 
if (isset($content['main_form_tags']))

 

I manage to ad text after ewery second or any number of qestions you wont just replace the number 2 with number you wont in if statment

also in the   qa-theme-base.php this time for the function q_list($q_list)

just replace it with this one 

function q_list($q_list)

 

 
{
$this->output('<DIV CLASS="qa-q-list">', '');
$brojac = 0;
foreach ($q_list['qs'] as $question){
 
$this->q_list_item($question);
$brojac = $brojac + 1 ;    // tu treba brojati
if ($brojac % 2 == 0)
$this->output('<DIV>TEST</DIV>');
}
 
 
$this->output('</DIV> <!-- END qa-q-list -->', '');
}

 

Again my qestion is how to ad this to layout option in admin panel

thanks

...