Problems after updating: Media Page not displaying


#1

My users media page isn’t displaying anything after updating. I’ve run the migration which all appears to have gone ok.

Example page for the error is http://www.trashdolls.com/members/Dolly-Trash/media/

Additionally I was using some custom code to display the users 5 most recent images on their main profile page which is now broken. Code is below:

function show_last_n_images($n=5){ 
  
    if(bp_is_my_profile()){ 
  
        $n = $n +1; } 
  
    $query = new BPMediaQuery(); 
  
    $args = $query->init('image',false,$n); 
  
    $q = new WP_Query($args); 
  
    if ($q && $q->have_posts()){ 
  
        echo '
    '; while ($q->have_posts()) : $q->the_post(); $mytemplate = new BPMediaTemplate(); $mytemplate->the_content(); endwhile; echo '
';} }

It errors out because it can’t find the BPMediaQuery() class which I assume has been changed in some way.

Any assistance to either issue would be greatly appreciated.


#2

Hi,
Could you try flushing the permalinks and check. Also check if it works on the default BuddyPress theme.

Regarding your custom code to display the users 5 most recent images on their main profile page, try the following.

function show_last_n_images($n = 5) {  
    if ($user_id = bp_displayed_user_id()) {  
        $model = new RTMediaModel();  
        $results = $model->get(array('media_type' => 'photo', 'media_author' => $user_id), 0, $n);  
        if ($results) {  
            echo '';  
        }  
    }  
}  

#3

I’ve tried flushing my permalinks but it had no effect.

EDIT: Seems you fixed the quoted code.

I now get the images which is great except they are all appearing as the larger 640x640px images rather than the 150x150px thumbnails I previously had displaying.


#4

Try changing “rt_media_thumbnail” to “thumbnail” and see if that works for you.

Did you try switching themes and check if the media gallery works for you?


#5

I tried swapping the theme back to Buddypress default but encountered the exact same issue that nothing loads on the media tab page


#6

Thats strange we would have to check out your site to figure out what the issue must be. Could you mail me the access to your site at joshua.abenazer@rtcamp.com


#7

Just so that it benefits other users. This problem was solved after upgrading BuddyPress to the latest version from BuddyPress 1.6.5


#8

This code does not work anymore. There is an update?


#9