Using BuddyPress for Social Networks

Using MediaPress to add Media Galleries to your site

Using MediaPress to add Media Galleries to your site

Version used for this article: V 1.0.6

One feature missing from the default BuddyPress installation is media galleries and the ability to allow BuddyPress users to upload their own images to be shared with others. Typical hosted social platforms allow the addition of media in three ways – media can be uploaded to a members personal profile page, for sharing with others and display on their profile page, Media can be uploaded to groups and held in a group gallery and media can be uploaded “to the site” – typically placed in a single collective gallery for all to see and often these images are displayed in a front page slider showcasing the uploads of those members. Sometimes media uploads can be marked as “Featured” and will be displayed in a featured content area in the main gallery.

Whilst WordPress has numerous gallery plugins only a few have been integrated with BuddyPress and most are designed to be created and managed by a single user – the site admin, designed for simple websites in order to showcase images. these are for the most part not suitable for use as part of a BuddyPress community.

There are really only two main media plugins that are available for BuddyPress – the long established rtMedia for WordPress, BuddyPress and bbPress and also the newly created fledgling plugin MediaPress. Both offer similar base features, rtMedia has a wider range of add-ons available but these are also typically premium and quite expensive, MediaPress on the other hand has it’s add-ons at a more reasonable price. It’s for this reason that I tend to use MediaPress and for this article I intend to take you through setting up MediaPress on your site.

Installing MediaPress

Installing MediaPress is a case of going to Dashboard>>Plugins>>Add New, searching for MediaPress in the WordPress Plugins Repository then clicking on “Install” and then “Activate”.

Configuring MediaPress

The first thing to note is that MediaPress creates a new BuddyPress Component – “Gallery”, this needs a page associated with it, you can go to Dashboard>>Pages>>Add New and create this page (you can call it gallery for example), then go to Dashboard>>Settings>>BuddyPress>>Pages to associate the gallery component to your newly created page. This page will display a view of all galleries on your site, you may wish to link it into your site menu by going to Dashboard>>Appearance>>Menus and adding this new page to your menu there.

The second thing to note is that in order to work at all, MediaPress needs you to save it’s settings, you can access these via Dashboard>>MediaPress>>Settings.

General Settings

The general settings allow you to choose the type of galleries your site will support (Sitewide, Group and User Galleries), the types of media supported by the galleries (Photo, Video, Audio and Documents), it allows you to choose the default and available privacy options (public, private, logged in users only, Friends only and Group only), the types of files supported (i.e. jpg, mp3 etc.) and also the storage limit setting per user/group (the default is 10Mb).

It is worth noting that the larger the files that are uploaded, the longer the upload session will take, especially on slow internet services and you may need to increase you PHP session timeouts to ensure file uploads do not timeout.

For the sake of this configuration exercise I’m going to assume that you are going to configure MediaPress for all Gallery types and for all Media types. what this means is that in effect you are enabling the creation of 12 different types of galleries:

  1. User Photo Galleries
  2. User Video Galleries
  3. User Audio Galleries
  4. User Document Galleries
  5. Group Photo Galleries
  6. Group Video Galleries
  7. Group Audio Galleries
  8. Group Document Galleries
  9. Sitewide Photo Galleries
  10. Sitewide Video Galleries
  11. Sitewide Audio Galleries
  12. Sitewide Document Galleries

You can see that this means that your site will become even more complex than it already is, so some discretion regarding the types of galleries you want to enable should be observed.

Note also that currently video galleries are only for uploaded video, in my opinion most people will upload their videos onto YouTube or similar mass hosting sites and look to share their videos as links so I have asked the developers to add support for video’s from web-links and they have agreed to consider putting this feature into the next release.

You need to consider also the storage limits of your hosting service when considering what types of galleries to enable and the upload limits per user. Personally I would wait for the video web-link gallery type and not install video galleries in order to reduce site load however that point of view is changing as increasing numbers of members have been asking me to allow video from mobile phone footage. If you are going to take media in any seriousness then its wise to find yourself a low cost unlimited data hosting solution.

Sitewide Gallery Settings

The settings available here allow you to create an archive page and set it’s slug name, the default is galleries, if you choose to create this page you will need to create a pages and associate it to the Galleries component in the same way that you did for the Gallery page.

Also here you can choose the types of galleries supported sitewide – Photo, Video, document and Audio. You also get to choose the default layout of those galleries – Grid View, List View and in the case of Audio and Video Galleries – Playlist.

Make sure you save these settings even if you have not changed them

BuddyPress Settings

Here you can choose to enable or disable to BuddyPress Gallery component we set up at the start, so if you do not want a page to list all galleries you can disable that here.

There is also the option to add a “Media” component page that creates a page that displays all media items, this is not currently supported and should be set to no.

You can choose whether or not to allow members to upload images etc. as part of an activity status update. When enabled, a member uploading in this way gets to choose which media gallery the upload is to go to. You can also choose if certain media related actions create a new activity item, such as the creation of a new gallery.

Note that if enabled, members activity updates will create an additional type of member gallery – their Wall Gallery and these will be of up to three types depending on the media supported.

You can also choose the views of the activity upload media items where more than one item is uploaded at a time.

Make sure you save these settings even if you have not changed them

Members Gallery Settings

Here you can choose what kinds of media galleries you are going to enable for each member – Photo, Video, Audio and Document. Enabling Filters allows the Member to filter by Gallery type. You can also set the default layout of the Members Galleries.

Make sure you save these settings even if you have not changed them

Groups Gallery Settings

Within this tab you are able to choose the types of media that the group galleries will support, you can also set the default views for those galleries, the group gallery settings which determine if Galleries are enabled in groups by default and who can edit and delete media, also if the My Galleries tab will be enabled within the groups

Make sure you save these settings even if you have not changed them

Theming

Here you can set such things as the number of galleries to list per page and the number of media items to list per gallery page. Note that currently there is no page 2 etc. meaning if you have 23 items in a gallery and your theming is set to 20 items displayed then 3 of those media items will not be displayed at all. I have asked the developer to add paging to the gallery view. For now you should set this number to be a high one.

For grid layouts you can set the default grid layouts here, default is four rows by four columns, what is suitable for you is dependent on your theme’s page settings.

You can also choose whether to show media descriptions on a single gallery and media pages, you can choose to allow playlists and commenting on media items in the Members Gallery and finally there are some light box settings. A Lightbox is a method of displaying media in a pop up window, it avoids loading another page when the media item is clicked.

Make sure you save these settings even if you have not changed them

Setting up a Sitewide Gallery so that all site members can upload to it.

Before setting up the gallery, there is a plugin that you need to install, it’s a short term fix that allows a gallery to be set so that any logged in member can upload to it. It is available from BuddyDev’s repository on GitHub and is called MPP Global Shared Gallery.

Many BuddyPress developers store their development files on GitHub, from here you can download and upload test files and fixes prior to public distribution or as in this case to store plugins with features destined to be included in the main release.

Warning, you must make sure that MediaPress is installed and activated on your site before uploading this plugin, if you plan to uninstall MediaPress make sure you uninstall this plugin first, otherwise your site will get errors, this is extremely important.

The next version of Mediapress will include this feature so you will be able to delete this plugin at that time.

  1. Head to https://github.com/mediapress/mpp-global-shared-gallery
  2. Click on the Download button
  3. Select to download the file as a Zip file
  4. Once it is downloaded, go to Dashboard>>Plugins>>Add New and select “Upload Plugin”
  5. Click on “Choose File” and navigate to the directory where you downloaded the file, on PC’s this is usually the Downloads directory
  6. Choose the file mpp-global-shared-gallery-master.zip
  7. Click on “Install Now”
  8. Click on “Activate Plugin”

The plugin is now installed on your site.

Once you have installed the Global Shared Gallery plugin, head to Dashboard>>MediaPress>>Add New Photo Gallery, this opens the page for adding a new Sitewide Gallery.

Give the Gallery a suitable name, scroll down the page and make sure the box “Allow everyone to upload” is checked, then save the Gallery.

Note that you can also choose to upload a cover image and set a description for this Gallery in the Edit Gallery tab of this page.

Also note that on the right of the Gallery page it tells you the shortcode to Add this gallery to a page. Copy that shortcode, it should look something like this:

[mpp-show-gallery id=36]

Note that in this case the Gallery has an id of 36

Next click on Dashboard>>Pages>>Add New and give the new page a suitable name (Such as Site Wide Photo’s)

In the page content paste the shortcode to display the gallery on this page.

In order to allow members to upload to this gallery you also need to insert the uploader shortcode as follows:

[mpp-uploader gallery_id=36]

Taking care to replace the gallery_Id number with that of your own gallery.

You can now save this Page and add it to your site menu in Dashboard>>Appearance>>Menus

Now if you visit your site, you will see your sitewide gallery in the site menu, clicking on this shows you the gallery uploader which allows you and any other site member to upload images to this gallery. Once there are media items in their it will also show them.

Using the same process you can also add sitewide Video, Document and Audio galleries if you so wish.

Adding a Gallery to a Group

The expectation is that your group admin will typically be the ones adding group galleries however you will want to test this process for yourself. I’m going to assume you do not already have a group created, since I’ve not mentioned that so far in this series. Note, if you have loaded any of the other group plugins that I’ve mentioned previously then the steps I’m mentioning here will be slightly different, I will take you though the creation of a basic group.

Login to your site as a test user, load the groups page, select “Create a Group”

This takes you to the Group Creation Page where you can give the Group a name and description. once these are entered you can click on “Create Group and Continue”.

The next page asks you to choose the Group Privacy Option and who can invite others to the group, select some suitable options.  Also note that on this page there is a new option to “enable the Group Gallery” you can click on this to enable group galleries to be created. Click “Next Step”

The next page allows you to choose if you want a group Gallery, make your choice and click on “Next Step”

The next page you will upload and crop the group avatar image, do this and click on “Next Step”.

On the next page you will upload the Group Cover Image, once done hit “Next Step”.

Finally the group creation will ask you about sending out invites, you can skip this and click on “Finish”

Your group is now created

You can now click on “Gallery” in order to set up your groups Galleries

Once in the gallery page you will see the option to Create a Gallery, click on that to start the gallery creation process, here you can select the type of gallery and also give it a name and description. Once this is done you can click on “Create” and your gallery will be created.

Creating a members Gallery

Display the members drop down menu by floating your mouse point above the member name on the top right hand corner of the page, from this drop down select Gallery>>Create.

A very similar dialogue will appear as the group gallery creation page that you have just navigated, again you get to choose the media type for the gallery, it’s name and description, clicking “Create” will then add the gallery to that members gallery list, available from the profile drop down menu as previously described. Enter the required information and click on “Create”

Congratulations, you have now installed, configured and Tested your MediaPress Plugin!

Conclusion

In this article I have taken you through adding media galleries to your BuddyPress installation, it’s quite a complex process but by now your site should start to the sorts of features that you need in order to create your ideal site.

Leave a Reply

Your email address will not be published.