BuddyPress Album
[resolved] activity thumb link mod? (2 posts)

  1. deepbevel
    Posted 1 year ago #

    I want to change the link for the activity thumbnail.
    I found this code in bp album core.php

    $content = '<p> <a href="'. $primary_link .'" class="picture-activity-thumb" title="'.$title.'"><img src="'. $image_path .'" /></a>'.$desc.'</p>';

    does this print the html for the activity post thumbnail image?, I'm wondering if there's a way to change it so it prints the link to the image file instead of the in-line view?

    I'm using a lightbox to open bp-album images site wide, it works with the pictures.php and all-images.php, just had to change the a class and link.

    <a href='<?php bp_album_picture_middle_url() ?>' class='fancybox' rel='slideshow' title=' <?php bp_album_picture_title_truncate(50) ?>'><img src='<?php bp_album_picture_thumb_url() ?>' /></a><br />

    I'd like activity thumbnails to open in a lightbox as well. But I don't know that it can work the same way in bp-core.php, I wouldn't know how to write it... I only know it works if I make the class/link adjustment manually for the activity post on the back-end.

    And thanks for this great plugin. So far It's the most flexible of all the bp media plugins I've tried.


  2. deepbevel
    Posted 1 year ago #

    it appears, that purely by trial and error, I have done it!

    In bp-album/includes/bpa.core.php

     * bp_album_record_activity()
     * @version
     * @since
    function bp_album_record_activity($pic_data) {
    	global $bp;
    	if ( !function_exists( 'bp_activity_add' ) || !$bp->album->bp_album_enable_wire) {
    		return false;
    	$id = bp_activity_get_activity_id(array('component'=> $bp->album->id,'item_id' => $pic_data->id));
    	$primary_link =
    bp_core_get_user_domain($pic_data->owner_id) . $bp->album->slug . '/'.$bp->album->single_slug.'/'.$pic_data->id . '/';

    I changed

    bp_core_get_user_domain($pic_data->owner_id) . $bp->album->slug . '/'.$bp->album->single_slug.'/'.$pic_data->id . '/';


    $image_path = bp_get_root_domain().$pic_data->pic_org_url;

    Now, I hope that's all there is to it. I didn't have to add the "fancybox" class, the lightbox worked anyway, to my suprise.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BuddyPress Album
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.