News:

Wondering if this will always be free?  See why free is better.

Main Menu

Hiding Some MemberGroups in Newsletters

Started by Lou69, January 19, 2011, 08:29:19 PM

Previous topic - Next topic

Lou69

I have a need to hide specific membergroups in the Newsletters section. Members have the ability to send newsletters, but some groups do not need or want to receive all the newsletters. As members are not always going to think about this, I would like a way to hide some membergroups from their view.

thanks

Illori

you should check the mod site, then request a mod to be created if you dont see one to fit what you want done.

Lou69

Thanks Illori, I will do that. Since there is no immediate fix, I will probably turn off the Newsletter to members.

Joker™

It can easily done by creating a permission field. If you are still seeking for the solution I can help you out on this.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Lou69

Hi Joker,

Yes, I would appreciate your help with this. I had gone to Admin/Manage Permissions/Advanced Options but I did not see an option there that jumped out at me.

My lack of experience I suppose.  :)


Lou

Joker™

There is no such setting yet, but we can make one.

So you want to hide some membergroups while sending newsletter, when newsletter is sent by some selected group. Am I right?

Also what is your SMF version?
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Lou69

Hi Joker,

Yes that is correct. The site has site members and club members that can send newsletters. I would like to hide other groups from them and from each other.

My apologies about not mentioning the SMF release, it is 2.0, RC 4.

Lou

Joker™

Ok this seems to be a big mod than I thought of, it will take time for a noob coder like me to built it up, but I'll be surely working on it. Going to keep you updated about it.

But someone else should also look into this request as the mod is quite complicated.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Lou69

Joker,

I appreciate your help and interest with this.  It would be a handy feature and it would add more versitality to the Newsletter feature, no doubt about it.  With several different special interest groups on the our forum, being able to restrict them to sending newsletters to their own group would be quite beneficial.

thanks,

Lou    :)

Joker™

#9
All I can say right now is we are bit on track regarding development of this mod ;).

Edit - The permission system has been built now just have to implement it in the newsletter code. Most probably it will be completed by Sunday.

Have a nice weekend ;D.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

Can someone help me a bit here, as i got stuck somewhere. What I've done till now is,

-made a column named as "newsletter_groups" in membergroup tables which will be filled through modify member group pages.
- this table contains id of member group to which user will be able to send newsletter

Now how to incorporate this table values in group function

Sources\ManageNews.php
// If we have post groups disabled then we need to give a "ungrouped members" option.
if (empty($modSettings['permission_enable_postgroups']))
{
$context['groups'][0] = array(
'id' => 0,
'name' => $txt['membergroups_members'],
'member_count' => 0,
);
$normalGroups[0] = 0;
}

// Get all the extra groups as well as Administrator and Global Moderator.
$request = $smcFunc['db_query']('', '
SELECT mg.id_group, mg.group_name, mg.min_posts
FROM {db_prefix}membergroups AS mg' . (empty($modSettings['permission_enable_postgroups']) ? '
WHERE mg.min_posts = {int:min_posts}' : '') . '
GROUP BY mg.id_group, mg.min_posts, mg.group_name
ORDER BY mg.min_posts, CASE WHEN mg.id_group < {int:newbie_group} THEN mg.id_group ELSE 4 END, mg.group_name',
array(
'min_posts' => -1,
'newbie_group' => 4,
)
);
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$context['groups'][$row['id_group']] = array(
'id' => $row['id_group'],
'name' => $row['group_name'],
'member_count' => 0,
);

if ($row['min_posts'] == -1)
$normalGroups[$row['id_group']] = $row['id_group'];
else
$postGroups[$row['id_group']] = $row['id_group'];
}
$smcFunc['db_free_result']($request);



I think through these codes member groups are being fetched onto newsletter page. Now to place the values to columns I made into this code, so that the ids present in newsletter_groups column will only be fetched to newsletter page.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Advertisement: