Forums / Developer / New contrib: phplist (Datatype)

New contrib: phplist (Datatype)

Author Message

Bruce Morrison

Thursday 06 October 2005 9:01:46 pm

Hi All,

I've released a module that introduces a new datatype "PHPList Subscribe". When this datatype is added to a user class it allows for:
+ user details to be added and synchronised with PHPlist
+ subscription and unsubscription from a nominated list.
+ user is removed from PHPList when deleted from eZ publish

See: http://ez.no/community/contribs/datatypes/phplist_module

P.S. not sure that datatypes was the best category

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Xavier Dutoit

Friday 07 October 2005 8:57:03 am

Hi Bruce,

I almost posted a "I'm trying to integrate PHPlist and ez" on the phplist list yesterday !

Have you integrated phplist (the admin interface) to ez (as a module) to take care, for instance, of the authentication (phplist stores the admin passwords cleartext and I'm not a big fan of that).

Also, I was thinking about letting the user choose between one or several lists, like the preference on phplist.

Anyway, that's a great start, could you contact me on xavier [AT] sydesy [DOT] com to talk about it ?

X+

http://www.sydesy.com

Gabriel Ambuehl

Friday 07 October 2005 9:21:19 am

The way I understand it, you can add fields to the user object for each list, that would allow the user to chose the lists to subscribe to himself no?

Visit http://triligon.org

Bruce Morrison

Friday 07 October 2005 4:16:03 pm

Hi Xavier

Have you integrated phplist (the admin interface) to
 ez (as a module) to take care, for instance, of the 
authentication (phplist stores the admin passwords 
cleartext and I'm not a big fan of that).

No, this module assumes that all user interaction with phplist (apart from the recieving of the emails ;) is handled via an eZ publish user object, so there in no need for the use of passwords in phplist.

I did make a start on implmenting the PHPList user interface as a eZ module about 18 months ago but found the PHPList code a "challange" to deal with. At that time there were up to 4 releases of PHPList a month so it turned out to be more effiecent for us to simply pop the subscribe interface up in a new window.

This module is designed for community type sites where users login and can edit there own details (their own user object)

Also, I was thinking about letting the user choose 
between one or several lists, like the preference on 
phplist.

This is possible, although not directly, by adding additional "PHPList Subscribe" datatypes to the user object for the different lists.

It could be handled a bit differently. The current method simply stores a boolean for the object attribute (subscribed or not) and the list id is stored in the class attribute.

Will drop you a line.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Bruce Morrison

Friday 07 October 2005 4:17:07 pm

Hi Gabriel

Got it in one!

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Brendan Pike

Monday 14 November 2005 8:45:02 pm

Hi Bruce

Tried out this datatype today and found it a simple and clean integration solution. Well done!

Cheers
Brendan

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Stuart Fenton

Thursday 01 December 2005 1:55:37 am

I have posted an updated version of the PHPList module that includes setting the default value. This way when the user subscibes some of the PHPLIst items can be pre-selected.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Bruce Morrison

Thursday 01 December 2005 2:37:21 am

Hi Fats

Looking at the source it seems that you have modified the code so that when you add the datatype you can choose if the user accepts HTML mail or not (this was "off- text only" by default in the original but I've changed this to "on - text or HTML" locally).

Do you thing the "Default" term should be replaced with "Accept HTML Mail" in your changes?

Is there a reason you didn't add this to the datatype content edit (as opposed to the class edit?) where the user could make the choice?

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Stuart Fenton

Thursday 01 December 2005 2:55:46 am

I changed the code so that the admin can decide if the checkbox should be selected or not as the default state when the user subscribes.

When the user subscribes they have the choice to leave the checkbox selected or uncheck it to not join the mailing list.

If that is not what you have then I may have missed a file. I checked the code last night and it is working correctly. I have used it on this site http://www.easyvinyl.com

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Bruce Morrison

Thursday 01 December 2005 3:03:16 am

Hi Fats

OK - that makes sense. Would you mind if I incorporated these changes into the original?

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Stuart Fenton

Thursday 01 December 2005 3:12:19 am

Please go ahead. I was just helping out.

I will email all the files over to you in case I forgot any if it helps.

Send me your email address and I'll package them up for you.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Łukasz Serwatka

Thursday 01 December 2005 3:33:53 am

It would be nice to do merge of this two almost identical contributions in to one, and make it good, maybe also put code to SVN?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Stuart Fenton

Thursday 01 December 2005 3:43:26 am

Can you delete the phplist contribution I posted since the original has now been updated with the changes and I can't delete it.

Thanks

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Łukasz Serwatka

Thursday 01 December 2005 3:48:41 am

Yes, done.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Stuart Fenton

Thursday 01 December 2005 6:12:09 am

Feature Request
--------------

I was thinking that an appropriate extra feature would be to have the users name passed across to phplist into some custom attributes. This way the emails could be customised with their actual name rather than being informal.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Bruce Morrison

Thursday 01 December 2005 5:28:50 pm

Hi Fats

I was thinking that an appropriate extra feature 
would be to have the users name passed across to phplist
 into some custom attributes. This way the emails could be
 customised with their actual name rather than being 
informal.

This functionallity is already partially inplace. Currently to use this you need to edit settings/phplist.ini.php and maunally add the mapping of the ezpublish attribute id to the phplist attribute id.

[AttributeMap]
MapEzPhplist[246]=1
MapEzPhplist[247]=2
MapEzPhplist[457]=3

Will map eZ Attribute ID 246 to phplist users attribute id 1 etc.

This will work for text fields and may work select or radio phplist attributes.

I'm still developing this part of the project so it is not complete or well documented.

The code is not in a public SVN repository as it is part of a number of ongoing projects. Because of this I need to keep a level of control over the code (much like eZ does with eZ publish ;)

I plan to eventually put the code up on the pubsvn server but in the meantime I'm happy to receive patches, changes or bug reports. Post them here or email me at phplist@designit.com.au

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Bruce Morrison

Thursday 01 December 2005 9:53:31 pm

Version 1.2 has been uploaded. This includes come minor bug fixes from the original as well as the enhancement provided by Fats.

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Stuart Fenton

Friday 02 December 2005 1:29:43 am

Sounds excellent. I will look forward to trying it out the attribute mapping.

I also found a way to import users into phpList and synchronise them with ez. It was a lot easier than I expected. I just exported the ezUser class to a file and imported a the file with email and the id number into PHPLIst.

When I login into ez it correctly checks the mailing lists checkbox showing that they are a member of the mailing lists. A really good implementation. It saved me going through and updating each of the users in ez.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Bruce Morrison

Friday 02 December 2005 4:02:07 am

Good to hear Fats!

I've done a lot of work integrating eZ with external systems (mostly custom databases) and using datatypes to do this seems to be the best way. There are plently of hooks for when the object is created, deleted and modified that allow you to do whats required. Also by using datatypes you can piggyback on the content module and all the features that it provides.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Brendan Pike

Monday 05 December 2005 10:37:58 pm

Hi Bruce

I'm not sure this is really a big deal since it won't effect many people. However I have discovered that if an ezp user tries to sign-up to a list and their email already exists. (previously imported for example) it can cause some transaction errors and the like.

Cheers
Brendan

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

eZ debug

Timing: Jan 30 2025 00:44:01
Script start
Timing: Jan 30 2025 00:44:01
Module start 'content'
Timing: Jan 30 2025 00:44:01
Module end 'content'
Timing: Jan 30 2025 00:44:01
Script end

Main resources:

Total runtime0.1991 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 587.9297180.8359
Module start 'content' 0.00570.0059 768.7656129.9922
Module end 'content' 0.01160.1873 898.7578558.5234
Script end 0.1989  1,457.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00422.1043200.0002
Check MTime0.00160.7825200.0001
Mysql Total
Database connection0.00090.429410.0009
Mysqli_queries0.140270.42091410.0010
Looping result0.00160.79721390.0000
Template Total0.187093.910.1870
Template load0.00090.464110.0009
Template processing0.186193.457110.1861
Override
Cache load0.00070.351110.0007
Sytem overhead
Fetch class attribute can translate value0.00120.611310.0012
XML
Image XML parsing0.00030.135710.0003
General
dbfile0.00964.8008200.0005
String conversion0.00000.003030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs