DrupalBin
Submit Code
About
Recent Posts
Views 2 get all field names
32 min 28 sec
ago
Code
1 hour 10 min
ago
How do i make this work in D6 (I have to clear the cache everytime to see the tabs)
4 hours 1 min
ago
Code
4 hours 56 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for overriding favorite nodes links
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
/** * Implementation of hook_links(). */ function favorite_nodes_link($type, $node = null, $teaser = false) { global $user; $links = array(); if ($type == 'node' && !$teaser) { if (variable_get(FAVORITE_NODES_NODE_TYPE . $node->type, 0)) { if (user_access(FAVORITE_NODES_PERM_ADD)) { if (!_favorite_nodes_check($node->nid)) { $links[] = array('title' => t('add to favorites'), 'href' => 'favorite_nodes/add/'. $node->nid, 'class' => 'fav'); } else { if (user_access(FAVORITE_NODES_PERM_VIEW)) { $links[] = array('title' => t('in favorites')); $links[] = array('title' => t('remove from favorites'), 'href' => 'favorite_nodes/delete/'. $node->nid); } } } } } return $links; }
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.