[Unsupported]: Email images to your gallery [Unsupported]: Email images to your gallery
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Unsupported]: Email images to your gallery

Started by rphMedia, July 17, 2006, 08:30:16 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

rphMedia

The magic of GD and a few scripts I gathered/merged.

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fgallery.rphmedia.net%2Falbums%2Fpixlog.jpg&hash=36bb9fa1dff4cb9cd6054e9d421ad2ba1524ee81)

Email an image (attatchment) to "cam AT rphmedia DOT net" - come back to this post/thread and refresh (may have to refresh twice; nature of this example.  The hack in the Sample Gallery appears upon entering :) )

I have to work out some details and I'll post everything after performing some more tests.

This could be used for simply emailing images to your gallery, cell phone pics/video, even documents or music.  There are filesize limits (where more testing needs to be done) and a couple of glitches here and there. 

Obviously, if more than one emails, your emailed image may not appear here, but if you go to the Sample Gallery (instead of refreshing here - but do it quickly because if someone refreshes ((or even reads this topic)), then your image will not be here as the emails are deleted [I turned this off for now] as soon as they're probed), you should see your image(s) under the album "Emailed Pix".

For now, definitely don't send an image >1MB.  If this is abused in any way, I'll have to shut it down, goes without saying.  And I also ask you - please don't send anything that could be offensive to others.  Thanks.

Joachim Müller

Looks promising - I'm looking forward to see your code contribution.

Joachim

Sami

Realy nice job ....
waiting for your final code :)
‍I don't answer to PM with support question
Please post your issue to related board

Pascal YAP

Yeah Ron,  ;D

I'm nice to read you again with a new terrific Mod/Hack  ;)
Me too, i'm waiting for your code !

PYAP

rphMedia

I hope to get to this soon ... been really busy this summer.

Be back later ! 

rphMedia

#5
OK, here are the files needed for this mod.

One of the first things you'll have to do is create an album that 'Visitors' can upload files to - retrieve the id # of the album. ((if you don't like the idea of "Visitors can upload files" turned on [which turns on the "upload link"], you can always remove the upload link itself using an appropriate plugin. I just realized that all you have to do is set "Visitors can upload files" at the properties of the album (you don't need to turn anonymous group upload on).  You can also enable "Upload Requires Approval". I haven't had the time to figure out how to be notified, but the approval process works.

Create a folder off of your 'albums' folder to store the emailed items - this example uses 'pix' as the folder name.

Create or use an existing email address for the php file to read (supports either imap or pop3).

Configure a new anycontent?.php file (this example uses the name 'anycontent1.php').  This will silently include the file needed to fire the email read when entering the gallery.

Input your variables into the 'newcam.php' file (host, username, login, filepath, album#, folder).

I think that's it.  It works every time.  I believe that there are filesize / attachment limits, but I'm sure that it's reliant on individual hosts.

I will answer questions best I can. 

My first post in this thread utilizes GD, a php embedded (imposter) jpg file and a log file and is a separate entity used just for show (in other words, not really related to Coppermine structure).  If you'd like that feature, you can PM me and I'll be happy to give you those scripts, but limited support - just don't have the time lately.

EDIT: Typo in attachment - didn't affect performance

Stramm

great, have to give this a try asap  ;D

taucher_0815

Thanks for this
.
Got it and tried to "install".

Any Idea of where to put the 3 files?

anycontent1 into the root?

but where to put the other2?

How to invoke the check for new "mail"?

rphMedia

Quote from: taucher_0815 on August 27, 2006, 10:13:56 AM
Thanks for this
.
Got it and tried to "install".

Any Idea of where to put the 3 files?

anycontent1 into the root?

but where to put the other2?

How to invoke the check for new "mail"?

Search the boards for configuring anycontent.

And yes, all files to the root.  For more advanced, they can actually be placed anywhere and modify paths as needed.

The email is checked (once anycontent is configured) when entering the gallery - home page.  Understand also that the email(s) is/are deleted once the script executes.  If you don't want the emails deleted, remove these lines:

imap_delete($mbox,$jk); // sends to trash, if available
imap_expunge($mbox); // totally deletes


I just (going by my instruction above to test) put this in my personal gallery --- worked out of the box :)

Pascal YAP

Hi Ron,

So fine MOD  ;D

About Anycontent, maybe you can create a new "case" versus "anycontent" !
For exemple your MOD is about emaling into CPG ! Create a new "case" with the name : "receivemail".
Find in INDEX.PHP :
case 'anycontent':
                        if ($cat == 0) {
                            ob_start();
                            /**
                             * Any php code or HTML can be put in this file and will be displayed
                             */
                            include('anycontent.php');
                            $anycontent = CPGPluginAPI::filter('anycontent',ob_get_contents());
                            ob_end_clean();
                            echo ($anycontent);
                        }
                        flush();
                        break;


Just after add :
case 'receivemail':

                if ($cat == 0) {
                    include('RPHMEDIA-FILE.php');
                }
                flush();
                break;


PYAP

rphMedia

Yeah, I wanted to avoid editing index.php, but yes, definitely an option  :)

Pascal YAP

Hey Ron, Morning...

I just try your MOD, and post one picture on your Galery  ;D
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fgallery.rphmedia.net%2Falbums%2Fpix%2Fthumb_ruine-st-barnabe_3_19-05-2006.jpg&hash=a3fa2934ea526cdd5cbda0be30fd5e5cdbd86ff5)
http://gallery.rphmedia.net/displayimage.php?pos=-181
Work very fine.
  But us, your visitors, can'nt add any info about our pictures ! C'est la Vie :-)

PYAP

rphMedia

I don't understand what you would like me to do.  No, this mod doesn't have that capability.

Pascal YAP

#13
QuoteI don't understand what you would like me to do.  No, this mod doesn't have that capability.
Exemple : my Object email become my Title picture in Coppemine
              and why not Body email, will be the file description.

I just discored a Fatal error: Call to undefined function: imap_open() in attachmentread.class.php on line 42 on one of my webs.
On other, your MOD work fine  ???

PYAP

rphMedia

imap_open() ---- Probably need to upgrade your php version on that server.

As far as reading the body of an email (to add a description to the image), I'm sure it could be done, but I don't have the time right now  :P

Pascal YAP

#15
Ron,

1, imap_open is perhaps not present on my host, I do not know!
In this case, how to turn around this fatal-error, to employ your MOD?
Secondly, some emails dispatched to my gallery towards emailpix(at)pays-dignois.com arrived on my emailbox!.
Unfortunately, nothing is recovered by my Coppermine  ???

PYAP

ps:
It seems to me that there is no update of your pixlog.jpg file, that one sees in your first post.

rphMedia

Hi PYAP,

Remember,
QuoteMy first post in this thread utilizes GD, a php embedded (imposter) jpg file and a log file and is a separate entity used just for show (in other words, not really related to Coppermine structure).  If you'd like that feature, you can PM me and I'll be happy to give you those scripts, but limited support - just don't have the time lately.
If you send an email to "cam AT rphmedia DOT net" and refresh here first, the email attachment will be in the post.  If you go to the sample gallery first, then the attacment will be inserted in the gallery and not this post.  Sorry for the confusion.

With the exception of your password, show me the scripts you're using and how you implement them (ie, how is the include call used) and where they are located (ie, paths ... root?).  Also make sure your email host supports - most do.  Maybe just try another email.  I see that it's Album="35"?  Hope you changed that  :)

Don't despair, we can get it working.  I may not respond today, but I'll be around later.


Gizmo

I'm getting the same error as PYAP -
QuoteFatal error: Call to undefined function: imap_open() in /home/content/B/i/l/BillyBullock/html/test/attachmentread.class.php on line 49

My PHP version is 4.3.11
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

Nibbler

You need the imap extension installed to be able to use the imap_* functions.

http://php.net/imap

Gizmo

Thanks Nibbler. I just called (I know I'm going to catch flack for saying this but...) GoDaddy and imap_* functions aren't installed and the tech support couldn't offer a reason why. I'll email them which usually gets a better answer. I do have the option to upgrade to a configuration that includes PHP 4 & 5 but doubt that these functions will be installed automatically. I also checked Gmail and it's not installed either- http://mail.google.com/support/bin/answer.py?answer=10339. A Google search shows a number of links to make it work with imap but I'm looking for a solid solution and not having to deal with email hacks. So unless there is a workaround, I doubt I'll be able to use this mod.  :'(
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision