A history for the shouts would be very nice.. some of my pageusers ask for it.. :)

Comments

illepic’s picture

Yes, this is something I would to see in the future as well :)

michellepurestock’s picture

Yes we would like that as well. Our users are asking for this as well.

purestock.tv

disterics’s picture

Is this different from having shouts that do not expire?

giorgosk’s picture

Disterics
Yes it is
The module does not have yet a page to display OLD shouts

----------------------------------------

Here is a quick and dirty hack if anyone is interested
until maintainer decides to include such a feature
(it is badly needed)

It is for the Drupal 6 version but I suppose with a little tweaking it can work for the D5

all following code goes in shoutbox.module

add in shoutbox_menu() right before
return $items;

  $items['shouts'] = array(
    'title' => 'All Shouts',
    'page callback' => 'shoutbox_page_view',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  );

Add this function
(its a slightly modification version of _shoutbox_block_view)

function shoutbox_page_view() {
  global $user;

  // Output the existing shoutbox posts.
  $show_amount = 1000; //number of shouts displayed // this function needs paging
  $shoutbox_ascending = variable_get('shoutbox_ascending', FALSE);
  $shoutbox_posts_data = _shoutbox_display_posts($show_amount);
  $shoutbox_posts .= $shoutbox_posts_data['output'];
  $output .= $shoutbox_posts;


  $default_nick = t('Your Name/Nick');
  $default_msg = t('Enter Message');
  $default_url = t('Your Website URL');

  // Variable needed by javascript code.
  $js_settings = array(
    'showAmount' => $show_amount,
    // Convert to milliseconds.
    'refreshDelay' => (1000 * variable_get('shoutbox_refresh', 0)),
    'ascending' => $shoutbox_ascending,
    'shownAmount' => $shoutbox_posts_data['count'],
    'defaultNick' => $default_nick,
    'defaultMsg' => $default_msg,
    'defaultUrl' => $default_url,
    'refreshPath' => base_path() . 'shoutbox/js/view',
  );

  drupal_add_js(array('shoutbox' => $js_settings), 'setting');
  return theme('shoutbox_page', $output, $title);
}

add this line in function _shoutbox_block_view() right before
return theme('shoutbox_page', $output, $title);

  $output .=  l('All Shouts','shouts');
stella’s picture

Assigned: Unassigned » stella
stella’s picture

Status: Active » Needs review
StatusFileSize
new5.46 KB
new7.36 KB

Try one of the attached patches. They're based on GiorgosK's example above but with paging capabilities and a few corrections.

Cheers,
Stella

michellepurestock’s picture

Hello. Thank you for the patch.

I tried the one for 5x and I get a parse error T_FUNCTION in line 46.

stella’s picture

StatusFileSize
new5.52 KB

I can't reproduce this though it's possible the patch didn't apply cleanly or was corrupted, so I've recreated it and attached it here.

Cheers,
Stella

disterics’s picture

Status: Needs review » Fixed

Code for both 5.x and 6.x is in CVS.

snsace’s picture

I am also trying to add the view history to 5.x 1.1 but this patch results
in failed messages for me. I looked in CVS but not sure what I am doing in CVS.
Until a new stable release is released, I just want to add the view history feature.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.