Formatting code for PhplistHacks
[[PhplistHacks phplist Hacks]]
----
=====phplist Hacks=====
=== What are hacks?===
Hacks are "quick and dirty" solutions. Solutions that probably could be nicely integrated into phpList, if the author of the hack knew enough about the internal architecture of phplist, and/or felt it was worth to integrate his or her solution into the phplist code. The latter conditions are not always fulfilled... still it 's valuable to collect the experience of people fiddling with phplist setups or code, because these simple solutions can be reused by anyone comfortable with php, and it may lead to proper phplist code offering the same functionality.
Browsing the forum, you will find a number of hacks that can help you address a specific need or help you sort out an issue. Some of them are listed here. You are welcome to add the ones you know and find useful. And of course thanks to the creators and contributors of these hacks.
**Please note** some of these hacks may address issues that happened in older versions of phplist and have been addressed in the latest release. Only try to apply a hack if you experience the same problem in the version you are using. Also in some cases, these hacks were made against older versions, so the instructions to apply them may not be entirely correct for the latest version. In general, it is likely you will need some knowledge of PHP in order to apply a hack.
===List of Hacks===
==Interfacing with external programs==
[[IntegratingPhpListWithOtherPackages Phplist with other packages]]
A lot of PHP/Mysql packages exist: CMSs, portals, online communities.... : a list of tested ways to integrate phplist into them.
[[NewsletterArchive Newsletter Archive]]
This add-on will query your database and produce a HTML page, listing all newsletters from a particular list. Clicking on a newsletter will display that newsletter.
[[http://forums.phplist.com/viewtopic.php?t=5009 Phplist class]]
A set of functions which provide a simple way to interact with phpList in your own programs (eg: adding a user who just purchased something from your website to a mailing list). It takes a list id, an email address, and optionally some attributes, and subscribes the user to that list. If the user already exists, the existing account will be subscribed. If it's a new user, they'll be added first. Users added in this way are pre-confirmed (they will not be sent a confirmation email).
[[http://forums.phplist.com/viewtopic.php?p=13312#13312 List control via HTTP]]
An add-on that can be used to subscribe a user using the HTTP command. The procedure works by simulating a POST to the default subscribe page. It requires the CURL PHP library.
[[http://forums.phplist.com/viewtopic.php?t=5401 Multi-language front end]]
A Newsletter system which integrates Phplist into an existing multi-language site.
[[http://forums.phplist.com/viewtopic.php?t=8268 Email your messages to a phpBB forum (plugin)]]
With this plugin you can automate the posting of an email to your preferred phpBB board. You can download the plugin [[http://www.sawey.be/download-manager.php?id=7 here]].
MultipleDatabases
Multiple phplist installations running on one file setup and multiple databases.
==Templates==
[[http://forums.phplist.com/viewtopic.php?t=4059 PBTS_XTRA - multiple content areas in templates]]
This plugin extends phpList's template functionality by allowing you to define multiple content regions within your templates. You are also able to include or exclude sections of your template based on whether one of these content regions is empty or not.
[[http://forums.phplist.com/viewtopic.php?p=15728#15728 Template permissions]]
This mod makes it possible to set admin permissions for templates.
==Placeholders & "mail merge"-type functionality==
[[http://forums.phplist.com/viewtopic.php?p=37376#37376 Conditional includes and placeholders]]
This hack allows you to customize email messages for each user by including different information in the email message depending on whether a certain attribute exists or not. For instance, you can write "Dear Bobby!" to a user whose first name is in your PHPlist database, and simply "Greetings!" to someone whose first name is unknown. Allows PHPlist messages to be much more customizable, like mail merge with a word processor.
[[http://forums.phplist.com/viewtopic.php?t=2259 Personalized subject line]]
This hack allows the use of placeholders in the subject line. Tried and tested. This hack works great in my installation.
You can find a [[http://forums.phplist.com/viewtopic.php?p=29855#29855 Personalized Subject Line]] mod for release 2.10.4 [[http://forums.phplist.com/viewtopic.php?p=29855#29855 here]].
[[http://mantis.phplist.com/view.php?id=3288 Custom placeholders in system messages]]
This mod makes it possible to use custom placeholders in system messages, like the confirmation message for instance.
[[http://forums.phplist.com/viewtopic.php?t=3674 Automatically insert date in messages]]
This mod will automate the insertion of the current date in your messages.
[[http://forums.phplist.com/viewtopic.php?t=10136 Set a default subject in subject line]]
You could try this mod to insert a default subject in the subject field of you list messages.
==Clicktracking/statistics==
[[http://forums.phplist.com/viewtopic.php?t=6349 Code for clicktracking in <area> links]]
This is a hack to make click tracking work in an <area > definition (those little boxes you put inside a picture to add links).
[[http://forums.phplist.com/viewtopic.php?p=10108#10108 Message open statistics]]
A plugin that gives message open & bounce statistics for a message. It also shows you exactly who has viewed the message (and who hasn't...as far as it's possible to tell). It only works for HTML messages.
==Criteria==
[[http://forums.phplist.com/viewtopic.php?t=6197 Textline as a criteria]]
This is a hack posted in the mantis tracker to use textline attributes as criteria, which would otherwise not be possible. A [[http://forums.phplist.com/viewtopic.php?p=32137#32137 more extensive hack]] allows you to list several matching values rather than just one (for example, send a message to all users whose attribute city=New York OR city=Chicago).
==Importing users==
[[http://forums.phplist.com/viewtopic.php?t=1172 Importing users without file uploads]]
This mod will allow importing users by copy/pasting the user list in a textarea.
[[http://forums.phplist.com/viewtopic.php?p=37643 "Soft Match" for CSV Imports that include Foreign Key]]
This mod creates a "soft match" so that users imported to PHPlist with a Foreign Key, are matched to current users via Email matching if that Foreign Key does not exist yet in the PHPlist database. [[http://forums.phplist.com/viewtopic.php?p=37643 More explanation of the problem/solution here.]]
[[http://forums.phplist.com/viewtopic.php?p=37651 Merge Duplicate Users with improved functionality]]
If you import users with a Foreign Key you may end up with many Duplicate Users. This improved functionality allows you to merge the attributes, list subscriptions, RSS Frequency, and other useful info from the Duplicate User back to your Main User in a nice way.
==Cron==
[[http://forums.phplist.com/viewtopic.php?t=8591 Cron toggle: An ON/OFF Button for Cron in the Admin Panel]]
If you use a cronjob to process the queue, but, for various reasons, want to turn the cronjob off after each mailing, you can use this mod.
[[http://forums.phplist.com/viewtopic.php?t=1716 Solution for getting cron to work with $require_login = 1;]]
Many users who have attempted cron jobs with $require_login = 1; (in config.php), have no doubt been frustrated by the cron returning a lengthy HTML code that informs you of the need to login. This mod attempts to fix this.
==Interfacing with PHPlist by email==
[[http://forums.phplist.com/viewtopic.php?t=3070 Bounce processing without IMAP extension]]
This mod will allow bounce processing even if you don't have the IMAP module installed. You need the Net_POP3 Pear module installed for this mod to work.
[[http://forums.phplist.com/viewtopic.php?t=8363 Send messages via email client (plugin)]]
With this plugin you can send messages via your favorite email client to your lists. You can download the plugin [[http://www.sawey.be/download-manager.php?id=6 here]].
Documentation can be found in the wiki [[MailToList here]].
==Extended PHPList functionality==
[[http://mantis.phplist.com/view.php?id=8826 Adding Captcha functionality to the subscribe form]]
Captcha is an anti spam method that requires the user to type the code on an image to subscribe.
[[http://mantis.phplist.com/view.php?id=8209 Faster message queue processor]]
This queue processor, loosely integrated with PHPList, will send out messages faster than the default processqueue.php. See also [[http://forums.phplist.com/viewtopic.php?t=6726 this forum thread]].
[[http://forums.phplist.com/viewtopic.php?=&p=16582 Displaying additional attributes on users page]]
This mod will display additional user attributes (like user name for instance) on the list all users page.
[[http://www.colizer.com/free-newsletter-template.php Colizer's Windows-like admin module]]
A GUI for the newsletter system that has more Windows feeling to it, with drop down menus from the top. And you can still get to the original view through 'advanced mode'. Upgrades will be announced in [[http://forums.phplist.com/viewtopic.php?p=31497#31497 this forum thread]].
==Miscellaneous==
[[http://forums.phplist.com/viewtopic.php?t=6664 Hide RSS frequency]]
This is not the best way, but if you have only one RSS frequency and want to hide it so users can't choose another frequency, this works ok.
[[http://forums.phplist.com/viewtopic.php?t=2789 Birthday mailing]]
With this hack you are going to be able to send messages to people that have a birthday that day.
[[http://mantis.phplist.com/view.php?id=7903 New subscriber gets last list email automatically]]
This is a nice one. A new subscriber will receive the last email sent.
[[http://forums.phplist.com/viewtopic.php?p=23711#23711 HTML confirmation email]]
This mod will enable you to send HTML confirmation messages, instead of text-only confirmation messages.
[[http://mantis.phplist.com/view.php?id=15235 Accept preselections in subscribe pages]]
Use additional $_GET parameters in subscribe pages in order to:
# Preselect HTML format for e-mails.
# Preselect one, all or several lists on subscribe pages.
[[http://forums.phplist.com/viewtopic.php?p=36650#36650 HTML or text format by default]]
phplist v 2.10.4
To have "HTML" or text checked by default in "send a message" > "format" tab
===List of fixes===
[[http://forums.phplist.com/viewtopic.php?t=6309 Change user to inactive after several bounces]]
If users aren't getting unconfirmed after getting several bounces this hack will fix it.
[[http://mantis.phplist.com/view.php?id=3416 Consecutive bounce count for MySQL 4.1.x]]
If your server is running ""MySQL"" 4.1.x, the bounce test mechanism may not get consecutive bounces, and instead gather all bounces for a user. This mod will deal with that issue.
**Note**: this is not a complete listing. You can also search for contributions in the [[http://mantis.phplist.com/ mantis tracker]] and in the [[http://forums.phplist.com/ forums]]
=== Plugin development ===
There isn't a documentation section on plugin development yet. For the moment, if you want to build your own plugins, you can consult [[http://forums.phplist.com/viewtopic.php?t=10948 this forum thread]]
----
CategoryHacks
----
=====phplist Hacks=====
=== What are hacks?===
Hacks are "quick and dirty" solutions. Solutions that probably could be nicely integrated into phpList, if the author of the hack knew enough about the internal architecture of phplist, and/or felt it was worth to integrate his or her solution into the phplist code. The latter conditions are not always fulfilled... still it 's valuable to collect the experience of people fiddling with phplist setups or code, because these simple solutions can be reused by anyone comfortable with php, and it may lead to proper phplist code offering the same functionality.
Browsing the forum, you will find a number of hacks that can help you address a specific need or help you sort out an issue. Some of them are listed here. You are welcome to add the ones you know and find useful. And of course thanks to the creators and contributors of these hacks.
**Please note** some of these hacks may address issues that happened in older versions of phplist and have been addressed in the latest release. Only try to apply a hack if you experience the same problem in the version you are using. Also in some cases, these hacks were made against older versions, so the instructions to apply them may not be entirely correct for the latest version. In general, it is likely you will need some knowledge of PHP in order to apply a hack.
===List of Hacks===
==Interfacing with external programs==
[[IntegratingPhpListWithOtherPackages Phplist with other packages]]
A lot of PHP/Mysql packages exist: CMSs, portals, online communities.... : a list of tested ways to integrate phplist into them.
[[NewsletterArchive Newsletter Archive]]
This add-on will query your database and produce a HTML page, listing all newsletters from a particular list. Clicking on a newsletter will display that newsletter.
[[http://forums.phplist.com/viewtopic.php?t=5009 Phplist class]]
A set of functions which provide a simple way to interact with phpList in your own programs (eg: adding a user who just purchased something from your website to a mailing list). It takes a list id, an email address, and optionally some attributes, and subscribes the user to that list. If the user already exists, the existing account will be subscribed. If it's a new user, they'll be added first. Users added in this way are pre-confirmed (they will not be sent a confirmation email).
[[http://forums.phplist.com/viewtopic.php?p=13312#13312 List control via HTTP]]
An add-on that can be used to subscribe a user using the HTTP command. The procedure works by simulating a POST to the default subscribe page. It requires the CURL PHP library.
[[http://forums.phplist.com/viewtopic.php?t=5401 Multi-language front end]]
A Newsletter system which integrates Phplist into an existing multi-language site.
[[http://forums.phplist.com/viewtopic.php?t=8268 Email your messages to a phpBB forum (plugin)]]
With this plugin you can automate the posting of an email to your preferred phpBB board. You can download the plugin [[http://www.sawey.be/download-manager.php?id=7 here]].
MultipleDatabases
Multiple phplist installations running on one file setup and multiple databases.
==Templates==
[[http://forums.phplist.com/viewtopic.php?t=4059 PBTS_XTRA - multiple content areas in templates]]
This plugin extends phpList's template functionality by allowing you to define multiple content regions within your templates. You are also able to include or exclude sections of your template based on whether one of these content regions is empty or not.
[[http://forums.phplist.com/viewtopic.php?p=15728#15728 Template permissions]]
This mod makes it possible to set admin permissions for templates.
==Placeholders & "mail merge"-type functionality==
[[http://forums.phplist.com/viewtopic.php?p=37376#37376 Conditional includes and placeholders]]
This hack allows you to customize email messages for each user by including different information in the email message depending on whether a certain attribute exists or not. For instance, you can write "Dear Bobby!" to a user whose first name is in your PHPlist database, and simply "Greetings!" to someone whose first name is unknown. Allows PHPlist messages to be much more customizable, like mail merge with a word processor.
[[http://forums.phplist.com/viewtopic.php?t=2259 Personalized subject line]]
This hack allows the use of placeholders in the subject line. Tried and tested. This hack works great in my installation.
You can find a [[http://forums.phplist.com/viewtopic.php?p=29855#29855 Personalized Subject Line]] mod for release 2.10.4 [[http://forums.phplist.com/viewtopic.php?p=29855#29855 here]].
[[http://mantis.phplist.com/view.php?id=3288 Custom placeholders in system messages]]
This mod makes it possible to use custom placeholders in system messages, like the confirmation message for instance.
[[http://forums.phplist.com/viewtopic.php?t=3674 Automatically insert date in messages]]
This mod will automate the insertion of the current date in your messages.
[[http://forums.phplist.com/viewtopic.php?t=10136 Set a default subject in subject line]]
You could try this mod to insert a default subject in the subject field of you list messages.
==Clicktracking/statistics==
[[http://forums.phplist.com/viewtopic.php?t=6349 Code for clicktracking in <area> links]]
This is a hack to make click tracking work in an <area > definition (those little boxes you put inside a picture to add links).
[[http://forums.phplist.com/viewtopic.php?p=10108#10108 Message open statistics]]
A plugin that gives message open & bounce statistics for a message. It also shows you exactly who has viewed the message (and who hasn't...as far as it's possible to tell). It only works for HTML messages.
==Criteria==
[[http://forums.phplist.com/viewtopic.php?t=6197 Textline as a criteria]]
This is a hack posted in the mantis tracker to use textline attributes as criteria, which would otherwise not be possible. A [[http://forums.phplist.com/viewtopic.php?p=32137#32137 more extensive hack]] allows you to list several matching values rather than just one (for example, send a message to all users whose attribute city=New York OR city=Chicago).
==Importing users==
[[http://forums.phplist.com/viewtopic.php?t=1172 Importing users without file uploads]]
This mod will allow importing users by copy/pasting the user list in a textarea.
[[http://forums.phplist.com/viewtopic.php?p=37643 "Soft Match" for CSV Imports that include Foreign Key]]
This mod creates a "soft match" so that users imported to PHPlist with a Foreign Key, are matched to current users via Email matching if that Foreign Key does not exist yet in the PHPlist database. [[http://forums.phplist.com/viewtopic.php?p=37643 More explanation of the problem/solution here.]]
[[http://forums.phplist.com/viewtopic.php?p=37651 Merge Duplicate Users with improved functionality]]
If you import users with a Foreign Key you may end up with many Duplicate Users. This improved functionality allows you to merge the attributes, list subscriptions, RSS Frequency, and other useful info from the Duplicate User back to your Main User in a nice way.
==Cron==
[[http://forums.phplist.com/viewtopic.php?t=8591 Cron toggle: An ON/OFF Button for Cron in the Admin Panel]]
If you use a cronjob to process the queue, but, for various reasons, want to turn the cronjob off after each mailing, you can use this mod.
[[http://forums.phplist.com/viewtopic.php?t=1716 Solution for getting cron to work with $require_login = 1;]]
Many users who have attempted cron jobs with $require_login = 1; (in config.php), have no doubt been frustrated by the cron returning a lengthy HTML code that informs you of the need to login. This mod attempts to fix this.
==Interfacing with PHPlist by email==
[[http://forums.phplist.com/viewtopic.php?t=3070 Bounce processing without IMAP extension]]
This mod will allow bounce processing even if you don't have the IMAP module installed. You need the Net_POP3 Pear module installed for this mod to work.
[[http://forums.phplist.com/viewtopic.php?t=8363 Send messages via email client (plugin)]]
With this plugin you can send messages via your favorite email client to your lists. You can download the plugin [[http://www.sawey.be/download-manager.php?id=6 here]].
Documentation can be found in the wiki [[MailToList here]].
==Extended PHPList functionality==
[[http://mantis.phplist.com/view.php?id=8826 Adding Captcha functionality to the subscribe form]]
Captcha is an anti spam method that requires the user to type the code on an image to subscribe.
[[http://mantis.phplist.com/view.php?id=8209 Faster message queue processor]]
This queue processor, loosely integrated with PHPList, will send out messages faster than the default processqueue.php. See also [[http://forums.phplist.com/viewtopic.php?t=6726 this forum thread]].
[[http://forums.phplist.com/viewtopic.php?=&p=16582 Displaying additional attributes on users page]]
This mod will display additional user attributes (like user name for instance) on the list all users page.
[[http://www.colizer.com/free-newsletter-template.php Colizer's Windows-like admin module]]
A GUI for the newsletter system that has more Windows feeling to it, with drop down menus from the top. And you can still get to the original view through 'advanced mode'. Upgrades will be announced in [[http://forums.phplist.com/viewtopic.php?p=31497#31497 this forum thread]].
==Miscellaneous==
[[http://forums.phplist.com/viewtopic.php?t=6664 Hide RSS frequency]]
This is not the best way, but if you have only one RSS frequency and want to hide it so users can't choose another frequency, this works ok.
[[http://forums.phplist.com/viewtopic.php?t=2789 Birthday mailing]]
With this hack you are going to be able to send messages to people that have a birthday that day.
[[http://mantis.phplist.com/view.php?id=7903 New subscriber gets last list email automatically]]
This is a nice one. A new subscriber will receive the last email sent.
[[http://forums.phplist.com/viewtopic.php?p=23711#23711 HTML confirmation email]]
This mod will enable you to send HTML confirmation messages, instead of text-only confirmation messages.
[[http://mantis.phplist.com/view.php?id=15235 Accept preselections in subscribe pages]]
Use additional $_GET parameters in subscribe pages in order to:
# Preselect HTML format for e-mails.
# Preselect one, all or several lists on subscribe pages.
[[http://forums.phplist.com/viewtopic.php?p=36650#36650 HTML or text format by default]]
phplist v 2.10.4
To have "HTML" or text checked by default in "send a message" > "format" tab
===List of fixes===
[[http://forums.phplist.com/viewtopic.php?t=6309 Change user to inactive after several bounces]]
If users aren't getting unconfirmed after getting several bounces this hack will fix it.
[[http://mantis.phplist.com/view.php?id=3416 Consecutive bounce count for MySQL 4.1.x]]
If your server is running ""MySQL"" 4.1.x, the bounce test mechanism may not get consecutive bounces, and instead gather all bounces for a user. This mod will deal with that issue.
**Note**: this is not a complete listing. You can also search for contributions in the [[http://mantis.phplist.com/ mantis tracker]] and in the [[http://forums.phplist.com/ forums]]
=== Plugin development ===
There isn't a documentation section on plugin development yet. For the moment, if you want to build your own plugins, you can consult [[http://forums.phplist.com/viewtopic.php?t=10948 this forum thread]]
----
CategoryHacks



