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
Comment #1
allie mickaThanks 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
Comment #2
designwork commentedHi 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