This topic has 7 replies, 2 voices, and was last updated 11 years by SQadmin.

  • Author
  • #6777
     adam
    Participant

    Hello – is there a way to display the “My Photos” (BP-Album) tab even if there aren’t any photos uploaded to the album? I’d like it to show even if it’s empty because I think it will encourage more users to upload additional pictures. maybe it would be possible to include a message like “user hasn’t uploaded additional photos.”?

    #6828
     adam
    Participant

    one work-around could be making the avatar/profile photo automatically appear in the album upon upload. not sure how to make this happen though…

    #6868
     SQadmin
    Keymaster

    Hi,
    You should override the class that handles the bp-Album tab. I will try and give you the code

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #6870
     adam
    Participant

    thank you 🙂

    #6911
     SQadmin
    Keymaster

    You can only replace this class in sweetdate/custom_buddypress/class-bp-tabs.php and change it after each update

    COPY CODE
    
    class BpMembersTab_bp_album extends BpMembersTab 
    {
    	public function __construct($args) {
    		parent::__construct($args);
    	}
    
    	public function title() 
    	{    
    		$active = '';
    		if($this->tabs_instance->active_tab === FALSE || $this->tabs_instance->active_tab == $this->args["name"] ) 
    		{ 
    			$active = 'active';  
    			$this->tabs_instance->active_tab = sanitize_title($this->args["name"]);
    		}
    
    		return '<dd class="sliderEvent '.$active.'"><a href="#'.sanitize_title($this->args["name"]).'">'.$this->args["name"].' <span class="radius label alert">'.bp_album_get_total_picture_count().'</span></a></dd>';
    	}
    
    	public function has_profile_data($name)
    	{
    		global $bp;
    		$save_current_action = $bp->current_action; 
    		$bp->current_action = 'hack-to-show-all-albums';
    
    		if (!function_exists('bp_album_query_pictures')) {
    			return false;
    		}
    
    		bp_album_query_pictures('per_page=100');
    		if ( bp_album_has_pictures() ) :
    
    			
    			$this->tabs_instance->fields_data[$name] = '<div id="gallery-carousel">';
    			while ( bp_album_has_pictures() ) : bp_album_the_picture();
    				$this->tabs_instance->fields_data[$name] .= '<span class="circle">';
    				  $this->tabs_instance->fields_data[$name] .= '<a href="'.bp_album_get_picture_original_url().'" class="imagelink" data-rel="prettyPhoto[gallery2]">';
    					$this->tabs_instance->fields_data[$name] .= '<span class="overlay"></span>';
    					$this->tabs_instance->fields_data[$name] .= '<span class="read"><i class="icon-'. apply_filters('kleo_img_rounded_icon','heart').'"></i></span>';
    					$this->tabs_instance->fields_data[$name] .= '<img src="'.bp_album_get_picture_original_url().'" alt="">';
    				  $this->tabs_instance->fields_data[$name] .= '</a>';
    				$this->tabs_instance->fields_data[$name] .= '</span>';
    			endwhile;
    			$this->tabs_instance->fields_data[$name] .= '</div><!--end #gallery-carousel-->';
    			$this->tabs_instance->fields_data[$name] .= '<div class="clearfix"></div>
    			<div class="four columns centered btn-carousel hide-for-small">
    			  <small><a href="#" id="stanga-prev">'. __("PREVIOUS", 'kleo_framework').'</a>     
    			  <a href="#" id="dreapta-next">'. __("NEXT", 'kleo_framework').'</a></small>
    			</div>';
    
    		else:
    			$this->tabs_instance->fields_data[$name] = "User hasn't uploaded additional photos";
    		endif; 
    		$bp->current_action = $save_current_action;
    		bp_album_query_pictures();
    
    		$this->tabs_instance->has_data[$name] = true;
    		return true;
    	}
    
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #6938
     adam
    Participant

    this code breaks my site. is the syntax correct?
    do i put it below:

    COPY CODE
    
    if (!class_exists('BpMembersTab_bp_album')):
    

    and above:

    COPY CODE
    
    endif;
    

    ?

    I REALLY appreciate this. Thanks!

    #6943
     adam
    Participant

    found the problem. i had to remove the rel=”nofollow” piece from line 16.

    is the rel=”nofollow” piece important? if so, what is the correct way to include it?

    Thanks! 🙂

    #6987
     SQadmin
    Keymaster

    Not important. You can use it without

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?