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

How can you put an advertisement After the question And before the first answer?

http://www.osc.co.il/pic.jpg

8 Answers

+2 votes
by
yes you can, use below addon, it is tested till 1.3.3 version. but not tested for 1.4

http://answers.prothoughts.com/q2a-themes-addons
–1 vote
by
its dont work :-(
0 votes
by
You need to overload the q_view function in your qa-theme.php file. Example:

 

        // Ad after question
        function q_view($q_view)
        {
            qa_html_theme_base::q_view($q_view);

            //ad after question, just before answers
            //Put your ad code in between below brackets
            ?>
              
            <?
        }
0 votes
by

You mean like this

 

my qa-theme.php

 

<?php

/*
 Question2Answer 1.4.1 (c) 2011, Gideon Greenspan

 http://www.question2answer.org/

 
 File: qa-theme/Candy/qa-theme.php
 Version: 1.4.1
 Date: 2011-07-10 06:58:57 GMT
 Description: Override something in base theme class for Candy theme


 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 More about this license: http://www.question2answer.org/license.php
*/

 class qa_html_theme extends qa_html_theme_base
 {
  function nav_user_search() // reverse the usual order
  {
   $this->search();
   $this->nav('user');
  }
 }
 
 
 // Ad after question
 function q_view($q_view)
 {
     qa_html_theme_base::q_view($q_view);

     //ad after question, just before answers
     //Put your ad code in between below brackets
     ?>
  my google script?
     <?
 }

/*
 Omit PHP closing tag to help avoid accidental output
*/

by
Yep. You can just try it out with a test picture or something instead of the adsense ad, and see how it goes.
0 votes
by

I still could not do it. Can someone please help me???

by
Did you try to put some other text instead of the ad, in the place I mentioned in qa-theme.php ? Trying printing a text string in there, and then refresh a question page on your site. Then, search for the test text and see where it shows up, it should show up below the question, and above the answers.
by
yes its dont work :-(
by
Do not forget to use:

$this->output('');

Put your google adsense code between the (' and ').
by
I did not realize you could please give me an example with the original file.

http://answers.prothoughts.com/q2a-themes-addons
–1 vote
by

Someone could already do that? Help please :-(

0 votes
by

i get the error

0 votes
by
The code of Q&A  is very confusing. They are using array, array & array.

Welcome to the Q&A site for Question2Answer.

If you have a question about Q2A, please ask here, in English.

To report a bug, please create a new issue on Github or ask a question here with the bug tag.

If you just want to try Q2A, please use the demo site.

Categories

...