WordPress.org

Ready to get started?Download WordPress

Forums

[eCampaign] experience and thoughts (40 posts)

  1. Mark Orie
    Member
    Posted 2 years ago #

    John,

    First of all, let me thank you for the great plugin. I do not code PHP and could not have solved any of this myself. I appologise in advance for the dirtyness of some of the hacks to your plugin I will describe below.

    There are some thoughts I would like to share. A line of thought rather than a feature request, although I would be delighted if any of them would be implemented in any future. For now, any pointers would be very welcome.

    I run a site (ZorgWaarde.org, dutch site) to support a movement for more explicit core values in Healthcare. I use the plugin so people can show support for the cause. Once they sign up, their name, function and organisation are displayed on a list (actually on two lists) and they are added as user to the site. For our work, we target organisations to scontribute or at least morally support. We use subscriptions as a reason to contact them.

    The site runs only one instance of eCampaign

    These are the points where I have to do things by hand or used ugly hacks for lack of PHP knowledge:

    * custom fields
    I needed the fields "Function" and "Organisation". I did not need adress, so I renamed the screen variables adress1 and adress 2 in the PHP file ePetition. Unfortunately, this puts them in a single cell in the table. Some "custom" variables would be great!

    I formatted the checkboxes to say "anonimise my name" and "anonimise my function". This is only indicated in the database, the real name is stored.

    * Display subscribers and organisation counts
    I do this by hand. I would not know how to generate the list in a page, let alone how to replace names and functions with "anonymous". I've tried modifiing the admin log display, but I do not know how to integrate that in a front end page (without al the buttons, just the table I need)

    I als maintain a list per organisation, including just the number of subscribers and the organisation status (contributing, supporting or only workplace of individual supporters)

    * Sign up
    I want signing the campaign and registring to be the same action. I do this now by adding users once they show up in my eCampaignLog, and by using a login/logout plugin widget with a "fake" registration link that points to the campaign page.

    All the manual actions are OK for now, but will be a major problem if the movement actually takes off, especially since I will be visiting the hospitals rather than administrating my site.

    sorry for the long post. As said: any help, pointers, referals to other plugins of included features would be extremely helpfull.

  2. john ackers
    Member
    Posted 2 years ago #

    Mark, thanks for the feedback. Long posts are good, they are interesting to me! Will get back to you tomorrow.

  3. Mark Orie
    Member
    Posted 2 years ago #

    Thanks for the quick response

  4. john ackers
    Member
    Posted 2 years ago #

    Mark

    custom fields: I think I can add custom fields in a subsequent release. The custom fields would be saved in the info column in ecampaign_log table and would be seen in the admin log page. But I think you would want to add your specific fields, function and organisation, as columns to ecampaign_log so these fields can be used for filtering, sorting, counting which I am slightly reluctant to do.

    Display subscribers and organisation counts: It would be easy to add this functionality (mainly to EcampaignLog.class.php) if these columns are added to the ecampaign_log table.

    Sign up: I think you want to create a new wordpress user of presumably type subscriber. It should be possible to get ecampaign to create a new wordpress user using a small amount of PHP and could add a class/file to do that.

    Have you considered using a CRM? CRMs give you a lost of flexibility in terms of fields, form design and reporting options. The open source drupal+CiviCRM comes to mind. But there is a also wordpress+CiviCRM package which will be released soon. I am guessing that there also some cheap commercial CRM packages that can be added to wordpress and would allow you to do what you want quite easily. If you don't think a CRM will be suitable please let know and I'll look what can be done with ecampaign again.

    Hope this helps.
    John

  5. Mark Orie
    Member
    Posted 2 years ago #

    John,
    Thanks for the reply.

    Custom fields:
    You are right, I would want to save fields in seperate columns. I could immagine something along the lines of the labels of the checkboxes: two or three colums named "custom1" etc, specifically named by an atribute in the form where the field is added. This would be universal and at the same time offer flexibility (I assume it is the specificness of the fields that bothers you, not adding another colum to the table. It means you could even use the fields differently depending on what petition you are showing (since the atributes coul be set differently on a customised form without affecting the db colums in any way)

    Displaying data
    The display function would be great. I immagine a call on page that uses the fields in the same way the forms do (default on admin pages and possible customisation on page). If the suggestion for custom fields above makes sense, this would sort them out again (atributing the right field names to the right custom fields. something like:

    [ecampaign class=display postID=11]
    {name};{custom1 "function"};{custom2 "organisation"}
    [/ecampaign]'
    
    Or, ideal to my situation but probably a lot more complex:
    [ecampaign class=display postID=11]
    {name anonymous=cb1};{custom1 "function" anonymous=cb2};{custom2 "organisation"}
    [/ecampaign]'

    I have searched for a generic display plugin (somethig that puts an user interface on echo-ing any wpdb data to a html table on a page). I have found none and it seems to be a common problem for many people who are not proficient in PHP: It is so simple to do specifically (if you know PHP) nobody finds any chalenge in building it generically.

    sign up
    I want to do exactly that. I realised after my initial post it would mean a check to see if the email is unique, but I would suggest that anyway after having multiple petition signups with one email adress (probably due to reloading a browser). You might even think of a welcomming email using the eCampaign fields in the same way a campaign is generated in the admin field, but I have no idea wheter that is easily achieved reusing code or a whole new chalenge

    CRM or WP
    I have indeed considered a CRM, but was strongly advised against it. The main reason is that, ultimately, the site is just pages and articles grouped around this one petition. That added to my non-existing PHP skills would make Drupal overly complex (or so I was told). Apart from some very specific point mentioned above and the generic problem of creating html tables on pages using data from the db, I am actually very happy with WordPress!

    Thanks for your response so far, I hope I have been an inspiration to eCampaign rather than just being a demanding user. Warn me if I ask to much...

  6. john ackers
    Member
    Posted 2 years ago #

    Mark

    Custom fields: I have added (but not yet committed to SVN) custom fields which takes the form {fieldname} or {fieldname label='labelname'} so in your case, you could do things like:

    {organisation size='40'}
    {position label='Job Title'}

    Sign up: This is what I am proposing to do. Provide an additional subscription class that will add site visitors as wp users using the wp api call. In addition, add any custom fields that match up to existing user meta data fields. I think this will be generally useful to others.

    Displaying Data: I think that there should be user profile plugins that will allow the user meta data to be viewed.

    I have been looking at this list
    http://wordpress.org/extend/plugins/tags/user-profile

    Almost suitable is
    http://wordpress.org/extend/plugins/profile-builder/

    If neither of us can find anything, I could add a table view of wp users to the admin pages.

    It seems to make sense leverage existing plugins to extend, store and display user profiles rather than replicate it within the ecampaign plugin.

    What do you think?

    John

  7. john ackers
    Member
    Posted 2 years ago #

    Have got the above working, will check in tomorrow. Have found that using this plugin
    http://wordpress.org/extend/plugins/simple-crm/
    and adding fields like say organisation, you can see the organisation keyed into the ecampaign form, on the bottom of the user profile. Have not found a plugin to list the users along with meta fields in the way that you want.

  8. john ackers
    Member
    Posted 2 years ago #

    Changes checked into the SVN trunk. All the functionality is there and working except the 'Display subscribers and organisation counts'. The readme.html has been updated. (But cannot find a simple way to download as zip.)

  9. Mark Orie
    Member
    Posted 2 years ago #

    That was not only quick, but the integration in profiles is excellent!

    I heve not installed it (did not use SVN before) but the docs suggest great work.

    For the display part, I did have a look at People lists.
    http://wordpress.org/extend/plugins/people-lists/
    There seems to be two problems:

    • they only display selected users, not just a comprehensive list of all of them.
    • they have their own implementation of custom fields, rather than looking which custom fields are already generated by other plugins

    Also, for my specific interest I would have to find a way to "anonymise" results for those who tagged that box, but that is just a problem specific to my case I guess.

    I wish I could be more helpfull than just by generating ideas. I really should get some programming skills after all.

  10. john ackers
    Member
    Posted 2 years ago #

    Mark,

    I don't think the anonymise function is a unique requirement. I could add support for an anonymise attribute on each field, perhaps the checkbox would appear when hovering over the field. But still thinking about what to do with the information.

    You said before "something that puts an user interface on echo-ing any wpdb data to a html table on a page", I think it would be possible to write a plugin to show a table of results. However making it flexible enough to handle usermeta and postmeta is more tricky. Also, if the table was going to appear in a user page, the view of the table(s) may need to be cached to improve performance.

    But if the column data presentation could be customised/configured, the test for anonymity could be included here and and this might give you the result you want.

    I think you have different/multiple views in mind. Can you be specific about what tables/columns and grouping/counting you are looking for. Does this view only need to be accessed just with a short code? If i put something together, I want to be sure your functionality is covered.

    John

  11. Mark Orie
    Member
    Posted 2 years ago #

    For my site, I maintain 2 views (manually, now):

    • a list of subscribers: name, function, organisation
    • a count of subscribers per organisation: organisation, count

    I ask subscribers for name, email, function and organisation. I use the 2 checkboxes for "do not show my name" and "do not show my function".

    on subscriptions:
    John Smith; john@smith.com; operator; Hellothere inc; 0;0
    Mike Turner; mike@turner.org; chairman, BraveWorld GmbH; 1;1
    Jake Jameson; Jake@jameson.net; CEO; Hellothere Inc

    I should get on the subscribers page
    John Smith; operator; Hellothere inc
    [hidden]; [hidden]; BraveWorld GmbH
    [hidden]; CEO; Hellothere Inc

    On the organisation page
    Hellothere Inc; 2
    BraveWorld GmbH; 1

    see it in action on http://www.zorgwaarde.org/?page_id=81 and http://www.zorgwaarde.org/?page_id=88 (I have made a distiction on the organisation page at the moment, but it is not important

    I imagined something like

    [ecampaign class=show]
    {name}{function}{organisation}
    [/ecampaign]

    to do the trick, where {function} could be replaced with something like {usermeta field=function} if necessary.

    I guess the anonymity marker would have to be stored with the other parameters. For my specific needs I would want to control which fields a subscriber could set to anonymous (because I always need to always show organisation for strategic purposes, the subscribers sympathise but their organisations are the ones are the ones that participate actively), but that may be nitpicking and as long as they are counted in the totals would not even be a real issue come to think of it.

    The generic thing I mentioned (something that puts...) is probably just my lack of coding knowledge. I sounded simple to have something that would take something like

    [tableshow]
    {wp_ecampaign_log select=state;sign show=name;address;checkbox1}
    [/tableshow]

    to display the requested data on a page in a table. It would not serve all of my needs (no anonimity; data is going to be spread across multiple tables; I didn't take into account the way the usermeta data is stored), but I looked for it as a starting point.

    Hope this is specific enough

  12. Mark Orie
    Member
    Posted 2 years ago #

    I reread my post and realised the wp_usermeta and wp_ecampaign_log should share a unique key or something in order to be coupled. otherwise my remark after the first coding example is of course useless.

  13. john ackers
    Member
    Posted 2 years ago #

    Mark

    That's really helpful. I should have looked at your web pages.

    It looks straightforward and I understand the anonymity requirements. I'll get back to you in a day or so. I could send you a simple 1 or 2 file plugin that meets your data view needs and then commit to SVN a generic/configurable version sometime after Christmas.

    John

    P.S. Jumping into detail, as far as annonymity field is concerned the current (SVN trunk) allows

    {name* label='Name'}   {hideName save='usermeta' type='checkbox' Hide my name in the list of participants}
    {email* label='E-Mail'}
    {Feature* }   {hideFeature save='usermeta' type='checkbox' Hide my position in the list of participants}

    hideName and hideFeature are just arbitrarily named fields.

    I am currently joining wp_usermeta and wp_ecampaign_log on email address but will probably introduce userID into wp_ecampaign_log.

  14. Mark Orie
    Member
    Posted 2 years ago #

    Hi John,

    tested everything and almost all of it works now. 1 issue I do not know how to handle yet:

    • When I tested, I did not get a password e-mail. Maybe because I disabled "users can register" in WP to force people to only register by signing the petition. You mentioned that the welcome message might contain the password, but how do I achieve that? Is {password} possible, which would be replaced by a newly generated user password?

    furthermore, there are some interesting points. Not problems, but points of attention

    • In "user profile" view, only profiles that have all fields filed are shown. fields may be empty, but is not all the fields are mentioned in the usermeta, the user will not show. This is important to know for all those who update their petition to include a new field, since it means they have to at least edit-save all of the exsisting users. Maybe a user could show as soon as action=sign, with e-mail as a key. missing fields could than be set to blank
    • It seems label is used to define how to display the field but also to define the fieldname in wp_usermeta. I did expect the latter to be named as the field is, i.e. {field label=showname save=usermeta} would result in displaying "Showname" and saving the input as "field" in wp_usermeta.
    • previous remark also means that, at the moment, a field which is set to save=usermeta but has no label set, will not be saved. Took me a while to fugure that one out, so maybe it should be mentioned in documentation
    • Simple CRM does not know how to handle checkboxes. I posted a suggestion to its developer to include them

    Having used the new configuration, your anonimity solution seems a specific case of coupling any checkbox to hide a field if checked. I could imagine a display format as mentioned before, like this:

    [ecampaign class=show]
    {name hide=checkbox1}{function }{organisation}
    [/ecampaign]

    which would introduce an if-loop on displaying the name, based on the value of checkbox1. Don't know if that poses serious coding chalenges or not.

  15. Mark Orie
    Member
    Posted 2 years ago #

    Oh, one more suggestion:
    would it be difficult to compose{Name} from fields like {firstname} and {lastname} . I would suggest something along the lines of

    {firstname label=first_name save=usermeta}
    {lastname label=last_name save=usermeta}
    {Name value='{firstname}.{lastname}' hidden=hidden}
    {nickname value='{firstname}." ".{lastname}' save=usermeta hidden=hidden}

    That would result in 2 input fields, a registration in the eCampaign Log, passing of a username without spaces and setting the appropriate values in the usermeta-fields for a user. That would allow for much completer userprofiles to begin with.

    The hidden attribute works fine on a field by the way, I use

    {adduser type='checkbox' checked='checked' hidden='hidden' }
    optin=adduser

    to automate subscription on signing, which works great ( ib inform my subscribers that they will be added on signing, but do not alow signing without becomming a user (although they can delete their profiles later)

  16. Mark Orie
    Member
    Posted 2 years ago #

    (although they can delete their profiles later)

    I checked. They can not (only I can, as administrator). Relieved, cause al the metadata about the petition would disappear if the user would be removed as user.

  17. john ackers
    Member
    Posted 2 years ago #

    Mark
    On your five bullet points:

    Password. Documentation not clear and have updated it. "If site visitors do not have to verify their email address, the password of the freshly created wordpress account can be included in the the petition confirmation email (inserted using the token %password)." Also updated the admin screens.

    User profile view. Sorry, that's a bug i knew about it. It looks like a sql join but sql looks right. Will fix.

    Label 1. Functionality should be as you describe it ought to be not how is. I hadn't seen that problem. Will fix. Sorry you have struggled with it but very grateful for feedback.

    Label 2.

    SimpleCRM. Noted.

    Will get back to you about first and last name.

    Incidentally I have found another db grid plugin http://wordpress.org/extend/plugins/drastic-table-manager/

  18. john ackers
    Member
    Posted 2 years ago #

    Mark,

    On your five bullet points:

    Password. Documentation updated and, sorry, code change. I am not sure how i tested that but obviously not well enough.

    User profile view. SQL redone, any usermeta field can be blank.

    Label 1. Label is used to for display name in table. Fieldname is used in usermeta.meta_key. i have not been able to recreate the problem you describe.

    Label 2.

    SimpleCRM. Noted.

    The two code changes above are not committed to a stable release, hope you can access trunk with svn. Will commit when we're happy.

    On firstname lastname. String concatenation would not be simple, parser/regex changes and testing needed.

    I could parse the name into firstname lastname at time of user registration, which is unlike to break any functionality.

    What's the benefit of separating first and second name. Could this wait until to new year?

    Finally database view with anonymised fields, sorry won't be able to sort that out until 1st week of Jan either!

    John

  19. Mark Orie
    Member
    Posted 2 years ago #

    After some fooling around, everything actually works!!! Glad to, since it seemed to work earlier and then broke down in production, forcing me to email subscribers for their details (when I misconfigured some things, data was sent to usermeta but never included, so it was totally lost). but now: great!

    Please do not apologise in any way for your time schedule: I am greatly impressed by the pace of your development and you have helped me (and probably many others very much.

    on firstname-lastname
    It is not important. I did not know wether it would be complicated or not. The only reason that I asked about it, is that it would allow for some things, all of which are mere luxuries:

    1. It would allow me to use "Dear {first_name}" or "Dear Mr/Mrs {Last_name} in the confirmation email
    2. It would allow me to provide users with a more complete user profile on subscription, filling in all the name fields for their comfort
    3. It would allow for field duplication. For instance,
      {functie* save=usermeta label="Functie"}
      {functionlog value=functie}

      would save the data about someones function in the user metadata, but also in the eCampaign_log info field (notice the lack of save=usermeta in functieLog). This means the data is available in the user profile, but the original subscription data is retained, even if the data is altered by the user or the user would be deleted.

    Again: mostly luxury

    Enjoy the last days of the year and a I wish you a great 2012!

  20. john ackers
    Member
    Posted 2 years ago #

    Mark

    I am very sorry to hear that you had to email back users. That is awful! However a small point; i think that all the fields, preconfigured and custom are saved. The custom fields are saved as key/value pairs in the info field in the ecampaign log, irrespective of whether they are saved in usermeta. Have you clicked on the last column of the log in normal view? (Perhaps you took an early version from trunk which does not save all fields).

    More on the other issues later in the week.

    John

  21. Mark Orie
    Member
    Posted 2 years ago #

    It happend in the 0.83 release. the latetst version in the trunk (which i upgraded to afterwards) is fine.

    The users involved found no problem with it and took the email as a token of involvedness on my account, so no harm done whatsoever

    Happy Newyear!

  22. john ackers
    Member
    Posted 2 years ago #

    Mark, I will have something later this week to do what you describe as tableview above. I will upload a demo somewhere.

  23. john ackers
    Member
    Posted 2 years ago #

    Mark, if you look at the first screenshot of this 'dbview' plugin, I think it's closer to what you are looking for.
    http://wordpress.org/extend/plugins/dbview/
    The anonymous fields are handled by PHP snippets of two lines in length (it could also have been done in sql). I just need to be able to suppress the checkboxes from the public view, which I'll sort out.

  24. Mark Orie
    Member
    Posted 2 years ago #

    John,

    The admin part works lik a charm. Even though I cannot hide the checkbox columns, I can hide the values using just
    return("");
    without any conditions. That leaves an empty column with only a name. I tried to blank that also, but the AS in the SQL puts the names right back in (and I need them to reference the checkbox column)

    The viewer does not do as well, unfortunately. It says my view cannot be found. I copy-pasted from the admin module and have nothing else on the page, so I do not know what is causing this. the included code is
    [dbview viewName='deelnemers' ]
    "deelnemers" is presented in the views-list, editable and presents the right table in admin.

  25. Mark Orie
    Member
    Posted 2 years ago #

    The selection can be done in SQL using cases. It works for me like this:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    The last WHERE statement excludes two testing accounts.

  26. Mark Orie
    Member
    Posted 2 years ago #

    oh, and strike the
    AND m.meta_value= 0
    I do not know what I was thinking there :-)

  27. john ackers
    Member
    Posted 2 years ago #

    1. Sorry the shortcode should be [dbview view='deelnemers'], not viewName. Sorry this in inconsistent with URLs generated. I will try to correct in the next version. But i would upgrade plugin first (to 0.2.2) before trying!

    2. We are both thinking on the same lines. My version below:

    select if(checkbox1,"-anonymous-",visitorname) as name,
    (select if(checkbox2,"-withheld-",meta_value) from wp_usermeta
     where meta_key='organisation'  and user_ID=u.ID) as organisation,
    (select meta_value  from wp_usermeta as um1
     where meta_key='position'  and user_ID=u.ID) as position
    from wp_ecampaign_log as ec left join wp_users as u on ec.visitoremail=u.user_email
    where ec.state='sign'  ;

    I'm using subqueries because I found many inner joins on the usermeta table very slow if there are a few hundred entries. Also I'm joining to wp_ecampaign_log because there might be more than one petition!

  28. Mark Orie
    Member
    Posted 2 years ago #

    Update fixed it! Everything works brilliantly, and not a moment to soon, since the rate of signing is growing dramatically

  29. Mark Orie
    Member
    Posted 2 years ago #

    Just learned SQL today to do this, so I was rather glad it worked at all :-). Your solution seems elegant.

  30. Mark Orie
    Member
    Posted 2 years ago #

    had one more question, but since it relates to DB View alone, I opened a new topic on
    here

Topic Closed

This topic has been closed to new replies.

About this Topic