BP-Album+ link to the album picture

Hi,

I use BP Album Rotate to show random pictures on the home page. At the moment they are without a link. So, how can I have a link to the actual picture from the member album?

Thanks!

  • Timothy
    • Chief Pigeon

    Have you approached the plugin developers?

    I downloaded the Album+ plugin and installed it to take a nosey but I don’t see this “rotate” option, is it another plugin or widget to extend? or is it in the plugin and if so then where is it located?

    #EDIT As Mason said. :slight_smile:

  • Timothy
    • Chief Pigeon

    /blogs-mu/functions.php

    Around line 206:

    /// using bp album+ for featured images - buddypress only

    The code following that relates directly to the images. The images in my test install for BP-Albums are broken for some reason and I haven’t investigated the matter yet so I can’t guarantee this will work but the code should look something like the following:

    ///////////////////////////////////////////////////////////////////////////////////
    /// using bp album+ for featured images - buddypress only
    ///////////////////////////////////////////////////////////////////////////////////
    function bp_album_featured_images_gallery() {
    global $wpdb;
    $uploads = wp_upload_dir();
    $bp_album_feat_img = $wpdb->get_results("SELECT * FROM " . $wpdb->base_prefix . "bp_album WHERE privacy = '0' ORDER BY RAND() ASC LIMIT 1");
    if($bp_album_feat_img) {
    foreach($bp_album_feat_img as $myalbum ) {
    if ( bp_core_is_multisite() ) { ?>
    <a href="<?php echo WP_CONTENT_URL . '/blogs.dir/' . $myalbum->owner_id . $myalbum->pic_mid_url; ?>"><img src="<?php echo WP_CONTENT_URL . '/blogs.dir/' . $myalbum->owner_id . $myalbum->pic_mid_url; ?>" /></a>
    <?php } else { ?>
    <a href="<?php echo site_url() . $myalbum->pic_mid_url; ?>"><img src="<?php echo site_url() . $myalbum->pic_mid_url; ?>" /></a>
    <?php } ?>
    <?php } }
    }

    Its the actual links part I’m not sure about because as I mentioned the images appear broke on my install. :slight_smile:

  • Mason
    • DEV MAN’s Sidekick

    Hiya crotariu,

    You’re most likely looking at a custom job for this. I’ll ask Richie to drop by, but this isn’t part of what the theme is meant to do – a custom solution should be easy to develop and Tim’s provided ya a link to the Job Boards.

    Thanks!

  • dyrect
    • Flash Drive

    I found the solution to the issue, I looked at the code in functions.php and the url that the bp-album rotate was getting and it didnt have the right path. I took out . ‘/blogs.dir/’, and it fixed the path to the images in album. Hope this helps someone.

    ///////////////////////////////////////////////////////////////////////////////////

    /// using bp album+ for featured images – buddypress only

    ///////////////////////////////////////////////////////////////////////////////////

    ……..

    <img src=”<?php echo WP_CONTENT_URL . ‘/blogs.dir/’ . $myalbum->owner_id .

    ……….

    (changed to)

    ///////////////////////////////////////////////////////////////////////////////////

    /// using bp album+ for featured images – buddypress only

    ///////////////////////////////////////////////////////////////////////////////////

    ……..

    <img src=”<?php echo WP_CONTENT_URL . $myalbum->owner_id .

    ……….