Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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

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

0 Members and 1 Guest are viewing this topic.

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #40 on: January 17, 2007, 06:37:33 pm »

I'm getting the same error that gizmo was getting:

Fatal error: Call to undefined function: imap_open() i


I thought his mod worked with both IMAP or POP3?
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Email images to your gallery
« Reply #41 on: January 17, 2007, 06:41:39 pm »

check with phpinfo if php on your box has been compiled with the imap library enabled

Nibbler

  • Guest
Re: Email images to your gallery
« Reply #42 on: January 17, 2007, 06:57:56 pm »

The imap extension works for POP3 aswell.
Logged

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #43 on: January 18, 2007, 09:52:23 am »

OK, I got them to fix that imap problem, now I'm getting:

Fatal error: Call to undefined function: is_known_filetype() in /home2/sexin/public_html/forum/gallery2/include/picmgmt.inc.php on line 38
Logged

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #44 on: January 18, 2007, 09:59:59 am »

Here is my newcam.php, BTW:

Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/picmgmt.inc.php');
require_once(
"attachmentread.class.php"); 
$host="{mail.meninshirtandtie.com:110/pop3}"// pop3host 
$login="e-pix@meninshirtandtie.com"//pop3 login 
$password="***********"//pop3 password */
$filepath="/home2/sexin/public_html/forum/gallery2/albums/e-pix/";// attachement will save in same directory where scripts run, otherwise give abs path 
$album="3"// album id #
$folder "e-pix/"// foldername with a /
$jk=new readattachment(); // Creating instance of class#### 
$jk->getdata($host,$login,$password,$filepath,$album,$folder); // calling member function 
?>

Notice, I changed the $filepath a bit, since I wasn't sure what it was asking...  but that should work, huh?

Notice, when I had that path wrong, I got a message about not being able to write ".... path/me.jpg" to the "...../e-pix/" directory..  so, it managed to log in and get the filename from the mailbox... but it didnt clear the mailbox or anything, so I know it at least got that far.
Logged

rphMedia

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

OK, I got them to fix that imap problem, now I'm getting:

Fatal error: Call to undefined function: is_known_filetype() in /home2/sexin/public_html/forum/gallery2/include/picmgmt.inc.php on line 38

For this error, you simply didn't add your anycontent case to index.php.

I would start from scratch - this works out of the box if you follow the directions exactly.

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #46 on: January 18, 2007, 12:09:31 pm »

what do you mean 'add your anycontent case to index.php'  I tried both adding include(webcam.php); to the stock anycontent.php and renaming anycontent1.php to anycontent.php (since I wasn't using it anyway.)

Is there something else I have to do to 'enable' anycontent.php? I've been looking.
Logged

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #47 on: January 18, 2007, 12:20:59 pm »

That should be include("newcam.php"); up there. :)  I have just re-installed this, twice.  :)

I mean, it's just uploading three files, configuring one, and chmodding a directory right?  I'm not saying I didn't miss a step, but that I don't think I know what that step is. :)

Here's pretty much everything I've done:

root path is /home2/sexin/public_html

CFG URL is /forum/gallery2

files uploaded to
/forum/gallery2/anycontent.php (I renamed anycontent1.php)
/forum/gallery2/newcam.php (configured as below)
/forum/gallery2/attachmentread.class.php (didn't modify)

/forum/gallery2/albums/e-pix is chmodded 777

My anycontent.php:

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.8
  $Source$
  $Revision: 3116 $
  $Author: gaugau $
  $Date: 2006-06-08 00:11:54 +0200 (Do, 08 Jun 2006) $
**********************************************/

/**
* Coppermine Photo Gallery 1.4.6 anycontent.php
*
* This file file gets included in the index.php if you set the option in admin
* can be used to display any content from any program, it is always to be edited
* according to tastes and then used
*
* @copyright 2002,2005 Gregory DEMAR, Coppermine Dev Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License V2
* @package Coppermine
* @version $Id: anycontent.php 3116 2006-06-07 22:11:54Z gaugau $
*/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
include(
"newcam.php");
?>



My newcam.php:

Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/picmgmt.inc.php');
require_once(
"attachmentread.class.php"); 
$host="{mail.meninshirtandtie.com:110/pop3}"// pop3host 
$login="e-pix@meninshirtandtie.com"//pop3 login 
$password="**************"//pop3 password */
$filepath="/home2/sexin/public_html/forum/gallery2/albums/e-pix/";// attachement will save in same directory where scripts run, otherwise give abs path 
$album="3"// album id #
$folder "e-pix/"// foldername with a /
$jk=new readattachment(); // Creating instance of class#### 
$jk->getdata($host,$login,$password,$filepath,$album,$folder); // calling member function 
?>

no other files were altered.


Thanks so much, BTW!  :)
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Email images to your gallery
« Reply #48 on: January 18, 2007, 12:40:37 pm »

Not too sure about the absolute server path ($filepath) - may want to revert to original.

Have you included the anycontent via your Admin Config?

breadcrumb/anycontent/alblist/catlist......

And make sure that your attachment (for starters) is a non-progressive .jpg file, then troubleshoot other file-types from there.

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #49 on: January 18, 2007, 12:51:56 pm »

Have you included the anycontent via your Admin Config?

breadcrumb/anycontent/alblist/catlist......

Nope.  I've been looking for ANY information on this anycontent.php file ...  All I see is hwo to back it up.  I don't see anything about it on the admin config at all.  I even 'expanded all' and did a search for anycontent... nothing.
Logged

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #50 on: January 18, 2007, 12:56:35 pm »

Nope.  I've been looking for ANY information on this anycontent.php file ...  All I see is hwo to back it up.  I don't see anything about it on the admin config at all.  I even 'expanded all' and did a search for anycontent... nothing.

Aha!  I did a search for breadcrumb/ and found where it was missing.  How is a newbie supposed to know that?! Damn, y'all are makin' me WORK. :)
Logged

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #51 on: January 18, 2007, 12:58:26 pm »

hot diggity that worked!   (I wish this forum let us edit our previous posts.... I hate to keep posting like this)
Logged

rphMedia

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

How is a newbie supposed to know that?! Damn, y'all are makin' me WORK. :)

It's in the documentation.  It's a good read if you get time  ;)

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #53 on: January 18, 2007, 01:41:59 pm »

I promised I read.  Promised.  Well, I was looking for 'anycontent.php'

 I didnt know what that meant until you said "breadcrumb/anycontent/alblist/catlist......"

It might be obvious to someone who has been using this for a while... but I had NO CLUE what that meant. :)
Logged

zapakh

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 11
Re: Email images to your gallery
« Reply #54 on: January 18, 2007, 03:54:18 pm »

Confidentially, it took me a little too long to find the meaning of "anycontent" as well, as I found this thread very early in my Coppermine experience.  My fellow newbies might fare better if given the hint "Admin, Config, Album list view".
Logged

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #55 on: January 18, 2007, 06:27:45 pm »

hmm. i spoke too soon.  I was able to get it to work one time.  Subsequent pictures are being removed from the mailbox, but not posted.  The one that worked was sent via my gmail account.  The ones that have not worked were sent via MMS message from my phone.

I'm gonna cry if this isn't going to work. I was THRILLED at the idea of being able to post photos from my phone. Grrrrr
Logged

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #56 on: January 18, 2007, 06:30:39 pm »

will try things previous posted on here.  (again, why cant we edit our own posts here?)
Logged

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #57 on: January 18, 2007, 06:54:32 pm »

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.

Could you be a little clearer with your replacement?  I'm not sure if I got it right or not...

mine before...

Code: [Select]
  if($part->disposition == "ATTACHMENT")
{
    $message["type"][$i] = $message["attachment"]["type"][$part->type] . "/" . strtolower($part->subtype);
$message["subtype"][$i] = strtolower($part->subtype);
$ext=$part->subtype;
$params = $part->dparameters;
$filename=$part->dparameters[0]->value;

        $mege="";
$data="";
  $mege = imap_fetchbody($mbox,$jk,$fpos); 
$fp=fopen($filepath . $filename,w);
$data=$this->getdecodevalue($mege,$part->type);

fputs($fp,$data);
fclose($fp);
add_picture($album, $folder, $filename, 0, $subject);
$fpos+=1;

and after

Code: [Select]
if(TRUE)
{
    $message["type"][$i] = $message["attachment"]["type"][$part->type] . "/" . strtolower($part->subtype);
$message["subtype"][$i] = strtolower($part->subtype);
$ext=$part->subtype;
                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);
$params = $part->dparameters;
$filename=$part->dparameters[0]->value;

        $mege="";
$data="";
  $mege = imap_fetchbody($mbox,$jk,$fpos); 
$fp=fopen($filepath . $filename,w);
$data=$this->getdecodevalue($mege,$part->type);

fputs($fp,$data);
fclose($fp);
add_picture($album, $folder, $filename, 0, $subject);
$fpos+=1;
Logged

zapakh

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 11
Re: Email images to your gallery
« Reply #58 on: January 18, 2007, 07:29:30 pm »

This is what I intended, except that you should also remove the two lines that say
Code: [Select]
$params = $part->dparameters;
$filename=$part->dparameters[0]->value;
immediately after the edited portion.

The $params line is harmless, but the $filename line would result in MMS-originated photos failing to appear for one of the wireless providers I tested, because the dparameter it's looking for may fail to exist, and we can't write to a file that doesn't have a name.

Not all wireless providers have been tested.  If pictures continue to fail to appear, it might be helpful to see the email headers you get when MMSing a photo to yourself.
Logged

nolageek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Email images to your gallery
« Reply #59 on: January 18, 2007, 09:51:52 pm »

This is driving me crazy!  This is compounded on with the fact that my internet got cut off last night, so I wont be able to test this anymore after I leave the coffee shop.


Here's the result of my experiments:

If I MMS it directly to the e-mail address on my domain, it doesn't work.  newcam.php runs, the file is removed from the mailbox but doesn't get copied to the directory nor appear in the gallery.

If I MMS it directly to my gmail account, then forward it via a FILTER to my domain's email address, not only it doesn't work but the message never gets forwarded. (does my domain block server-level forwards?)

If I MMS it directly to my gmail account, then forward it MANUALLY, it works just fine.

If I MMS is directly to a forward rule on my domain, to gmail FILTER to e-mail address on my domain, it doesn't work.  newcam.php runs, the file is removed from the mailbox but doesn't get copied to the directory nor appear in the gallery.

Can't connect to gmail directly.
Logged
Pages: 1 2 [3] 4 5 6 7   Go Up
 

Page created in 0.068 seconds with 20 queries.