forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Ecards & Email => Topic started by: Sikes on June 11, 2004, 05:52:50 am

Title: ECard - sender's email missing on web display
Post by: Sikes on June 11, 2004, 05:52:50 am
Something happened to the e-card form between the last beta and the release. The senders email address field is missing, making it impossible to send an e-card.  I tried several skins including Hardwired, Default and Classic and it seems to be the same all around.

Can anybody else confirm this?
Title: Re: E-Cards broken in release build
Post by: djboxny on June 11, 2004, 07:22:31 am
Well is your Gallery Intergrated with a BB.  Cuz if it is then only registered users can send e-cards unless u did some configuration to the access right.  Try Log in and sending a E- card to your self.  then try loggin out and doing the same thing then post your results here
Title: Re: E-Cards broken in release build
Post by: djboxny on June 11, 2004, 07:34:51 am
DId a little research my self and found out that since my gallery and my board are integrated Unregistered users are not allow to send e-cards so since only registered users are allow and if you are logged in then when u wanna send a e-card the gallery alreay has your E-mail.   THOSE the senders e-mail thingy is dashed OUT.


Hope this was helpfull

Also to fix this go to Gruops and change permtion for unregistered users if u want them to be able to send e-cards
Title: Re: E-Cards broken in release build
Post by: Ernst on June 11, 2004, 04:02:04 pm
Hey,

i use the hardwired theme (cpg 1.3.0 upgraded from cpg 1.2.1). When i try to send an ecard i can't fill in the "Your email address' field, because there is no textfield for it. Next when i try to click "Send an e-card", the following is displayed: "Warning : invalid email address !"  (off course).

Where can i fix this issue? thnx in advance

btw there are some nice functions in cpg1.3.0! congratz... keep up the good work!!
Title: Re: E-Cards broken in release build
Post by: Casper on June 11, 2004, 05:54:46 pm
This is not due to the themes.
It happens when the database has no email address for the sender.  That will be the admin who set up the site, and any users created by the admin with no email address input.
To get it to work for you, you can use your db tool to input your email address, or use another admin account to edit your original.
Title: Re: E-Cards broken in release build
Post by: Nibbler on June 11, 2004, 06:35:37 pm
Looks like this was broken by some other change...

Fix for this:

*fix removed, seems to have undesirable side effects*
Title: Re: E-Cards broken in release build
Post by: Sikes on June 11, 2004, 07:36:51 pm
Looks like this was broken by some other change...

Thanks, I knew something was wrong because it was definitely working before. I'll try it out tonight.
Title: Re: E-Cards broken in release build
Post by: FuguTabetai on June 11, 2004, 11:00:38 pm
Looks like this was broken by some other change...

Fix for this:

Open /includes/init.inc.php

Underneath

udb_authenticate();

add

$USER_DATA = array_merge($USER_DATA,udb_get_user_infos(USER_ID));

This did not entirely fix the problem for me.  I applied this change, and also had to modify my ecard.php from:

Code: [Select]
if (USER_ID){
$sender_email = $USER_DATA['user_email'];
$sender_box = $sender_email;
} else {
$sender_email = get_post_var('sender_email',$USER['email'] ? $USER['email'] : '');
$sender_box = "<input type=\"text\" class=\"textinput\" value=\"$sender_email\" name=\"sender_email\" style=\"WIDTH: 100%;\">";
}

to:

Code: [Select]
if (USER_ID){
$sender_email = get_post_var('sender_email',$USER['email'] ? $USER['email'] : '');
//$sender_email = $USER_DATA['user_email'];
$sender_box = $sender_email;
$sender_box = "<input type=\"text\" class=\"textinput\" value=\"$sender_email\" name=\"sender_email\" style=\"WIDTH: 100%;\">";
} else {
$sender_email = get_post_var('sender_email',$USER['email'] ? $USER['email'] : '');
$sender_box = "<input type=\"text\" class=\"textinput\" value=\"$sender_email\" name=\"sender_email\" style=\"WIDTH: 100%;\">";
}

Basically, when I checked with debug mode on, my user email field was ''.  I guess I should add an email to my account, but ecards should work when the user doesn't have an email on their account.  I haven't checked if ecards work with anonymous people though.
Title: Re: E-Cards broken in release build
Post by: sdstern on June 12, 2004, 12:59:42 am
I added

$USER_DATA = array_merge($USER_DATA,udb_get_user_infos(USER_ID));

as shown above and now the mail gets sent.  But the footer on the email is

 Sent by from IP at

Appears that the values for by and IP are missing

ecard.php contains

 $message .= "Sent by from IP" .$_SERVER["REMOTE_HOST"]." at ".gmstrftime ....

I changed this to

 $message .= "Sent by ".$sender_name." from IP" .$_SERVER["REMOTE_ADDR"]." at ".gmstrftime("%A,  ......
Title: ECard - sender's email missing on web display
Post by: sdstern on June 12, 2004, 01:25:35 am
When I view the ecard as mailed, it shows the sender's name and email


   sender(sender@host.domain)

But when viewed online it shows

    sender()

I checked displayecard.php. The value is supposed to come from the array data, but it's not there. A print_r($data) shows:

Array ( [rn] => steven [sn] => sender[se] => [p] =>

Where is the data array loaded?  It comes into this script from an HTTP variable.
Title: Re: E-Cards broken in release build
Post by: Pacjack on June 12, 2004, 01:36:16 am
Looks like this was broken by some other change...

Fix for this:

Open /includes/init.inc.php

Underneath

udb_authenticate();

add

$USER_DATA = array_merge($USER_DATA,udb_get_user_infos(USER_ID));

This did not entirely fix the problem for me.  I applied this change, and also had to modify my ecard.php from:

Code: [Select]
if (USER_ID){
$sender_email = $USER_DATA['user_email'];
$sender_box = $sender_email;
} else {
$sender_email = get_post_var('sender_email',$USER['email'] ? $USER['email'] : '');
$sender_box = "<input type=\"text\" class=\"textinput\" value=\"$sender_email\" name=\"sender_email\" style=\"WIDTH: 100%;\">";
}

to:

Code: [Select]
if (USER_ID){
$sender_email = get_post_var('sender_email',$USER['email'] ? $USER['email'] : '');
//$sender_email = $USER_DATA['user_email'];
$sender_box = $sender_email;
$sender_box = "<input type=\"text\" class=\"textinput\" value=\"$sender_email\" name=\"sender_email\" style=\"WIDTH: 100%;\">";
} else {
$sender_email = get_post_var('sender_email',$USER['email'] ? $USER['email'] : '');
$sender_box = "<input type=\"text\" class=\"textinput\" value=\"$sender_email\" name=\"sender_email\" style=\"WIDTH: 100%;\">";
}

Basically, when I checked with debug mode on, my user email field was ''.  I guess I should add an email to my account, but ecards should work when the user doesn't have an email on their account.  I haven't checked if ecards work with anonymous people though.

Thanks, now it works ;)


I added

$USER_DATA = array_merge($USER_DATA,udb_get_user_infos(USER_ID));

as shown above and now the mail gets sent.  But the footer on the email is

 Sent by from IP at

Appears that the values for by and IP are missing

ecard.php contains

 $message .= "Sent by from IP" .$_SERVER["REMOTE_HOST"]." at ".gmstrftime ....

I changed this to

 $message .= "Sent by ".$sender_name." from IP" .$_SERVER["REMOTE_ADDR"]." at ".gmstrftime("%A,  ......

Haven't tried this yet, what does it do?
Title: Re: E-Cards broken in release build
Post by: sdstern on June 12, 2004, 04:27:20 am
>> Haven't tried this yet, what does it do? <<

At the bottom of the ecard email, there's a footer (duh!) that's not quite right without this fix. The footer specifies the sender and the IP address of the sender's browser at the time the ecard was sent.
Title: Send an E-Card
Post by: sergiovc on June 12, 2004, 07:54:48 am
When I login as Admin, I tried to send an E-Card, my email doesn't appear and it is not possible enter my email this box called Your email address
When I logout yes I can send an E-Card but I have to enter my email address
When some register user comes to my CPG 1.30 nad login, he/she can send an E-Card and his/her email addres appears automatically.

Is this ok or this is a bugs?

Tell me please.

Thanks
Title: Re: ECard - sender's email missing on web display
Post by: FuguTabetai on June 12, 2004, 03:43:38 pm
Admins / coppermine gurus, is there an official fix for this planned?  Because the workaround that I posted up above is almost positively not the right way to go (completely ignores trying to get the email from a registered user, which must have been there for a good reason...)
Title: Re: ECard - sender's email missing on web display
Post by: Nibbler on June 12, 2004, 04:10:18 pm
OK, forget any changes to init.inc.php, new version of ecard.php is in CVS, and for download here (http://www.ic-gallery.com/ecard.phps).

Box will only display if it cannot get your email address
sender email is encoded into $data properly
url uses config's ecard target link.
footer info corrected.
Title: Re: ECard - sender's email missing on web display
Post by: FuguTabetai on June 12, 2004, 06:08:35 pm
Thanks!  Worked like a charm.
Title: Re: ECard - sender's email missing on web display
Post by: Guardian on June 19, 2004, 11:50:29 am
Thanks! I just replaced the entire contents and it fixed the problem.
Title: Re: [Solved]: ECard - sender's email missing on web display
Post by: williamb on June 20, 2004, 12:20:17 am
Worked great for me too, quick fix.  Thanks!
Title: Re: [Solved]: ECard - sender's email missing on web display
Post by: beni on June 20, 2004, 06:50:50 pm
I have replaced the "ecard.php,v 1.12" file with "ecard.php,v 1.13" file. To send E-Mails everything works fine - but when i receive the mails, the pictures (stamp and gallery-picture) dont appear, only two red cross. :\'(

Tell me please.

Thanks
Title: Re: [Solved]: ECard - sender's email missing on web display
Post by: Joachim Müller on June 20, 2004, 11:57:32 pm
check the html code of the emails you receicve and post here if necessary. You will only see the stamp and other pictures if you read your email online (connected to the internet). Some clever email clients disable having <img>-tags in emails pointing to a http-server, as this technology has been abused in the past by so-called web-bugs. Make sure your email client can handle them as expected, or remove the stamps from the ecard's html code (to be found in themes/yourtheme/theme.php) altogether.

GauGau
Title: Re: [Solved]: ECard - sender's email missing on web display
Post by: beni on June 21, 2004, 08:12:02 pm
I have checked the html code of the emails.

Everywhere in V 1.13 ("missing pictures-version") the directory "Coppermine" dont appear:

V 1.13 <p align="center"><a href="http://www.mindermode.ch/displayecard.php?data=YTo2OntzOjI6InJu
V 1.12 <p align="center"><a href="http://www.mindermode.ch/coppermine/displayecard.php?data=YTo2OntzOj

V 1.13 <img src="http://www.mindermode.ch/albums/userpics/brautmode11skaliert_h400.jpg" border="1" alt="" /><br />
V 1.12 <img src="http://www.mindermode.ch/coppermine/albums/userpics/brautmode11skaliert_h400.jpg" border="1" alt="" /><br />

V 1.13 <div align="right"><img src="http://www.mindermode.ch/images/stamp.gif" alt="" border="0" /></div>
V 1.12 <div align="right"><img src="http://www.mindermode.ch/coppermine/images/stamp.gif" alt="" border="0" /></div>

Thanks for help!

PS At this moment i have installed V 1.13: http://www.mindermode.ch/coppermine
Title: Re: [Solved]: ECard - sender's email missing on web display
Post by: Joachim Müller on June 22, 2004, 07:22:29 am
what do you have in config for "link to ecards"?

GauGau
Title: Re: [Solved]: ECard - sender's email missing on web display
Post by: beni on June 22, 2004, 11:25:33 pm
Hallo

I have replaced in ecard.php the following (line 75 & 76) new code by the old code from ecard.php V 1.12
Now the pictures appears.

Are the new code wrong / incomplete?


Code "create and send the e-card" in ecard.php,v 1.13

Code: [Select]
// Create and send the e-card
if (count($HTTP_POST_VARS) > 0 && $valid_sender_email && $valid_recipient_email) {
    $gallery_url_prefix = $CONFIG['ecards_more_pic_target'] . '/';


Code "create and send the e-card" in ecard.php,v 1.12

Code: [Select]
// Create and send the e-card
if (count($HTTP_POST_VARS) > 0 && $valid_sender_email && $valid_recipient_email) {
    $gallery_dir = strtr(dirname($PHP_SELF), '\\', '/');
$gallery_url_prefix = 'http://' . $HTTP_SERVER_VARS['HTTP_HOST'] . $gallery_dir . (substr($gallery_dir, -1) == '/' ? '' : '/');
Title: Re: [Solved]: ECard - sender's email missing on web display
Post by: Joachim Müller on June 23, 2004, 05:13:55 am
That's what I was suggesting: modify the "Target address for the 'See more pictures' link in e-cards" setting in coppermine config and you should be fine as well, but if your solution works, then go ahead and smile ;)

GauGau
Title: Re: [Solved]: ECard - sender's email missing on web display
Post by: phishpics on August 28, 2004, 07:40:46 pm
THANK YOU!!!


I was racking my brain trying to figure this one out forever!

much aprpeciated!

Craig