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

2 Answers

0 votes
by
edited by
You're using an advanced theme, yes? If so, you will want to override the "footer()" function and add your ad code at the beginning of the function.
by
I'll be using advanced theme, but overriding footer() will place ads on all pages including questions, unanswered etc, which I dont want. I would like to have ads only on newly created pages.
+1 vote
by
You could pass through the $post['created'] to the theme layer by adding something like this inside qa_post_html_fields(...) in qa-app-format.php:

$fields['created_raw']=@$post['created'];

Then in the appropriate function in your advanced theme file, check:

if (
    ($this->template=='question') &&
    ((time() - @$this->content['q_view']['created_raw'])<60)
)
    // output whatever you want

The 60 in the code above means this will only be displayed on questions which are less than 60 seconds old, so change that to whatever you want.

Considering a few questions that have appeared like this, methinks it is time that qa_post_html_fields(...) simply passes the entire raw information about the $post through to the theme layer. Will do this for 1.2.1.
...