A A A

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Help adding hook
Sep 8, 2010
7:40 pm
Rookie
Forum Posts: 3
Member Since:
Sep 9, 2010
Offline

I'm hoping someone can help me with this as I am sure it is easy and I
just don't know what I am doing.I am trying to add adesense to any forum post. I read
the instructions on the site but am having problems still. When I
save the php file and upload it to the hooks folder within the plug-ins
folder it doesn't work. Instead of placing the ad in the post it places
it in the header for every page of the site. Below is what displays in
the header.

{function sf_hook_first_post($forumid, $topicid) $x = ' '; return $x; }

Warning: session_start()[function.session-start]: Cannot send session
cache limiter – headers already sent (output started at
/home/content/61/6669961/html/wp-content/plugins/simple-forum/forum/hooks/sf-hook-template.php:5)
in
/home/content/61/6669961/html/wp-content/plugins/wp-responder-email-autoresponder-and-newsletter-plugin/wpresponder.php
on line 269

And this is the code in the file I am uploading.

{function sf_hook_first_post($forumid, $topicid)

$x = '<script type="text/javascript"><!–

google_ad_client = "pub-XXXXXXXXXXXX";

/* 234x60, created 9/8/10 */

google_ad_slot = "1443406738";

google_ad_width = 234;

google_ad_height = 60;

//–>

</script>

<script type="text/javascript"

src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>';

return $x;

}

Does any of that even make sense to anyone?

Sep 8, 2010
9:31 pm

SP Master
Forum Posts: 23688
Member Since:
Dec 10, 2006
Offline

probably need some clarification, but as the wiki help on hooks says, you rename the hook .txt file .php and leave it in the same location… or at least it has to be in the location specified in forum – configuration – storage locations… sounds like you moved it the plugins folder which make wp treat it as a standalone plugin…

Sep 8, 2010
9:56 pm
Rookie
Forum Posts: 3
Member Since:
Sep 9, 2010
Offline

I am loading it in the same folder the txt file was in. simple-forum_forum_hooks.

 

I thought it might be the wp-responder that was causing problems since this line shows up

- home/content/61/6669961/html/wp-content/plugins/wp-responder-email-autoresponder-and-newsletter-plugin/wpresponder.php on line 269

so I deavtivated it and that line went away but the hook still showed up at the top of the page with the ad displaying.

 

Does the code I posted look correct?

Sep 8, 2010
10:00 pm

SP Master
Forum Posts: 23688
Member Since:
Dec 10, 2006
Offline

is this a typo

{function sf_hook_first_post($forumid, $topicid)

shoud be

function sf_hook_first_post($forumid, $topicid)

{

Sep 8, 2010
10:04 pm
Rookie
Forum Posts: 3
Member Since:
Sep 9, 2010
Offline

Yeah I fixed that line and it is still doing the same thing.

Sep 9, 2010
3:54 am

SP Master
Forum Posts: 22181
Member Since:
Nov 9, 2008
Online

Can you supply your code again now you have changed it. I will take a look.

Caqn you put it on a proper code block please (highlight the code using the syntax highlighter button on the toolkbar) which will ensure the quote marks are as intended etc.

Yellow Swordfish
Forum Timezone: America/Chicago

Most Users Ever Online: 444

Currently Online: Yellow Swordfish, Conrad_Farlow, lisalew, Jason Clark, Superfast
51 Guest(s)

Currently Browsing this Page:
1 Guest(s)

See All Online Activity

Top Posters:

-Radio-: 1251

Lee H: 606

Luffer: 535

Conrad_Farlow: 501

jim: 478

neon: 263

ovizii: 240

Tal: 240

Member Stats:

Guest Posters: 2624

Members: 7354

Moderators: 1

Admins: 2

Forum Stats:

Groups: 5

Forums: 16

Topics: 10877

Posts: 79454

Moderators: Brandon C (162)

Administrators: Yellow Swordfish (22180), Mr Papa (23688)