MyBB Community Forums

Full Version: RELEASE: Newsletter Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
Hello Smile

Thanks for this awesome contribution!

I was just wondering if it can be set so that new registered members are automatically put into the mailing list as default upon sign up?

Any help is appreciated Smile
Also is there a way to have the topic and threads name wrote in before the url?

Otherwise i don't see why someone would click the link in the email if there isn't anything to tempt them Wink
jcay Wrote:I was just wondering if it can be set so that new registered members are automatically put into the mailing list as default upon sign up?
In theory, I can just add a hook to run when they register an account which adds them to the group. I'll look at it later.

jcay Wrote:Also is there a way to have the topic and threads name wrote in before the url?
Strange, I thought I had already had a discussion with someone about this in this thread. Yes. There is but you must bear in mind that the plugin does no checking to see if the user actually has permission to view the thread/post/etc, all it does it get the newest data. If you add the code below, you must understand that users may see the names of threads and replies that they will be unable to view due to their access levels and this may potentially leak private information.

ONLY if you agree to this, add the following code:
Line 277, replace:
$query = $db->query("SELECT aid FROM ".TABLE_PREFIX."announcements ORDER BY aid DESC LIMIT 1");
With:
$query = $db->query("SELECT aid, subject FROM ".TABLE_PREFIX."announcements ORDER BY aid DESC LIMIT 1");

Line 281, replace:
$message = str_replace("{bblannounce}", "{$mybb->settings['bburl']}/announcements.php?aid={$row['aid']}", $message);
With:
$message = str_replace("{bblannounce}", "{$row['subject']} - {$mybb->settings['bburl']}/announcements.php?aid={$row['aid']}", $message);

Line 290, replace:
$query = $db->query("SELECT tid FROM ".TABLE_PREFIX."threads ORDER BY tid DESC LIMIT 5");
With:
$query = $db->query("SELECT tid, subject FROM ".TABLE_PREFIX."threads ORDER BY tid DESC LIMIT 5");

Line 296, replace:
$part .= "{$mybb->settings['bburl']}/showthread.php?tid={$row['tid']}\r\n";
With:
$part .= "{$row['subject']} - {$mybb->settings['bburl']}/showthread.php?tid={$row['tid']}\r\n";

Line 307, replace:
$query = $db->query("SELECT tid, pid FROM ".TABLE_PREFIX."posts ORDER BY pid DESC LIMIT 5");
With:
$query = $db->query("SELECT tid, pid, subject FROM ".TABLE_PREFIX."posts ORDER BY pid DESC LIMIT 5");

Line 313, replace:
$part .= "{$mybb->settings['bburl']}/showthread.php?tid={$row['tid']}&pid={$row['pid']}#pid{$row['pid']}\r\n";
With:
$part .= "{$row['subject']} - {$mybb->settings['bburl']}/showthread.php?tid={$row['tid']}&pid={$row['pid']}#pid{$row['pid']}\r\n";
Oooh i'm sorry if you had posted elsewhere, i thought i had checked everywhere!

Yes i hadn't thought of that... Definately something to consider... Don't think there is too much to leak tho... Not many private forums hehe Smile

Thanks for all your help!! Smile
Can you enter more then one GID values? I would like my newsletter sent to two groups.

Thanks
Not easily. Don't forget that it will only send to additional usergroups anyway so you could just make the members of the two primary groups you want to send the newsletter to members of the additional group used for mailing list.

You would be able to do it using phpMyAdmin with a SQL command which I don't know off the top of my head.
Hi MrDoom.
Hi have install the last mybb, and import all data
but I make a mistake, im backup all forum with the plugins activated.
now wen hi try to put the new plugin, i have this.
MySQL error: 1051
Unknown table 'mybb_newsletterplugin'
Query: DROP TABLE `mybb_newsletterplugin`;
Hi cannot desactivated because he just are activated.
have solutions?
thanks
Just open the file, and comment out line 214:
$db->query("DROP TABLE `".TABLE_PREFIX."newsletterplugin`;");

Then upload it back to your webserver and deactivate the plugin.

All it's trying to do is remove a table that no-longer exists and is failing.
MrDoom Wrote:Just open the file, and comment out line 214:
$db->query("DROP TABLE `".TABLE_PREFIX."newsletterplugin`;");

Then upload it back to your webserver and deactivate the plugin.

All it's trying to do is remove a table that no-longer exists and is failing.

thanks MrDoom, the plugin are work perfect again, Smile
thanks
Can someone please help me with the code for adding images and links to this?
Its a great mod, i want to be able to add images, font/size/color, and links to the messages it shows.


Like this sort of thing
[Image: 63yssn.gif] Our Forum. Please enjoy your visit!

Thanks Smile
Pages: 1 2 3 4 5 6 7