Is anyone working on an ecard module for G2? It is the one think I really used a lot in G1 that is keeping me from moving over to G2 fully.
As a side note I did my G2 installation yesterday and my import of all my G1 data and it was a really easy install and import. My thanks for the great work by everyone on the project to get it to this point.
MasterK Out
Posts: 32509
nope, to my knowledge noone is working on such a module.
Posts: 214
Ups... ecards are the most used things in common gallerys, so I definitly need this feature !!!
Would it be too difficult to adopt the G1.5 ecard module to G2 within forseeable time ???
Posts: 32509
a user would have to contribute it. in forseeable time, we're working on bug fixes, downloadable modules and a lot of usability issues.
Posts: 3
I manually modified one from an older ecard module. I'll post the details this weekend
Posts: 18
Has anyone been able to integrate g2 and ecard? It would in my opinion really add commercial value to the product.
Posts: 32509
nope, not heard of anyone having finished such a module.
Posts: 198
I thought the orginal eCard released back when by Muggles functioned the best in Gallery. If I get time I'll dig it up and see what happens.
Posts: 18
come on folks if I could write the integration i would, gallery 1.X has ecard. I switched from g1 to version 2 as it offered more options. however, g2 does not have the same directory structure as g1 so i cant figure out the difference. I'm sure some one with php smarts can figure this one out! WE NEED ECARD AAAAAAAHHHHHHH!!!
Posts: 32509
money doesn't work here. it's a matter of having time to write such things or not.
you still can offer some money in the services forum.
Posts: 18
O.k. does please help?
Posts: 16504
not really Go here and vote for it: http://gallery.menalto.com/sfvote
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 118
Ok, I'm just trying to get an eCard module working, but this can take some days. I already know what the Plugin architecture is about and got some simple form working...
Posts: 32509
heh, the only problem you have is that our expectations might be too high since we know already siriux ;)
Posts: 118
valiant: ;-)
A basic module is running already (and sending mails is possible), I begin to love the G2 code even more. I'll make it customizable (configuration page) and platform independent (file system operations) and then I'll post it.
Posts: 18
Wow, at least we are getting play on the subject. Thank you I know i'm not the only one, who is looking to have this functionality within G2.
Looking forward to the mod.
Thank you again
Posts: 118
Ok, current state:
- the module adds an item action "Send as eCard" to each Photo
- a form with sender and recipient name/mail and message is shown
- HTML mail is generated and sent with original image attached (multipart, image inline, plaintext alternative)
- default sender, subject, header and footer is customizable (with "from" and "to" template keywords)
Now I have several problems (any devs around?):
- Form data seems to be saved as HTML (e.g. the Admin forms). Is there a default way to avoid HTML escaping? I'd like to save e-mail Subject and Message, so escaping is bad here
- What is the best way to send the smallest derivative instead of the (large) original? (which I currently fetch with item->fetchPath and fopen)
- What happens if I try to get the path of a derivative which is not generated yet? (I guess I have to go like GalleryTheme does, list all derivatives and rebuild them if not existent)
- And how does i18n work? Can I generate a mo file from a po file or is this whole process automatized (language team?)?
I'm willing to release the module if these problems are solved, later I might add "pickup" support, so you can send e-mails with links to generated eCards (like AOL does e.g.). But this is quite "advanced", so give me some time to dive into G2 some more.
Posts: 32509
probably you already have, but make sure your email template is translateable (g->text).
- form data input: html? don't think so, but i might be wrong. all input is exactly what the user entered in UTF-8
when outputting data in templates, you can run it through smarty modifiers (truncate, ...)
and output is ran through our markup modifier, which does either html, bbcode or nothing.
modules/core/classes/GalleryCoreApi.class:
- smallest derivative: that's probably the thumbnail...or do you want the smallest resize? GalleryCoreApi:: has methods to fetch thumbnails / resizes for an item. if you want a resize, you can then use getWidth i guess to find out which one's the smallest.
- not generated derivatives: GalleryCoreApi:: has methods to rebuild... ifnotcurrent etc. that's the way to go i guess
- i18n: see docs/LOCALIZING make sure you use g->text in the tpl files, $gallery->translate in the php files. also see http://codex.gallery2.org/index.php/Gallery2:Translations
-feature suggestion: maybe also add a block such that you can have a sidebar block to recommend this site to a friend or something like that.
Posts: 118
Sure. I found out how to do translations and already translated it into german.
I'm saving form data from GalleryController::handleRequest($form) to GalleryCoreApi::setPluginParameter. In the database there are " and escaped umlauts, so there must be some HTML escaping before handleRequest...
Ok, I'll copy some code from GalleryTheme, which lists all derivatives (and also rebuilds missing ones).
What should be in the block? Currently there is an item action (e.g. in the sidebar item navigation list or in the dropdown (for Matrix theme) under the thumbnails) "Send as eCard".
Posts: 32509
true, all input vars (GET, POST, ..) get filtered through GalleryUtilities::sanitizeInputValues which does the " -> " replacement.
there's also GalleryUtilities::unsanitizeInputValues if you need it...
Posts: 118
Ok, thanks, I'll try this.
Posts: 18
hi,
was wondering if you have made any head way? Thanks for your effort this far. I'm sure many other silent gallery members are waiting as well for the outcome of your mod...
Posts: 118
It's getting pretty much in shape. Although I'm moving "pickup" support to a later version so I don't need to story any data in G2 yet.
It supports plain-text mails with attachment as well as HTML mails with inline graphics, I'm a little bit stuck with broken E-mail clients (like Outlook Express or German Web.de webmail) because they don't support UTF-8...
Posts: 18
We'll if you are ready to share what you have i would be willing to try it on my site. If, you can code and could help nicokaiser it would be greatly appreciated..
Posts: 118
Test version available (with the mentioned flaws):
http://siriux.net/news/2005/10/22/ecard-module-for-gallery-20/
Posts: 32509
hi nico,
got some feedback
(@coding style: i received the same feedback from bharat and mindless for my reviews, so don't be upset )
bugs / style:
- coding style: indention: after an opening { indent 4 characters on the next line, not 8 (set your tabs in your editor to 8 spaces)
- coding style: a few windows line ending
- coding style: a few lines with > 100 chars found
- i'd move unction _replaceKeywords into a helper class, remove reduncancy (controller / view)
- i guess i'd prefer plain html links and not buttons on the confirmation page "ecard sent, send another ecard, done"
- don't serialize / unserialize session data. the GallerySession does that already for you. plus, you get an error from php when you use it when the session->get returns null (unserialize can't operator on null, it needs at least an empty string) (-> develop for G2 with php error_handling set to E_ALL)
missing features:
- send ecards for albums / non photo items, e.g. just with a thumbnail (if available) and a link.
- "Send eCard" / "Preview" page should/could contain also the image your sending, i mean, it's a preview and you wanna know what you're commenting on when sending a card
- the from name / from email address should both default to the current G2 user's from name / email address (it should default already when loading the view and presenting it to the user for the first time)
i tested it and sent a single ecard from my gentoo box to my ms office 2003 outlook, this is what i received:
headers:
i replaced my address with MYADDRESS1 for privacy.
in site admin -> ecard, i put %from into the sender from field.
the email body itself didn't look alright:
maybe i should have tested it with a jpg and not a non-web-viewable wmf file?
this http://dev.nei.ch/SendEcard.inc.zip file has fixed indention and removed serialize / unserialize. didn't fix anything else though. just wanted to show what i mean with the indention (you'll have to switch your tabs to 8 spaces).
Posts: 118
- Ok, I'll switch my editor to spaces (although I really hate space indention).
- The e-mail header seems to be wrong, some \r's are not interpretet / double-escaped. I'll look at that...
- I didn't find a good was to get the image URL (g->url seems to be in themes only), so I don't display the image on the form. Do you have a hint for me?
Posts: 118
Re "coding style" (and your version of SendEcard.inc): there are still tabs in it?!? In my opinion a mixture of tabs and spaces is not good, either "indent by <n> spaces" or "indent by 1 tab"...
Posts: 118
valiant: can you test it again? same url, but working mime-type now (quoting was wrong for some reason), some magic-quotes-hacks and corrent indention.
Posts: 32509
@indention:
in G2, we define tabs to be 8 spaces. in code editors like eclipse, emacs, ... you can configure the width of tabs. in your editor it's seems to be set to 4 spaces, which is not ok for G2.
emacs can be configured to automatically replace 8 spaces by a single tab (smart tabs) etc.
when writing g2 code, i don't have to think about such things at all. i just use the g2 mode for emacs (written by bharat) and it does everything for me.
@showing the image in the preview:
see album.tpl or photo.tpl of themes, there we also show the image... you can use the same smarty code in your view.
@urls:
if you want to include the URL to the photo / photo page somewhere:
global $gallery;
$urlGenerator =& $gallery->getUrlGenerator();
$urlGenerator->generateUrl('view' => 'core.ShowItem', 'itemId' => $itemId);
or
$urlGenerator->generateUrl('view' => 'core.DownloadItem', 'itemId' => $itemId);
Posts: 18
Just wanted to say thank you, I appreciate your efforts tremendously. Thank you again! I have downloaded your mod hopefully i can test it soon.
Regards,
Boyakaa
Posts: 18
Dude,
Sweeeeeeeettttttttt!!!!!!!! inline graphics nice! Wow thats great work. Thanks so much I can't wait to see the finished product.
Did i mention thanks!
Posts: 46
nicokaiser: great job. i tested the module plugin too.
1st ecard goes out ok but 2nd, 3rd and so on does not attach picture anymore.
i go into site admin then maintennance and clear out cache first card sends ok with pic again but 2nd e-mail attempt no pic again.
it's looking good though.
-----------------
G2 v2.0.1
PG Theme v1.0RC5
Posts: 118
cow736: Strange. Is the picture in the 2nd, 3rd mail missing or is it broken (empty file, etc.)? Can you forward such a broken mail to me (or send me a card ;-))? I'll have a look at that.
Maybe it has to do with derivatives not being generated, but the plugin should generate any missing derivative before trying to fetch it from the filesystem and attach it...
Posts: 47
I have just tested the eCard module and it looks very cool! :-D
With this post, I have attached the Dutch translation for the module. I hope this can be included in the next release of eCard.
When translating the module, I noticed that the default phrases in the site admin are not "localizable" (does this word exists?), such as:
- "You have been sent an eCard"
- "This eCard was sent with Gallery 2.0 - Your photos on your website"
etc.
Perhaps this can also be included in the next version.
It would be even more slick, if multiple eCard mail texts in the Site Admin could be maintained. Then an eCard sender could choose the recipient's language. Based upon this, the correct e-mail language could be added to the email. But I can imagine that this something for the future...
Posts: 32509
just a few ideas for additional ecard features
http://www.care2.com/ecards/build/8/3423069/http://www.care2.com/c2c/photos/view/63/102606288/YA_Me_N_DA_Family_/IMG_0151.JPG.html
(they're using a G2 alpha 2 version which was heavily customized)
Posts: 1
I have used nicokaiser's module in my Gallery 2 page. It's working fine. Many thanks nico. There is a bottleneck though.
Anybody interested can check this link:- http://photogeniec.com/gallery2/v/Iris/PICT0032.JPG.html
The bottleneck is that the recipient e-mail address can accept only one address. I need to send the card to multiple address simultaneously. That means the recipient address field needs to be able to accept multiple addresses. Any help - a modified PHP / dirctives to modify the PHP etc.?
Posts: 388
I installed the ecard module, keft the setting at the default and sent an ecard to myself.
On receiving its all text based. Any ideas on why and what I need to do to fix?
Posts: 118
This looks like there are no line breaks in the header. I'll add \r\n instead of \n in the code and then let's look if this helps... (Any e-mail gurus around? I think \r\n is mandatory for mail headers, isn't it?)
Posts: 388
It looks as though \r\n are already in the code. Did you browse over the code for the ecard module in G1? Perhaps looking over the original ecard code may give you some clues. Particularly the htmlMimeMail.php file.
Posts: 2
I'm having trouble using this module. It sent once without the picture in HTML mode and then once with a proper picture attachment in text mode. However, the attached picture looked like it had an underscore appended to the end of it, but I was still able to view it. Now I can't seem to send any, though. I can't figure out why it's not sending, either. I'd really like to see this module working, and I'll help where I can.
Posts: 2
Well I reinstalled it and now it's working very well. Maybe I screwed something up the first time. Nice module! I'm looking forward to new versions with more features.
Posts: 388
Do ALL the features currently in it work for you?
Posts: 2
When i try to send te ecard i get the following error:
Error (ERROR_UNKNOWN) : Could not send mail to
in modules/core/classes/helpers/MailHelper_simple.class at line 102 (gallerystatus::error)
in modules/core/classes/GalleryCoreApi.class at line 2543 (mailhelper_simple::sendtemplatedemail)
in modules/ecard/SendEcard.inc at line 185 (gallerycoreapi::sendtemplatedemail)
in main.php at line 174 (sendecardcontroller::handlerequest)
in main.php at line 87
in main.php at line 80
Hope someone can help me out with this!
Posts: 118
Maybe there is an error in the mail template? (See G2 admin)
Posts: 4
I am having some problems with the mail that is being sent.
This is from gmail.
Any thoughts on what the problem could be ?
Posts: 2
Yes, is was in the email settings! Thanks!
Posts: 3
Well I installed this Module today and it works GREAT! My only complaint (and it is a msall one) is that I would love to be able to specify multiple recipients perhaps comma seperated.
If anyone could help make that happen it would make this perfect.
Thanks!!
Posts: 4
I didnt mention that i am running mamp, apache mysql php on mac.
I installed gallery2 and the ecard module on a linux machine and it worked then.
I suppose this had something to do with the mailer in osx or apache in mamp...
Anyways problem solved for now.
Posts: 118
I have to take a look at Mac OS X and line breaks (together with base64 encoding)...
Posts: 397
Upgraded to G2.02 and a working ecard module stopped working. Anyone else had this happen. Is a cool module and was bummed to see it disappear. Reinstalled it, everything looked right. It exists in Site Admin. But doesn;t apepar in permissions or theme setup.
Ideas? tx a ton...