Topic RSS
Hi,
I need to find out which file contains the output for the special group message.
I want it to only display for certain users.
Thanks
/forum/sf-group-view.php for the 'group' message. /forum/sf-forum-view.php for the forum message. Look for the 'special message' comment.
You could accomplish the same thing using a program hook and wouldn't need to edit core code. See the wiki, plugin api section.
The Existing Group Hooks did not work for me since I am trying to add in conditional Special Group Messages, but I did get everythjing working by adding in a "new" hook.
Add the following into the Front/Main Page – Group/Forum Listing area of simple-forum/forum/hooks/sf-hook-template.php
/* ---------------------------------------------------
sf_hook_special_group_message($groupid)
Displays content after each Special Group Message on the main/front
Forum listing page. The GROUP_ID is passed if needed.
------------------------------------------------------ */
function sf_hook_special_group_message($groupid)
{
if(condition is met)
{
$sgm = 'Your message here';
}
return $sgm;
}
Then change the following in simple-forum/forum/sf-group-components.php
From:
# = SPECIAL FORUM MESSAGE =====================
if(!function_exists('sf_render_special_group_message')):
function sf_render_special_group_message($message)
{
$out = '<div class="sfgroupmessage sfmessagestrip"><p>'.$message.'</p></div>'."\n";
return $out;
}
endif;
To:
# = SPECIAL FORUM MESSAGE =====================
if(!function_exists('sf_render_special_group_message')):
function sf_render_special_group_message($message, $groupid)
{
$out = '<div class="sfgroupmessage sfmessagestrip"><p>'.$message;
# Get Program Hook
$out.= sf_process_hook('sf_hook_special_group_message', $groupid).'</p></div>'."\n";
return $out;
}
endif;
Then change the following in simple-forum/forum/sf-group-view.php
From:
# Special Message
if(!empty($group['group_message']))
{
$out.= sf_render_special_group_message(sf_filter_text_display($group['group_message']));
}
To:
# Special Message $out.= sf_render_special_group_message(sf_filter_text_display($group['group_message']),$group['group_id']);
This worked for me, but if anyone can simplify this and/or make it more efficient, please let me know. Also, would it be better to use a pluggable function?
Most Users Ever Online: 444
Currently Online: Conrad_Farlow, steve.engelking, jawaulk, irlandes1, joelrob
75 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
-Radio-: 1251
Lee H: 606
Luffer: 535
Conrad_Farlow: 502
jim: 478
neon: 263
ovizii: 240
Tal: 240
Member Stats:
Guest Posters: 2626
Members: 7363
Moderators: 1
Admins: 2
Forum Stats:
Groups: 5
Forums: 16
Topics: 10897
Posts: 79582
Newest Members: Rick Thomas, joelrob, ndc, MacBravO, irlandes1, triphop, betokan, Jonathan Yovani Muñoz, somosguatemala, ahcreate
Moderators: Brandon C (162)
Administrators: Yellow Swordfish (22240), Mr Papa (23688)
Log In
Register
Home
Add Reply
Add Topic
Offline
Quote




Visit

Privacy Policy



