Skip to content

dart-creations.com

Advertisement
Home arrow Joomla arrow Joomla Tutorials arrow Kunena AdSense - how to put Google AdSense in your Kunena Forum
Print E-mail
Saturday, 09 May 2009

Kunena AdSense - how to put Google AdSense in your Kunena Forum 

It seems that (at least at the time of writing), there isn't support of Google AdSense within Joomla Kunena Forum, which I find strange since this was supported in FireBoard forums. Anyway, for those of you who want Google AdSense in their Kunena forum, here is how. 

    • Go to Components > Kunena Forum > Kunena Configuration and find the name of the template you are using
    • kunenatemplate.jpg
    • You will now need to change the view.php file. Using FTP software, or anything else which you use to edit Joomla files, find the view.php of the template you are using (MAKE A BACKUP OF THE FILE, in case something goes wrong and you need to get the original file!)

    e.g. /components/com_kunena/template/defualt/view.php

    If you are not using the default template, you will need to change /components/com_kunena/template/{TEMPLATE_NAME_HERE}/view.php to the name of the template you are using 

    • Find the following code:
                                    //(JJ)
                                    if (file_exists(KUNENA_ABSTMPLTPATH .                                  '/message.php')) {
                                        include (KUNENA_ABSTMPLTPATH .                                      '/message.php');
                                    }
                                    else {
                                        include (KUNENA_ABSPATH . 
                                          '/template/default/message.php');
                                    }
                                    unset(
                                    $msg_id,
                                    $msg_username,
                                    $msg_avatar,
                                    $msg_usertype,
                                    $msg_userrank,
                          

     

    and replace and insert your Google AdSense code include also the if ($mmm == 1) { and the end } bracket. You need to add an echo '{adsense code line}' to each line. You can also add a div align=center to center the AdSense code. Your end result should look similar to the following:

     

     if (file_exists(KUNENA_ABSTMPLTPATH . '/message.php')) {
                                        include (KUNENA_ABSTMPLTPATH . '/message.php');
                                    }
                                    else {
                                        include (KUNENA_ABSPATH . '/template/default/message.php'); 
                                    }
                         if ( $mmm == 1 ) {                       
                         echo '<div align="center">'."\n";
                                    echo '<script type="text/javascript"><!--' . "\n";
                                    echo 'google_ad_client = "pub-2218323024863973";' . "\n";
                                    echo '/* 468x60, DCForums */' . "\n";
                                    echo 'google_ad_slot = "0489013212";' . "\n";
                                    echo 'google_ad_width = 468;' . "\n";
                                    echo 'google_ad_height = 60;'. "\n";
                                    echo '//-->'. "\n";
                                    echo '</script>' . "\n";
                                    echo '<script type="text/javascript"' . "\n";
                                    echo 'src="http://pagead2.googlesyndication.com/pagead/show_ads.js">'. "\n";
                                    echo '</script>' . "\n";
                                    echo '</div>'."\n";
                    }
                                    unset(
                                    $msg_id,
                                    $msg_username,
                                    $msg_avatar,

    That's basically it!

     

    Comments
    Search RSS
    Only registered users can write comments!

    3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

    Last Updated ( Saturday, 09 May 2009 )
     

    Sponsors

    Login Form






    Lost Password?
    No account yet? Register

    Buy us a beer!

    If we've helped you, consider buying a beer €3. It will inspire us to keep on giving! Cheers!


    Generated in 0.28623 Seconds