Hi All

I just want to post a new function for the premium Module. A simple hook link that overrides the read_more link if the node is a premium node, so that an anonymus user can the it.

/**
* Implementation of hook_link()    
*/

function premium_link($type, $node = NULL, $teaser = FALSE) {
	$links = array();
   
    if ($type == 'node' && $node->premium) {
	$links['node_read_more'] = array(
          'title' => t('Members only'),
          'href' => 'node/'. $node->nid,
          'attributes' => array('title' => t('Dieser Inhalt ist Members Only'))
        ); 	
    }

    return $links;
}  

Just put it on the end of the module and it works.

Dirk

Comments

allie micka’s picture

Status: Active » Closed (won't fix)

Thanks for this!

You can easily add this hook to a module other than premium and have the same effect. So I'm going to mark this as "won't fix". If you haven't already, perhaps you can post this elsewhere as a handy snippet.

Thanks again,

Allie

designwork’s picture

Hi Allie,

will you use it? I can make a handbook page for this kind of stuff. Do you still are working on premium? Need some help?

Warm regards from Cologne

Dirk