Helping you Build Your Own Social Network!

Faster, better and easier!

BP Gallery: Photo description with thumbnails on activity stream and whatnot

(5 posts) (4 voices)

Tags:


  1. Hi

    1. I would like for Photo description to also appear with thumbnails on activity page as it is on facebook (Like "Last night at Erick's birthday party" etc). As it is now it only says "So-so uploaded 2 photos." Whatever description you add with the photo doesn't appear on activity stream.

    2. I also would like to remove photo titles and the arrows, and instead I just want to have links that say "previous", "next" on next_gallery_media_link() etc. What's the best way to do this? By the way, in which file is next_gallery_media_link() defined?

    3. What function returns the url of a photo page? Or what function gets current URL in Buddypress? I'm using facebook comments and I don't want to use $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']

    4. How can I change page title to reflect current gallery's name. As it is now it appears like this: member's name|gallery|site name. I think it'd be much better if it just says the name of the gallery/album i.e "Summer Vacation"

    Thanks in advance

    Edgar

    Posted 6 months ago #
  2. -Scratch question 3. I got that figured out.
    -On question 2. I solved it but in a dirty kinda way because the code confused me a little bit. Here is what I did:

    In bp-gallery/core/media/template-tags.php, line 239, I replaced

    $title = $media->title;

    if ( empty($media->title) )
    $title = $previous ? __('Previous','bp-gallery') : __('Next','bp-gallery');`

    With:

    $title = $media->title;
    $title = 'previous';

    If($previous)
    $title = 'next';

    if ( empty($media->title) )
    $title = $previous ? __('Previous','bp-gallery') : __('Next','bp-gallery');

    It works, and now it displays <<previous and next>>. But I feel like there's a better way of doing this so I will appreciate your input.

    I'm still stuck on questions 1 & 4.

    Thanks

    Edgar

    Posted 6 months ago #
  3. Hi Edgar,
    sorry I took a little longer to reply.
    for the 4th point,
    Please have a look in bp-gallery/core/filters.php.

    The function "bp_gallery_page_title" generates the title. It is hooked to bp_page_title

    The first point is a little bit difficult to achieve as you will need to rewrite the function which generates activity.

    You can see the code in bp-gallery/core/activity-function.php

    bp_gallery_publish_all_media_to_activity

    and
    bp_gallery_publish_media_to_activity

    Hope that helps.

    Posted 5 months ago #
  4. Just to follow up on Question 2: You could add a class to the "a" tag. In my case, I wanted to use the button class. So, in the same file, bp-gallery/core/media/template-tags.php, around line 250, look for

    $string = '<a href="'.bp_get_media_permalink($media).'">';

    and replace with,

    $string = '<a class="button" href="'.bp_get_media_permalink($media).'">';

    Now the "previous" and "next" links have my theme's common button styling. :-)

    Thank you, gentlemen.

    P.S. I also commented out Line 284 through 298 in structure.css

    Posted 5 months ago #
  5. Thanks guys! I like this change and works great!

    I also removed the media title from certain areas as many people have ridiculously long names for their files and it spills out of the tables the pic is located in.

    i did this by doing the following:

    remove:

    <h4 class='media-title'><?php bp_media_title();?></h4>

    from:

    /your-theme/gallery/members/single.php

    and, remove:

    <div class="media-title"><strong><?php bp_media_title();?></strong></div>

    from:

    /your-theme/gallery/single/media/photo-loop.php

    Posted 5 months ago #

Reply

You must log in to post.