PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2005-09-11 12:00:02

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Adsense after First Post 1.1

Code:

##
##
##        Mod title:  Adsense after First Post
##
##      Mod version:  1.1
##   Works on PunBB:  1.2.5, 1.2.6, 1.2.7
##     Release date:  2005-09-11
##           Author:  Neal Poole (smartys@gmail.com)
##
##      Description:  This mod allows you to place a Google ad after the first
##                post in every thread, disguised as a post.
##
##   Affected files:  viewtopic.php
##                    include/common.php
##                      include/cache.php
##
##       Affects DB:  Yes
##
##            Notes:  This doesn't change the color of the ad based on the style used.
##              If people need it, I'll try and implement it in the next version.
##              If you need to upgrade, just replace the plugin
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

Download here


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#2 2005-09-11 12:01:00

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

Alright, you can now exclude certain groups and certain forums. I also updated install_mod.php to use the new install format.


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#3 2005-09-12 03:57:23

Matt Moore
New member
Registered: 2005-09-12
Posts: 2

Re: Adsense after First Post 1.1

Would it be completely impossible to make the ads show up after the first post but not actually be in a post themselves? I love the mod, I think it puts ads in just the right place, but it looks distracting to me that they look like they were posted by a user.

I realize this might require a lot more hacking of the core php files, but it would be really cool if it could be done.

(Sorry if this has already been asked, I'm new to PunBB.)

Offline

 

#4 2005-09-12 11:56:58

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

Well, I think it looks ugly then :-/
You can hack my admin plugin to remove the check on the title, set title and tag to be nothing, and see if it's better like that


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#5 2005-09-12 14:28:43

Matt Moore
New member
Registered: 2005-09-12
Posts: 2

Re: Adsense after First Post 1.1

Nevermind, I got it figured out.  Looks great now, thanks.

Last edited by Matt Moore (2005-09-12 16:39:49)

Offline

 

#6 2005-09-17 18:57:43

Krisekca
New member
Registered: 2005-09-11
Posts: 4

Re: Adsense after First Post 1.1

pub-000000000000000000000

i nead to AD id client with pub- ? or only 0000000000000000 ??

Offline

 

#7 2005-09-17 18:59:39

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

pub-0000000000000000000000 is necessary
Oh, and don't bother counting the number there: I wasn't trying to be accurate, just to illustrate my point tongue

Last edited by Smartys (2005-09-17 19:00:02)


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#8 2006-01-26 06:35:52

Kommercial
New member
Registered: 2006-01-26
Posts: 8

Re: Adsense after First Post 1.1

I can't get this thing working!  Everytime I attempt to install the plugin, I get "Cannot find adsense config!"  Can someone help?

Offline

 

#9 2006-01-26 15:09:10

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

That's not an error message my mod gives :-/


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#10 2006-01-27 00:36:49

Kommercial
New member
Registered: 2006-01-26
Posts: 8

Re: Adsense after First Post 1.1

Smartys wrote:

That's not an error message my mod gives :-/

Do I need to store my adsense config in my cPanel somewhere?  Do I need to edit the config in common.php to my adsense config?

It's pretty confusing.

Last edited by Kommercial (2006-01-27 00:37:22)

Offline

 

#11 2006-01-27 00:59:24

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

Follow the instructions in the readme file and if it doesn't work paste the EXACT error you get
This is one of the easiest mods I've seen (aside from my sitemap mod, where you simply drop the new file in)


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#12 2006-01-27 01:07:11

Kommercial
New member
Registered: 2006-01-26
Posts: 8

Re: Adsense after First Post 1.1

Smartys wrote:

Follow the instructions in the readme file and if it doesn't work paste the EXACT error you get
This is one of the easiest mods I've seen (aside from my sitemap mod, where you simply drop the new file in)

That's exactly what it says.  "Cannot find adsense config!"  I get that error when trying to run install_mod.php.

Offline

 

#13 2006-01-27 01:54:00

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

There is no such error in there wink
The only error that appears when installing is "Unable to create table adsense_config"
And there should be more to the error, since debug mode is enabled for install_mod.php files

Last edited by Smartys (2006-01-27 01:54:09)


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#14 2006-01-28 02:53:02

Kommercial
New member
Registered: 2006-01-26
Posts: 8

Re: Adsense after First Post 1.1

Smartys wrote:

There is no such error in there wink
The only error that appears when installing is "Unable to create table adsense_config"
And there should be more to the error, since debug mode is enabled for install_mod.php files

Do I need to change this,

Code:

    <script type=\"text/javascript\">
    <!--
        google_ad_client = \"".$adsense_config['google_ad_client']."\";
        google_ad_width = ".$adsense_config['google_ad_width'].";
        google_ad_height = ".$adsense_config['google_ad_height'].";
        google_ad_format = \"".$adsense_config['google_ad_format']."\";
        google_ad_channel =\"".$adsense_config['google_ad_channel']."\";
        google_ad_type = \"".$adsense_config['google_ad_type']."\";
        google_color_border = \"".$adsense_config['google_color_border']."\";
        google_color_bg = \"".$adsense_config['google_color_bg']."\";
        google_color_link = \"".$adsense_config['google_color_link']."\";
        google_color_url = \"".$adsense_config['google_color_url']."\";
        google_color_text = \"".$adsense_config['google_color_text']."\";
        google_alternate_color = \"".$adsense_config['google_alternate_color']."\";
    //-->
    </script>
    <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></script>

to my Adsense config?

Here is a screenshot of the error:

http://img100.imageshack.us/img100/1378/screen7dm.jpg

Last edited by Kommercial (2006-01-28 03:02:57)

Offline

 

#15 2006-01-28 14:21:59

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

Aha: that wasn't the error you gave me tongue
That error means it can't select the data from the table: sounds like you didn't run install_mod.php wink


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#16 2006-01-28 17:58:45

Kommercial
New member
Registered: 2006-01-26
Posts: 8

Re: Adsense after First Post 1.1

Smartys wrote:

Aha: that wasn't the error you gave me tongue
That error means it can't select the data from the table: sounds like you didn't run install_mod.php wink

Do I run install_mod before or after the file edits?

Offline

 

#17 2006-01-28 18:51:38

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

Before is probably best, but you can run it after wink


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#18 2006-01-28 19:35:39

Kommercial
New member
Registered: 2006-01-26
Posts: 8

Re: Adsense after First Post 1.1

Actually, I tried after, and it didn't work.  I did it before, and it worked great.

Offline

 

#19 2006-01-28 22:33:20

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

There is no way for it to make a difference (as in: the install will work properly if done before/after the modding) tongue
Of course, if you mod first, until you run install_mod.php you'll get that error


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#20 2006-03-05 18:32:31

eusoudaki
Member
Registered: 2006-03-04
Posts: 21

Re: Adsense after First Post 1.1

what i could made wrong?

now i cant see any forums:

Warning: Division by zero in W:\www\forum\viewforum.php on line 70

An error was encountered
Error: Unable to fetch topic list.

and cant configure adsense:

Fatal error: Call to undefined function: generate_adsense_config_cache() in W:\www\forum\plugins\AP_Adsense_Options.php on line 69

Offline

 

#21 2006-03-05 18:54:18

eusoudaki
Member
Registered: 2006-03-04
Posts: 21

Re: Adsense after First Post 1.1

~u i cant see any ads..x,x
what i put on bot and bot tag?

Last edited by eusoudaki (2006-03-05 19:00:11)

Offline

 

#22 2006-04-23 01:40:38

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

I was thinking of adding some new features
- You can pick what post to put the ad after (of course, if the user chooses not to view posts that high, the ad will be hidden from them)
- Supporting ad networks other than Google (although that would require help from people who run those ads)

Any interest? And if so, what ad networks should I also support?


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#23 2006-04-23 11:31:58

Fungi
New member
Registered: 2006-04-11
Posts: 9

Re: Adsense after First Post 1.1

Can I see this in action somewere?

Offline

 

#24 2006-04-23 14:16:19

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Adsense after First Post 1.1

http://www.foohonpie.net/forums/viewtopic.php?id=173
Except that he has put it at the bottom of the topics wink


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#25 2006-04-23 14:38:13

StevenBullen
Moderator
Registered: 2005-09-13
Posts: 300
Website

Re: Adsense after First Post 1.1

I have a question of topic....

Why can I only have one google ad on my page at one time? Is it something I am doing wrong?

Last edited by StevenBullen (2006-04-23 14:38:29)


Blog - Follow Me and FluxBB on Twitter

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.