UseBB Community

The official board for UseBB help and discussion

UseBB Community » Resources & Customization » Ads/ Adsense after first post..

Ads/ Adsense after first post..

Moderators: Gaia.

Page: 1

Author Post
Member
Registered: Oct 2006
Posts: 37
Hello there.
Can anyone modify the template code to display adsense under the first post only.

I have tried to modify the code but it displays adsense under every replies too. Googe don`t allow to have more than 2 adsense ads on one page.

This have what I need. I don`t know how he has done it.
http://www.accommodation-forum.com/czech-republic/in-the-drug-store/

Please help me to modify the code. Any ideas? :D
Developer
Registered: Apr 2004
Posts: 2218
Location: Belgium
This is not possible in v1 by modifying templates...

You need to edit the PHP code for that.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Oct 2006
Posts: 37
Ok.. It`s maybe difficult to do that or what?
If you can do it for me it will be a big help.. ;)

Otherwise no problem.. I can wait until the next version release..
Thank you for your reply..
Member
Registered: Oct 2006
Posts: 37
I don`t think I can find a release date for the next version.. or version 2.0

Do you have any idea for when it will be released? :D
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
When its ready :)
_______________
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
This seems to work :)

In file topic.php line 430 after
'poster_ip_addr' => ( !empty($postsdata['poster_ip_addr']) && $functions->get_user_level() == LEVEL_ADMIN ) ? sprintf($template->get_config('poster_ip_addr_format'), sprintf($lang['ViewingIP'], '<a href="'.$functions->make_url('admin.php', array('act' => 'iplookup', 'ip' => $postsdata['poster_ip_addr'])).'">'.$postsdata['poster_ip_addr'].'</a>')) : '',
'colornum' => $colornum
));
add
/*
Google Ad Mod
Copyright Vandamme Samuel
*/
if ( $i == 1 ) {
$template->parse('googlead', 'topic');
}

Open file templates/[yourtemplate]/topic.tpl.php and goto the end of the file. Before
?>
add
$templates['googlead'] = 'YOUR GOOGLE STUFF HERE';




(Shortest mod ever!)
_______________
« Last edit by Samuel on Mon Oct 09, 2006 6:55 pm. »
Member
Registered: Oct 2006
Posts: 37
Thanks for the hack. But it seems to there are some errors.

I get this error message:



In file template.php on line 117:

E_USER_ERROR - Unable to load googlead templates file for set "default"!
Member
Registered: Oct 2006
Posts: 37
Samuel wrote
When its ready :)


Ok.. Maybe I had to ask another question..
Do you have any idea for when it will be ready? :P :D
Member
Registered: Apr 2004
Posts: 192
Location: Brussels Belgium
Right :) I fixed this in my own code but somehow I copy pasted the old code here.
/*
Google Ad Mod
Copyright Vandamme Samuel
*/
if ( $i == 1 ) {
$template->parse('googlead', 'topic');
}
this should fix it :)


I really cant say, probably at the end of 2007
_______________
Developer
Registered: Apr 2004
Posts: 2218
Location: Belgium
sarangan wrote
Samuel wrote
When its ready :)


Ok.. Maybe I had to ask another question..
Do you have any idea for when it will be ready? :P :D

See http://www.usebb.net/community/topic-831.html.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Oct 2006
Posts: 37
Great hack..
It working prefectly.. Thank you for your help..

I love UseBB! ;) as most users do.

I am looking forward to the next version.
Member
Registered: Dec 2006
Posts: 14
yeh its working man

Page: 1

UseBB Community » Resources & Customization » Ads/ Adsense after first post..

UseBB Community is powered by UseBB 1 Forum Software