|
You can easily add Google Ads embedded in the forum listing with Kunena Forum 1.0.8. Follow the steps in this simple tutorial.
- Go to the Administrator and select the menu Components > Kunena Forum
- Click on Kunena Configuration
- Scroll down to the Frontent parameters and locate the Template setting

- Locate the view.php file in the Kunena installation:
{$JOOMLA}/components/com_kunena/template/{TEMPLATE_NAME}/view.php
where
{$JOOMLA} is the Joomla installation folder {TEMPLATE_NAME} is the name of the template that you are using
- Make a backup copy of the view.php file.
- Go to Google AdSense and get desired ad code.
- Open view.php in your favorite text editor. Locate the following lines, around line 1195:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<?php //(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, ?>
|
- Add your Google AdSense code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
<?php //(JJ) if (file_exists(KUNENA_ABSTMPLTPATH . '/message.php')) { include (KUNENA_ABSTMPLTPATH . '/message.php'); } else { include (KUNENA_ABSPATH . '/template/default/message.php'); }
// Google AdSense ---> start if ( $mmm == 1 ) { echo '<div style="margin-top: 10px;margin-bottom: 10px;">' . "\n"; echo '<script type="text/javascript"><!--' . "\n"; echo 'google_ad_client = "pub-1348872499180295";' . "\n"; echo "/* 728x90, created 3/17/09 */\n"; echo 'google_ad_slot = "7075580028";' . "\n"; echo "google_ad_width = 728;\n"; echo "google_ad_height = 90;\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"; } // Google AdSense ---> end
unset( $msg_id, $msg_username, $msg_avatar, $msg_usertype, $msg_userrank, ?>
|
- Done!
The forum at Joomla-R-Us is using this little hack. Here's a sample thread where you can see this in action.
 |