-
Author
-
November 17, 2013 at 01:31 #6777adamParticipant
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.”?
November 17, 2013 at 09:09 #6828adamParticipantone work-around could be making the avatar/profile photo automatically appear in the album upon upload. not sure how to make this happen though…
November 19, 2013 at 01:23 #6868SQadminKeymasterHi,
You should override the class that handles the bp-Album tab. I will try and give you the codeHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 19, 2013 at 13:48 #6911SQadminKeymasterYou can only replace this class in sweetdate/custom_buddypress/class-bp-tabs.php and change it after each update
COPY CODEclass 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 solutionNovember 19, 2013 at 18:25 #6938adamParticipantthis code breaks my site. is the syntax correct?
do i put it below:COPY CODEif (!class_exists('BpMembersTab_bp_album')):
and above:
COPY CODEendif;
?
I REALLY appreciate this. Thanks!
November 19, 2013 at 19:08 #6943adamParticipantfound 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! 🙂
November 21, 2013 at 01:21 #6987SQadminKeymasterNot 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 -
AuthorPosts
The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.