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
Advert below the last post/reply
Jul 24, 2010
2:21 am
Member
Forum Posts: 6
Member Since:
Mar 20, 2010
Offline

I want to add adverts after the last post/reply. How do I do that?

Jul 24, 2010
4:04 am

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

Take a look at the wiki – Plugin API – Program Hooks section. Do read th4 overview and then you want the 'Topic Hooks' page.

Yellow Swordfish
Jul 25, 2010
3:34 pm
Member
Forum Posts: 6
Member Since:
Mar 20, 2010
Offline

what file to edit?

Jul 25, 2010
4:04 pm

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

I think this is in my post above.

The 'overview' tells you which file to edit and how.

The 'Topic Hooks' gives you the list of available hooks to choose from.

Yellow Swordfish
Jul 25, 2010
5:24 pm
Member
Forum Posts: 6
Member Since:
Mar 20, 2010
Offline

this is the current code in the file:

$out.= sf_process_hook('sf_hook_topic_footer', array($sfvars['forumid'], $sfvars['topicid']));

 

do i have to replace it with

 

function sf_hook_topic_footer($forumid, $topicid)
{
	return '';
}

my advert code
Jul 25, 2010
6:55 pm

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

You rename the hook file to .php. You put your code in there just like it says in the wiki. Your code goes inside the function and has to be 'returned' not echoed. Your code replaces the empty quote marks of the return statement above.

Yellow Swordfish
Jul 26, 2010
3:41 am
Member
Forum Posts: 6
Member Since:
Mar 20, 2010
Offline

do i have to replace all the codes in sf-topic-view.php with

function sf_hook_topic_footer($forumid, $topicid)
{
	return ' MYADVERT HERE';
}

i'm a noob and know nothing about coding.. please help
Jul 26, 2010
5:21 am

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

You do not touch ANY code in sf-topic-view.php. You do it as you ave it there – in the return statement of the hook function.

be careful with quoting. I woud recommend getting help form someone who underatands php.

Yellow Swordfish
Forum Timezone: America/Chicago

Most Users Ever Online: 444

Currently Online: Yellow Swordfish, chaiavi, woody, prasanna, ndc
85 Guest(s)

Currently Browsing this Page:
1 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: 7360

Moderators: 1

Admins: 2

Forum Stats:

Groups: 5

Forums: 16

Topics: 10888

Posts: 79519

Moderators: Brandon C (162)

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