Advanced search  

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]

Pages: 1 [2] 3 4 5 6 7   Go Down

Author Topic: [Unsupported]: Email images to your gallery  (Read 134313 times)

0 Members and 1 Guest are viewing this topic.

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #20 on: September 02, 2006, 01:54:08 pm »

For some reason, after updating to cpg1.4.9, this mod is broke.

Fatal error: Call to undefined function: is_known_filetype() in /homepages/38/d92220195/htdocs/rphgallery/include/picmgmt.inc.php on line 38

I'll be investigating in the next few days, but if anyone has any insight, please let me know.



The scripts, without the integration, still work.

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Email images to your gallery
« Reply #21 on: September 02, 2006, 02:36:16 pm »

check this file :include/media.functions.inc.php
and re-upload it
Logged
‍I don't answer to PM with support question
Please post your issue to related board

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #22 on: September 02, 2006, 02:57:51 pm »

check this file :include/media.functions.inc.php
and re-upload it

I actually tried that, didn't work.

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Email images to your gallery
« Reply #23 on: September 02, 2006, 05:20:12 pm »

I don't see any differences between 1.4.8 ver and 1.4.9 version of thoes files !
Logged
‍I don't answer to PM with support question
Please post your issue to related board

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #24 on: September 02, 2006, 05:40:22 pm »

Yeah, thanks for looking into it.  Something is definitely wrong.  I just tried to edit an image and nothing happens (blank output).  I've never used the edit feature before, so I don't know what to compare it to. 

But it also needs picmgmt.inc.php .... more troubleshooting.

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #25 on: September 03, 2006, 12:44:28 pm »

Nothing broke - didn't modify case 'anycontent?' in index.php  ::)

lhenke

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Email images to your gallery
« Reply #26 on: September 05, 2006, 07:54:23 pm »

Hello!

I have tried to install this function, but without any luck.

I created a folder within the album directory, chmod the folder to 777.
I have a mailbox for the incoming files, and have put the information needed to the newcam.php, such as mail host, username, password, gallery #, and album paths..
In the index.php I changed the case for anycontent to anycontent1.php, this is the file I uploaded to my webserver.
In the settings for cpg I changed in the albumlist to anycontent1.

When I send mms to the mailbox I see that the files are there, but nothing happends in the gallery.
It seems like the script doesnt check the mailbox, is there any way I can debug this or anyone have a clue what I have missed :) .

I'm runnig cpg149..

Best Regards.
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #27 on: September 06, 2006, 09:48:25 am »

With the exception of your email password, show me every snippet of code (that you modified or otherwise) and I should be able to tell you where it's gone wrong. 

Reagarding anycontent - if you don't currently use anycontent, you can simply change the filename to anycontent.php and configure/add accordingly.  I only changed the name so novices wouldn't overwrite their current anycontent.php file.  So, you may want to undo your changes to index.php, change the name of anycontent1.php to anycontent.php and start from scratch there.

lhenke

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Email images to your gallery
« Reply #28 on: September 06, 2006, 03:03:16 pm »

Hey!

I fixed it, I debuged newcam.php and the script connected to the mailbox and read the message but didnt find the attachment, and I dont know if there is a diffrent in mms settings for providers in Europe / US ?
Cause the mms I tried to send was attached and the script was looking for inside (disposition) so I had to modify the script to check for both type's of attachment, so now its working :D

//H
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #29 on: September 06, 2006, 09:54:40 pm »

I'm glad you got it working.  Most don't return once they have it working - thanks for the feedback, it may help others.

jahumphr

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Email images to your gallery
« Reply #30 on: November 26, 2006, 07:49:56 am »

I get this error....any ideas?

can't connect: Certificate failure for kycities.com: self signed certificate: /C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=localhost.localdomain/emailAddress=root@localhost

newcam.php:

<?php

define('IN_COPPERMINE', true);

require('include/picmgmt.inc.php');

require_once("attachmentread.class.php");

$host="{kycities.com:110/pop3}"; // pop3host

$login="pix"; //pop3 login

$password="*****"; //pop3 password

$filepath=$_SERVER["DOCUMENT_ROOT"]."/albums/pix/";  ; // attachement will save in same directory where scripts run, otherwise give abs path

$album="81"; // album id #

$folder = "pix/"; // foldername with a /

$jk=new readattachment(); // Creating instance of class####

$jk->getdata($host,$login,$password,$filepath,$album,$folder); // calling member function

?>
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #31 on: November 26, 2006, 01:29:53 pm »

You need to ensure that kycities email box will support this method.  Also, double check that host address, most will be something like pop.kycities.com ... for the pop3 connect.

jahumphr

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Email images to your gallery
« Reply #32 on: November 28, 2006, 02:16:33 am »

I had to modify newcam.php to get it to work.

$host="{mail.kycities.com:110/pop3/novalidate-cert}"; // pop3host

It is working now via email but when I use MMS it deletes the email but does not copy the attached pic to the /pix folder and does not post to the gallery. Could this be because of the attached txt file also?

Also I am able to upload a .3gp(quicktime) video file via email but it will not play. If i download the same video from the email it plays on my pc. When i ftp the same file from the /pix directory to my pc it will not play....any ideas.

Logged

jahumphr

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Email images to your gallery
« Reply #33 on: November 28, 2006, 03:16:48 am »

I left off the fact that if you dont include a subject and some text in the body the email attachment will not post.
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #34 on: November 28, 2006, 12:01:58 pm »

It is working now via email but when I use MMS it deletes the email but does not copy the attached pic to the /pix folder and does not post to the gallery. Could this be because of the attached txt file also?
No idea, works from my cellphone.  Don't think it's because of the text file because I can easily attach two items to my email and it works. Again, could be the email client and how they process incoming messages.

Also I am able to upload a .3gp(quicktime) video file via email but it will not play. If i download the same video from the email it plays on my pc. When i ftp the same file from the /pix directory to my pc it will not play....any ideas.
Beyond the scope of this mod.  That's a Coppermine config problem - search the boards, there's info on 3gp's out there.

I left off the fact that if you dont include a subject and some text in the body the email attachment will not post
I send pictures without subject AND body text all the time.  Once again, you may want to try a different email host ('novalidate-cert' - no idea what that is, but could be part of your problem).

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #35 on: January 02, 2007, 09:22:20 pm »

I apologize if some have sent emails to test, I use the site as a test platform and I inadvertantly removed the anycontent file associated with this mod.

Back on & works again.  Sorry 'bout that.

zapakh

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 11
Re: Email images to your gallery
« Reply #36 on: January 11, 2007, 01:47:07 am »

Hey!

I fixed it, I debuged newcam.php and the script connected to the mailbox and read the message but didnt find the attachment, and I dont know if there is a diffrent in mms settings for providers in Europe / US ?
Cause the mms I tried to send was attached and the script was looking for inside (disposition) so I had to modify the script to check for both type's of attachment, so now its working :D

//H

I think I encountered the same difficulty.  In attachmentreadclass.php I modified

Code: [Select]
if($part->disposition == "ATTACHMENT")
to read

Code: [Select]
if($part->disposition == "ATTACHMENT" || $part->disposition == "INLINE")
Thereafter, I could MMS-email from my phone and have the images show up.

Great mod!
Logged

zapakh

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 11
Re: Email images to your gallery
« Reply #37 on: January 11, 2007, 04:26:18 am »

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
As an example of something similar, I have modified my copy of the script to add a Title to the image from the Subject of the email, if one is provided.

In attachmentread.class.php, just after
Code: [Select]
        for ($jk = 1; $jk <= imap_num_msg($mbox); $jk++)
        {
insert the lines
Code: [Select]
        $headerinfo = imap_header($mbox, $jk);
        $subject = $headerinfo->Subject;

Also in attachmentread.class.php, later on, alter the line
Code: [Select]
                        add_picture($album, $folder, $filename);
so that it looks like
Code: [Select]
                        add_picture($album, $folder, $filename, 0, $subject);
The 0 argument is the default value for the $position argument of add_picture().

One additional issue... In sending MMS from my cell phone, the resulting emails would have a subject line like
Code: [Select]
Subject: =?utf-8?B?Rmxvd2VycyE=?=

which apparently means it has encoded a utf-8 encoded subject using base64.  I worked around this by inserting an ugly hack consisting of the following lines just below the $headerinfo->Subject bit:

Code: [Select]
                        $matches = array();
                        if (preg_match('/^=\?[^?]*\?B\?(.*)\?=/m', $subject, $matches))
                                $subject = base64_decode($matches[1]);

This resulted in the desired behavior for this specific case, but does anyone know the Right Way to make sense of such a subject line in PHP?

Logged

zapakh

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 11
Re: Email images to your gallery
« Reply #38 on: January 11, 2007, 08:35:14 pm »

I was testing the email functionality from a friend's cell phone, using a different wireless provider, and the pictures failed to show up in the gallery.

I inspected the emails that were arriving gallery-side, and discovered that through this particular phone/service/gateway configuration, those emails were arriving without any Content-Disposition headers to be seen.  This is doubly bad because the script relies on the existence of a filename attribute on that header.

My solution was to replace

Code: [Select]
  if($part->disposition == "ATTACHMENT")
  {
  ...
  $params = $part->dparameters;
  $filename=$part->dparameters[0]->value;

with

Code: [Select]
  if(TRUE)
  {
  ...
                if ($part->ifdparameters)
                  foreach($part->dparameters as $dparam)
                    if (strtolower($dparam->attribute) == 'filename') $filename = $dparam->value;
                if (empty($filename))
                  if ($part->ifparameters)
                    foreach($part->parameters as $param)
                      if (strtolower($param->attribute) == 'name') $filename = $param->value;
                if (empty($filename)) $filename = 'nfn' . rand() . '.' . strtolower($part->subtype);

This snippet looks for a 'filename' attribute on Content-Disposition, followed by a 'name' attribute on Content-Type, and finally generates a random filename if all else fails.  It corrected my problem.
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #39 on: January 11, 2007, 10:03:58 pm »

zapakh, thanks much for all the refinements.  I just haven't had a lot of time to detail the code.  Seems you're doing my homework.  I'll look into them later and update the attachments if required ...

Keep it up !
Pages: 1 [2] 3 4 5 6 7   Go Up
 

Page created in 0.026 seconds with 20 queries.