Skip to content

Commit

Permalink
Added french translation and fixed widget privacy
Browse files Browse the repository at this point in the history
  • Loading branch information
actual-saurabh committed Mar 26, 2013
1 parent 8b74d38 commit 2b09c7a
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 54 deletions.
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -88,7 +88,8 @@ BuddyPress Media is now available in *Brazilian Portuguese*, *Spanish*, *Japanes
* [Japanese](https://rtcamp.com/translate/projects/buddypress-media/ja/default) translation by [Tetsu Yamaoka](http://twitter.com/ytetsu)
* [Polish](https://rtcamp.com/translate/projects/buddypress-media/pl/default) translation by [czemubynie](http://profiles.wordpress.org/czemubyniegmailcom/)
* [Serbian](https://rtcamp.com/translate/projects/buddypress-media/sr/default) translation by [nikolakica](http://profiles.wordpress.org/nikolakica/)
* [German](https://rtcamp.com/translate/projects/buddypress-media/de/defaul) translation by [hannes.muc]
* [German](https://rtcamp.com/translate/projects/buddypress-media/de/default) translation by [hannes.muc]
* [French](https://rtcamp.com/translate/projects/buddypress-media/fr/default) translation by [Peter Lewit](http://profiles.wordpress.org/deegan)

## Installation ##

Expand Down Expand Up @@ -121,8 +122,13 @@ Please visit [BuddyPress Media's Features page](http://rtcamp.com/buddypress-med

Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/?utm_source####readme&utm_medium####plugin&utm_campaign####buddypress-media "Visit BuddyPress Media's Features page") to get some details about future releases.

#### 2.7.4 ####
* Added french translation
* Fixed Widget privacy

#### 2.7.3 ####
* Added option to toggle lightbox functionality to prevent theme conflicts
* Fixed conflict with Bottstrap based themes
* Minor code revision

#### 2.7.2 ####
Expand Down
7 changes: 4 additions & 3 deletions app/assets/css/main.css
Expand Up @@ -219,9 +219,10 @@ position: relative;}
.media-tabs-container .ui-state-default a{text-decoration: none}
.media-tabs-container .ui-state-default.ui-state-active a{text-decoration: underline}

.media-tabs-container .widget-item-listing li{margin-top: 10px;overflow: hidden;min-height: 52px}
.media-tabs-container .widget-item-listing li img{max-width:52px; margin-right: 10px; float: left; display: block }
.media-tabs-container .widget-item-listing li h3 {margin: 0}
.media-tabs-container .widget-item-listing li{position:relative; margin-top: 10px;overflow: hidden;min-height: 52px; float:left; width:50%;}
.media-tabs-container .widget-item-listing li img{max-width:90%; margin:0 auto; float: left; display: block }
.media-tabs-container .widget-item-listing li h3 {position:absolute; bottom:0;margin: 0; display:none; background:#fff none; width:100%;text-align:center;}
.media-tabs-container .widget-item-listing li:hover h3{display:block;}
.media-tabs-container .widget-item-listing li h3 a{font-size: 13px;font-weight: normal;word-wrap: break-word; }

#bp-media-show-more{width: 200px;margin-left: auto;margin-right: auto;display: block;height: 30px;line-height: 30px;font-size: 20px;}
Expand Down
111 changes: 64 additions & 47 deletions app/main/widgets/BPMediaWidget.php
Expand Up @@ -31,29 +31,34 @@ function widget( $args, $instance ) {
extract( $args );
echo $before_widget;
$title = apply_filters( 'widget_title', empty( $instance[ 'title' ] ) ? __( 'BuddyPress Media', BP_MEDIA_TXT_DOMAIN ) : $instance[ 'title' ], $instance, $this->id_base );
$allow= array();
$allow = array( );
$allowed = array( );
if ( empty( $instance[ 'number' ] ) || ! $number = absint( $instance[ 'number' ] ) ) {
$number = 10;
}
$wdType = isset( $instance[ 'wdType' ] ) ? esc_attr( $instance[ 'wdType' ] ) : 'recent';
if(isset( $instance[ 'allow_all' ] ) && (bool)$instance[ 'allow_all' ]===true)$allow[]='all';
if(isset( $instance[ 'allow_image' ] ) && (bool)$instance[ 'allow_image' ]===true)$allow[]='image';
if(isset( $instance[ 'allow_audio' ] ) && (bool)$instance[ 'allow_audio' ]===true)$allow[]='audio';
if(isset( $instance[ 'allow_video' ] ) && (bool)$instance[ 'allow_video' ]===true)$allow[]='video';
if ( isset( $instance[ 'allow_all' ] ) && (bool) $instance[ 'allow_all' ] === true )
$allow[ ] = 'all';
if ( isset( $instance[ 'allow_image' ] ) && (bool) $instance[ 'allow_image' ] === true )
$allow[ ] = 'image';
if ( isset( $instance[ 'allow_audio' ] ) && (bool) $instance[ 'allow_audio' ] === true )
$allow[ ] = 'audio';
if ( isset( $instance[ 'allow_video' ] ) && (bool) $instance[ 'allow_video' ] === true )
$allow[ ] = 'video';

global $bp_media;
$enabled = $bp_media->enabled();
unset($enabled['album']);unset($enabled['upload']);
foreach($allow as $type){
unset( $enabled[ 'album' ] );
unset( $enabled[ 'upload' ] );
foreach ( $allow as $type ) {

if($type!='all'){
if ( $type != 'all' ) {
echo '<br>';
if($enabled[$type]){
$allowed[]= $type;
if ( $enabled[ $type ] ) {
$allowed[ ] = $type;
}
}else{
$allowed[]=$type;
} else {
$allowed[ ] = $type;
}
}
echo $before_title . $title . $after_title;
Expand Down Expand Up @@ -85,58 +90,70 @@ function widget( $args, $instance ) {
if ( count( $allowed ) > 3 ) {
unset( $allowed[ 'all' ] );
}
$allowMimeType = array(); ?>
$allowMimeType = array( );
?>
<div id="<?php echo $wdType; ?>-media-tabs" class="media-tabs-container media-tabs-container-tabs">
<ul><?php
<ul><?php
foreach ( $allowed as $type ) {
if ( $type != 'all' ) {
array_push( $allowMimeType, $type );
} ?>
<li><a href="#<?php echo $wdType; ?>-media-tabs-<?php echo $type; ?>-<?php echo $widgetid; ?>">
<?php echo $strings[ $type ]; ?>
</a></li><?php
} ?>
</ul><?php
foreach ( $allowed as $type ) { ?>
<div id="<?php echo $wdType; ?>-media-tabs-<?php echo $type; ?>-<?php echo $widgetid; ?>" class="bp-media-tab-panel"><?php

$args = array(
'post_type' => 'attachment',
'post_status' => 'any',
'meta_key' => 'bp_media_privacy',
'meta_value' => 0,
'posts_per_page' => $number
);
if ( $type != 'all' )
$args['post_mime_type'] = $type;
}
?>
<li><a href="#<?php echo $wdType; ?>-media-tabs-<?php echo $type; ?>-<?php echo $widgetid; ?>">
<?php echo $strings[ $type ]; ?>
</a></li><?php }
?>
</ul><?php foreach ( $allowed as $type ) { ?>
<div id="<?php echo $wdType; ?>-media-tabs-<?php echo $type; ?>-<?php echo $widgetid; ?>" class="bp-media-tab-panel"><?php
$value = 0;
if ( is_user_logged_in() ) {
$value = 2;
}
$privacy_query = array(
array(
'key' => 'bp_media_privacy',
'value' => $value,
'compare' => '<='
)
);
$args = array(
'post_type' => 'attachment',
'post_status' => 'any',
'meta_query' => $privacy_query,
'posts_per_page' => $number
);
if ( $type != 'all' )
$args[ 'post_mime_type' ] = $type;
$bp_media_widget_query = new WP_Query( $args );
if ( $bp_media_widget_query->have_posts() ) { ?>
<ul class="widget-item-listing"><?php
if ( $bp_media_widget_query->have_posts() ) {
?>
<ul class="widget-item-listing"><?php
while ( $bp_media_widget_query->have_posts() ) {
$bp_media_widget_query->the_post();
try{
$entry = new BPMediaHostWordpress( get_the_ID() );
echo $entry->get_media_gallery_content();
}catch (Exception $e){
try {
$entry = new BPMediaHostWordpress( get_the_ID() );
echo $entry->get_media_gallery_content();
} catch ( Exception $e ) {
echo '<li>';
echo $e->getMessage();
echo '<h3><a>Private</h3>';
echo '</li>';
echo $e->getMessage();
echo '<h3><a>Private</h3>';
echo '</li>';
}

} ?>
</ul><?php
}
?>
</ul><?php
} else {
$media_string = $type;
if ( $type === 'all' ) {
$media_string = 'media';
}
_e( 'No ' . $wdType . ' ' . $media_string . ' found', BP_MEDIA_TXT_DOMAIN );
}
wp_reset_query(); ?>
wp_reset_query();
?>

</div><?php
} ?>
</div><?php }
?>

</div><?php
}
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -3,7 +3,7 @@
Plugin Name: BuddyPress Media
Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
Version: 2.7.3
Version: 2.7.4
Author: rtCamp
Text Domain: buddypress-media
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
Expand Down
File renamed without changes.
Binary file removed languages/buddypress-media-es.mo
Binary file not shown.
Binary file added languages/buddypress-media-es_ES.mo
Binary file not shown.
Binary file removed languages/buddypress-media-fr.mo
Binary file not shown.
Binary file added languages/buddypress-media-fr_FR.mo
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 8 additions & 2 deletions readme.txt
Expand Up @@ -6,7 +6,7 @@ License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Requires at least: WordPress 3.5 + BuddyPress 1.6
Tested up to: WordPress 3.5 + BuddyPress 1.6
Stable tag: 2.7.3
Stable tag: 2.7.4

Adds Photos, Music, Videos & Albums to BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.

Expand Down Expand Up @@ -88,7 +88,8 @@ BuddyPress Media is now available in *Brazilian Portuguese*, *Spanish*, *Japanes
* [Japanese](https://rtcamp.com/translate/projects/buddypress-media/ja/default) translation by [Tetsu Yamaoka](http://twitter.com/ytetsu)
* [Polish](https://rtcamp.com/translate/projects/buddypress-media/pl/default) translation by [czemubynie](http://profiles.wordpress.org/czemubyniegmailcom/)
* [Serbian](https://rtcamp.com/translate/projects/buddypress-media/sr/default) translation by [nikolakica](http://profiles.wordpress.org/nikolakica/)
* [German](https://rtcamp.com/translate/projects/buddypress-media/de/defaul) translation by [hannes.muc]
* [German](https://rtcamp.com/translate/projects/buddypress-media/de/default) translation by [hannes.muc]
* [French](https://rtcamp.com/translate/projects/buddypress-media/fr/default) translation by [Peter Lewit](http://profiles.wordpress.org/deegan)

== Installation ==

Expand Down Expand Up @@ -121,8 +122,13 @@ Please visit [BuddyPress Media's Features page](http://rtcamp.com/buddypress-med

Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit BuddyPress Media's Features page") to get some details about future releases.

= 2.7.4 =
* Added french translation
* Fixed Widget privacy

= 2.7.3 =
* Added option to toggle lightbox functionality to prevent theme conflicts
* Fixed conflict with Bottstrap based themes
* Minor code revision

= 2.7.2 =
Expand Down

0 comments on commit 2b09c7a

Please sign in to comment.