-
Author
Tagged: rtmedia gallery cover photo
-
September 22, 2015 at 10:11 #78869creamundoParticipant
Hi,
Have three questions:
1) I would like to add a gallery (with Rtmedia) with the latest pictures of a member in their profile, just under the profile cover photo.
I’m using the code provided by rtmedia in their url: http://docs.rtcamp.com/rtmedia/developers/show-last-n-images-in-header.htmladd_action( ‘bp_after_member_header’, ‘show_last_n_images’, 99 );
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 ) {?>-
<?php foreach( $results as $image ) { ?>
-
<div class=”rtmedia-media” id=”rtmedia-media-<?php echo $image->id; ?>”>
id ); ?>” title=”<?php echo $image->media_title; ?>”>
id ); ?>” alt=”<?php echo rtmedia_image_alt( $image->id );?>” />
</div>
<?php } ?>
<?php
}
}
}The problem is that when i use this code it shows the gallery INTO the cover photo, nor outside…
2) Anothe question is: how could I link to members media gallery?, the code ##profile_link## and the code ##member_name## dont work here.
3) how could i change the media tab name? I can’t change the “multimedia” name in the tab even with the buddypress code for doing this. I can change other tab names but not media tab name.
¿could you please help me?
September 22, 2015 at 12:24 #78878creamundoParticipantHi,
Question 3 is solved, I made a translate mistake and its solved already.
Here you have an screenshot of the other problems.Attachments:
You must be logged in to view attached files.September 22, 2015 at 18:54 #78955sharmstrModerator1 – Try changing the action call to this
COPY CODEif ( bp_is_user() ) { add_action( 'kleo_before_main_content', 'show_last_n_images', 99 ); }
2 – Doesnt work where? If you are talking about in a menu, it would be ##profile_link##/media
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 22, 2015 at 19:25 #78973creamundoParticipanthi @sharmstr ,
now i put the code like you said, like this:
if (bp_is_user()){
add_action( ‘kleo_before_main_content’, ‘show_last_n_images’, 99 );}
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 ) {?>-
<?php foreach( $results as $image ) { ?>
-
<div class=”rtmedia-item-thumbnail” id=”foto-home-perfil”>
id ); ?>” title=”<?php echo $image->media_title; ?>”>
id ); ?>” alt=”<?php echo rtmedia_image_alt( $image->id );?>” />
</div>
<?php } ?>
<div id=”ver-mas-fotos”>Ver más fotos</div><?php
}
}
}but it wont work, if I delete the conditional “if (bp_is_user()){… and start with the add_action it shows the pictures OVER the cover profile photo but I need it UNDER the cover profile photo (I tried to change kleo_before_main_content for kleo_under_main_content but it put the pictures near the footer….)
The problem with the profile link is just near those pictures, I whant a link to “show more pictures” that links to the media tab: <div id=”see-more-pictures”>Show more pictures</div> but it wont work, I supose that it is because it not in the menu…
Thanks for all, you are helping me a lot.
Sorry for my bad english…September 22, 2015 at 19:38 #78984sharmstrModeratorPlease repost your code. Put ‘
COPY CODE' before and '
‘ after. Alternatively, put it in a text file and attach.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 22, 2015 at 19:48 #78986sharmstrModeratorMy code didnt show up. Please see attached for example on how to post code
COPY CODEyour code here
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
Attachments:
You must be logged in to view attached files.September 22, 2015 at 22:01 #79029sharmstrModeratorTry this instead
COPY CODEadd_action('bp_init', 'add_user_images', 2); function add_user_images () { if (bp_is_user()){ add_action('kleo_before_main_content', 'show_last_n_images', 99); } }
BP has built in functions to get the path to a profile. https://codex.buddypress.org/developer/template-tag-reference/ (bp_core_get_user_domain(bp_displayed_user_id()) . ‘media’)
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 23, 2015 at 22:07 #79201creamundoParticipantHi,
Now my code is like this:COPY CODEadd_action('bp_init', 'add_user_images', 2); function add_user_images () { if (bp_is_user()){ add_action('kleo_before_main_content', 'show_last_n_images', 99); } } 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 ) {?> <ul> <?php foreach( $results as $image ) { ?> <li> <div class="rtmedia-item-thumbnail" id="foto-home-perfil"> <a>id ); ?>" title="<?php echo $image->media_title; ?>"> <img />id ); ?>" alt="<?php echo rtmedia_image_alt( $image->id );?>" /> </a> </div> </li> <?php } ?> <div id="ver-mas-fotos"><a href="/media">Ver más fotos</a></div> </ul> <?php } } }
But it still shows the gallery in the top of the cover photo, and i need it UNDER the cover photo. I attach an screenshot.
Attachments:
You must be logged in to view attached files.September 23, 2015 at 22:12 #79205sharmstrModeratorWhat version of kleo are you running?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 23, 2015 at 22:15 #79208sharmstrModeratorI just tried the code and it puts it just above the buddypress profile tabs and below the cover photo. You need Kleo 3.0.9 for it to work.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
Attachments:
You must be logged in to view attached files.September 23, 2015 at 23:49 #79236creamundoParticipantHi,
Same version here…
Do you want admin access to my test site to try the code?September 24, 2015 at 00:20 #79250sharmstrModeratorsure
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 24, 2015 at 15:37 #79315sharmstrModeratorI cant see the profile since the account you created for me isnt assigned to a membership level. I need admin credentials if you want me to help
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 24, 2015 at 15:46 #79319creamundoParticipantHi, Sharmstr
Sorry for the mistake, you have administrator credentials updated now.
Thanks for your job.
September 24, 2015 at 16:23 #79323sharmstrModeratorahhhh. The difference was that I had my profile cover set to full width. There’s no way to inject it between the cover photo and the buddypress nav if you dont have “full width cover” turned on. You’ll have to edit the core buddypress profile file and remember to check for changes after every kleo/buddypress update.
Copy /kleo/buddypress/members/single/home.php to your child theme. Put the following code starting on line 18
COPY CODE<?php $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 ) {?> <div class="rtmedia-item-thumbnail" id="foto-home-perfil"> <ul> <?php foreach( $results as $image ) { ?> <li> <a>id ); ?>" title="<?php echo $image->media_title; ?>"> <img />id ); ?>" alt="<?php echo rtmedia_image_alt( $image->id );?>" /> </a> </li> <?php } ?> </ul> </div> <div id="ver-mas-fotos" class="generic-button" ><a>">Ver más fotos</a></div> <?php } } ?>
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 24, 2015 at 17:06 #79335creamundoParticipantHi,
I did what you say, and it takes the correct place. The only things is that the code you pasted is not ok.
I think there is an error in the < a > declaration and I only can see an error. I attach an screenshot.Attachments:
You must be logged in to view attached files.September 24, 2015 at 17:23 #79340sharmstrModeratorThis forum always screws up those tags. Just use the code you had before but make sure you put this before
COPY CODE<?php
and this after
COPY CODE?>
Also, make sure you put the file in /kleo-child/buddypress/members/single/home.php
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
September 24, 2015 at 18:56 #79363creamundoParticipantyeah!!!! this is perfect!!! it’s running perfect!!!!
only one more question (hope not abuse)… how could I link each picture with the lightbox? i prefer this than the link to the gallery image…September 24, 2015 at 19:28 #79371sharmstrModeratorYou should ask rtCamp since you got the code from them.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
<div class=”rtmedia-media” id=”rtmedia-media-<?php echo $image->id; ?>”>
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.