Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/01/2008 04:03:12 AM (17 years ago)
Author:
apeatling
Message:
  • Moved all components to use the new $bp global. This replaces the mush of BuddyPress specific globals and now uses a specific function in each component to set any globals.
  • Moved all avatar functionality into the core component. This is in anticipation of group avatars.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-ajax.php

    r195 r251  
    22
    33function messages_ajax_send_reply() {
    4     global $bp_messages_image_base;
     4    global $bp;
    55   
    66    check_ajax_referer('messages_sendreply');
     7   
     8    if ( !$bp ) {
     9        bp_core_setup_globals();
     10        messages_setup_globals();
     11    }
    712
    813    $result = messages_send_message($_REQUEST['send_to'], $_REQUEST['subject'], $_REQUEST['content'], $_REQUEST['thread_id'], true, false, true);
     
    1015    if ( $result['status'] ) { ?>
    1116            <div class="avatar-box">
    12                 <?php if ( function_exists('xprofile_get_avatar') )
    13                     echo xprofile_get_avatar($result['reply']->sender_id, 1);
     17                <?php if ( function_exists('core_get_avatar') )
     18                    echo core_get_avatar($result['reply']->sender_id, 1);
    1419                ?>
    1520   
     
    2126        <?php
    2227    } else {
    23         $result['message'] = '<img src="' . $bp_messages_image_base . '/warning.gif" alt="Warning" /> &nbsp;' . $result['message'];
     28        $result['message'] = '<img src="' . $bp['messages']['image_base'] . '/warning.gif" alt="Warning" /> &nbsp;' . $result['message'];
    2429        echo "-1|" . $result['message'];
    2530    }
     
    2833
    2934function messages_ajax_markunread() {
     35    global $bp;
     36   
     37    if ( !$bp ) {
     38        bp_core_setup_globals();
     39        messages_setup_globals();
     40    }
     41   
    3042    if ( !isset($_POST['thread_ids']) ) {
    3143        echo "-1|" . __('There was a problem marking messages as unread.');
     
    4153
    4254function messages_ajax_markread() {
     55    global $bp;
     56   
     57    if ( !$bp ) {
     58        bp_core_setup_globals();
     59        messages_setup_globals();
     60    }
     61   
    4362    if ( !isset($_POST['thread_ids']) ) {
    4463        echo "-1|" . __('There was a problem marking messages as read.');
     
    5473
    5574function messages_ajax_delete() {
     75    global $bp;
     76   
     77    if ( !$bp ) {
     78        bp_core_setup_globals();
     79        messages_setup_globals();
     80    }
     81   
    5682    if ( !isset($_POST['thread_ids']) ) {
    5783        echo "-1|" . __('There was a problem deleting messages.');
Note: See TracChangeset for help on using the changeset viewer.