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
Anyone want to help me with Adsense?
Apr 4, 2009
1:21 pm
Member
Forum Posts: 22
Member Since:
Apr 4, 2009
Offline

    /* —————————————————
    sf_hook_last_post($forumid, $topicid)
    Inserts content at the bottom of a topics last post Ð
    immediately after the users signature (if used). The
    FORUM ID and the TOPIC ID are passed into the hook.
    Introduced in version 3.1.2
    —————————————————— */

    function sf_hook_last_post($forumid, $topcid)
    {
        return '';
    }
$adsense='<script type="text/javascript"><!–
google_ad_client = "pub-9642497531158180";
/* 468x60, created 6/29/08 */
google_ad_slot = "9396562676";
google_ad_width = 468;
google_ad_height = 60;
//–>
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>’;
return $adsense

Apr 4, 2009
1:28 pm

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

you have to put the code in the hook function where you want it to appear…

function sf_hook_last_post($forumid, $topcid)
{
$adsense='<script type=”text/javascript”><!–
google_ad_client = “pub-9642497531158180″;
/* 468×60, created 6/29/08 */
google_ad_slot = “9396562676″;
google_ad_width = 468;
google_ad_height = 60;
//–>
</script>
<script type=”text/javascript”
src=”http://pagead2.googlesyndicati…..rdquo;>
</script>’;
return $adsense   
}

watch the quotes again…

Apr 4, 2009
1:44 pm
Member
Forum Posts: 22
Member Since:
Apr 4, 2009
Offline

Still not working. Not sure why.

Apr 4, 2009
1:48 pm

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

are you sure you have the single and double quotes correct? that is hand typed and not cut and paste? just tested it too…

and are you sure thats the hook you want to use? that only outputs the code on a topic page after the last post in the topic…

Apr 4, 2009
1:51 pm
Member
Forum Posts: 22
Member Since:
Apr 4, 2009
Offline

I want to use a hook where it is under every single post I believe. At this moment I'm more or less trying to get one to work and then I can move it to another if needed.

I typed it myself and it's not working. I can copy/paste the adsense code right, just not everything else?

Apr 4, 2009
2:01 pm

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

when cutting and pasting from the forum, chars like ‘ and ” may get screwed up…

so you view a topic page? one with a bunch of posts? and there was no adsense after the last post? do you have an adblocker on? hell, just to test dont bother with adsense… just return ‘my hook stuff’ and look for your text string until its working…

Apr 4, 2009
2:03 pm
Member
Forum Posts: 22
Member Since:
Apr 4, 2009
Offline

It is giving me error messages when I refresh the page with the adsense included.

Apr 4, 2009
2:05 pm

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

whats the message? likely you have a syntax error from php…

Apr 4, 2009
2:09 pm
Member
Forum Posts: 22
Member Since:
Apr 4, 2009
Offline

The line changes every time it seems but here's the error

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/d/a/n/dantheman42501/html/wp-content/plugins/simple-forum/forum/hooks/sf-hook-template.php on line 288

Apr 4, 2009
2:13 pm

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

thats a syntax error… you are not typing in the code correct – guessing dorked quotes…

remove all the adsense code and just do a

return 'here I am';

inside the hook fuunction, but HAND TYPE the single quotes… see if it shows up… once working, then get the adsense code typed in correct…

Forum Timezone: America/Chicago

Most Users Ever Online: 444

Currently Online: ptomislav, steve.engelking
73 Guest(s)

Currently Browsing this Page:
2 Guest(s)

See All Online Activity

Top Posters:

-Radio-: 1251

Lee H: 606

Luffer: 535

Conrad_Farlow: 502

jim: 478

neon: 263

ovizii: 240

Tal: 240

Member Stats:

Guest Posters: 2625

Members: 7361

Moderators: 1

Admins: 2

Forum Stats:

Groups: 5

Forums: 16

Topics: 10890

Posts: 79543

Moderators: Brandon C (162)

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