You are here

function shoutbox_js_view in Shoutbox 6.2

Same name and namespace in other branches
  1. 5 shoutbox.module \shoutbox_js_view()
  2. 6 shoutbox.module \shoutbox_js_view()
  3. 7.2 shoutbox.module \shoutbox_js_view()
  4. 7 shoutbox.module \shoutbox_js_view()

Javascript callback. Prints out shouts only.

3 calls to shoutbox_js_view()
shoutbox_group_js_view in shoutbox_group/shoutbox_group.module
Javascript callback to handle auto-update shouts
shoutbox_tags_js_view in shoutbox_tags/shoutbox_tags.module
Javascript callback for viewing shouts for a given tag
shoutbox_user_js_view in shoutbox_user/shoutbox_user.module
Javascript callback for viewing shouts for a given tag
1 string reference to 'shoutbox_js_view'
shoutbox_menu in ./shoutbox.module
Implementation of hook_menu().

File

./shoutbox.module, line 169
Shout box module displays a block for users to create short messages for the whole site. Uses AHAH to update the database and display content.

Code

function shoutbox_js_view() {

  // Determine the amount of shouts based on the mode
  switch ($_GET['mode']) {
    case 'page':
      $show_amount = variable_get('shoutbox_showamount_page', '30');
      break;
    case 'block':
    default:
      $show_amount = variable_get('shoutbox_showamount_block', '10');
      break;
  }
  $shoutbox_posts_data = shoutbox_display_posts($show_amount, FALSE);
  $output = theme('table', NULL, $shoutbox_posts_data['rows']);
  return drupal_json(array(
    'success' => TRUE,
    'data' => $output,
  ));
}