Advertisement:

Author Topic: Help with $message [body]  (Read 860 times)

Offline LA-GUERRA

  • Semi-Newbie
  • *
  • Posts: 47
Help with $message [body]
« on: February 21, 2010, 11:47:45 PM »
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

Code: [Select]
$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:
Code: [Select]
'body' => $message['body']if I edit it this way:
Code: [Select]
'body' => $message[' ']I get ARRAY (or something)

I hope I've explained.

Thanks for your help ....

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,868
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Help with $message [body]
« Reply #1 on: February 22, 2010, 01:10:14 AM »
Replace 'body' => $message['body'], with this:

Code: [Select]
'body' => 'Whatever text you want displayed',
Change the text to whatever you want :)
Michael Eshom
Cincy Space - now open!