john ackers
Forum Replies Created
-
Forum: Plugins
In reply to: [dbview] [Plugin: dbview] [db view] displaying of imagesMark, sorry, by default, the cell data is put through encodeHtmlEntities() and nl2br() so people can see the contents of the fields. I was planning to add flags for that option but also I didn’t expect anyone to insert the HTML tags in a database select statement! However if you make
return($value);
the PHP snippet, you will get the value from the database without any manipulation. It works for me with your SQL statement.Forum: Plugins
In reply to: [dbview] [Plugin: dbview] [db view] displaying of imagesMark. I’m not sure how wp loads images from blobs in any event. If you have images in the media library, here’s some SQL to show the thumbnails in a table using dbview:
select meta_id, post_id, meta_value as wp_attached_file, (select meta_value from wp_postmeta where post_id=pm1.post_id and meta_key='_wp_attachment_metadata') as thumbnail from wp_postmeta as pm1 where meta_key='_wp_attached_file' limit 100
And this is the PHP snippet to drop in the top of the ‘thumbnail’ column which embeds the image into the column.
$o = unserialize($value); if (!isset($o['sizes']['thumbnail']['file'])) return "no thumbnail" ; $ud = wp_upload_dir(); $imageURL = $ud['url']."/".$o['sizes']['thumbnail']['file']; return("<img src='".$imageURL."' />");
This might give you a start. I’m guessing that you need a different $imageURL. I looked at the organisations page on your site and the images have gone. How did it previously work with blobs, crucially what did the HTML look like? (or What plugin to handle blob requests are you using)?
Forum: Plugins
In reply to: [eCampaign] experience and thoughts1. 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!
Forum: Plugins
In reply to: [eCampaign] experience and thoughtsMark, if you look at the first screenshot of this ‘dbview’ plugin, I think it’s closer to what you are looking for.
https://www.ads-software.com/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.Forum: Plugins
In reply to: [eCampaign] experience and thoughtsMark, I will have something later this week to do what you describe as tableview above. I will upload a demo somewhere.
Forum: Plugins
In reply to: [eCampaign] experience and thoughtsMark
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
Forum: Plugins
In reply to: [eCampaign] experience and thoughtsMark,
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
Forum: Plugins
In reply to: [eCampaign] experience and thoughtsMark
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 https://www.ads-software.com/extend/plugins/drastic-table-manager/
There are editable email templates for the ’email address verification’ and the new ‘petition signed confirmation’ emails in the svn/trunk version of ecampaign. You can include any of the captured fields and others like the permalink for the post in the email. It will be in the release version in the next few days.
However, you will need to use this shortcode to get correct functionality. [ecampaign class=’EcampaignPetition’].
John
Forum: Plugins
In reply to: [eCampaign] experience and thoughtsMark
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.
Forum: Plugins
In reply to: [eCampaign] experience and thoughtsMark,
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
Forum: Plugins
In reply to: [eCampaign] experience and thoughtsChanges 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.)
Forum: Plugins
In reply to: [eCampaign] experience and thoughtsHave got the above working, will check in tomorrow. Have found that using this plugin
https://www.ads-software.com/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.Forum: Plugins
In reply to: [eCampaign] experience and thoughtsMark
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
https://www.ads-software.com/extend/plugins/tags/user-profileAlmost suitable is
https://www.ads-software.com/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
Forum: Plugins
In reply to: [eCampaign] experience and thoughtsMark
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