News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Help with $message [body]

Started by LA-GUERRA, February 21, 2010, 11:47:45 PM

Previous topic - Next topic

LA-GUERRA

Well, I have a small problem with $message [body], I was told this is the variable that is used to call the content of the message that express the user (and already comprovar) I want to do is that all messages from the forum all users have the same content (an experiment), how can I get that??? the code is as follows and is in display.php

$output = array(
      'attachment' => loadAttachmentContext($message['id_msg']),
      'alternate' => $counter % 2,
      'id' => $message['id_msg'],
      'href' => $scripturl . '?topic=' . $topic . '.msg' . $message['id_msg'] . '#msg' . $message['id_msg'],
      'link' => '<a href="' . $scripturl . '?topic=' . $topic . '.msg' . $message['id_msg'] . '#msg' . $message['id_msg'] . '" rel="nofollow">' . $message['subject'] . '</a>',
      'member' => &$memberContext[$message['id_member']],
      'icon' => $message['icon'],
      'icon_url' => $settings[$context['icon_sources'][$message['icon']]] . '/post/' . $message['icon'] . '.gif',
      'subject' => $message['subject'],
      'time' => timeformat($message['poster_time']),
      'timestamp' => forum_time(true, $message['poster_time']),
      'counter' => $counter,
      'modified' => array(
         'time' => timeformat($message['modified_time']),
         'timestamp' => forum_time(true, $message['modified_time']),
         'name' => $message['modified_name']
      ),
             'body' => $message['body'],
      'new' => empty($message['is_read']),
      'approved' => $message['approved'],
      'first_new' => isset($context['start_from']) && $context['start_from'] == $counter,
      'can_approve' => !$message['approved'] && $context['can_approve'],
      'can_unapprove' => $message['approved'] && $context['can_approve'],
      'can_modify' => (!$context['is_locked'] || allowedTo('moderate_board')) && (allowedTo('modify_any') || (allowedTo('modify_replies') && $context['user']['started']) || (allowedTo('modify_own') && $message['id_member'] == $user_info['id'] && (empty($modSettings['edit_disable_time']) || !$message['approved'] || $message['poster_time'] + $modSettings['edit_disable_time'] * 60 > time()))),
      'can_remove' => allowedTo('delete_any') || (allowedTo('delete_replies') && $context['user']['started']) || (allowedTo('delete_own') && $message['id_member'] == $user_info['id'] && (empty($modSettings['edit_disable_time']) || $message['poster_time'] + $modSettings['edit_disable_time'] * 60 > time())),
      'can_see_ip' => allowedTo('moderate_forum') || ($message['id_member'] == $user_info['id'] && !empty($user_info['id'])),
   );


now, there is a line that if we remove "body" appears to me all the post message ARRAY (or something) and I want to display "Hola que tal"

the line is the following:
'body' => $message['body']
if I edit it this way:
'body' => $message[' ']
I get ARRAY (or something)

I hope I've explained.

Thanks for your help ....

Oldiesmann

Replace 'body' => $message['body'], with this:

'body' => 'Whatever text you want displayed',

Change the text to whatever you want :)
Michael Eshom
Christian Metal Fans

Advertisement: