Guest User

Untitled

a guest
Jul 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. function assistant_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  2. switch ($op) {
  3. case 'prepare':
  4. // Planet Harmony is very specific in that users can only
  5. // create 1 group. So, when a group node is being added to the
  6. // site, then we need to make that check here.
  7. global $user;
  8. if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'og-group') {
  9. $check = db_result(db_query("SELECT COUNT(nid) FROM {node} WHERE uid = %d AND type = '%s'", $user->uid, 'og_group'));
  10. if ($check) {
  11. drupal_set_message('Planet Harmony only allows a member to be the administrator of 1 group at a time.');
  12. drupal_goto('profile/'. $user->uid);
  13. }
  14. }
  15. break;
  16. case 'view':
  17. if ($node->type != 'page') {
  18. $node->content['sharethis_sharethis_this']['#value'] = '<div class="node-landing-gray-info sharethis">'. $node->content['sharethis_sharethis_this']['#value'] .'</div>';
  19. $node->content['fivestar_widget']['#value'] = '<div class="node-landing-gray-info fivestar">'. $node->content['fivestar_widget']['#value'] .'</div>';
  20. }
  21. break;
  22. }
  23. }
Add Comment
Please, Sign In to add comment