Does this also work for 4.5 or is it currently ported?

Comments

crunchywelch’s picture

Assigned: Unassigned » crunchywelch
StatusFileSize
new12.18 KB

Here is a patch that:

- Ports to drupal 4.5
- Removes use of cookies for the referring page value and places it in a hidden field
- Uses $_SERVER['HTTP_REFERER'] if no node id is supplied to allow emailing of any page
- Detects posts to the module from a site other than the one in $base_url to prevent someone trying to use this as a mail relay
- Minor wording updates to settings page

Thanks for the work!

daniel read’s picture

Does anyone have a fully patched emailpage.module file that they can upload or email to me? I get hunk errors applying this diff file. I would love to have a version of this module that works for 4.5.

Or perhaps someone could open up public CVS access for this module, as other modules have?

Thanks,
Dan Read

daniel read’s picture

Disregard my previous post. I found the patched file here:

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/emailpage/

It seems the CVS repository is open. I had thought otherwise because there was not a link on the module's page. I grabbed the emailpage.module file and it's working great on 4.5.

Thanks again for this port.

Daniel Read

mikeryan’s picture

StatusFileSize
new7.75 KB

Daniel, the latest CVS doesn't have the crunchywelch patch. To hold us over until these changes are consolidated into a 4.5-compatible release, I'm attaching the emailpage.module I'm using at the moment. It includes:

  1. The cruncywelch patch
  2. My patch to the permission problem
  3. A quick answer to the 30-char address limit problem (changing the field to 30 chars displayed, allowing 60 characters to be entered)
Ian Ward’s picture

Category: task » bug

I just tried this patched version and first it appears the permissions bug did not get patched in it (i say this because 'admin emailpage' is used in the perm function while 'administer emailpage' is used in the settings funtion. Also when I try using it, when I click on the 'email this page' link from an individual node page I get an error saying "Cross posts are not allowed." Any ideas on what might be happening here?

Ian Ward’s picture

Hi Mike, all,
Taking a closer look it appears that at least some of the patches did not catch on emailpage_0.module. I'm going to try and patch it w/ the above various fixes and see if it is working then...
Ian

Ian Ward’s picture

Sorry, the changes from crunchywelch's patch do appear to have applied to emailpage_0.module, but the permission fix did not.

I believe the problem I was having is related to the cross post prevention on line 69...and in watchdog my own client ip comes up. commenting out the lines works, but then the original purpose/spamming prevention is lost, but also, the module has flood control built in and configurable at /admin/settings/emailpage

Ian Ward’s picture

Right around line 101 I modified the emailpage_success_msg to say this instead

$content.="<p>Success, ".variable_get('emailpage_success_msg', "Success!")."</p>\n\n<p>"."<a href=\"$nodelink\">"."Return to what you were reading."."</a>"."</p>\n\n";

so that instead of just the success message, you also get the return url printed as a hyperlink. I thought this favorable over just getting redirected to the post because the user will wonder whether or not the message was successfully sent. Also, since the success message is on /emailpage you can put custom blocks on there like popular content or also figure out how to do most-emailed posts overall and daily...

basicmagic.net’s picture

Title: Port to 4.5 » Email This Page (or any node) Module for Drupal 4.5.2
StatusFileSize
new2.92 KB

see attached .zip of the email this page module-
hacked up and working nicely for drupal 4.5.2.

you can see it in action- live at http://www.ralphdeluca.com

*vip* please see this recent forum post for all / more info...

http://drupal.org/node/21184

thanks-
vincent

dmclark’s picture

I'm having troube with this in 4.6.

seaneffel’s picture

For dmclark, I was in a similar situation, problems using this module with version 4.6. I was getting a "Page Not Found" error when clicking the email link. I downloaded and installed the new module file (listed a few posts above us) and now it works fine. Maybe that can help you.

Andrzej7’s picture

basicmagic - thanks for a big improvementof the module!

There is a "mail sent thanks" page, the comments a sent with proper link, you can return to the page... and other impovements comparing to original module.

But as usual - there are some possibilities to improve on and on ;-)

In the patches of this module I found a possibility of e new field, that makes a personal comment to the sent e-mail.
http://drupal.org/files/issues/emailpage-note.patch

I can't implement it to the new version of the module - I'm quite new to php ;-( Could you do it?

The second (tweak only)...
The body of e-mail looks like that:

http://www.ralphdeluca.com/

[Your Name] thought you would like to see the above page

Is it possible to change it for that?

thought you would like to see the above page

http://www.ralphdeluca.com/

[Your Name] 

I think this code is responsible for that, but as said - I'm not a programmer

mail($edit['emailpage_addy'], $edit['emailpage_sender']." ".variable_get('emailpage_subject_line', "thought you'd like to see this"), $edit['referer']."\n\n".$edit['emailpage_sender']."\n\n".wordwrap(variable_get('emailpage_message',"someone thought you would like this page\n"), 72), $headers);

I looked for that module a long time, the improvements a very nice and they make the promotion of a site much better. Why is it not in the core Drupal distribution?

Andrzej

darren oh’s picture

Title: Email This Page (or any node) Module for Drupal 4.5.2 » Release for Drupal 4.5.2
darren oh’s picture

Status: Active » Closed (won't fix)

If someone wants CVS access to maintain a Drupal 4.5 branch of this module, contact me directly.