Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function assistant_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
- switch ($op) {
- case 'prepare':
- // Planet Harmony is very specific in that users can only
- // create 1 group. So, when a group node is being added to the
- // site, then we need to make that check here.
- global $user;
- if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'og-group') {
- $check = db_result(db_query("SELECT COUNT(nid) FROM {node} WHERE uid = %d AND type = '%s'", $user->uid, 'og_group'));
- if ($check) {
- drupal_set_message('Planet Harmony only allows a member to be the administrator of 1 group at a time.');
- drupal_goto('profile/'. $user->uid);
- }
- }
- break;
- case 'view':
- if ($node->type != 'page') {
- $node->content['sharethis_sharethis_this']['#value'] = '<div class="node-landing-gray-info sharethis">'. $node->content['sharethis_sharethis_this']['#value'] .'</div>';
- $node->content['fivestar_widget']['#value'] = '<div class="node-landing-gray-info fivestar">'. $node->content['fivestar_widget']['#value'] .'</div>';
- }
- break;
- }
- }
Add Comment
Please, Sign In to add comment