Attached you'll find a patch that adds an optional forward block that allows to forward pages.
The advantage is that you can forward pages which aren't nodes and that you can benefit from general block configuration options.

Comments

mkalkbrenner’s picture

StatusFileSize
new8.6 KB

I improved my patch a little. Now the block takes care about 'access forward' permission. I also added the possibility to hide the forward link from a node's view. So in my case I can configure to only show the forward block in general and an additional forward link on teasers.

I also added a FIXME comment to forward_link() because there's some dead code which could never run. I also tweaked an if statement there in this context. Because if you plan to support other types than 'node' and 'comment', variable_get('forward_display_'. $node->type, '1') will create an incomplete variable named 'forward_display_'.

BTW it looks like a hack to use hook_help to show forward links on non node pages ;-)

eyecon-1’s picture

@dch.tips-q.com forward]# patch -p0 <patch
patching file forward.module
Hunk #2 FAILED at 345.
Hunk #3 succeeded at 808 (offset 73 lines).
Hunk #4 succeeded at 954 (offset 7 lines).
1 out of 4 hunks FAILED -- saving rejects to file forward.module.rej

Rejects:

***************
*** 338,344 ****
  function forward_page() {
    //print '<pre>'.print_r(menu_get_menu(),1).'</pre>'; exit;
    $nid = NULL;
-   
    if (empty($_GET['path']) || ($_GET['path'] == 'node/0')) {
      return 'No path was selected to forward';
    }
--- 345,351 ----
  function forward_page() {
    //print '<pre>'.print_r(menu_get_menu(),1).'</pre>'; exit;
    $nid = NULL;
+ 
    if (empty($_GET['path']) || ($_GET['path'] == 'node/0')) {
      return 'No path was selected to forward';
    }
mkalkbrenner’s picture

StatusFileSize
new8.37 KB

Here's the patch adjusted to forward 6.x-1.5 2009-May-27.

eyecon-1’s picture

Thank you very much for your contribution.

That patch works.

One suggestion: Honor the form/link option. As coded, it is link only which means that the user leaves the content page.

Thanks again.

seanr’s picture

Status: Needs review » Closed (duplicate)

This is a duplicate of #93499: Patch to add "Email This Page" Block

Can we move the discussion over there and try to get one combined patch that addresses everyone's needs? Then I'll test it and get it committed. Sorry for being slow to respond to these two issues, I've been fairly busy and don;t have a need for this issue myself so it's slipped off the radar a bit.

joachim’s picture

> BTW it looks like a hack to use hook_help to show forward links on non node pages ;-)
Agreed.

Subscribing so I can test this patch when I get a spare moment.