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
Conditional Welcome Message using hook
Jan 17, 2010
10:54 am
Brian
Guest

I am using the sf_hook_post_breadcrumbs hook to insert a welcome message on the forum because I couldn't figure out a better way to do it. But I would like the message to only show on the main forum page and not on any other sub-pages (forums, topics, etc.) Is this possible? Is there some other method to accomplish this? Thanks in advance for your help – this is my first endeavor into using your forum and I am loving it so far!

Jan 17, 2010
11:08 am

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

thats pretty much the way to do it… which hook depends on where you want the message located…

as to showing on the main forum page only, take a look on our wiki at our template tags – the pageview ones – for checking for specific page views. you will will want the sf_is_groupview() one. you can add that check in your hook.

Jan 17, 2010
12:33 pm
Brian
Guest

Thanks for the quick reply – glad I was on the right track. Can you explain how to use the template tag as part of the hook?

Jan 17, 2010
12:40 pm

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

inside the hook function:

 

$out = "";
if (sf_is_groupview())
{
$out.="your welcome message";
}
return $out;

 

Jan 17, 2010
1:12 pm
Brian
Guest

Works perfectly! Thanks for the help – I would've never figured that out. :P

Jan 17, 2010
1:27 pm

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

np. glad to help!

Jan 17, 2010
1:55 pm

SP Master
Forum Posts: 22131
Member Since:
Nov 9, 2008
Offline

There are also three hooks that are specific to the front 'Group' view…

Yellow Swordfish
Jul 22, 2011
2:27 am
Rookie
Forum Posts: 1
Member Since:
Jul 22, 2011
Offline
Hi

Where exactly would I need to add the following code?

$out = "";
if (sf_is_groupview())
{
$out.="your welcome message";
}
return $out;

Best
J. Christensen
Jul 22, 2011
4:58 am

SP Master
Forum Posts: 22131
Member Since:
Nov 9, 2008
Offline

See our wiki – plugin api section – Program Hooks for details on how to use them.

Yellow Swordfish
Forum Timezone: America/Chicago

Most Users Ever Online: 444

Currently Online:
57 Guest(s)

Currently Browsing this Page:
1 Guest(s)

See All Online Activity

Top Posters:

-Radio-: 1251

Lee H: 606

Luffer: 535

Conrad_Farlow: 485

jim: 478

neon: 263

ovizii: 240

Tal: 240

Member Stats:

Guest Posters: 2616

Members: 7328

Moderators: 1

Admins: 2

Forum Stats:

Groups: 5

Forums: 16

Topics: 10839

Posts: 79131

Moderators: Brandon C (158)

Administrators: Yellow Swordfish (22131), Mr Papa (23587)