Giter Site home page Giter Site logo

davidiq / mailinglist Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 51 KB

phpBB extension for adding basic mailing list functionality to boards so that new posts and/or topics can be forwarded to configured mailing list addresses and associated forums.

Home Page: https://www.phpbb.com/customise/db/extension/mailinglist/

License: GNU General Public License v2.0

PHP 86.24% HTML 13.76%

mailinglist's People

Contributors

davidiq avatar dmzx avatar maskinisten avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mailinglist's Issues

Image and video tags not coming through in emails

https://github.com/DavidIQ/MailingList/blob/master/event/listener.php#L123

Looks like the strip_tags call is completely stripping out images and videos so they don't come through at all in emails. Will need to investigate to see if maybe a regex can be devised to strip out the BBcodes and leave behind the URLs. Another possible solution would be to leverage the messenger class and override the text-only setting of the emails sent out by this extension.

Originated from: https://www.phpbb.com/customise/db/extension/mailinglist/support/topic/206856

Set "In-Reply-To" header

To help email clients keep messages together (threaded) set the "In-Reply-To" header as well as the "References" header. Should be enough to use the topic ID in some fashion for both to keep them grouped together.

Code review notes

  • managers/mailinglist_manager.php
while ($row = $this->db->sql_fetchrow($result))
{
	$sql2 = "SELECT m.mailinglist_forum_id, f.forum_name
	   FROM {$this->mailinglists_forums_table} m
	   JOIN " . FORUMS_TABLE . " f ON f.forum_id = m.mailinglist_forum_id
	   WHERE m.mailinglist_id = {$row['mailinglist_id']}";
	$result2 = $this->db->sql_query($sql2);
	$row['forums'] = $this->db->sql_fetchrowset($result2);
	$this->db->sql_freeresult($result2);
	$mailinglists_data[$row['mailinglist_id']] = $row;
}

Line 72-82: please don't run database queries inside loops. You should run a single query, for example WHERE $db->sql_in_set('m.mailinglist_id', $mailinglist_ids)

foreach ($forum_ids as $forum_id)
{
	$sql = "INSERT INTO {$this->mailinglists_forums_table} " . $this->db->sql_build_array('INSERT',
			[
				'mailinglist_id' => $mailinglist_id,
				'mailinglist_forum_id' => $forum_id
			]);
	$this->db->sql_query($sql);
}

Line 199-208: rather than looping over the rows to insert, you should use $db->sql_multi_insert()

  • migrations/v20x/add_mailinglist_table.php & v200.php
    Indentation could be improved in these files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.