Version Description
- New Widget added with more options!
- Fixed 'Show More' action on Group Album thanks to bowoolley
- Fixed conflicts with 'BuddyPress Activity Plus', thanks to number_6 and param-veer(https://github.com/param-veer)
- Some more housekeeping, code cleanup and documentation.
Download this release
Release Info
Developer | saurabhshukla |
Plugin | rtMedia for WordPress, BuddyPress and bbPress |
Version | 2.4.1 |
Comparing to | |
See all releases |
Code changes from version 2.4 to 2.4.1
- app/admin/BPMediaAdmin.php +8 -5
- app/assets/css/main.css +1 -0
- app/assets/js/bp-media-uploader.js +5 -1
- app/assets/js/main.js +2 -2
- app/helper/BPMediaAddon.php +3 -0
- app/helper/{BPMediaWidget.php → BPMediaAdminWidget.php} +2 -2
- app/helper/BPMediaBranding.php +3 -0
- app/helper/BPMediaSettings.php +38 -8
- app/helper/BPMediaUpgrade.php +1 -2
- app/main/BPMediaLoader.php +38 -5
- app/main/BuddyPressMedia.php +309 -282
- app/main/includes/BPMediaActions.php +2 -2
- app/main/includes/BPMediaFunction.php +13 -5
- app/main/includes/BPMediaHostWordpress.php +739 -737
- app/main/profile/BPMediaAlbum.php +23 -2
- app/main/profile/BPMediaAlbumScreen.php +7 -8
- app/main/profile/BPMediaScreen.php +357 -365
- app/main/profile/BPMediaTemplate.php +7 -8
- app/main/profile/BPMediaUploadScreen.php +3 -5
- app/main/widgets/BPMediaPopularMedia.php +93 -77
- app/main/widgets/BPMediaRecentMedia.php +205 -186
- app/main/widgets/BPMediaWidget.php +281 -0
- index.php +29 -19
- lang/buddypress-media.po +414 -277
- readme.txt +16 -5
app/admin/BPMediaAdmin.php
CHANGED
@@ -2,6 +2,9 @@
|
|
2 |
/**
|
3 |
* Description of BPMediaAdmin
|
4 |
*
|
|
|
|
|
|
|
5 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
6 |
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
|
7 |
*/
|
@@ -260,7 +263,7 @@ if (!class_exists('BPMediaAdmin')) {
|
|
260 |
<li><a href="' . sprintf('%s', 'https://twitter.com/rtcamp/') . '" title="' . __('Follow us on Twitter', BP_MEDIA_TXT_DOMAIN) . '" class="bp-media-twitter bp-media-social">' . __('Twitter', BP_MEDIA_TXT_DOMAIN) . '</a></li>
|
261 |
<li><a href="' . sprintf('%s', 'http://feeds.feedburner.com/rtcamp/') . '" title="' . __('Subscribe to our feeds', BP_MEDIA_TXT_DOMAIN) . '" class="bp-media-rss bp-media-social">' . __('RSS Feed', BP_MEDIA_TXT_DOMAIN) . '</a></li>
|
262 |
</ul>';
|
263 |
-
new
|
264 |
|
265 |
$support = '<p><ul>
|
266 |
<li>' . sprintf('<a href="%s">' . __("Read FAQ", BP_MEDIA_TXT_DOMAIN) . '</a>', 'http://rtcamp.com/buddypress-media/faq/') . '</li>
|
@@ -268,11 +271,11 @@ if (!class_exists('BPMediaAdmin')) {
|
|
268 |
<li>' . sprintf('<a href="%s">' . __("Github Issue Tracker", BP_MEDIA_TXT_DOMAIN) . '</a>', 'https://github.com/rtCamp/buddypress-media/issues/') . '</li>
|
269 |
<li>' . sprintf('<a href="%s">' . __("Hire us!", BP_MEDIA_TXT_DOMAIN) . '</a> ' . __("To get professional customisation/setup service.", BP_MEDIA_TXT_DOMAIN), 'http://rtcamp.com/buddypress-media/hire/') . '</li>
|
270 |
</ul></p>';
|
271 |
-
new
|
272 |
|
273 |
$donate = '<span><a href="http://rtcamp.com/donate/" title="' . __('Help the development keep going.', BP_MEDIA_TXT_DOMAIN) . '"><img class="bp-media-donation-image" src ="' . BP_MEDIA_URL . 'app/assets/img/donate.gif" /></a></span>
|
274 |
<p>' . sprintf(__('Help us release more amazing features faster. Consider making a donation to our consistent efforts.', BP_MEDIA_TXT_DOMAIN)) . '</p>';
|
275 |
-
new
|
276 |
|
277 |
$addons = '<ul>
|
278 |
<li><a href="http://rtcamp.com/store/buddypress-media-kaltura/" title="' . __('BuddyPress Media Kaltura', BP_MEDIA_TXT_DOMAIN) . '">' . __('BPM-Kaltura', BP_MEDIA_TXT_DOMAIN) . '</a> - ' . __('Add support for Kaltura.com/Kaltura-CE based video conversion support', BP_MEDIA_TXT_DOMAIN) . '</li>
|
@@ -280,10 +283,10 @@ if (!class_exists('BPMediaAdmin')) {
|
|
280 |
</ul>
|
281 |
<h4>' . sprintf(__('Are you a developer?', BP_MEDIA_TXT_DOMAIN)) . '</h4>
|
282 |
<p>' . sprintf(__('If you are developing a BuddyPress Media addon we would like to include it in above list. We can also help you sell them. <a href="%s">More info!</a>', BP_MEDIA_TXT_DOMAIN), 'http://rtcamp.com/contact/') . '</p></h4>';
|
283 |
-
new
|
284 |
|
285 |
$news = '<img src ="' . admin_url('/images/wpspin_light.gif') . '" /> Loading...';
|
286 |
-
new
|
287 |
}
|
288 |
|
289 |
}
|
2 |
/**
|
3 |
* Description of BPMediaAdmin
|
4 |
*
|
5 |
+
* @package BuddyPressMedia
|
6 |
+
* @subpackage Admin
|
7 |
+
*
|
8 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
9 |
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
|
10 |
*/
|
263 |
<li><a href="' . sprintf('%s', 'https://twitter.com/rtcamp/') . '" title="' . __('Follow us on Twitter', BP_MEDIA_TXT_DOMAIN) . '" class="bp-media-twitter bp-media-social">' . __('Twitter', BP_MEDIA_TXT_DOMAIN) . '</a></li>
|
264 |
<li><a href="' . sprintf('%s', 'http://feeds.feedburner.com/rtcamp/') . '" title="' . __('Subscribe to our feeds', BP_MEDIA_TXT_DOMAIN) . '" class="bp-media-rss bp-media-social">' . __('RSS Feed', BP_MEDIA_TXT_DOMAIN) . '</a></li>
|
265 |
</ul>';
|
266 |
+
new BPMediaAdminWidget('branding', '', $branding);
|
267 |
|
268 |
$support = '<p><ul>
|
269 |
<li>' . sprintf('<a href="%s">' . __("Read FAQ", BP_MEDIA_TXT_DOMAIN) . '</a>', 'http://rtcamp.com/buddypress-media/faq/') . '</li>
|
271 |
<li>' . sprintf('<a href="%s">' . __("Github Issue Tracker", BP_MEDIA_TXT_DOMAIN) . '</a>', 'https://github.com/rtCamp/buddypress-media/issues/') . '</li>
|
272 |
<li>' . sprintf('<a href="%s">' . __("Hire us!", BP_MEDIA_TXT_DOMAIN) . '</a> ' . __("To get professional customisation/setup service.", BP_MEDIA_TXT_DOMAIN), 'http://rtcamp.com/buddypress-media/hire/') . '</li>
|
273 |
</ul></p>';
|
274 |
+
new BPMediaAdminWidget('support', __('Need Help?', BP_MEDIA_TXT_DOMAIN), $support);
|
275 |
|
276 |
$donate = '<span><a href="http://rtcamp.com/donate/" title="' . __('Help the development keep going.', BP_MEDIA_TXT_DOMAIN) . '"><img class="bp-media-donation-image" src ="' . BP_MEDIA_URL . 'app/assets/img/donate.gif" /></a></span>
|
277 |
<p>' . sprintf(__('Help us release more amazing features faster. Consider making a donation to our consistent efforts.', BP_MEDIA_TXT_DOMAIN)) . '</p>';
|
278 |
+
new BPMediaAdminWidget('donate', __('Donate', BP_MEDIA_TXT_DOMAIN), $donate);
|
279 |
|
280 |
$addons = '<ul>
|
281 |
<li><a href="http://rtcamp.com/store/buddypress-media-kaltura/" title="' . __('BuddyPress Media Kaltura', BP_MEDIA_TXT_DOMAIN) . '">' . __('BPM-Kaltura', BP_MEDIA_TXT_DOMAIN) . '</a> - ' . __('Add support for Kaltura.com/Kaltura-CE based video conversion support', BP_MEDIA_TXT_DOMAIN) . '</li>
|
283 |
</ul>
|
284 |
<h4>' . sprintf(__('Are you a developer?', BP_MEDIA_TXT_DOMAIN)) . '</h4>
|
285 |
<p>' . sprintf(__('If you are developing a BuddyPress Media addon we would like to include it in above list. We can also help you sell them. <a href="%s">More info!</a>', BP_MEDIA_TXT_DOMAIN), 'http://rtcamp.com/contact/') . '</p></h4>';
|
286 |
+
new BPMediaAdminWidget('premium-addons', __('Premium Addons', BP_MEDIA_TXT_DOMAIN), $addons);
|
287 |
|
288 |
$news = '<img src ="' . admin_url('/images/wpspin_light.gif') . '" /> Loading...';
|
289 |
+
new BPMediaAdminWidget('latest-news', __('Latest News', BP_MEDIA_TXT_DOMAIN), $news);
|
290 |
}
|
291 |
|
292 |
}
|
app/assets/css/main.css
CHANGED
@@ -169,3 +169,4 @@ img.bp-media-donation-image{display:block;margin: 10px auto;}
|
|
169 |
#bp-media-album-new > label { font-size: 14px; }
|
170 |
#bp-media-album-new input[type="text"] { width: 98%; }
|
171 |
#custom-overlay { background: none repeat scroll 0 0 #000000;bottom: 0;left: 0;min-height: 360px;opacity: 0.7;position: fixed;right: 0;top: 0;z-index: 105000; }
|
|
169 |
#bp-media-album-new > label { font-size: 14px; }
|
170 |
#bp-media-album-new input[type="text"] { width: 98%; }
|
171 |
#custom-overlay { background: none repeat scroll 0 0 #000000;bottom: 0;left: 0;min-height: 360px;opacity: 0.7;position: fixed;right: 0;top: 0;z-index: 105000; }
|
172 |
+
div.error{margin: 5px 0 15px; background-color: #ffebe8; border-color: #c00;padding: 0 .6em;-webkit-border-radius: 3px;border-radius: 3px;border-width: 1px;border-style: solid;}
|
app/assets/js/bp-media-uploader.js
CHANGED
@@ -4,8 +4,12 @@
|
|
4 |
*/
|
5 |
|
6 |
jQuery(document).ready(function(){
|
7 |
-
|
8 |
jQuery('#custom-overlay').hide();
|
|
|
|
|
|
|
|
|
9 |
jQuery('#bp-media-close').click(function(){
|
10 |
jQuery('#bp-media-album-prompt').hide();
|
11 |
jQuery('#custom-overlay').hide();
|
4 |
*/
|
5 |
|
6 |
jQuery(document).ready(function(){
|
7 |
+
jQuery('body').append('<div id="custom-overlay"></div>');
|
8 |
jQuery('#custom-overlay').hide();
|
9 |
+
jQuery('body').append('<div id="bp-media-album-prompt">'+jQuery('#bp-media-album-prompt').html()+'</div>');
|
10 |
+
jQuery('body').append('<div id="bp-media-album-new">'+jQuery('#bp-media-album-new').html()+'</div>');
|
11 |
+
jQuery('#content #bp-media-album-prompt').remove();
|
12 |
+
jQuery('#content #bp-media-album-new').remove();
|
13 |
jQuery('#bp-media-close').click(function(){
|
14 |
jQuery('#bp-media-album-prompt').hide();
|
15 |
jQuery('#custom-overlay').hide();
|
app/assets/js/main.js
CHANGED
@@ -16,7 +16,7 @@ function bp_media_create_element(id){
|
|
16 |
|
17 |
jQuery(document).ready(function(){
|
18 |
|
19 |
-
var bp_media_recent_tabs = jQuery('
|
20 |
if(bp_media_recent_tabs.length>0){
|
21 |
jQuery(bp_media_recent_tabs).tabs();
|
22 |
}
|
@@ -82,7 +82,7 @@ jQuery(document).ready(function(){
|
|
82 |
remove_featured = jQuery(this).attr('data-remove-featured');
|
83 |
}
|
84 |
jQuery.ajax({
|
85 |
-
url:
|
86 |
type:'POST',
|
87 |
data:'action=my_featured_action&post_id='+post_id+'&remove_featured='+remove_featured+'&post_date='+date,
|
88 |
success:function( results )
|
16 |
|
17 |
jQuery(document).ready(function(){
|
18 |
|
19 |
+
var bp_media_recent_tabs = jQuery('.media-tabs-container-tabs');
|
20 |
if(bp_media_recent_tabs.length>0){
|
21 |
jQuery(bp_media_recent_tabs).tabs();
|
22 |
}
|
82 |
remove_featured = jQuery(this).attr('data-remove-featured');
|
83 |
}
|
84 |
jQuery.ajax({
|
85 |
+
url:bp_media_vars.ajax_url,
|
86 |
type:'POST',
|
87 |
data:'action=my_featured_action&post_id='+post_id+'&remove_featured='+remove_featured+'&post_date='+date,
|
88 |
success:function( results )
|
app/helper/BPMediaAddon.php
CHANGED
@@ -3,6 +3,9 @@
|
|
3 |
/**
|
4 |
* Description of BPMediaAddon
|
5 |
*
|
|
|
|
|
|
|
6 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
7 |
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
|
8 |
*/
|
3 |
/**
|
4 |
* Description of BPMediaAddon
|
5 |
*
|
6 |
+
* @package BuddyPressMedia
|
7 |
+
* @subpackage Admin
|
8 |
+
*
|
9 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
10 |
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
|
11 |
*/
|
app/helper/{BPMediaWidget.php → BPMediaAdminWidget.php}
RENAMED
@@ -5,9 +5,9 @@
|
|
5 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
6 |
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
|
7 |
*/
|
8 |
-
if (!class_exists('
|
9 |
|
10 |
-
class
|
11 |
|
12 |
public function __construct($id = NULL, $title = NULL, $content = NULL) {
|
13 |
global $bp_media;
|
5 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
6 |
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
|
7 |
*/
|
8 |
+
if (!class_exists('BPMediaAdminWidget')) {
|
9 |
|
10 |
+
class BPMediaAdminWidget {
|
11 |
|
12 |
public function __construct($id = NULL, $title = NULL, $content = NULL) {
|
13 |
global $bp_media;
|
app/helper/BPMediaBranding.php
CHANGED
@@ -3,6 +3,9 @@
|
|
3 |
/**
|
4 |
* Description of BPMediaBranding
|
5 |
*
|
|
|
|
|
|
|
6 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
7 |
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
|
8 |
*/
|
3 |
/**
|
4 |
* Description of BPMediaBranding
|
5 |
*
|
6 |
+
* @package BuddyPressMedia
|
7 |
+
* @subpackage Admin
|
8 |
+
*
|
9 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
10 |
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
|
11 |
*/
|
app/helper/BPMediaSettings.php
CHANGED
@@ -80,7 +80,7 @@ if (!class_exists('BPMediaSettings')) {
|
|
80 |
/**
|
81 |
* Output a checkbox
|
82 |
*
|
83 |
-
* @global
|
84 |
* @param array $args
|
85 |
*/
|
86 |
public function checkbox($args) {
|
@@ -108,7 +108,7 @@ if (!class_exists('BPMediaSettings')) {
|
|
108 |
/**
|
109 |
* Outputs Radio Buttons
|
110 |
*
|
111 |
-
* @global
|
112 |
* @param array $args
|
113 |
*/
|
114 |
public function radio($args) {
|
@@ -128,19 +128,49 @@ if (!class_exists('BPMediaSettings')) {
|
|
128 |
trigger_error(__('Need to specify atleast to radios else use a checkbox instead', BP_MEDIA_TXT_DOMAIN));
|
129 |
return;
|
130 |
}
|
131 |
-
if (empty($options[$option])) {
|
132 |
-
$options[$option] = $
|
133 |
}
|
134 |
foreach ($radios as $value => $desc) {
|
135 |
?>
|
136 |
-
<label for="<?php echo sanitize_title($desc); ?>"><input<?php checked($options[$option], $value); ?> value=
|
137 |
}
|
138 |
}
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
/**
|
141 |
* Outputs Dropdown
|
142 |
*
|
143 |
-
* @global
|
144 |
* @param array $args
|
145 |
*/
|
146 |
public function dropdown($args) {
|
@@ -158,7 +188,7 @@ if (!class_exists('BPMediaSettings')) {
|
|
158 |
trigger_error(__('Please provide some values to populate the dropdown. Format : array( \'value\' => \'option\' )', BP_MEDIA_TXT_DOMAIN));
|
159 |
return;
|
160 |
}
|
161 |
-
|
162 |
<select name="<?php echo $option; ?>" id="<?php echo $option; ?>"><?php if ($none) { ?>
|
163 |
<option><?php __e('None', BP_MEDIA_TXT_DOMAIN); ?></option><?php
|
164 |
}
|
@@ -172,7 +202,7 @@ if (!class_exists('BPMediaSettings')) {
|
|
172 |
/**
|
173 |
* Outputs a Button
|
174 |
*
|
175 |
-
* @global
|
176 |
* @param array $args
|
177 |
*/
|
178 |
public function button($args) {
|
80 |
/**
|
81 |
* Output a checkbox
|
82 |
*
|
83 |
+
* @global array $bp_media
|
84 |
* @param array $args
|
85 |
*/
|
86 |
public function checkbox($args) {
|
108 |
/**
|
109 |
* Outputs Radio Buttons
|
110 |
*
|
111 |
+
* @global array $bp_media
|
112 |
* @param array $args
|
113 |
*/
|
114 |
public function radio($args) {
|
128 |
trigger_error(__('Need to specify atleast to radios else use a checkbox instead', BP_MEDIA_TXT_DOMAIN));
|
129 |
return;
|
130 |
}
|
131 |
+
if ((isset($options[$option]) && empty($options[$option])) || !isset($options[$option])) {
|
132 |
+
$options[$option] = $default;
|
133 |
}
|
134 |
foreach ($radios as $value => $desc) {
|
135 |
?>
|
136 |
+
<label for="<?php echo sanitize_title($desc); ?>"><input<?php checked($options[$option], $value); ?> value="<?php echo $value; ?>" name="bp_media_options[<?php echo $option; ?>]" id="<?php echo sanitize_title($desc); ?>" type="radio" /><?php echo $desc; ?></label><br /><?php
|
137 |
}
|
138 |
}
|
139 |
|
140 |
+
/**
|
141 |
+
* Outputs Textbox
|
142 |
+
*
|
143 |
+
* @global array $bp_media
|
144 |
+
* @param array $args
|
145 |
+
*/
|
146 |
+
public function textbox($args) {
|
147 |
+
global $bp_media;
|
148 |
+
$options = $bp_media->options;
|
149 |
+
$defaults = array(
|
150 |
+
'option' => '',
|
151 |
+
'desc' => '',
|
152 |
+
);
|
153 |
+
$args = wp_parse_args($args, $defaults);
|
154 |
+
extract($args);
|
155 |
+
if (empty($option)) {
|
156 |
+
trigger_error(__('Please provide "option" value ( required ) in the argument. Pass argument to add_settings_field in the following format array( \'option\' => \'option_name\' )', BP_MEDIA_TXT_DOMAIN));
|
157 |
+
return;
|
158 |
+
}
|
159 |
+
if ((isset($options[$option]) && empty($options[$option])) || !isset($options[$option])) {
|
160 |
+
$options[$option] = '';
|
161 |
+
}
|
162 |
+
?>
|
163 |
+
<label for="<?php echo sanitize_title($option); ?>"><input value="<?php echo $options[$option]; ?>" name="bp_media_options[<?php echo $option; ?>]" id="<?php echo sanitize_title($option); ?>" type="text" /><?php
|
164 |
+
if (!empty($desc)) {
|
165 |
+
echo '<br /><span class="description">' . $desc . '</span>';
|
166 |
+
}
|
167 |
+
?></label><br /><?php
|
168 |
+
}
|
169 |
+
|
170 |
/**
|
171 |
* Outputs Dropdown
|
172 |
*
|
173 |
+
* @global array $bp_media
|
174 |
* @param array $args
|
175 |
*/
|
176 |
public function dropdown($args) {
|
188 |
trigger_error(__('Please provide some values to populate the dropdown. Format : array( \'value\' => \'option\' )', BP_MEDIA_TXT_DOMAIN));
|
189 |
return;
|
190 |
}
|
191 |
+
?>
|
192 |
<select name="<?php echo $option; ?>" id="<?php echo $option; ?>"><?php if ($none) { ?>
|
193 |
<option><?php __e('None', BP_MEDIA_TXT_DOMAIN); ?></option><?php
|
194 |
}
|
202 |
/**
|
203 |
* Outputs a Button
|
204 |
*
|
205 |
+
* @global array $bp_media
|
206 |
* @param array $args
|
207 |
*/
|
208 |
public function button($args) {
|
app/helper/BPMediaUpgrade.php
CHANGED
@@ -27,7 +27,7 @@ if (!class_exists('BPMediaUpgrade')) {
|
|
27 |
global $bp_media;
|
28 |
?>
|
29 |
<div class="error"><p><?php
|
30 |
-
printf(__('Please click upgrade to upgrade the database of BuddyPress Media <a class="button" id="refresh_media_count" href ="%s" class="button" title="It will migrate your BuddyPress Media\'s earlier database to new database.">Upgrade</a>', BP_MEDIA_TXT_DOMAIN),
|
31 |
?>
|
32 |
</p></div>
|
33 |
<?php
|
@@ -39,7 +39,6 @@ if (!class_exists('BPMediaUpgrade')) {
|
|
39 |
public function upgrade() {
|
40 |
if (isset($_GET['bp_media_upgrade_db']) && empty($_REQUEST['settings-updated'])) {
|
41 |
check_admin_referer('bp_media_upgrade_db', 'wp_nonce');
|
42 |
-
require_once('bp-media-upgrade-script.php');
|
43 |
$current_version = get_site_option('bp_media_db_version', '1.0');
|
44 |
if ($current_version == '2.0')
|
45 |
$this->upgrade_2_0_to_2_1();
|
27 |
global $bp_media;
|
28 |
?>
|
29 |
<div class="error"><p><?php
|
30 |
+
printf(__('Please click upgrade to upgrade the database of BuddyPress Media <a class="button" id="refresh_media_count" href ="%s" class="button" title="It will migrate your BuddyPress Media\'s earlier database to new database.">Upgrade</a>', BP_MEDIA_TXT_DOMAIN), bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings', 'bp_media_upgrade_db' => 1, 'wp_nonce' => wp_create_nonce('bp_media_upgrade_db')), 'admin.php')))
|
31 |
?>
|
32 |
</p></div>
|
33 |
<?php
|
39 |
public function upgrade() {
|
40 |
if (isset($_GET['bp_media_upgrade_db']) && empty($_REQUEST['settings-updated'])) {
|
41 |
check_admin_referer('bp_media_upgrade_db', 'wp_nonce');
|
|
|
42 |
$current_version = get_site_option('bp_media_db_version', '1.0');
|
43 |
if ($current_version == '2.0')
|
44 |
$this->upgrade_2_0_to_2_1();
|
app/main/BPMediaLoader.php
CHANGED
@@ -1,27 +1,54 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if ( ! defined( 'ABSPATH' ) )
|
4 |
-
exit;
|
5 |
-
|
6 |
/**
|
7 |
-
*
|
|
|
|
|
|
|
|
|
|
|
8 |
*
|
9 |
* @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
|
10 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
11 |
*/
|
12 |
class BPMediaLoader {
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
public function __construct() {
|
15 |
add_action( 'bp_loaded', array( $this, 'load_component' ) );
|
16 |
add_action( 'bp_setup_nav', array( $this, 'custom_nav' ), 999 );
|
17 |
add_action( 'after_setup_theme', array( $this, 'thumbnail' ) );
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
public function load_component() {
|
21 |
global $bp;
|
22 |
$bp->{BP_MEDIA_SLUG} = new BPMediaComponent();
|
23 |
}
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
public function custom_nav() {
|
26 |
global $bp;
|
27 |
foreach ( $bp->bp_nav as $key => $nav_item ) {
|
@@ -57,7 +84,13 @@ class BPMediaLoader {
|
|
57 |
}
|
58 |
}
|
59 |
}
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
public function thumbnail() {
|
62 |
global $bp_media;
|
63 |
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
3 |
/**
|
4 |
+
* BuddyPress Media Loader
|
5 |
+
*
|
6 |
+
* Hooks BuddyPress Media properly into BuddyPress, so we can load BuddyPress Media
|
7 |
+
*
|
8 |
+
* @package BuddyPressMedia
|
9 |
+
* @subpackage Main
|
10 |
*
|
11 |
* @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
|
12 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
13 |
*/
|
14 |
class BPMediaLoader {
|
15 |
|
16 |
+
/**
|
17 |
+
* Hooks into BuddyPress
|
18 |
+
*
|
19 |
+
* Hooks into bp_loaded to load itself
|
20 |
+
* Hooks into bp_setup_nav to add tabs to the profile and group navigation
|
21 |
+
* Hooks into after_setup_theme to add its thumbnail sizes
|
22 |
+
*
|
23 |
+
* @uses bp_loaded
|
24 |
+
* @uses bp_setup_nav
|
25 |
+
* @uses after_setup_theme
|
26 |
+
*/
|
27 |
public function __construct() {
|
28 |
add_action( 'bp_loaded', array( $this, 'load_component' ) );
|
29 |
add_action( 'bp_setup_nav', array( $this, 'custom_nav' ), 999 );
|
30 |
add_action( 'after_setup_theme', array( $this, 'thumbnail' ) );
|
31 |
}
|
32 |
|
33 |
+
/**
|
34 |
+
* BuddyPress Media Loader
|
35 |
+
*
|
36 |
+
* Loads and adds it to the BuddyPress global object
|
37 |
+
*
|
38 |
+
* @global object $bp BuddyPress object
|
39 |
+
*/
|
40 |
public function load_component() {
|
41 |
global $bp;
|
42 |
$bp->{BP_MEDIA_SLUG} = new BPMediaComponent();
|
43 |
}
|
44 |
|
45 |
+
/**
|
46 |
+
* Navigation Loader
|
47 |
+
*
|
48 |
+
* Loads BuddyPress Media's navigation
|
49 |
+
*
|
50 |
+
* @global object $bp BuddyPress object
|
51 |
+
*/
|
52 |
public function custom_nav() {
|
53 |
global $bp;
|
54 |
foreach ( $bp->bp_nav as $key => $nav_item ) {
|
84 |
}
|
85 |
}
|
86 |
}
|
87 |
+
/**
|
88 |
+
* Custom Thumbnail Sizes
|
89 |
+
*
|
90 |
+
* Adds image sizes required by the plugin to existing WordPress sizes
|
91 |
+
*
|
92 |
+
* @global object $bp_media
|
93 |
+
*/
|
94 |
public function thumbnail() {
|
95 |
global $bp_media;
|
96 |
|
app/main/BuddyPressMedia.php
CHANGED
@@ -1,295 +1,322 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
-
*
|
|
|
|
|
|
|
|
|
|
|
4 |
*
|
5 |
* @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
|
6 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
7 |
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
|
8 |
*/
|
9 |
-
if (
|
10 |
-
|
11 |
|
12 |
class BuddyPressMedia {
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
|
294 |
}
|
295 |
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
+
* BuddyPress Media
|
5 |
+
*
|
6 |
+
* The main BuddyPress Media Class. This is where everything starts.
|
7 |
+
*
|
8 |
+
* @package BuddyPressMedia
|
9 |
+
* @subpackage Main
|
10 |
*
|
11 |
* @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
|
12 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
13 |
* @author Joshua Abenazer <joshua.abenazer@rtcamp.com>
|
14 |
*/
|
15 |
+
if (!defined('ABSPATH'))
|
16 |
+
exit;
|
17 |
|
18 |
class BuddyPressMedia {
|
19 |
|
20 |
+
public $text_domain = 'buddypress-media';
|
21 |
+
public $options;
|
22 |
+
public $support_email = 'support@rtcamp.com';
|
23 |
+
public $support_url = 'http://rtcamp.com/support/forum/buddypress-media/';
|
24 |
+
public $query;
|
25 |
+
public $albums_query;
|
26 |
+
public $count = null;
|
27 |
+
public $posts_per_page = 10;
|
28 |
+
public $activity_types = array(
|
29 |
+
'media_upload',
|
30 |
+
'album_updated',
|
31 |
+
'album_created'
|
32 |
+
);
|
33 |
+
public $hidden_activity_cache = array();
|
34 |
+
public $loader;
|
35 |
+
public $group_loader;
|
36 |
+
|
37 |
+
public function __construct() {
|
38 |
+
$this->constants();
|
39 |
+
$this->excerpt_lengths();
|
40 |
+
add_action('admin_notices', array($this, 'bp_exists'));
|
41 |
+
/**
|
42 |
+
* Activating the plugin!
|
43 |
+
*/
|
44 |
+
register_activation_hook(__FILE__, array($this, 'activate'));
|
45 |
+
|
46 |
+
/**
|
47 |
+
* And hooking it to BuddyPress
|
48 |
+
*/
|
49 |
+
add_action('bp_include', array($this, 'init'));
|
50 |
+
add_action('widgets_init', array($this, 'widgets_init'), 1);
|
51 |
+
global $bp_media_counter;
|
52 |
+
$bp_media_counter = 0;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function bp_exists() {
|
56 |
+
if (!class_exists('BuddyPress')) {
|
57 |
+
echo '<div class="error">
|
58 |
+
<p><strong>' . __('BuddyPress is not installed.', $this->text_domain) . '</strong></p>
|
59 |
+
<p>' . sprintf(__('To use BuddyPress Media, <a href="%s" target="_blank">BuddyPress</a> must be installed first.', $this->text_domain), 'http://wordpress.org/extend/plugins/buddypress/') . '</p>
|
60 |
+
</div>';
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
public function get_option() {
|
65 |
+
$this->options = bp_get_option('bp_media_options');
|
66 |
+
}
|
67 |
+
|
68 |
+
public function constants() {
|
69 |
+
/* Text domain */
|
70 |
+
if (!defined('BP_MEDIA_TXT_DOMAIN'))
|
71 |
+
define('BP_MEDIA_TXT_DOMAIN', $this->text_domain);
|
72 |
+
|
73 |
+
/* If the plugin is installed. */
|
74 |
+
if (!defined('BP_MEDIA_IS_INSTALLED'))
|
75 |
+
define('BP_MEDIA_IS_INSTALLED', 1);
|
76 |
+
|
77 |
+
/* Current Version. */
|
78 |
+
if (!defined('BP_MEDIA_VERSION'))
|
79 |
+
define('BP_MEDIA_VERSION', '2.4');
|
80 |
+
|
81 |
+
/* Required Version */
|
82 |
+
if (!defined('BP_MEDIA_REQUIRED_BP'))
|
83 |
+
define('BP_MEDIA_REQUIRED_BP', '1.6.2');
|
84 |
+
|
85 |
+
/* Database Version */
|
86 |
+
if (!defined('BP_MEDIA_DB_VERSION'))
|
87 |
+
define('BP_MEDIA_DB_VERSION', '2.1');
|
88 |
+
|
89 |
+
/**
|
90 |
+
/* A constant to Active Collab API Assignee ID
|
91 |
+
if ( ! defined( 'BP_MEDIA_AC_API_ASSIGNEE_ID' ) )
|
92 |
+
define( 'BP_MEDIA_AC_API_ASSIGNEE_ID', '5' );
|
93 |
+
|
94 |
+
/* A constant to Active Collab API Assignee ID
|
95 |
+
if ( ! defined( 'BP_MEDIA_AC_API_LABEL_ID' ) )
|
96 |
+
define( 'BP_MEDIA_AC_API_LABEL_ID', '1' );
|
97 |
+
|
98 |
+
/* A constant to Active Collab API priority
|
99 |
+
if ( ! defined( 'BP_MEDIA_AC_API_PRIORITY' ) )
|
100 |
+
define( 'BP_MEDIA_AC_API_PRIORITY', '2' );
|
101 |
+
|
102 |
+
/* A constant to Active Collab API priority
|
103 |
+
if ( ! defined( 'BP_MEDIA_AC_API_CATEGORY_ID' ) )
|
104 |
+
define( 'BP_MEDIA_AC_API_CATEGORY_ID', '224' );
|
105 |
+
*/
|
106 |
+
/* Slug Constants */
|
107 |
+
if (!defined('BP_MEDIA_SLUG'))
|
108 |
+
define('BP_MEDIA_SLUG', 'media');
|
109 |
+
|
110 |
+
if (!defined('BP_MEDIA_UPLOAD_SLUG'))
|
111 |
+
define('BP_MEDIA_UPLOAD_SLUG', 'upload');
|
112 |
+
|
113 |
+
if (!defined('BP_MEDIA_DELETE_SLUG'))
|
114 |
+
define('BP_MEDIA_DELETE_SLUG', 'delete');
|
115 |
+
|
116 |
+
if (!defined('BP_MEDIA_IMAGES_SLUG'))
|
117 |
+
define('BP_MEDIA_IMAGES_SLUG', 'photos');
|
118 |
+
|
119 |
+
if (!defined('BP_MEDIA_IMAGES_ENTRY_SLUG'))
|
120 |
+
define('BP_MEDIA_IMAGES_ENTRY_SLUG', 'view');
|
121 |
+
|
122 |
+
if (!defined('BP_MEDIA_IMAGES_EDIT_SLUG'))
|
123 |
+
define('BP_MEDIA_IMAGES_EDIT_SLUG', 'edit');
|
124 |
+
|
125 |
+
if (!defined('BP_MEDIA_VIDEOS_SLUG'))
|
126 |
+
define('BP_MEDIA_VIDEOS_SLUG', 'videos');
|
127 |
+
|
128 |
+
if (!defined('BP_MEDIA_VIDEOS_ENTRY_SLUG'))
|
129 |
+
define('BP_MEDIA_VIDEOS_ENTRY_SLUG', 'watch');
|
130 |
+
|
131 |
+
if (!defined('BP_MEDIA_VIDEOS_EDIT_SLUG'))
|
132 |
+
define('BP_MEDIA_VIDEOS_EDIT_SLUG', 'edit');
|
133 |
+
|
134 |
+
if (!defined('BP_MEDIA_AUDIO_SLUG'))
|
135 |
+
define('BP_MEDIA_AUDIO_SLUG', 'music');
|
136 |
+
|
137 |
+
if (!defined('BP_MEDIA_AUDIO_ENTRY_SLUG'))
|
138 |
+
define('BP_MEDIA_AUDIO_ENTRY_SLUG', 'listen');
|
139 |
+
|
140 |
+
if (!defined('BP_MEDIA_AUDIO_EDIT_SLUG'))
|
141 |
+
define('BP_MEDIA_AUDIO_EDIT_SLUG', 'edit');
|
142 |
+
|
143 |
+
if (!defined('BP_MEDIA_ALBUMS_SLUG'))
|
144 |
+
define('BP_MEDIA_ALBUMS_SLUG', 'albums');
|
145 |
+
|
146 |
+
if (!defined('BP_MEDIA_ALBUMS_ENTRY_SLUG'))
|
147 |
+
define('BP_MEDIA_ALBUMS_ENTRY_SLUG', 'list');
|
148 |
+
|
149 |
+
if (!defined('BP_MEDIA_ALBUMS_EDIT_SLUG'))
|
150 |
+
define('BP_MEDIA_ALBUMS_EDIT_SLUG', 'edit');
|
151 |
+
|
152 |
+
/* Labels loaded via text domain, can be translated */
|
153 |
+
if (!defined('BP_MEDIA_LABEL'))
|
154 |
+
define('BP_MEDIA_LABEL', __('Media', $this->text_domain));
|
155 |
+
|
156 |
+
if (!defined('BP_MEDIA_LABEL_SINGULAR'))
|
157 |
+
define('BP_MEDIA_LABEL_SINGULAR', __('Media', $this->text_domain));
|
158 |
+
|
159 |
+
if (!defined('BP_MEDIA_IMAGES_LABEL'))
|
160 |
+
define('BP_MEDIA_IMAGES_LABEL', __('Photos', $this->text_domain));
|
161 |
+
|
162 |
+
if (!defined('BP_MEDIA_IMAGES_LABEL_SINGULAR'))
|
163 |
+
define('BP_MEDIA_IMAGES_LABEL_SINGULAR', __('Photo', $this->text_domain));
|
164 |
+
|
165 |
+
if (!defined('BP_MEDIA_VIDEOS_LABEL'))
|
166 |
+
define('BP_MEDIA_VIDEOS_LABEL', __('Videos', $this->text_domain));
|
167 |
+
|
168 |
+
if (!defined('BP_MEDIA_VIDEOS_LABEL_SINGULAR'))
|
169 |
+
define('BP_MEDIA_VIDEOS_LABEL_SINGULAR', __('Video', $this->text_domain));
|
170 |
+
|
171 |
+
if (!defined('BP_MEDIA_AUDIO_LABEL'))
|
172 |
+
define('BP_MEDIA_AUDIO_LABEL', __('Music', $this->text_domain));
|
173 |
+
|
174 |
+
if (!defined('BP_MEDIA_AUDIO_LABEL_SINGULAR'))
|
175 |
+
define('BP_MEDIA_AUDIO_LABEL_SINGULAR', __('Music', $this->text_domain));
|
176 |
+
|
177 |
+
if (!defined('BP_MEDIA_ALBUMS_LABEL'))
|
178 |
+
define('BP_MEDIA_ALBUMS_LABEL', __('Albums', $this->text_domain));
|
179 |
+
|
180 |
+
if (!defined('BP_MEDIA_ALBUMS_LABEL_SINGULAR'))
|
181 |
+
define('BP_MEDIA_ALBUMS_LABEL_SINGULAR', __('Album', $this->text_domain));
|
182 |
+
|
183 |
+
if (!defined('BP_MEDIAUPLOAD_LABEL'))
|
184 |
+
define('BP_MEDIA_UPLOAD_LABEL', __('Upload', $this->text_domain));
|
185 |
+
|
186 |
+
if (!defined('BP_MEDIA_TMP_DIR'))
|
187 |
+
define('BP_MEDIA_TMP_DIR', WP_CONTENT_DIR . '/bp-media-temp');
|
188 |
+
|
189 |
+
if (!defined('BP_MEDIA_SUPPORT_EMAIL'))
|
190 |
+
define('BP_MEDIA_SUPPORT_EMAIL', $this->support_email);
|
191 |
+
}
|
192 |
+
|
193 |
+
function init() {
|
194 |
+
$this->get_option();
|
195 |
+
|
196 |
+
if (defined('BP_VERSION') && version_compare(BP_VERSION, BP_MEDIA_REQUIRED_BP, '>=')) {
|
197 |
+
add_filter('plugin_action_links', array($this, 'settings_link'), 10, 2);
|
198 |
+
$this->loader = new BPMediaLoader();
|
199 |
+
$this->group_loader = new BPMediaGroup();
|
200 |
+
new BPMediaFilters();
|
201 |
+
new BPMediaActions();
|
202 |
+
new BPMediaFunction();
|
203 |
+
}
|
204 |
+
|
205 |
+
if (file_exists(BP_MEDIA_PATH . '/languages/' . get_locale() . '.mo'))
|
206 |
+
load_textdomain(BP_MEDIA_TXT_DOMAIN, BP_MEDIA_PATH . '/languages/' . get_locale() . '.mo');
|
207 |
+
|
208 |
+
add_action('admin_notices', array($this, 'admin_notice'));
|
209 |
+
global $bp_media_admin;
|
210 |
+
$bp_media_admin = new BPMediaAdmin();
|
211 |
+
}
|
212 |
+
|
213 |
+
function settings_link($links, $file) {
|
214 |
+
/* create link */
|
215 |
+
$plugin_name = plugin_basename(__FILE__);
|
216 |
+
$admin_link = $this->get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php'));
|
217 |
+
if ($file == $plugin_name) {
|
218 |
+
array_unshift(
|
219 |
+
$links, sprintf('<a href="%s">%s</a>', $admin_link, __('Settings', $this->text_domain))
|
220 |
+
);
|
221 |
+
}
|
222 |
+
return $links;
|
223 |
+
}
|
224 |
+
|
225 |
+
function media_sizes() {
|
226 |
+
$def_sizes = array(
|
227 |
+
'activity_image' => array(
|
228 |
+
'width' => 320,
|
229 |
+
'height' => 240
|
230 |
+
),
|
231 |
+
'activity_video' => array(
|
232 |
+
'width' => 320,
|
233 |
+
'height' => 240
|
234 |
+
),
|
235 |
+
'activity_audio' => array(
|
236 |
+
'width' => 320,
|
237 |
+
),
|
238 |
+
'single_image' => array(
|
239 |
+
'width' => 800,
|
240 |
+
'height' => 0
|
241 |
+
),
|
242 |
+
'single_video' => array(
|
243 |
+
'width' => 640,
|
244 |
+
'height' => 480
|
245 |
+
),
|
246 |
+
'single_audio' => array(
|
247 |
+
'width' => 640,
|
248 |
+
),
|
249 |
+
);
|
250 |
+
|
251 |
+
return apply_filters('bpm_media_sizes', $def_sizes);
|
252 |
+
}
|
253 |
+
|
254 |
+
function excerpt_lengths() {
|
255 |
+
global $bp_media_default_excerpts;
|
256 |
+
$def_excerpt = array(
|
257 |
+
'single_entry_title' => 100,
|
258 |
+
'single_entry_description' => 500,
|
259 |
+
'activity_entry_title' => 50,
|
260 |
+
'activity_entry_description' => 500
|
261 |
+
);
|
262 |
+
|
263 |
+
$bp_media_default_excerpts = apply_filters('bpm_excerpt_lengths', $def_excerpt);
|
264 |
+
}
|
265 |
+
|
266 |
+
public function admin_notice() {
|
267 |
+
global $current_user;
|
268 |
+
$user_id = $current_user->ID;
|
269 |
+
if (isset($_GET['bp_media_nag_ignore']) && '0' == $_GET['bp_media_nag_ignore']) {
|
270 |
+
add_user_meta($user_id, 'bp_media_ignore_notice', 'true', true);
|
271 |
+
}
|
272 |
+
/* Check that the user hasn't already clicked to ignore the message */
|
273 |
+
if (!get_user_meta($user_id, 'bp_media_ignore_notice')) {
|
274 |
+
if (defined('BP_VERSION')) {
|
275 |
+
if (version_compare(BP_VERSION, BP_MEDIA_REQUIRED_BP, '<')) {
|
276 |
+
echo '<div class="error"><p>';
|
277 |
+
printf(__('The BuddyPress version installed is an older version and is not supported, please update BuddyPress to use BuddyPress Media Plugin.<a class="alignright" href="%1$s">X</a>', $this->text_domain), '?bp_media_nag_ignore=0');
|
278 |
+
echo "</p></div>";
|
279 |
+
}
|
280 |
+
} else {
|
281 |
+
echo '<div class="error"><p>';
|
282 |
+
printf(__('You have not installed BuddyPress. Please install latest version of BuddyPress to use BuddyPress Media plugin.<a class="alignright" href="%1$s">X</a>', $this->text_domain), '?bp_media_nag_ignore=0');
|
283 |
+
echo "</p></div>";
|
284 |
+
}
|
285 |
+
}
|
286 |
+
}
|
287 |
+
|
288 |
+
public function activate() {
|
289 |
+
$bpmquery = new WP_Query(array('post_type' => 'bp_media', 'posts_per_page' => 1));
|
290 |
+
if ($bpmquery->found_posts > 0) {
|
291 |
+
update_site_option('bp_media_db_version', '1.0');
|
292 |
+
} else {
|
293 |
+
switch (get_site_option('bp_media_db_version', false, false)) {
|
294 |
+
case '2.0':
|
295 |
+
break;
|
296 |
+
default:
|
297 |
+
update_site_option('bp_media_db_version', BP_MEDIA_DB_VERSION);
|
298 |
+
}
|
299 |
+
}
|
300 |
+
}
|
301 |
+
|
302 |
+
function get_admin_url($path = '', $scheme = 'admin') {
|
303 |
+
|
304 |
+
// Links belong in network admin
|
305 |
+
if (is_multisite())
|
306 |
+
$url = network_admin_url($path, $scheme);
|
307 |
+
|
308 |
+
// Links belong in site admin
|
309 |
+
else
|
310 |
+
$url = admin_url($path, $scheme);
|
311 |
+
|
312 |
+
return $url;
|
313 |
+
}
|
314 |
+
|
315 |
+
function widgets_init() {
|
316 |
+
register_widget('BPMediaRecentMedia');
|
317 |
+
register_widget('BPMediaPopularMedia');
|
318 |
+
register_widget('BPMediaWidget');
|
319 |
+
}
|
320 |
|
321 |
}
|
322 |
|
app/main/includes/BPMediaActions.php
CHANGED
@@ -133,7 +133,7 @@ class BPMediaActions {
|
|
133 |
$bp_media_vars = array(
|
134 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
135 |
'page' => 1,
|
136 |
-
'current_action' => $cur_group_id ? (empty($bp->action_variables) ? BP_MEDIA_IMAGES_SLUG : $bp->action_variables) : (isset($bp->current_action) ? $bp->current_action : false),
|
137 |
'action_variables' => isset($bp->action_variables) ? (empty($bp->action_variables) ? array(BP_MEDIA_IMAGES_SLUG) : $bp->action_variables) : array(BP_MEDIA_IMAGES_SLUG),
|
138 |
'displayed_user' => bp_displayed_user_id(),
|
139 |
'loggedin_user' => bp_loggedin_user_id(),
|
@@ -240,7 +240,6 @@ class BPMediaActions {
|
|
240 |
* @since BuddyPress Media 2.0
|
241 |
*/
|
242 |
function action_buttons() {
|
243 |
-
global $bp_media;
|
244 |
if (!in_array('bp_media_current_entry', $GLOBALS))
|
245 |
return false;
|
246 |
global $bp_media_current_entry, $bp_media_options;
|
@@ -373,6 +372,7 @@ class BPMediaActions {
|
|
373 |
* Function to return the media for the ajax requests
|
374 |
*/
|
375 |
function load_more() {
|
|
|
376 |
global $bp, $bp_media_query, $bp_media_posts_per_page;
|
377 |
$page = isset($_POST['page']) ? $_POST['page'] : die();
|
378 |
$current_action = isset($_POST['current_action']) ? $_POST['current_action'] : null;
|
133 |
$bp_media_vars = array(
|
134 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
135 |
'page' => 1,
|
136 |
+
'current_action' => $cur_group_id ? (empty($bp->action_variables) ? BP_MEDIA_IMAGES_SLUG : $bp->action_variables[0]) : (isset($bp->current_action) ? $bp->current_action : false),
|
137 |
'action_variables' => isset($bp->action_variables) ? (empty($bp->action_variables) ? array(BP_MEDIA_IMAGES_SLUG) : $bp->action_variables) : array(BP_MEDIA_IMAGES_SLUG),
|
138 |
'displayed_user' => bp_displayed_user_id(),
|
139 |
'loggedin_user' => bp_loggedin_user_id(),
|
240 |
* @since BuddyPress Media 2.0
|
241 |
*/
|
242 |
function action_buttons() {
|
|
|
243 |
if (!in_array('bp_media_current_entry', $GLOBALS))
|
244 |
return false;
|
245 |
global $bp_media_current_entry, $bp_media_options;
|
372 |
* Function to return the media for the ajax requests
|
373 |
*/
|
374 |
function load_more() {
|
375 |
+
|
376 |
global $bp, $bp_media_query, $bp_media_posts_per_page;
|
377 |
$page = isset($_POST['page']) ? $_POST['page'] : die();
|
378 |
$current_action = isset($_POST['current_action']) ? $_POST['current_action'] : null;
|
app/main/includes/BPMediaFunction.php
CHANGED
@@ -69,18 +69,26 @@ class BPMediaFunction {
|
|
69 |
}
|
70 |
echo '</div>';
|
71 |
}
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
static function conditional_override_allowed_tags($content, $activity = null) {
|
74 |
-
|
75 |
if ($activity != null && in_array($activity->type, $bp_media->activity_types)) {
|
|
|
76 |
add_filter('bp_activity_allowed_tags', 'BPMediaFunction::override_allowed_tags', 1);
|
77 |
-
|
78 |
-
|
79 |
}
|
80 |
|
81 |
function swap_filters() {
|
82 |
add_filter('bp_get_activity_content_body', 'BPMediaFunction::conditional_override_allowed_tags', 1, 2);
|
83 |
-
remove_filter('bp_get_activity_content_body', 'bp_activity_filter_kses', 1);
|
84 |
}
|
85 |
|
86 |
/**
|
69 |
}
|
70 |
echo '</div>';
|
71 |
}
|
72 |
+
/*
|
73 |
+
function remove_kses_filter(){
|
74 |
+
global $bp_media;
|
75 |
+
if ($activity != null && in_array($activity->type, $bp_media->activity_types)) {
|
76 |
+
remove_filter('bp_get_activity_content_body', 'bp_activity_filter_kses', 1);
|
77 |
+
}
|
78 |
+
}
|
79 |
+
*
|
80 |
+
*/
|
81 |
static function conditional_override_allowed_tags($content, $activity = null) {
|
82 |
+
global $bp_media;
|
83 |
if ($activity != null && in_array($activity->type, $bp_media->activity_types)) {
|
84 |
+
|
85 |
add_filter('bp_activity_allowed_tags', 'BPMediaFunction::override_allowed_tags', 1);
|
86 |
+
}
|
87 |
+
return $content;
|
88 |
}
|
89 |
|
90 |
function swap_filters() {
|
91 |
add_filter('bp_get_activity_content_body', 'BPMediaFunction::conditional_override_allowed_tags', 1, 2);
|
|
|
92 |
}
|
93 |
|
94 |
/**
|
app/main/includes/BPMediaHostWordpress.php
CHANGED
@@ -1,752 +1,754 @@
|
|
1 |
<?php
|
2 |
-
class BPMediaHostWordpress {
|
3 |
|
4 |
-
|
5 |
-
* Private variables not to be accessible outside this class' member functions
|
6 |
-
*/
|
7 |
-
protected $id, //id of the entry
|
8 |
-
$name, //Name of the entry
|
9 |
-
$description, //Description of the entry
|
10 |
-
$url, //URL of the entry
|
11 |
-
$type, //Type of the entry (Video, Image or Audio)
|
12 |
-
$owner, //Owner of the entry
|
13 |
-
$delete_url, //The delete url for the media
|
14 |
-
$thumbnail_id, //The thumbnail's id
|
15 |
-
$album_id, //The album id to which the media belongs
|
16 |
-
$edit_url, //The edit page's url for the media
|
17 |
-
$group_id; //The group id of the current media file if it belongs to a group
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Constructs a new BP_Media_Host_Wordpress element
|
21 |
-
*
|
22 |
-
* @param mixed $media_id optional Media ID of the element to be initialized if not defined, returns an empty element.
|
23 |
-
*
|
24 |
-
* @since BuddyPress Media 2.0
|
25 |
-
*/
|
26 |
-
function __construct($media_id = '') {
|
27 |
-
if (!$media_id == '') {
|
28 |
-
$this->init($media_id);
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Initializes the object with the variables from the post
|
34 |
-
*
|
35 |
-
* @param mixed $media_id Media ID of the element to be initialized. Can be the ID or the object of the Media
|
36 |
-
*
|
37 |
-
* @since BuddyPress Media 2.0
|
38 |
-
*/
|
39 |
-
function init($media_id = '') {
|
40 |
-
if (is_object($media_id)) {
|
41 |
-
$media = $media_id;
|
42 |
-
} else {
|
43 |
-
$media = &get_post($media_id);
|
44 |
-
}
|
45 |
-
if (empty($media->ID))
|
46 |
-
throw new Exception(__('Sorry, the requested media does not exist.', BP_MEDIA_TXT_DOMAIN));
|
47 |
-
$this->id = $media->ID;
|
48 |
-
$this->description = $media->post_content;
|
49 |
-
$this->name = $media->post_title;
|
50 |
-
$this->owner = $media->post_author;
|
51 |
-
$this->album_id = $media->post_parent;
|
52 |
-
$meta_key = get_post_meta($this->id, 'bp-media-key', true);
|
53 |
-
/**
|
54 |
-
* We use bp-media-key to distinguish if the entry belongs to a group or not
|
55 |
-
* if the value is less than 0 it means it the group id to which the media belongs
|
56 |
-
* and if its greater than 0 then it means its the author id of the uploader
|
57 |
-
* But for use in the class, we use group_id as positive integer even though
|
58 |
-
* we use it as negative value in the bp-media-key meta key
|
59 |
-
*/
|
60 |
-
$this->group_id = $meta_key<0?-$meta_key:0;
|
61 |
-
preg_match_all('/audio|video|image/i', $media->post_mime_type, $result);
|
62 |
-
if(isset($result[0][0]))
|
63 |
-
$this->type = $result[0][0];
|
64 |
-
else
|
65 |
-
return false;
|
66 |
-
$this->set_permalinks();
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Handles the uploaded media file and creates attachment post for the file.
|
71 |
-
*
|
72 |
-
* @since BuddyPress Media 2.0
|
73 |
-
*/
|
74 |
-
function add_media($name, $description, $album_id = 0, $group = 0, $is_multiple = false) {
|
75 |
-
do_action('bp_media_before_add_media');
|
76 |
-
global $bp, $wpdb, $bp_media_count,$bp_media;
|
77 |
-
include_once(ABSPATH . 'wp-admin/includes/file.php');
|
78 |
-
include_once(ABSPATH . 'wp-admin/includes/image.php');
|
79 |
-
|
80 |
-
$post_id = $this->check_and_create_album($album_id,$group);
|
81 |
-
|
82 |
-
$file = wp_handle_upload($_FILES['bp_media_file']);
|
83 |
-
if (isset($file['error']) || $file === null) {
|
84 |
-
throw new Exception(__('Error Uploading File', BP_MEDIA_TXT_DOMAIN));
|
85 |
-
}
|
86 |
-
|
87 |
-
$attachment = array();
|
88 |
-
$url = $file['url'];
|
89 |
-
$type = $file['type'];
|
90 |
-
$file = $file['file'];
|
91 |
-
$title = $name;
|
92 |
-
$content = $description;
|
93 |
-
$attachment = array(
|
94 |
-
'post_mime_type' => $type,
|
95 |
-
'guid' => $url,
|
96 |
-
'post_title' => $title,
|
97 |
-
'post_content' => $content,
|
98 |
-
'post_parent' => $post_id,
|
99 |
-
);
|
100 |
-
BPMediaActions::init_count(bp_loggedin_user_id());
|
101 |
-
switch ($type) {
|
102 |
-
case 'video/mp4' :
|
103 |
-
case 'video/quicktime' :
|
104 |
-
$type = 'video';
|
105 |
-
include_once(trailingslashit(BP_MEDIA_PATH) . 'lib/getid3/getid3.php');
|
106 |
-
try {
|
107 |
-
$getID3 = new getID3;
|
108 |
-
$vid_info = $getID3->analyze($file);
|
109 |
-
} catch (Exception $e) {
|
110 |
-
unlink($file);
|
111 |
-
$activity_content = false;
|
112 |
-
throw new Exception(__('MP4 file you have uploaded is corrupt.', BP_MEDIA_TXT_DOMAIN));
|
113 |
-
}
|
114 |
-
if (is_array($vid_info)) {
|
115 |
-
if (!array_key_exists('error',$vid_info)&& array_key_exists('fileformat', $vid_info) && array_key_exists('video', $vid_info)&&array_key_exists('fourcc',$vid_info['video'])) {
|
116 |
-
if (!($vid_info['fileformat']=='mp4'&&$vid_info['video']['fourcc']=='avc1')) {
|
117 |
-
unlink($file);
|
118 |
-
$activity_content = false;
|
119 |
-
throw new Exception(__('The MP4 file you have uploaded is using an unsupported video codec. Supported video codec is H.264.', BP_MEDIA_TXT_DOMAIN));
|
120 |
-
}
|
121 |
-
} else {
|
122 |
-
unlink($file);
|
123 |
-
$activity_content = false;
|
124 |
-
throw new Exception(__('The MP4 file you have uploaded is using an unsupported video codec. Supported video codec is H.264.', BP_MEDIA_TXT_DOMAIN));
|
125 |
-
}
|
126 |
-
} else {
|
127 |
-
unlink($file);
|
128 |
-
$activity_content = false;
|
129 |
-
throw new Exception(__('The MP4 file you have uploaded is not a video file.', BP_MEDIA_TXT_DOMAIN));
|
130 |
-
}
|
131 |
-
$bp_media_count['videos'] = intval($bp_media_count['videos']) + 1;
|
132 |
-
break;
|
133 |
-
case 'audio/mpeg' :
|
134 |
-
include_once(trailingslashit(BP_MEDIA_PATH) . 'lib/getid3/getid3.php');
|
135 |
-
try {
|
136 |
-
$getID3 = new getID3;
|
137 |
-
$file_info = $getID3->analyze($file);
|
138 |
-
} catch (Exception $e) {
|
139 |
-
unlink($file);
|
140 |
-
$activity_content = false;
|
141 |
-
throw new Exception(__('MP3 file you have uploaded is currupt.', BP_MEDIA_TXT_DOMAIN));
|
142 |
-
}
|
143 |
-
if (is_array($file_info)) {
|
144 |
-
if (!array_key_exists('error',$file_info)&& array_key_exists('fileformat', $file_info) && array_key_exists('audio', $file_info)&&array_key_exists('dataformat',$file_info['audio'])) {
|
145 |
-
if (!($file_info['fileformat']=='mp3'&&$file_info['audio']['dataformat']=='mp3')) {
|
146 |
-
unlink($file);
|
147 |
-
$activity_content = false;
|
148 |
-
throw new Exception(__('The MP3 file you have uploaded is using an unsupported audio format. Supported audio format is MP3.', BP_MEDIA_TXT_DOMAIN));
|
149 |
-
}
|
150 |
-
} else {
|
151 |
-
unlink($file);
|
152 |
-
$activity_content = false;
|
153 |
-
throw new Exception(__('The MP3 file you have uploaded is using an unsupported audio format. Supported audio format is MP3.', BP_MEDIA_TXT_DOMAIN));
|
154 |
-
}
|
155 |
-
} else {
|
156 |
-
unlink($file);
|
157 |
-
$activity_content = false;
|
158 |
-
throw new Exception(__('The MP3 file you have uploaded is not an audio file.', BP_MEDIA_TXT_DOMAIN));
|
159 |
-
}
|
160 |
-
$type = 'audio';
|
161 |
-
$bp_media_count['audio'] = intval($bp_media_count['audio']) + 1;
|
162 |
-
break;
|
163 |
-
case 'image/gif' :
|
164 |
-
case 'image/jpeg' :
|
165 |
-
case 'image/png' :
|
166 |
-
$type = 'image';
|
167 |
-
$bp_media_count['images'] = intval($bp_media_count['images']) + 1;
|
168 |
-
break;
|
169 |
-
default :
|
170 |
-
unlink($file);
|
171 |
-
$activity_content = false;
|
172 |
-
throw new Exception(__('Media File you have tried to upload is not supported. Supported media files are .jpg, .png, .gif, .mp3, .mov and .mp4.', BP_MEDIA_TXT_DOMAIN));
|
173 |
-
}
|
174 |
-
$attachment_id = wp_insert_attachment($attachment, $file, $post_id);
|
175 |
-
if (!is_wp_error($attachment_id)) {
|
176 |
-
wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $file));
|
177 |
-
} else {
|
178 |
-
unlink($file);
|
179 |
-
throw new Exception(__('Error creating attachment for the media file, please try again', BP_MEDIA_TXT_DOMAIN));
|
180 |
-
}
|
181 |
-
$this->id = $attachment_id;
|
182 |
-
$this->name = $name;
|
183 |
-
$this->description = $description;
|
184 |
-
$this->type = $type;
|
185 |
-
$this->owner = get_current_user_id();
|
186 |
-
$this->album_id = $post_id;
|
187 |
-
$this->group_id = $group;
|
188 |
-
$this->set_permalinks();
|
189 |
-
if($group == 0){
|
190 |
-
update_post_meta($attachment_id, 'bp-media-key', get_current_user_id());
|
191 |
-
bp_update_user_meta(bp_loggedin_user_id(), 'bp_media_count', $bp_media_count);
|
192 |
-
}
|
193 |
-
else{
|
194 |
-
update_post_meta($attachment_id, 'bp-media-key', (-$group));
|
195 |
-
}
|
196 |
-
do_action('bp_media_after_add_media',$this,$is_multiple);
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* Fetches the content of the activity of media upload based on its type
|
201 |
-
*
|
202 |
-
*/
|
203 |
-
function get_media_activity_content() {
|
204 |
-
global $bp_media_counter, $bp_media_default_excerpts,$bp_media;
|
205 |
-
$attachment_id = $this->id;
|
206 |
-
$activity_content = '<div class="bp_media_title"><a href="' . $this->url . '" title="' . __($this->description,BP_MEDIA_TXT_DOMAIN) . '">' . __(wp_html_excerpt($this->name, $bp_media_default_excerpts['activity_entry_title']),BP_MEDIA_TXT_DOMAIN) . '</a></div>';
|
207 |
-
$activity_content .='<div class="bp_media_content">';
|
208 |
-
switch ($this->type) {
|
209 |
-
case 'video' :
|
210 |
-
if($this->thumbnail_id){
|
211 |
-
$image_array = image_downsize($this->thumbnail_id, 'bp_media_activity_image');
|
212 |
-
$activity_content.='<video poster="'.$image_array[0].'" src="' . wp_get_attachment_url($attachment_id) . '" width="320" height="240" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span><script>bp_media_create_element("bp_media_video_' . $this->id . '_' . $bp_media_counter . '");</script>';
|
213 |
-
}
|
214 |
-
else{
|
215 |
-
$activity_content.='<video src="' . wp_get_attachment_url($attachment_id) . '" width="320" height="240" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span><script>bp_media_create_element("bp_media_video_' . $this->id . '_' . $bp_media_counter . '");</script>';
|
216 |
-
}
|
217 |
-
break;
|
218 |
-
case 'audio' :
|
219 |
-
$activity_content.='<audio src="' . wp_get_attachment_url($attachment_id) . '" width="320" type="audio/mp3" id="bp_media_audio_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none" ></audio></span><script>bp_media_create_element("bp_media_audio_' . $this->id . '_' . $bp_media_counter . '");</script>';
|
220 |
-
$type = 'audio';
|
221 |
-
break;
|
222 |
-
case 'image' :
|
223 |
-
$image_array = image_downsize($attachment_id, 'bp_media_activity_image');
|
224 |
-
$activity_content.='<a href="' . $this->url . '" title="' . __($this->name,BP_MEDIA_TXT_DOMAIN) . '"><img src="' . $image_array[0] . '" id="bp_media_image_' . $this->id . '_' . $bp_media_counter++ . '" alt="' . __($this->name,BP_MEDIA_TXT_DOMAIN) . '" /></a>';
|
225 |
-
$type = 'image';
|
226 |
-
break;
|
227 |
-
default :
|
228 |
-
return false;
|
229 |
-
}
|
230 |
-
$activity_content .= '</div>';
|
231 |
-
$activity_content .= '<div class="bp_media_description">' . __(wp_html_excerpt($this->description, $bp_media_default_excerpts['activity_entry_description']),BP_MEDIA_TXT_DOMAIN) . '</div>';
|
232 |
-
return $activity_content;
|
233 |
-
}
|
234 |
-
|
235 |
-
/**
|
236 |
-
* Returns the single media entry's URL
|
237 |
-
*/
|
238 |
-
function get_media_activity_url() {
|
239 |
-
if (!bp_is_activity_component())
|
240 |
-
return false;
|
241 |
-
$activity_url = $this->url;
|
242 |
-
return $activity_url;
|
243 |
-
}
|
244 |
-
|
245 |
-
/**
|
246 |
-
* Returns the media activity's action text
|
247 |
-
*/
|
248 |
-
function get_media_activity_action() {
|
249 |
-
global $bp_media;
|
250 |
-
if (!bp_is_activity_component())
|
251 |
-
return false;
|
252 |
-
$activity_action = sprintf(__("%s uploaded a media.",BP_MEDIA_TXT_DOMAIN), bp_core_get_userlink($this->owner));
|
253 |
-
return $activity_action;
|
254 |
-
}
|
255 |
-
|
256 |
-
/**
|
257 |
-
* Returns the HTML for content of the single entry page of the Media Entry
|
258 |
-
*/
|
259 |
-
function get_media_single_content() {
|
260 |
-
global $bp_media_default_excerpts,$bp_media;
|
261 |
-
|
262 |
-
$default_sizes = $bp_media->media_sizes();
|
263 |
-
$content = '';
|
264 |
-
if($this->group_id>0){
|
265 |
-
|
266 |
-
$content .= '<div class="bp_media_author">' . __("Uploaded by ", BP_MEDIA_TXT_DOMAIN) . bp_core_get_userlink($this->owner).'</div>';
|
267 |
-
}
|
268 |
-
$content .= '<div class="bp_media_content">';
|
269 |
-
switch ($this->type) {
|
270 |
-
case 'video' :
|
271 |
-
if($this->thumbnail_id){
|
272 |
-
$image_array = image_downsize($this->thumbnail_id, 'bp_media_single_image');
|
273 |
-
$content.=apply_filters('bp_media_single_content_filter', '<video poster="'.$image_array[0].'" src="' . wp_get_attachment_url($this->id) . '" width="' . $default_sizes['single_video']['width'] . '" height="' . ($default_sizes['single_video']['height'] == 0 ? 'auto' : $default_sizes['single_video']['height']) . '" type="video/mp4" id="bp_media_video_' . $this->id . '" controls="controls" preload="none"></video><script>bp_media_create_element("bp_media_video_' . $this->id . '");</script>',$this);
|
274 |
-
}
|
275 |
-
else{
|
276 |
-
$content.=apply_filters('bp_media_single_content_filter', '<video src="' . wp_get_attachment_url($this->id) . '" width="' . $default_sizes['single_video']['width'] . '" height="' . ($default_sizes['single_video']['height'] == 0 ? 'auto' : $default_sizes['single_video']['height']) . '" type="video/mp4" id="bp_media_video_' . $this->id . '" controls="controls" preload="none"></video><script>bp_media_create_element("bp_media_video_' . $this->id . '");</script>',$this);
|
277 |
-
}
|
278 |
-
break;
|
279 |
-
case 'audio' :
|
280 |
-
$content.=apply_filters('bp_media_single_content_filter', '<audio src="' . wp_get_attachment_url($this->id) . '" width="' . $default_sizes['single_audio']['width'] . '" type="audio/mp3" id="bp_media_audio_' . $this->id . '" controls="controls" preload="none" ></audio><script>bp_media_create_element("bp_media_audio_' . $this->id . '");</script>',$this);
|
281 |
-
break;
|
282 |
-
case 'image' :
|
283 |
-
$image_array = image_downsize($this->id, 'bp_media_single_image');
|
284 |
-
$content.=apply_filters('bp_media_single_content_filter', '<img src="' . $image_array[0] . '" id="bp_media_image_' . $this->id . '" />',$this);
|
285 |
-
break;
|
286 |
-
default :
|
287 |
-
return false;
|
288 |
-
}
|
289 |
-
$content .= '</div>';
|
290 |
-
$content .= '<div class="bp_media_description">' . __(wp_html_excerpt($this->description, $bp_media_default_excerpts['single_entry_description']),BP_MEDIA_TXT_DOMAIN) . '</div>';
|
291 |
-
return $content;
|
292 |
-
}
|
293 |
-
|
294 |
-
/**
|
295 |
-
* Returns the HTML for title of the single entry page of the Media Entry
|
296 |
-
*/
|
297 |
-
function get_media_single_title(){
|
298 |
-
global $bp_media_default_excerpts,$bp_media;
|
299 |
-
$content = '<div class="bp_media_title">' . __(wp_html_excerpt($this->name, $bp_media_default_excerpts['single_entry_title']),BP_MEDIA_TXT_DOMAIN) . '</div>';
|
300 |
-
return $content;
|
301 |
-
}
|
302 |
-
|
303 |
-
/**
|
304 |
-
* Returns the HTML for a media entry to be shown in the listing/gallery page
|
305 |
-
*/
|
306 |
-
function get_media_gallery_content() {
|
307 |
-
global $bp_media;
|
308 |
-
$attachment = $this->id;
|
309 |
-
switch ($this->type) {
|
310 |
-
case 'video' :
|
311 |
-
if($this->thumbnail_id){
|
312 |
-
$medium_array = image_downsize($this->thumbnail_id, 'thumbnail');
|
313 |
-
$thumb_url = $medium_array[0];
|
314 |
-
}
|
315 |
-
else{
|
316 |
-
$thumb_url = BP_MEDIA_URL.'app/assets/img/video_thumb.png';
|
317 |
-
}
|
318 |
-
?>
|
319 |
-
<li>
|
320 |
-
<a href="<?php echo $this->url ?>" title="<?php _e($this->description,BP_MEDIA_TXT_DOMAIN); ?>">
|
321 |
-
<img src="<?php echo $thumb_url; ?>" />
|
322 |
-
</a>
|
323 |
-
<h3 title="<?php echo $this->name; ?>"><a href="<?php echo $this->url ?>" title="<?php _e($this->description,BP_MEDIA_TXT_DOMAIN); ?>"><?php echo $this->name; ?></a></h3>
|
324 |
-
</li>
|
325 |
-
<?php
|
326 |
-
break;
|
327 |
-
case 'audio' :
|
328 |
-
if($this->thumbnail_id){
|
329 |
-
$medium_array = image_downsize($this->thumbnail_id, 'thumbnail');
|
330 |
-
$thumb_url = $medium_array[0];
|
331 |
-
}
|
332 |
-
else{
|
333 |
-
$thumb_url = BP_MEDIA_URL.'app/assets/img/audio_thumb.png';
|
334 |
-
}
|
335 |
-
?>
|
336 |
-
<li>
|
337 |
-
<a href="<?php echo $this->url ?>" title="<?php _e($this->description,BP_MEDIA_TXT_DOMAIN); ?>">
|
338 |
-
<img src="<?php echo $thumb_url ?>" />
|
339 |
-
</a>
|
340 |
-
<h3 title="<?php echo $this->name; ?>"><a href="<?php echo $this->url ?>" title="<?php _e($this->description,BP_MEDIA_TXT_DOMAIN); ?>"><?php echo $this->name ?></a></h3>
|
341 |
-
</li>
|
342 |
-
<?php
|
343 |
-
break;
|
344 |
-
case 'image' :
|
345 |
-
$medium_array = image_downsize($attachment, 'thumbnail');
|
346 |
-
$medium_path = $medium_array[0];
|
347 |
-
?>
|
348 |
-
<li>
|
349 |
-
<a href="<?php echo $this->url ?>" title="<?php echo $this->description ?>">
|
350 |
-
<img src="<?php echo $medium_path ?>" />
|
351 |
-
</a>
|
352 |
-
<h3 title="<?php echo $this->name ?>"><a href="<?php echo $this->url ?>" title="<?php _e($this->description,BP_MEDIA_TXT_DOMAIN); ?>"><?php echo $this->name ?></a></h3>
|
353 |
-
</li>
|
354 |
-
<?php
|
355 |
-
break;
|
356 |
-
default :
|
357 |
-
return false;
|
358 |
-
}
|
359 |
-
}
|
360 |
-
|
361 |
-
function show_comment_form_wordpress(){
|
362 |
-
query_posts('attachment_id='.$this->id);
|
363 |
-
while(have_posts()): the_post();
|
364 |
-
add_action('comment_form','BPMediaFunction::wp_comment_form_mod');
|
365 |
-
comments_template();
|
366 |
-
endwhile;
|
367 |
-
}
|
368 |
-
|
369 |
-
/**
|
370 |
-
* Outputs the comments and comment form in the single media entry page
|
371 |
-
*/
|
372 |
-
function show_comment_form() {
|
373 |
-
global $bp_media;
|
374 |
-
$activity_id = get_post_meta($this->id, 'bp_media_child_activity', true);
|
375 |
-
if(!$activity_id || !function_exists('bp_has_activities'))
|
376 |
-
return false;
|
377 |
-
if (bp_has_activities(array(
|
378 |
-
'display_comments' => 'stream',
|
379 |
-
'include' => $activity_id,
|
380 |
-
'max' => 1
|
381 |
-
))) :
|
382 |
-
while (bp_activities()) : bp_the_activity();
|
383 |
-
do_action('bp_before_activity_entry');
|
384 |
-
?>
|
385 |
-
<div class="activity">
|
386 |
-
<ul id="activity-stream" class="activity-list item-list">
|
387 |
-
<li class="activity activity_update" id="activity-<?php echo $activity_id; ?>">
|
388 |
-
<div class="activity-content">
|
389 |
-
<?php do_action('bp_activity_entry_content'); ?>
|
390 |
-
<?php if (is_user_logged_in()) : ?>
|
391 |
-
<div class="activity-meta no-ajax">
|
392 |
-
<?php if (bp_activity_can_comment()) : ?>
|
393 |
-
<a href="<?php bp_get_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf(__('Comment <span>%s</span>', BP_MEDIA_TXT_DOMAIN), bp_activity_get_comment_count()); ?></a>
|
394 |
-
<?php endif; ?>
|
395 |
-
<?php if (bp_activity_can_favorite()) : ?>
|
396 |
-
<?php if (!bp_get_activity_is_favorite()) : ?>
|
397 |
-
<a href="<?php bp_activity_favorite_link(); ?>" class="button fav bp-secondary-action" title="<?php esc_attr_e('Mark as Favorite', BP_MEDIA_TXT_DOMAIN); ?>"><?php _e('Favorite', BP_MEDIA_TXT_DOMAIN) ?></a>
|
398 |
-
<?php else : ?>
|
399 |
-
<a href="<?php bp_activity_unfavorite_link(); ?>" class="button unfav bp-secondary-action" title="<?php esc_attr_e('Remove Favorite', BP_MEDIA_TXT_DOMAIN); ?>"><?php _e('Remove Favorite', BP_MEDIA_TXT_DOMAIN) ?></a>
|
400 |
-
<?php endif; ?>
|
401 |
-
<?php endif; ?>
|
402 |
-
<?php if (bp_activity_user_can_delete()) bp_activity_delete_link(); ?>
|
403 |
-
<?php do_action('bp_activity_entry_meta'); ?>
|
404 |
-
</div>
|
405 |
-
<?php endif; ?>
|
406 |
-
</div>
|
407 |
-
<?php do_action('bp_before_activity_entry_comments'); ?>
|
408 |
-
<?php if (( is_user_logged_in() && bp_activity_can_comment() ) || bp_activity_get_comment_count()) : ?>
|
409 |
-
<div class="activity-comments">
|
410 |
-
<?php bp_activity_comments(); ?>
|
411 |
-
<?php if (is_user_logged_in()) : ?>
|
412 |
-
<form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>>
|
413 |
-
<div class="ac-reply-avatar"><?php bp_loggedin_user_avatar('width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT); ?></div>
|
414 |
-
<div class="ac-reply-content">
|
415 |
-
<div class="ac-textarea">
|
416 |
-
<textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
|
417 |
-
</div>
|
418 |
-
<input type="submit" name="ac_form_submit" value="<?php _e('Post', BP_MEDIA_TXT_DOMAIN); ?>" /> <?php _e('or press esc to cancel.', BP_MEDIA_TXT_DOMAIN); ?>
|
419 |
-
<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
|
420 |
-
</div>
|
421 |
-
<?php do_action('bp_activity_entry_comments'); ?>
|
422 |
-
<?php wp_nonce_field('new_activity_comment', '_wpnonce_new_activity_comment'); ?>
|
423 |
-
</form>
|
424 |
-
<?php endif; ?>
|
425 |
-
</div>
|
426 |
-
<?php endif; ?>
|
427 |
-
<?php do_action('bp_after_activity_entry_comments'); ?>
|
428 |
-
</li>
|
429 |
-
</ul>
|
430 |
-
</div>
|
431 |
-
<?php
|
432 |
-
endwhile;
|
433 |
-
else: ?>
|
434 |
-
<div class="activity">
|
435 |
-
<ul id="activity-stream" class="activity-list item-list">
|
436 |
-
<li class="activity activity_update" id="activity-<?php echo $activity_id; ?>">
|
437 |
-
<div class="activity-content">
|
438 |
-
<?php do_action('bp_activity_entry_content'); ?>
|
439 |
-
<?php if (is_user_logged_in()) : ?>
|
440 |
-
<div class="activity-meta no-ajax">
|
441 |
-
<a href="<?php echo $this->get_delete_url(); ?>" class="button item-button bp-secondary-action delete-activity-single confirm" rel="nofollow"><?php _e("Delete",BP_MEDIA_TXT_DOMAIN); ?></a>
|
442 |
-
</div>
|
443 |
-
<?php endif; ?>
|
444 |
-
</div>
|
445 |
-
</li>
|
446 |
-
</ul>
|
447 |
-
</div>
|
448 |
-
<?php
|
449 |
-
endif;
|
450 |
-
}
|
451 |
-
|
452 |
-
/**
|
453 |
-
* Returns the URL of the single media entry page
|
454 |
-
*/
|
455 |
-
function get_url() {
|
456 |
-
return $this->url;
|
457 |
-
}
|
458 |
-
|
459 |
-
/**
|
460 |
-
* Returns the URL of the attached media file
|
461 |
-
*/
|
462 |
-
function get_attachment_url(){
|
463 |
-
return wp_get_attachment_url($this->id);
|
464 |
-
}
|
465 |
-
|
466 |
-
/**
|
467 |
-
* Updates the media entry
|
468 |
-
*
|
469 |
-
* @param array $args Array with the following keys:<br/>
|
470 |
-
* 'name' <br/>
|
471 |
-
* 'description'<br/>
|
472 |
-
* 'owner'
|
473 |
-
*
|
474 |
-
* @return bool True when the update is successful, False when the update fails
|
475 |
-
*/
|
476 |
-
function update_media($args=array()){
|
477 |
-
$defaults=array(
|
478 |
-
'name' => $this->name,
|
479 |
-
'description' => $this->description,
|
480 |
-
'owner' => $this->owner
|
481 |
-
);
|
482 |
-
$args = wp_parse_args( $args, $defaults );
|
483 |
-
$post=get_post($this->id,ARRAY_A);
|
484 |
-
$post['post_title']=esc_html($args['name']);
|
485 |
-
$post['post_content']=esc_html($args['description']);
|
486 |
-
$post['post_author']=$args['owner'];
|
487 |
-
$result = wp_update_post($post);
|
488 |
-
$this->init($this->id);
|
489 |
-
return $result;
|
490 |
-
}
|
491 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
492 |
/**
|
493 |
-
*
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
518 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
519 |
}
|
520 |
}
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
|
|
|
|
|
|
723 |
FROM $wpdb->posts
|
724 |
WHERE
|
725 |
post_title = 'Wall Posts'
|
726 |
-
AND post_author = '".
|
727 |
AND post_type='bp_media_album'"
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
"SELECT wp_posts.ID
|
733 |
FROM $wpdb->posts
|
734 |
INNER JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id
|
735 |
AND $wpdb->postmeta.meta_key = 'bp-media-key'
|
736 |
AND $wpdb->postmeta.meta_value = -$group
|
737 |
-
AND $wpdb->posts.post_title = 'Wall Posts'"
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
|
|
|
1 |
<?php
|
|
|
2 |
|
3 |
+
class BPMediaHostWordpress {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
+
/**
|
6 |
+
* Private variables not to be accessible outside this class' member functions
|
7 |
+
*/
|
8 |
+
protected $id, //id of the entry
|
9 |
+
$name, //Name of the entry
|
10 |
+
$description, //Description of the entry
|
11 |
+
$url, //URL of the entry
|
12 |
+
$type, //Type of the entry (Video, Image or Audio)
|
13 |
+
$owner, //Owner of the entry
|
14 |
+
$delete_url, //The delete url for the media
|
15 |
+
$thumbnail_id, //The thumbnail's id
|
16 |
+
$album_id, //The album id to which the media belongs
|
17 |
+
$edit_url, //The edit page's url for the media
|
18 |
+
$group_id; //The group id of the current media file if it belongs to a group
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Constructs a new BP_Media_Host_Wordpress element
|
22 |
+
*
|
23 |
+
* @param mixed $media_id optional Media ID of the element to be initialized if not defined, returns an empty element.
|
24 |
+
*
|
25 |
+
* @since BuddyPress Media 2.0
|
26 |
+
*/
|
27 |
+
|
28 |
+
function __construct($media_id = '') {
|
29 |
+
if (!$media_id == '') {
|
30 |
+
$this->init($media_id);
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Initializes the object with the variables from the post
|
36 |
+
*
|
37 |
+
* @param mixed $media_id Media ID of the element to be initialized. Can be the ID or the object of the Media
|
38 |
+
*
|
39 |
+
* @since BuddyPress Media 2.0
|
40 |
+
*/
|
41 |
+
function init($media_id = '') {
|
42 |
+
if (is_object($media_id)) {
|
43 |
+
$media = $media_id;
|
44 |
+
} else {
|
45 |
+
$media = &get_post($media_id);
|
46 |
+
}
|
47 |
+
if (empty($media->ID))
|
48 |
+
throw new Exception(__('Sorry, the requested media does not exist.', BP_MEDIA_TXT_DOMAIN));
|
49 |
+
$this->id = $media->ID;
|
50 |
+
$this->description = $media->post_content;
|
51 |
+
$this->name = $media->post_title;
|
52 |
+
$this->owner = $media->post_author;
|
53 |
+
$this->album_id = $media->post_parent;
|
54 |
+
$meta_key = get_post_meta($this->id, 'bp-media-key', true);
|
55 |
/**
|
56 |
+
* We use bp-media-key to distinguish if the entry belongs to a group or not
|
57 |
+
* if the value is less than 0 it means it the group id to which the media belongs
|
58 |
+
* and if its greater than 0 then it means its the author id of the uploader
|
59 |
+
* But for use in the class, we use group_id as positive integer even though
|
60 |
+
* we use it as negative value in the bp-media-key meta key
|
61 |
+
*/
|
62 |
+
$this->group_id = $meta_key < 0 ? -$meta_key : 0;
|
63 |
+
preg_match_all('/audio|video|image/i', $media->post_mime_type, $result);
|
64 |
+
if (isset($result[0][0]))
|
65 |
+
$this->type = $result[0][0];
|
66 |
+
else
|
67 |
+
return false;
|
68 |
+
$this->set_permalinks();
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Handles the uploaded media file and creates attachment post for the file.
|
73 |
+
*
|
74 |
+
* @since BuddyPress Media 2.0
|
75 |
+
*/
|
76 |
+
function add_media($name, $description, $album_id = 0, $group = 0, $is_multiple = false) {
|
77 |
+
do_action('bp_media_before_add_media');
|
78 |
+
global $bp, $wpdb, $bp_media_count, $bp_media;
|
79 |
+
include_once(ABSPATH . 'wp-admin/includes/file.php');
|
80 |
+
include_once(ABSPATH . 'wp-admin/includes/image.php');
|
81 |
+
|
82 |
+
$post_id = $this->check_and_create_album($album_id, $group);
|
83 |
+
|
84 |
+
$file = wp_handle_upload($_FILES['bp_media_file']);
|
85 |
+
if (isset($file['error']) || $file === null) {
|
86 |
+
throw new Exception(__('Error Uploading File', BP_MEDIA_TXT_DOMAIN));
|
87 |
+
}
|
88 |
+
|
89 |
+
$attachment = array();
|
90 |
+
$url = $file['url'];
|
91 |
+
$type = $file['type'];
|
92 |
+
$file = $file['file'];
|
93 |
+
$title = $name;
|
94 |
+
$content = $description;
|
95 |
+
$attachment = array(
|
96 |
+
'post_mime_type' => $type,
|
97 |
+
'guid' => $url,
|
98 |
+
'post_title' => $title,
|
99 |
+
'post_content' => $content,
|
100 |
+
'post_parent' => $post_id,
|
101 |
+
);
|
102 |
+
BPMediaActions::init_count(bp_loggedin_user_id());
|
103 |
+
switch ($type) {
|
104 |
+
case 'video/mp4' :
|
105 |
+
case 'video/quicktime' :
|
106 |
+
$type = 'video';
|
107 |
+
include_once(trailingslashit(BP_MEDIA_PATH) . 'lib/getid3/getid3.php');
|
108 |
+
try {
|
109 |
+
$getID3 = new getID3;
|
110 |
+
$vid_info = $getID3->analyze($file);
|
111 |
+
} catch (Exception $e) {
|
112 |
+
unlink($file);
|
113 |
+
$activity_content = false;
|
114 |
+
throw new Exception(__('MP4 file you have uploaded is corrupt.', BP_MEDIA_TXT_DOMAIN));
|
115 |
+
}
|
116 |
+
if (is_array($vid_info)) {
|
117 |
+
if (!array_key_exists('error', $vid_info) && array_key_exists('fileformat', $vid_info) && array_key_exists('video', $vid_info) && array_key_exists('fourcc', $vid_info['video'])) {
|
118 |
+
if (!($vid_info['fileformat'] == 'mp4' && $vid_info['video']['fourcc'] == 'avc1')) {
|
119 |
+
unlink($file);
|
120 |
+
$activity_content = false;
|
121 |
+
throw new Exception(__('The MP4 file you have uploaded is using an unsupported video codec. Supported video codec is H.264.', BP_MEDIA_TXT_DOMAIN));
|
122 |
+
}
|
123 |
+
} else {
|
124 |
+
unlink($file);
|
125 |
+
$activity_content = false;
|
126 |
+
throw new Exception(__('The MP4 file you have uploaded is using an unsupported video codec. Supported video codec is H.264.', BP_MEDIA_TXT_DOMAIN));
|
127 |
+
}
|
128 |
+
} else {
|
129 |
+
unlink($file);
|
130 |
+
$activity_content = false;
|
131 |
+
throw new Exception(__('The MP4 file you have uploaded is not a video file.', BP_MEDIA_TXT_DOMAIN));
|
132 |
+
}
|
133 |
+
$bp_media_count['videos'] = intval($bp_media_count['videos']) + 1;
|
134 |
+
break;
|
135 |
+
case 'audio/mpeg' :
|
136 |
+
include_once(trailingslashit(BP_MEDIA_PATH) . 'lib/getid3/getid3.php');
|
137 |
+
try {
|
138 |
+
$getID3 = new getID3;
|
139 |
+
$file_info = $getID3->analyze($file);
|
140 |
+
} catch (Exception $e) {
|
141 |
+
unlink($file);
|
142 |
+
$activity_content = false;
|
143 |
+
throw new Exception(__('MP3 file you have uploaded is currupt.', BP_MEDIA_TXT_DOMAIN));
|
144 |
+
}
|
145 |
+
if (is_array($file_info)) {
|
146 |
+
if (!array_key_exists('error', $file_info) && array_key_exists('fileformat', $file_info) && array_key_exists('audio', $file_info) && array_key_exists('dataformat', $file_info['audio'])) {
|
147 |
+
if (!($file_info['fileformat'] == 'mp3' && $file_info['audio']['dataformat'] == 'mp3')) {
|
148 |
+
unlink($file);
|
149 |
+
$activity_content = false;
|
150 |
+
throw new Exception(__('The MP3 file you have uploaded is using an unsupported audio format. Supported audio format is MP3.', BP_MEDIA_TXT_DOMAIN));
|
151 |
+
}
|
152 |
+
} else {
|
153 |
+
unlink($file);
|
154 |
+
$activity_content = false;
|
155 |
+
throw new Exception(__('The MP3 file you have uploaded is using an unsupported audio format. Supported audio format is MP3.', BP_MEDIA_TXT_DOMAIN));
|
156 |
+
}
|
157 |
+
} else {
|
158 |
+
unlink($file);
|
159 |
+
$activity_content = false;
|
160 |
+
throw new Exception(__('The MP3 file you have uploaded is not an audio file.', BP_MEDIA_TXT_DOMAIN));
|
161 |
+
}
|
162 |
+
$type = 'audio';
|
163 |
+
$bp_media_count['audio'] = intval($bp_media_count['audio']) + 1;
|
164 |
+
break;
|
165 |
+
case 'image/gif' :
|
166 |
+
case 'image/jpeg' :
|
167 |
+
case 'image/png' :
|
168 |
+
$type = 'image';
|
169 |
+
$bp_media_count['images'] = intval($bp_media_count['images']) + 1;
|
170 |
+
break;
|
171 |
+
default :
|
172 |
+
unlink($file);
|
173 |
+
$activity_content = false;
|
174 |
+
throw new Exception(__('Media File you have tried to upload is not supported. Supported media files are .jpg, .png, .gif, .mp3, .mov and .mp4.', BP_MEDIA_TXT_DOMAIN));
|
175 |
+
}
|
176 |
+
$attachment_id = wp_insert_attachment($attachment, $file, $post_id);
|
177 |
+
if (!is_wp_error($attachment_id)) {
|
178 |
+
wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $file));
|
179 |
+
} else {
|
180 |
+
unlink($file);
|
181 |
+
throw new Exception(__('Error creating attachment for the media file, please try again', BP_MEDIA_TXT_DOMAIN));
|
182 |
+
}
|
183 |
+
$this->id = $attachment_id;
|
184 |
+
$this->name = $name;
|
185 |
+
$this->description = $description;
|
186 |
+
$this->type = $type;
|
187 |
+
$this->owner = get_current_user_id();
|
188 |
+
$this->album_id = $post_id;
|
189 |
+
$this->group_id = $group;
|
190 |
+
$this->set_permalinks();
|
191 |
+
if ($group == 0) {
|
192 |
+
update_post_meta($attachment_id, 'bp-media-key', get_current_user_id());
|
193 |
+
bp_update_user_meta(bp_loggedin_user_id(), 'bp_media_count', $bp_media_count);
|
194 |
+
} else {
|
195 |
+
update_post_meta($attachment_id, 'bp-media-key', (-$group));
|
196 |
+
}
|
197 |
+
do_action('bp_media_after_add_media', $this, $is_multiple);
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Fetches the content of the activity of media upload based on its type
|
202 |
+
*
|
203 |
+
*/
|
204 |
+
function get_media_activity_content() {
|
205 |
+
global $bp_media_counter, $bp_media_default_excerpts, $bp_media;
|
206 |
+
$attachment_id = $this->id;
|
207 |
+
$activity_content = '<div class="bp_media_title"><a href="' . $this->url . '" title="' . __($this->description, BP_MEDIA_TXT_DOMAIN) . '">' . __(wp_html_excerpt($this->name, $bp_media_default_excerpts['activity_entry_title']), BP_MEDIA_TXT_DOMAIN) . '</a></div>';
|
208 |
+
$activity_content .='<div class="bp_media_content">';
|
209 |
+
switch ($this->type) {
|
210 |
+
case 'video' :
|
211 |
+
if ($this->thumbnail_id) {
|
212 |
+
$image_array = image_downsize($this->thumbnail_id, 'bp_media_activity_image');
|
213 |
+
$activity_content.='<video poster="' . $image_array[0] . '" src="' . wp_get_attachment_url($attachment_id) . '" width="320" height="240" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span><script>bp_media_create_element("bp_media_video_' . $this->id . '_' . $bp_media_counter . '");</script>';
|
214 |
+
} else {
|
215 |
+
$activity_content.='<video src="' . wp_get_attachment_url($attachment_id) . '" width="320" height="240" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span><script>bp_media_create_element("bp_media_video_' . $this->id . '_' . $bp_media_counter . '");</script>';
|
216 |
+
}
|
217 |
+
break;
|
218 |
+
case 'audio' :
|
219 |
+
$activity_content.='<audio src="' . wp_get_attachment_url($attachment_id) . '" width="320" type="audio/mp3" id="bp_media_audio_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none" ></audio></span><script>bp_media_create_element("bp_media_audio_' . $this->id . '_' . $bp_media_counter . '");</script>';
|
220 |
+
$type = 'audio';
|
221 |
+
break;
|
222 |
+
case 'image' :
|
223 |
+
$image_array = image_downsize($attachment_id, 'bp_media_activity_image');
|
224 |
+
$activity_content.='<a href="' . $this->url . '" title="' . __($this->name, BP_MEDIA_TXT_DOMAIN) . '"><img src="' . $image_array[0] . '" id="bp_media_image_' . $this->id . '_' . $bp_media_counter++ . '" alt="' . __($this->name, BP_MEDIA_TXT_DOMAIN) . '" /></a>';
|
225 |
+
$type = 'image';
|
226 |
+
break;
|
227 |
+
default :
|
228 |
+
return false;
|
229 |
+
}
|
230 |
+
$activity_content .= '</div>';
|
231 |
+
$activity_content .= '<div class="bp_media_description">' . __(wp_html_excerpt($this->description, $bp_media_default_excerpts['activity_entry_description']), BP_MEDIA_TXT_DOMAIN) . '</div>';
|
232 |
+
return $activity_content;
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Returns the single media entry's URL
|
237 |
+
*/
|
238 |
+
function get_media_activity_url() {
|
239 |
+
if (!bp_is_activity_component())
|
240 |
+
return false;
|
241 |
+
$activity_url = $this->url;
|
242 |
+
return $activity_url;
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Returns the media activity's action text
|
247 |
+
*/
|
248 |
+
function get_media_activity_action() {
|
249 |
+
global $bp_media;
|
250 |
+
if (!bp_is_activity_component())
|
251 |
+
return false;
|
252 |
+
$activity_action = sprintf(__("%s uploaded a media.", BP_MEDIA_TXT_DOMAIN), bp_core_get_userlink($this->owner));
|
253 |
+
return $activity_action;
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Returns the HTML for content of the single entry page of the Media Entry
|
258 |
+
*/
|
259 |
+
function get_media_single_content() {
|
260 |
+
global $bp_media_default_excerpts, $bp_media;
|
261 |
+
|
262 |
+
$default_sizes = $bp_media->media_sizes();
|
263 |
+
$content = '';
|
264 |
+
if ($this->group_id > 0) {
|
265 |
+
|
266 |
+
$content .= '<div class="bp_media_author">' . __("Uploaded by ", BP_MEDIA_TXT_DOMAIN) . bp_core_get_userlink($this->owner) . '</div>';
|
267 |
+
}
|
268 |
+
$content .= '<div class="bp_media_content">';
|
269 |
+
switch ($this->type) {
|
270 |
+
case 'video' :
|
271 |
+
if ($this->thumbnail_id) {
|
272 |
+
$image_array = image_downsize($this->thumbnail_id, 'bp_media_single_image');
|
273 |
+
$content.=apply_filters('bp_media_single_content_filter', '<video poster="' . $image_array[0] . '" src="' . wp_get_attachment_url($this->id) . '" width="' . $default_sizes['single_video']['width'] . '" height="' . ($default_sizes['single_video']['height'] == 0 ? 'auto' : $default_sizes['single_video']['height']) . '" type="video/mp4" id="bp_media_video_' . $this->id . '" controls="controls" preload="none"></video><script>bp_media_create_element("bp_media_video_' . $this->id . '");</script>', $this);
|
274 |
+
} else {
|
275 |
+
$content.=apply_filters('bp_media_single_content_filter', '<video src="' . wp_get_attachment_url($this->id) . '" width="' . $default_sizes['single_video']['width'] . '" height="' . ($default_sizes['single_video']['height'] == 0 ? 'auto' : $default_sizes['single_video']['height']) . '" type="video/mp4" id="bp_media_video_' . $this->id . '" controls="controls" preload="none"></video><script>bp_media_create_element("bp_media_video_' . $this->id . '");</script>', $this);
|
276 |
+
}
|
277 |
+
break;
|
278 |
+
case 'audio' :
|
279 |
+
$content.=apply_filters('bp_media_single_content_filter', '<audio src="' . wp_get_attachment_url($this->id) . '" width="' . $default_sizes['single_audio']['width'] . '" type="audio/mp3" id="bp_media_audio_' . $this->id . '" controls="controls" preload="none" ></audio><script>bp_media_create_element("bp_media_audio_' . $this->id . '");</script>', $this);
|
280 |
+
break;
|
281 |
+
case 'image' :
|
282 |
+
$image_array = image_downsize($this->id, 'bp_media_single_image');
|
283 |
+
$content.=apply_filters('bp_media_single_content_filter', '<img src="' . $image_array[0] . '" id="bp_media_image_' . $this->id . '" />', $this);
|
284 |
+
break;
|
285 |
+
default :
|
286 |
+
return false;
|
287 |
+
}
|
288 |
+
$content .= '</div>';
|
289 |
+
$content .= '<div class="bp_media_description">' . __(wp_html_excerpt($this->description, $bp_media_default_excerpts['single_entry_description']), BP_MEDIA_TXT_DOMAIN) . '</div>';
|
290 |
+
return $content;
|
291 |
+
}
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Returns the HTML for title of the single entry page of the Media Entry
|
295 |
+
*/
|
296 |
+
function get_media_single_title() {
|
297 |
+
global $bp_media_default_excerpts, $bp_media;
|
298 |
+
$content = '<div class="bp_media_title">' . __(wp_html_excerpt($this->name, $bp_media_default_excerpts['single_entry_title']), BP_MEDIA_TXT_DOMAIN) . '</div>';
|
299 |
+
return $content;
|
300 |
+
}
|
301 |
+
|
302 |
+
/**
|
303 |
+
* Returns the HTML for a media entry to be shown in the listing/gallery page
|
304 |
+
*/
|
305 |
+
function get_media_gallery_content() {
|
306 |
+
global $bp_media;
|
307 |
+
$attachment = $this->id;
|
308 |
+
switch ($this->type) {
|
309 |
+
case 'video' :
|
310 |
+
if ($this->thumbnail_id) {
|
311 |
+
$medium_array = image_downsize($this->thumbnail_id, 'thumbnail');
|
312 |
+
$thumb_url = $medium_array[0];
|
313 |
+
} else {
|
314 |
+
$thumb_url = BP_MEDIA_URL . 'app/assets/img/video_thumb.png';
|
315 |
}
|
316 |
+
?>
|
317 |
+
<li>
|
318 |
+
<a href="<?php echo $this->url ?>" title="<?php _e($this->description, BP_MEDIA_TXT_DOMAIN); ?>">
|
319 |
+
<img src="<?php echo $thumb_url; ?>" />
|
320 |
+
</a>
|
321 |
+
<h3 title="<?php echo $this->name; ?>"><a href="<?php echo $this->url ?>" title="<?php _e($this->description, BP_MEDIA_TXT_DOMAIN); ?>"><?php echo $this->name; ?></a></h3>
|
322 |
+
</li>
|
323 |
+
<?php
|
324 |
+
break;
|
325 |
+
case 'audio' :
|
326 |
+
if ($this->thumbnail_id) {
|
327 |
+
$medium_array = image_downsize($this->thumbnail_id, 'thumbnail');
|
328 |
+
$thumb_url = $medium_array[0];
|
329 |
+
} else {
|
330 |
+
$thumb_url = BP_MEDIA_URL . 'app/assets/img/audio_thumb.png';
|
331 |
+
}
|
332 |
+
?>
|
333 |
+
<li>
|
334 |
+
<a href="<?php echo $this->url ?>" title="<?php _e($this->description, BP_MEDIA_TXT_DOMAIN); ?>">
|
335 |
+
<img src="<?php echo $thumb_url ?>" />
|
336 |
+
</a>
|
337 |
+
<h3 title="<?php echo $this->name; ?>"><a href="<?php echo $this->url ?>" title="<?php _e($this->description, BP_MEDIA_TXT_DOMAIN); ?>"><?php echo $this->name ?></a></h3>
|
338 |
+
</li>
|
339 |
+
<?php
|
340 |
+
break;
|
341 |
+
case 'image' :
|
342 |
+
$medium_array = image_downsize($attachment, 'thumbnail');
|
343 |
+
$medium_path = $medium_array[0];
|
344 |
+
?>
|
345 |
+
<li>
|
346 |
+
<a href="<?php echo $this->url ?>" title="<?php echo $this->description ?>">
|
347 |
+
<img src="<?php echo $medium_path ?>" />
|
348 |
+
</a>
|
349 |
+
<h3 title="<?php echo $this->name ?>"><a href="<?php echo $this->url ?>" title="<?php _e($this->description, BP_MEDIA_TXT_DOMAIN); ?>"><?php echo $this->name ?></a></h3>
|
350 |
+
</li>
|
351 |
+
<?php
|
352 |
+
break;
|
353 |
+
default :
|
354 |
+
return false;
|
355 |
+
}
|
356 |
+
}
|
357 |
+
|
358 |
+
function show_comment_form_wordpress() {
|
359 |
+
query_posts('attachment_id=' . $this->id);
|
360 |
+
while (have_posts()): the_post();
|
361 |
+
add_action('comment_form', 'BPMediaFunction::wp_comment_form_mod');
|
362 |
+
comments_template();
|
363 |
+
endwhile;
|
364 |
+
}
|
365 |
+
|
366 |
+
/**
|
367 |
+
* Outputs the comments and comment form in the single media entry page
|
368 |
+
*/
|
369 |
+
function show_comment_form() {
|
370 |
+
global $bp_media;
|
371 |
+
$activity_id = get_post_meta($this->id, 'bp_media_child_activity', true);
|
372 |
+
if (!$activity_id || !function_exists('bp_has_activities'))
|
373 |
+
return false;
|
374 |
+
if (bp_has_activities(array(
|
375 |
+
'display_comments' => 'stream',
|
376 |
+
'include' => $activity_id,
|
377 |
+
'max' => 1
|
378 |
+
))) :
|
379 |
+
while (bp_activities()) : bp_the_activity();
|
380 |
+
do_action('bp_before_activity_entry');
|
381 |
+
?>
|
382 |
+
<div class="activity">
|
383 |
+
<ul id="activity-stream" class="activity-list item-list">
|
384 |
+
<li class="activity activity_update" id="activity-<?php echo $activity_id; ?>">
|
385 |
+
<div class="activity-content">
|
386 |
+
<?php do_action('bp_activity_entry_content'); ?>
|
387 |
+
<?php if (is_user_logged_in()) : ?>
|
388 |
+
<div class="activity-meta no-ajax">
|
389 |
+
<?php if (bp_activity_can_comment()) : ?>
|
390 |
+
<a href="<?php bp_get_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf(__('Comment <span>%s</span>', BP_MEDIA_TXT_DOMAIN), bp_activity_get_comment_count()); ?></a>
|
391 |
+
<?php endif; ?>
|
392 |
+
<?php if (bp_activity_can_favorite()) : ?>
|
393 |
+
<?php if (!bp_get_activity_is_favorite()) : ?>
|
394 |
+
<a href="<?php bp_activity_favorite_link(); ?>" class="button fav bp-secondary-action" title="<?php esc_attr_e('Mark as Favorite', BP_MEDIA_TXT_DOMAIN); ?>"><?php _e('Favorite', BP_MEDIA_TXT_DOMAIN) ?></a>
|
395 |
+
<?php else : ?>
|
396 |
+
<a href="<?php bp_activity_unfavorite_link(); ?>" class="button unfav bp-secondary-action" title="<?php esc_attr_e('Remove Favorite', BP_MEDIA_TXT_DOMAIN); ?>"><?php _e('Remove Favorite', BP_MEDIA_TXT_DOMAIN) ?></a>
|
397 |
+
<?php endif; ?>
|
398 |
+
<?php endif; ?>
|
399 |
+
<?php if (bp_activity_user_can_delete()) bp_activity_delete_link(); ?>
|
400 |
+
<?php do_action('bp_activity_entry_meta'); ?>
|
401 |
+
</div>
|
402 |
+
<?php endif; ?>
|
403 |
+
</div>
|
404 |
+
<?php do_action('bp_before_activity_entry_comments'); ?>
|
405 |
+
<?php if (( is_user_logged_in() && bp_activity_can_comment() ) || bp_activity_get_comment_count()) : ?>
|
406 |
+
<div class="activity-comments">
|
407 |
+
<?php bp_activity_comments(); ?>
|
408 |
+
<?php if (is_user_logged_in()) : ?>
|
409 |
+
<form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>>
|
410 |
+
<div class="ac-reply-avatar"><?php bp_loggedin_user_avatar('width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT); ?></div>
|
411 |
+
<div class="ac-reply-content">
|
412 |
+
<div class="ac-textarea">
|
413 |
+
<textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
|
414 |
+
</div>
|
415 |
+
<input type="submit" name="ac_form_submit" value="<?php _e('Post', BP_MEDIA_TXT_DOMAIN); ?>" /> <?php _e('or press esc to cancel.', BP_MEDIA_TXT_DOMAIN); ?>
|
416 |
+
<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
|
417 |
+
</div>
|
418 |
+
<?php do_action('bp_activity_entry_comments'); ?>
|
419 |
+
<?php wp_nonce_field('new_activity_comment', '_wpnonce_new_activity_comment'); ?>
|
420 |
+
</form>
|
421 |
+
<?php endif; ?>
|
422 |
+
</div>
|
423 |
+
<?php endif; ?>
|
424 |
+
<?php do_action('bp_after_activity_entry_comments'); ?>
|
425 |
+
</li>
|
426 |
+
</ul>
|
427 |
+
</div>
|
428 |
+
<?php
|
429 |
+
endwhile;
|
430 |
+
else:
|
431 |
+
?>
|
432 |
+
<div class="activity">
|
433 |
+
<ul id="activity-stream" class="activity-list item-list">
|
434 |
+
<li class="activity activity_update" id="activity-<?php echo $activity_id; ?>">
|
435 |
+
<div class="activity-content">
|
436 |
+
<?php do_action('bp_activity_entry_content'); ?>
|
437 |
+
<?php if (is_user_logged_in()) : ?>
|
438 |
+
<div class="activity-meta no-ajax">
|
439 |
+
<a href="<?php echo $this->get_delete_url(); ?>" class="button item-button bp-secondary-action delete-activity-single confirm" rel="nofollow"><?php _e("Delete", BP_MEDIA_TXT_DOMAIN); ?></a>
|
440 |
+
</div>
|
441 |
+
<?php endif; ?>
|
442 |
+
</div>
|
443 |
+
</li>
|
444 |
+
</ul>
|
445 |
+
</div>
|
446 |
+
<?php
|
447 |
+
endif;
|
448 |
+
}
|
449 |
+
|
450 |
+
/**
|
451 |
+
* Returns the URL of the single media entry page
|
452 |
+
*/
|
453 |
+
function get_url() {
|
454 |
+
return $this->url;
|
455 |
+
}
|
456 |
+
|
457 |
+
/**
|
458 |
+
* Returns the URL of the attached media file
|
459 |
+
*/
|
460 |
+
function get_attachment_url() {
|
461 |
+
return wp_get_attachment_url($this->id);
|
462 |
+
}
|
463 |
+
|
464 |
+
/**
|
465 |
+
* Updates the media entry
|
466 |
+
*
|
467 |
+
* @param array $args Array with the following keys:<br/>
|
468 |
+
* 'name' <br/>
|
469 |
+
* 'description'<br/>
|
470 |
+
* 'owner'
|
471 |
+
*
|
472 |
+
* @return bool True when the update is successful, False when the update fails
|
473 |
+
*/
|
474 |
+
function update_media($args = array()) {
|
475 |
+
$defaults = array(
|
476 |
+
'name' => $this->name,
|
477 |
+
'description' => $this->description,
|
478 |
+
'owner' => $this->owner
|
479 |
+
);
|
480 |
+
$args = wp_parse_args($args, $defaults);
|
481 |
+
$post = get_post($this->id, ARRAY_A);
|
482 |
+
$post['post_title'] = esc_html($args['name']);
|
483 |
+
$post['post_content'] = esc_html($args['description']);
|
484 |
+
$post['post_author'] = $args['owner'];
|
485 |
+
$result = wp_update_post($post);
|
486 |
+
$this->init($this->id);
|
487 |
+
do_action('bp_media_after_update_media', $this->id, $this->type);
|
488 |
+
return $result;
|
489 |
+
}
|
490 |
+
|
491 |
+
/**
|
492 |
+
* Updates activity content's title and description sync with the editing of Media
|
493 |
+
*
|
494 |
+
*/
|
495 |
+
function update_media_activity() {
|
496 |
+
global $wpdb, $bp, $current_user, $bp_media;
|
497 |
+
$q = $wpdb->prepare("SELECT id FROM {$bp->activity->table_name} WHERE type = %s AND item_id = %d", 'media_upload', $this->id);
|
498 |
+
$activities = $wpdb->get_results($q);
|
499 |
+
if (isset($activities) && count($activities) > 0) {
|
500 |
+
$activities_template = new BP_Activity_Template(array(
|
501 |
+
'max' => TRUE,
|
502 |
+
'user_id' => $current_user,
|
503 |
+
'in' => $activities[0]->id
|
504 |
+
));
|
505 |
+
foreach ($activities_template->activities as $activity) {
|
506 |
+
$args = array(
|
507 |
+
'content' => $this->get_media_activity_content(),
|
508 |
+
'id' => $activity->id,
|
509 |
+
'type' => 'media_upload',
|
510 |
+
'action' => apply_filters('bp_media_added_media', sprintf(__('%1$s added a %2$s', BP_MEDIA_TXT_DOMAIN), bp_core_get_userlink($this->get_author()), '<a href="' . $this->get_url() . '">' . $this->get_media_activity_type() . '</a>')),
|
511 |
+
'primary_link' => $this->get_url(),
|
512 |
+
'item_id' => $this->get_id(),
|
513 |
+
'recorded_time' => $activity->date_recorded,
|
514 |
+
'user_id' => $this->get_author()
|
515 |
+
);
|
516 |
+
$activity_id = BPMediaFunction::record_activity($args);
|
517 |
}
|
518 |
}
|
519 |
+
}
|
520 |
+
|
521 |
+
/**
|
522 |
+
* Deletes the Media Entry
|
523 |
+
*/
|
524 |
+
function delete_media() {
|
525 |
+
do_action('bp_media_before_delete_media', $this->id);
|
526 |
+
global $bp_media_count;
|
527 |
+
BPMediaActions::init_count($this->owner);
|
528 |
+
switch ($this->type) {
|
529 |
+
case 'image':
|
530 |
+
$bp_media_count['images'] = intval($bp_media_count['images']) - 1;
|
531 |
+
break;
|
532 |
+
case 'video':
|
533 |
+
$bp_media_count['videos'] = intval($bp_media_count['videos']) - 1;
|
534 |
+
break;
|
535 |
+
case 'audio':
|
536 |
+
$bp_media_count['audio'] = intval($bp_media_count['audio']) - 1;
|
537 |
+
break;
|
538 |
+
}
|
539 |
+
wp_delete_attachment($this->id, true);
|
540 |
+
bp_update_user_meta($this->owner, 'bp_media_count', $bp_media_count);
|
541 |
+
do_action('bp_media_after_delete_media', $this->id);
|
542 |
+
}
|
543 |
+
|
544 |
+
/**
|
545 |
+
* Function to return the content to be placed in the activity of album
|
546 |
+
*/
|
547 |
+
function get_album_activity_content() {
|
548 |
+
$attachment = $this->id;
|
549 |
+
switch ($this->type) {
|
550 |
+
case 'video' :
|
551 |
+
if ($this->thumbnail_id) {
|
552 |
+
$medium_array = image_downsize($this->thumbnail_id, 'thumbnail');
|
553 |
+
$thumb_url = $medium_array[0];
|
554 |
+
} else {
|
555 |
+
$thumb_url = BP_MEDIA_URL . 'app/assets/img/video_thumb.png';
|
556 |
+
}
|
557 |
+
break;
|
558 |
+
case 'audio' :
|
559 |
+
if ($this->thumbnail_id) {
|
560 |
+
$medium_array = image_downsize($this->thumbnail_id, 'thumbnail');
|
561 |
+
$thumb_url = $medium_array[0];
|
562 |
+
} else {
|
563 |
+
$thumb_url = BP_MEDIA_URL . 'app/assets/img/audio_thumb.png';
|
564 |
+
}
|
565 |
+
break;
|
566 |
+
case 'image' :
|
567 |
+
$medium_array = image_downsize($attachment, 'thumbnail');
|
568 |
+
$thumb_url = $medium_array[0];
|
569 |
+
break;
|
570 |
+
default :
|
571 |
+
return false;
|
572 |
+
}
|
573 |
+
$content = '<li>';
|
574 |
+
$content .= '<a href="' . $this->url . '" title="' . $this->name . '">';
|
575 |
+
$content .= '<img src="' . $thumb_url . '" />';
|
576 |
+
$content .= '</a>';
|
577 |
+
$content .= '</li>';
|
578 |
+
return $content;
|
579 |
+
}
|
580 |
+
|
581 |
+
/**
|
582 |
+
* Returns the description of the Media Entry
|
583 |
+
*/
|
584 |
+
function get_content() {
|
585 |
+
return $this->description;
|
586 |
+
}
|
587 |
+
|
588 |
+
/**
|
589 |
+
* Returns the owner id of the Media Entry
|
590 |
+
*/
|
591 |
+
function get_author() {
|
592 |
+
return $this->owner;
|
593 |
+
}
|
594 |
+
|
595 |
+
/**
|
596 |
+
* Returns the id of the Media Entry
|
597 |
+
*/
|
598 |
+
function get_id() {
|
599 |
+
return $this->id;
|
600 |
+
}
|
601 |
+
|
602 |
+
/**
|
603 |
+
* Returns the edit url of the Media Entry
|
604 |
+
*/
|
605 |
+
function get_edit_url() {
|
606 |
+
return $this->edit_url;
|
607 |
+
}
|
608 |
+
|
609 |
+
/**
|
610 |
+
* Returns the delete url of the Media Entry
|
611 |
+
*/
|
612 |
+
function get_delete_url() {
|
613 |
+
return $this->delete_url;
|
614 |
+
}
|
615 |
+
|
616 |
+
/**
|
617 |
+
* Returns the type of activity
|
618 |
+
*/
|
619 |
+
function get_media_activity_type() {
|
620 |
+
switch ($this->type) {
|
621 |
+
case 'image':
|
622 |
+
return BP_MEDIA_IMAGES_LABEL_SINGULAR;
|
623 |
+
case 'video':
|
624 |
+
return BP_MEDIA_VIDEOS_LABEL_SINGULAR;
|
625 |
+
case 'audio':
|
626 |
+
return BP_MEDIA_AUDIO_LABEL_SINGULAR;
|
627 |
+
default:
|
628 |
+
return 'Media';
|
629 |
+
}
|
630 |
+
}
|
631 |
+
|
632 |
+
/**
|
633 |
+
* Returns the album id
|
634 |
+
*/
|
635 |
+
function get_album_id() {
|
636 |
+
return $this->album_id;
|
637 |
+
}
|
638 |
+
|
639 |
+
/**
|
640 |
+
* Returns the title of the media
|
641 |
+
*/
|
642 |
+
function get_title() {
|
643 |
+
return $this->name;
|
644 |
+
}
|
645 |
+
|
646 |
+
/**
|
647 |
+
* Returns the type of media
|
648 |
+
*/
|
649 |
+
function get_type() {
|
650 |
+
return $this->type;
|
651 |
+
}
|
652 |
+
|
653 |
+
/**
|
654 |
+
* Returns the thumbnail id
|
655 |
+
*/
|
656 |
+
function get_thumbnail_id() {
|
657 |
+
return $this->thumbnail_id;
|
658 |
+
}
|
659 |
+
|
660 |
+
/**
|
661 |
+
* Returns the group id of the media, 0 if it does not belong to a group
|
662 |
+
*/
|
663 |
+
function get_group_id() {
|
664 |
+
return $this->group_id;
|
665 |
+
}
|
666 |
+
|
667 |
+
/**
|
668 |
+
* Sets the permalinks of the media depending upon whether its in member directory
|
669 |
+
* or group and acording to the media type
|
670 |
+
*/
|
671 |
+
protected function set_permalinks() {
|
672 |
+
if ($this->group_id > 0) {
|
673 |
+
$current_group = new BP_Groups_Group($this->group_id);
|
674 |
+
$pre_url = bp_get_group_permalink($current_group);
|
675 |
+
} else {
|
676 |
+
$pre_url = bp_core_get_user_domain($this->owner);
|
677 |
+
}
|
678 |
+
switch ($this->type) {
|
679 |
+
case 'video' :
|
680 |
+
$this->url = trailingslashit($pre_url . BP_MEDIA_VIDEOS_SLUG . '/' . $this->id);
|
681 |
+
$this->edit_url = trailingslashit($pre_url . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_VIDEOS_EDIT_SLUG . '/' . $this->id);
|
682 |
+
$this->delete_url = trailingslashit($pre_url . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id);
|
683 |
+
$this->thumbnail_id = get_post_meta($this->id, 'bp_media_thumbnail', true);
|
684 |
+
break;
|
685 |
+
case 'audio' :
|
686 |
+
$this->url = trailingslashit($pre_url . BP_MEDIA_AUDIO_SLUG . '/' . $this->id);
|
687 |
+
$this->edit_url = trailingslashit($pre_url . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_AUDIO_EDIT_SLUG . '/' . $this->id);
|
688 |
+
$this->delete_url = trailingslashit($pre_url . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id);
|
689 |
+
$this->thumbnail_id = get_post_meta($this->id, 'bp_media_thumbnail', true);
|
690 |
+
break;
|
691 |
+
case 'image' :
|
692 |
+
$this->url = trailingslashit($pre_url . BP_MEDIA_IMAGES_SLUG . '/' . $this->id);
|
693 |
+
$this->edit_url = trailingslashit($pre_url . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_IMAGES_EDIT_SLUG . '/' . $this->id);
|
694 |
+
$this->delete_url = trailingslashit($pre_url . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id);
|
695 |
+
$image_array = image_downsize($this->id, 'bp_media_single_image');
|
696 |
+
$this->thumbnail_id = $this->id;
|
697 |
+
break;
|
698 |
+
default :
|
699 |
+
return false;
|
700 |
+
}
|
701 |
+
return true;
|
702 |
+
}
|
703 |
+
|
704 |
+
/**
|
705 |
+
* Checks if the album given exists if not, creates a new one according to context
|
706 |
+
*/
|
707 |
+
function check_and_create_album($album_id, $group) {
|
708 |
+
global $wpdb;
|
709 |
+
$create_new_album_flag = false;
|
710 |
+
if ($album_id != 0) {
|
711 |
+
$album = get_post($album_id);
|
712 |
+
if ($album->post_author != get_current_user_id() && $group == 0) {
|
713 |
+
$create_new_album_flag = true;
|
714 |
+
} else {
|
715 |
+
$post_id = $album->ID;
|
716 |
+
}
|
717 |
+
} else {
|
718 |
+
$create_new_album_flag = true;
|
719 |
+
}
|
720 |
+
if ($create_new_album_flag) {
|
721 |
+
if ($group == 0) {
|
722 |
+
$post_id = $wpdb->get_var(
|
723 |
+
"SELECT ID
|
724 |
FROM $wpdb->posts
|
725 |
WHERE
|
726 |
post_title = 'Wall Posts'
|
727 |
+
AND post_author = '" . get_current_user_id() . "'
|
728 |
AND post_type='bp_media_album'"
|
729 |
+
);
|
730 |
+
} else {
|
731 |
+
$post_id = $wpdb->get_var(
|
732 |
+
"SELECT wp_posts.ID
|
|
|
733 |
FROM $wpdb->posts
|
734 |
INNER JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id
|
735 |
AND $wpdb->postmeta.meta_key = 'bp-media-key'
|
736 |
AND $wpdb->postmeta.meta_value = -$group
|
737 |
+
AND $wpdb->posts.post_title = 'Wall Posts'");
|
738 |
+
}
|
739 |
+
if ($post_id == null) {
|
740 |
+
$album = new BPMediaAlbum();
|
741 |
+
if ($group == 0)
|
742 |
+
$album->add_album('Wall Posts', get_current_user_id(), $group);
|
743 |
+
else {
|
744 |
+
$current_user = wp_get_current_user();
|
745 |
+
$album->add_album($current_user->display_name . '\'s Album', get_current_user_id(), $group);
|
746 |
+
}
|
747 |
+
$post_id = $album->get_id();
|
748 |
+
}
|
749 |
+
}
|
750 |
+
return $post_id;
|
751 |
+
}
|
752 |
+
|
753 |
+
}
|
754 |
+
?>
|
app/main/profile/BPMediaAlbum.php
CHANGED
@@ -1,5 +1,14 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class BPMediaAlbum{
|
4 |
private $id,
|
5 |
$name,
|
@@ -12,6 +21,10 @@ class BPMediaAlbum{
|
|
12 |
$media_entries,
|
13 |
$group_id;
|
14 |
|
|
|
|
|
|
|
|
|
15 |
/**
|
16 |
* Constructs a new BP_Media_Album
|
17 |
*
|
@@ -25,6 +38,11 @@ class BPMediaAlbum{
|
|
25 |
}
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
28 |
/**
|
29 |
* Initializes the object
|
30 |
*
|
@@ -176,8 +194,11 @@ class BPMediaAlbum{
|
|
176 |
do_action('bp_media_after_edit_album',$this);
|
177 |
}
|
178 |
|
|
|
|
|
|
|
|
|
179 |
function get_album_gallery_content(){
|
180 |
-
global $bp_media
|
181 |
?><li>
|
182 |
<a href="<?php echo $this->url ?>" title="<?php _e($this->description,BP_MEDIA_TXT_DOMAIN); ?>">
|
183 |
<?php echo $this->thumbnail; ?>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Adds the album screens and functionality
|
4 |
+
*
|
5 |
+
* @package BuddyPressMedia
|
6 |
+
* @subpackage Profile
|
7 |
+
*
|
8 |
+
* @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
|
9 |
+
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
10 |
+
*
|
11 |
+
*/
|
12 |
class BPMediaAlbum{
|
13 |
private $id,
|
14 |
$name,
|
21 |
$media_entries,
|
22 |
$group_id;
|
23 |
|
24 |
+
/**
|
25 |
+
*
|
26 |
+
* @param type $album_id
|
27 |
+
*/
|
28 |
/**
|
29 |
* Constructs a new BP_Media_Album
|
30 |
*
|
38 |
}
|
39 |
}
|
40 |
|
41 |
+
/**
|
42 |
+
*
|
43 |
+
* @param type $album_id
|
44 |
+
* @throws Exception
|
45 |
+
*/
|
46 |
/**
|
47 |
* Initializes the object
|
48 |
*
|
194 |
do_action('bp_media_after_edit_album',$this);
|
195 |
}
|
196 |
|
197 |
+
/**
|
198 |
+
*
|
199 |
+
* @global type $bp_media
|
200 |
+
*/
|
201 |
function get_album_gallery_content(){
|
|
|
202 |
?><li>
|
203 |
<a href="<?php echo $this->url ?>" title="<?php _e($this->description,BP_MEDIA_TXT_DOMAIN); ?>">
|
204 |
<?php echo $this->thumbnail; ?>
|
app/main/profile/BPMediaAlbumScreen.php
CHANGED
@@ -1,14 +1,13 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* To change this template, choose Tools | Templates
|
5 |
-
* and open the template in the editor.
|
6 |
-
*/
|
7 |
-
|
8 |
/**
|
9 |
-
*
|
|
|
|
|
|
|
10 |
*
|
11 |
-
* @author saurabh
|
|
|
|
|
12 |
*/
|
13 |
class BPMediaAlbumScreen extends BPMediaScreen {
|
14 |
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
+
* Adds the Album Screen to the BuddyPress Profile
|
4 |
+
*
|
5 |
+
* @package BuddyPressMedia
|
6 |
+
* @subpackage Profile
|
7 |
*
|
8 |
+
* @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
|
9 |
+
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
10 |
+
*
|
11 |
*/
|
12 |
class BPMediaAlbumScreen extends BPMediaScreen {
|
13 |
|
app/main/profile/BPMediaScreen.php
CHANGED
@@ -1,410 +1,402 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* This protects from direct access
|
4 |
-
*/
|
5 |
-
if ( ! defined( 'ABSPATH' ) )
|
6 |
-
exit;
|
7 |
|
8 |
/**
|
9 |
* Base class for creating BuddyPress Media Tabs on the user profile
|
10 |
*
|
|
|
|
|
|
|
11 |
* @author Saurabh Shukla <saurabh.sahukla@rtcamp.com>
|
12 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
13 |
*/
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
$this->media_constant( $media_type );
|
53 |
-
$this->template = new BPMediaTemplate();
|
54 |
-
}
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
}
|
74 |
-
$this->medias_type = $media;
|
75 |
}
|
|
|
|
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
}
|
150 |
-
} else {
|
151 |
-
$this->set_query();
|
152 |
-
add_action( 'bp_template_content', array( $this, 'screen_content' ) );
|
153 |
}
|
154 |
-
|
155 |
-
}
|
156 |
-
|
157 |
-
/**
|
158 |
-
*
|
159 |
-
* @global type $bp_media
|
160 |
-
* @global type $bp_media_query
|
161 |
-
* @global type $bp_media_albums_query
|
162 |
-
*/
|
163 |
-
function screen_content() {
|
164 |
-
global $bp_media_query, $bp_media_albums_query;
|
165 |
$this->set_query();
|
166 |
-
|
167 |
-
$this->hook_before();
|
168 |
-
if ( $bp_media_query && $bp_media_query->have_posts() ):
|
169 |
-
echo '<ul id="bp-media-list" class="bp-media-gallery item-list">';
|
170 |
-
while ( $bp_media_query->have_posts() ) : $bp_media_query->the_post();
|
171 |
-
$this->template->the_content();
|
172 |
-
endwhile;
|
173 |
-
echo '</ul>';
|
174 |
-
$this->template->show_more();
|
175 |
-
else:
|
176 |
-
BPMediaFunction::show_formatted_error_message( sprintf( __( 'Sorry, no %s were found.', BP_MEDIA_TXT_DOMAIN ), $this->slug ), 'info' );
|
177 |
-
endif;
|
178 |
-
$this->hook_after();
|
179 |
}
|
|
|
|
|
180 |
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
$
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
|
|
203 |
|
204 |
-
|
205 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
}
|
207 |
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
*/
|
212 |
-
function entry_screen_title() {
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
*/
|
226 |
-
function entry_screen_content() {
|
227 |
-
global $bp, $bp_media_current_entry;
|
228 |
-
$entryslug = 'BP_MEDIA_' . $this->media_const . '_ENTRY_SLUG';
|
229 |
-
$this->hook_before();
|
230 |
-
if ( ! $bp->action_variables[ 0 ] == constant( $entryslug ) )
|
231 |
-
return false;
|
232 |
-
echo '<div class="bp-media-single bp-media-image">';
|
233 |
-
echo $bp_media_current_entry->get_media_single_content();
|
234 |
-
echo $bp_media_current_entry->show_comment_form();
|
235 |
-
echo '</div>';
|
236 |
-
$this->hook_after();
|
237 |
-
}
|
238 |
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
exit;
|
258 |
-
}
|
259 |
-
BPMediaFunction::check_user();
|
260 |
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
|
|
|
|
|
|
267 |
}
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
|
|
|
|
275 |
}
|
|
|
276 |
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
* @global BPMediaHostWordpress $bp_media_current_entry
|
281 |
-
* @global type $bp_media_default_excerpts
|
282 |
-
* @global type $bp_media
|
283 |
-
*/
|
284 |
-
function edit_screen_content() {
|
285 |
-
global $bp_media_current_entry, $bp_media_default_excerpts;
|
286 |
-
?>
|
287 |
-
<form method="post" class="standard-form" id="bp-media-upload-form">
|
288 |
-
<label for="bp-media-upload-input-title">
|
289 |
-
<?php printf( __( '%s Title', BP_MEDIA_TXT_DOMAIN ), ucfirst( $this->media_type ) ); ?>
|
290 |
-
</label>
|
291 |
-
<input id="bp-media-upload-input-title" type="text" name="bp_media_title" class="settings-input"
|
292 |
-
maxlength="<?php echo max( array( $bp_media_default_excerpts[ 'single_entry_title' ], $bp_media_default_excerpts[ 'activity_entry_title' ] ) ) ?>"
|
293 |
-
value="<?php echo $bp_media_current_entry->get_title(); ?>" />
|
294 |
-
<label for="bp-media-upload-input-description">
|
295 |
-
<?php printf( __( '%s Description', BP_MEDIA_TXT_DOMAIN ), ucfirst( $this->media_type ) ); ?>
|
296 |
-
</label>
|
297 |
-
<input id="bp-media-upload-input-description" type="text" name="bp_media_description" class="settings-input"
|
298 |
-
maxlength="<?php echo max( array( $bp_media_default_excerpts[ 'single_entry_description' ], $bp_media_default_excerpts[ 'activity_entry_description' ] ) ) ?>"
|
299 |
-
value="<?php echo $bp_media_current_entry->get_content(); ?>" />
|
300 |
-
<div class="submit">
|
301 |
-
<input type="submit" class="auto" value="<?php _e( 'Update', BP_MEDIA_TXT_DOMAIN ); ?>" />
|
302 |
-
<a href="<?php echo $bp_media_current_entry->get_url(); ?>" class="button" title="<?php _e( 'Back to Media File', BP_MEDIA_TXT_DOMAIN ); ?>">
|
303 |
-
<?php _e( 'Back to Media', BP_MEDIA_TXT_DOMAIN ); ?>
|
304 |
-
</a>
|
305 |
-
</div>
|
306 |
-
</form>
|
307 |
-
<?php
|
308 |
}
|
|
|
|
|
|
|
309 |
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
global $bp;
|
318 |
-
if ( bp_loggedin_user_id() != bp_displayed_user_id() ) {
|
319 |
-
bp_core_no_access( array(
|
320 |
-
'message' => __( 'You do not have access to this page.', BP_MEDIA_TXT_DOMAIN ),
|
321 |
-
'root' => bp_displayed_user_domain(),
|
322 |
-
'redirect' => false
|
323 |
-
) );
|
324 |
-
exit;
|
325 |
-
}
|
326 |
-
if ( ! isset( $bp->action_variables[ 1 ] ) ) {
|
327 |
-
@setcookie( 'bp-message', __( 'The requested url does not exist', BP_MEDIA_TXT_DOMAIN ), time() + 60 * 60 * 24, COOKIEPATH );
|
328 |
-
@setcookie( 'bp-message-type', 'error', time() + 60 * 60 * 24, COOKIEPATH );
|
329 |
-
$this->template->redirect($this->media_const);
|
330 |
-
exit;
|
331 |
-
}
|
332 |
-
global $bp_media_current_entry;
|
333 |
-
try {
|
334 |
-
$bp_media_current_entry = new BPMediaHostWordpress( $bp->action_variables[ 1 ] );
|
335 |
-
} catch ( Exception $e ) {
|
336 |
-
/* Send the values to the cookie for page reload display */
|
337 |
-
@setcookie( 'bp-message', $e->getMessage(), time() + 60 * 60 * 24, COOKIEPATH );
|
338 |
-
@setcookie( 'bp-message-type', 'error', time() + 60 * 60 * 24, COOKIEPATH );
|
339 |
-
$this->template->redirect($this->media_const);
|
340 |
-
exit;
|
341 |
-
}
|
342 |
-
$post_id = $bp_media_current_entry->get_id();
|
343 |
-
$activity_id = get_post_meta( $post_id, 'bp_media_child_activity', true );
|
344 |
|
345 |
-
|
346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
|
348 |
-
|
349 |
-
|
350 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
exit;
|
352 |
}
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
}
|
|
|
|
|
362 |
|
|
|
|
|
363 |
|
|
|
|
|
|
|
|
|
|
|
364 |
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
switch ( $bp->current_action ) {
|
374 |
-
case BP_MEDIA_IMAGES_SLUG:
|
375 |
-
$type = 'image';
|
376 |
-
break;
|
377 |
-
case BP_MEDIA_AUDIO_SLUG:
|
378 |
-
$type = 'audio';
|
379 |
-
break;
|
380 |
-
case BP_MEDIA_VIDEOS_SLUG:
|
381 |
-
$type = 'video';
|
382 |
-
break;
|
383 |
-
default :
|
384 |
-
$type = null;
|
385 |
-
}
|
386 |
-
if ( isset( $bp->action_variables ) && is_array( $bp->action_variables ) && isset( $bp->action_variables[ 0 ] ) && $bp->action_variables[ 0 ] == 'page' && isset( $bp->action_variables[ 1 ] ) && is_numeric( $bp->action_variables[ 1 ] ) ) {
|
387 |
-
$paged = $bp->action_variables[ 1 ];
|
388 |
-
} else {
|
389 |
-
$paged = 1;
|
390 |
-
}
|
391 |
-
if ( $type ) {
|
392 |
-
$args = array(
|
393 |
-
'post_type' => 'attachment',
|
394 |
-
'post_status' => 'any',
|
395 |
-
'post_mime_type' => $type,
|
396 |
-
'author' => $bp->displayed_user->id,
|
397 |
-
'meta_key' => 'bp-media-key',
|
398 |
-
'meta_value' => $bp->displayed_user->id,
|
399 |
-
'meta_compare' => '=',
|
400 |
-
'paged' => $paged,
|
401 |
-
'posts_per_page' => $bp_media_posts_per_page
|
402 |
-
);
|
403 |
-
|
404 |
-
$bp_media_query = new WP_Query( $args );
|
405 |
-
}
|
406 |
-
}
|
407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
}
|
409 |
|
410 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
/**
|
4 |
* Base class for creating BuddyPress Media Tabs on the user profile
|
5 |
*
|
6 |
+
* @package BuddyPressMedia
|
7 |
+
* @subpackage Profile
|
8 |
+
*
|
9 |
* @author Saurabh Shukla <saurabh.sahukla@rtcamp.com>
|
10 |
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
11 |
*/
|
12 |
+
class BPMediaScreen {
|
13 |
+
|
14 |
+
/**
|
15 |
+
*
|
16 |
+
* @var string Slug to be used for the media type/screen
|
17 |
+
*/
|
18 |
+
public $slug = NULL;
|
19 |
+
|
20 |
+
/**
|
21 |
+
*
|
22 |
+
* @var string Media type for use in the class
|
23 |
+
*/
|
24 |
+
public $media_type = '';
|
25 |
+
|
26 |
+
/**
|
27 |
+
*
|
28 |
+
* @var string Media type string used to build constants
|
29 |
+
*/
|
30 |
+
public $media_const = '';
|
31 |
+
|
32 |
+
/**
|
33 |
+
*
|
34 |
+
* @var string Plural media type string
|
35 |
+
*/
|
36 |
+
public $medias_type = '';
|
37 |
+
public $template = '';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Populates all the variables of the class, $media_type, $media_const, $medias_type
|
41 |
+
*
|
42 |
+
* @param string $media_type The media type for which the screen is going to be created
|
43 |
+
* @param string $slug The slug to use for the media type
|
44 |
+
*/
|
45 |
+
public function __construct( $media_type, $slug ) {
|
46 |
+
$this->slug = $slug;
|
47 |
+
$this->media_constant( $media_type );
|
48 |
+
$this->template = new BPMediaTemplate();
|
49 |
+
}
|
|
|
|
|
|
|
50 |
|
51 |
+
/**
|
52 |
+
* Populates variable $media_type
|
53 |
+
* @param string $media_type
|
54 |
+
*/
|
55 |
+
private function media( $media_type ) {
|
56 |
+
$this->media_type = $media_type;
|
57 |
+
}
|
58 |
|
59 |
+
/**
|
60 |
+
* Creates plural
|
61 |
+
* @param type $media_type
|
62 |
+
*/
|
63 |
+
private function medias( $media_type ) {
|
64 |
+
$this->media( $media_type );
|
65 |
+
$media = strtolower( $this->media_type );
|
66 |
+
if ( $media != 'audio' ) {
|
67 |
+
$media .= 's';
|
|
|
|
|
68 |
}
|
69 |
+
$this->medias_type = $media;
|
70 |
+
}
|
71 |
|
72 |
+
/**
|
73 |
+
*
|
74 |
+
* @param type $media_type
|
75 |
+
*/
|
76 |
+
private function media_constant( $media_type ) {
|
77 |
+
$this->medias( $media_type );
|
78 |
+
$this->media_const = strtoupper( $this->medias_type );
|
79 |
+
}
|
80 |
|
81 |
+
/**
|
82 |
+
*
|
83 |
+
*/
|
84 |
+
public function hook_before() {
|
85 |
+
do_action( 'bp_media_before_content' );
|
86 |
+
do_action( 'bp_media_before_' . $this->slug );
|
87 |
+
}
|
88 |
|
89 |
+
/**
|
90 |
+
*
|
91 |
+
*/
|
92 |
+
public function hook_after() {
|
93 |
+
do_action( 'bp_media_after_' . $this->slug );
|
94 |
+
do_action( 'bp_media_after_content' );
|
95 |
+
}
|
96 |
|
97 |
+
/**
|
98 |
+
*
|
99 |
+
* @global type $bp_media
|
100 |
+
*/
|
101 |
+
private function page_not_exist() {
|
102 |
+
@setcookie( 'bp-message', __( 'The requested url does not exist', BP_MEDIA_TXT_DOMAIN ), time() + 60 * 60 * 24, COOKIEPATH );
|
103 |
+
@setcookie( 'bp-message-type', 'error', time() + 60 * 60 * 24, COOKIEPATH );
|
104 |
+
$this->template->redirect( $this->media_const );
|
105 |
+
exit;
|
106 |
+
}
|
107 |
|
108 |
+
/**
|
109 |
+
*
|
110 |
+
* @global type $bp_media
|
111 |
+
*/
|
112 |
+
private function screen_title() {
|
113 |
+
printf( __( '%s List Page', BP_MEDIA_TXT_DOMAIN ), $this->slug );
|
114 |
+
}
|
115 |
|
116 |
+
/**
|
117 |
+
*
|
118 |
+
* @global type $bp
|
119 |
+
*/
|
120 |
+
public function screen() {
|
121 |
+
$editslug = 'BP_MEDIA_' . $this->media_const . '_EDIT_SLUG';
|
122 |
+
$entryslug = 'BP_MEDIA_' . $this->media_const . '_ENTRY_SLUG';
|
123 |
+
|
124 |
+
global $bp;
|
125 |
+
|
126 |
+
remove_filter( 'bp_activity_get_user_join_filter', 'activity_query_filter', 10 );
|
127 |
+
if ( isset( $bp->action_variables[ 0 ] ) ) {
|
128 |
+
switch ( $bp->action_variables[ 0 ] ) {
|
129 |
+
case constant( $editslug ) :
|
130 |
+
$this->edit_screen();
|
131 |
+
break;
|
132 |
+
case constant( $entryslug ) :
|
133 |
+
$this->entry_screen();
|
134 |
+
break;
|
135 |
+
case BP_MEDIA_DELETE_SLUG :
|
136 |
+
if ( ! isset( $bp->action_variables[ 1 ] ) ) {
|
137 |
+
$this->page_not_exist();
|
138 |
+
}
|
139 |
+
$this->entry_delete();
|
140 |
+
break;
|
141 |
+
default:
|
142 |
+
$this->set_query();
|
143 |
+
add_action( 'bp_template_content', array( $this, 'screen_content' ) );
|
|
|
|
|
|
|
|
|
144 |
}
|
145 |
+
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
$this->set_query();
|
147 |
+
add_action( 'bp_template_content', array( $this, 'screen_content' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
}
|
149 |
+
$this->template->loader();
|
150 |
+
}
|
151 |
|
152 |
+
/**
|
153 |
+
*
|
154 |
+
* @global type $bp_media
|
155 |
+
* @global type $bp_media_query
|
156 |
+
* @global type $bp_media_albums_query
|
157 |
+
*/
|
158 |
+
function screen_content() {
|
159 |
+
global $bp_media_query, $bp_media_albums_query;
|
160 |
+
$this->set_query();
|
161 |
+
|
162 |
+
$this->hook_before();
|
163 |
+
if ( $bp_media_query && $bp_media_query->have_posts() ):
|
164 |
+
echo '<ul id="bp-media-list" class="bp-media-gallery item-list">';
|
165 |
+
while ( $bp_media_query->have_posts() ) : $bp_media_query->the_post();
|
166 |
+
$this->template->the_content();
|
167 |
+
endwhile;
|
168 |
+
echo '</ul>';
|
169 |
+
$this->template->show_more();
|
170 |
+
else:
|
171 |
+
BPMediaFunction::show_formatted_error_message( sprintf( __( 'Sorry, no %s were found.', BP_MEDIA_TXT_DOMAIN ), $this->slug ), 'info' );
|
172 |
+
endif;
|
173 |
+
$this->hook_after();
|
174 |
+
}
|
175 |
|
176 |
+
/**
|
177 |
+
*
|
178 |
+
* @global type $bp
|
179 |
+
* @global BPMediaHostWordpress $bp_media_current_entry
|
180 |
+
* @return boolean
|
181 |
+
*/
|
182 |
+
function entry_screen() {
|
183 |
+
|
184 |
+
global $bp, $bp_media_current_entry;
|
185 |
+
$entryslug = 'BP_MEDIA_' . $this->media_const . '_ENTRY_SLUG';
|
186 |
+
if ( ! $bp->action_variables[ 0 ] == constant( $entryslug ) )
|
187 |
+
return false;
|
188 |
+
try {
|
189 |
+
|
190 |
+
$bp_media_current_entry = new BPMediaHostWordpress( $bp->action_variables[ 1 ] );
|
191 |
+
} catch ( Exception $e ) {
|
192 |
+
/* Send the values to the cookie for page reload display */
|
193 |
+
@setcookie( 'bp-message', $_COOKIE[ 'bp-message' ], time() + 60 * 60 * 24, COOKIEPATH );
|
194 |
+
@setcookie( 'bp-message-type', $_COOKIE[ 'bp-message-type' ], time() + 60 * 60 * 24, COOKIEPATH );
|
195 |
+
$this->template->redirect( $this->media_const );
|
196 |
+
exit;
|
197 |
}
|
198 |
|
199 |
+
$this->template_actions( 'entry_screen' );
|
200 |
+
$this->template->loader();
|
201 |
+
}
|
|
|
|
|
202 |
|
203 |
+
/**
|
204 |
+
*
|
205 |
+
* @global BPMediaHostWordpress $bp_media_current_entry
|
206 |
+
*/
|
207 |
+
function entry_screen_title() {
|
208 |
|
209 |
+
global $bp_media_current_entry;
|
210 |
+
/** @var $bp_media_current_entry BPMediaHostWordpress */
|
211 |
+
if ( is_object( $bp_media_current_entry ) )
|
212 |
+
echo $bp_media_current_entry->get_media_single_title();
|
213 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
|
215 |
+
/**
|
216 |
+
*
|
217 |
+
* @global type $bp
|
218 |
+
* @global BPMediaHostWordpress $bp_media_current_entry
|
219 |
+
* @return boolean
|
220 |
+
*/
|
221 |
+
function entry_screen_content() {
|
222 |
+
global $bp, $bp_media_current_entry;
|
223 |
+
$entryslug = 'BP_MEDIA_' . $this->media_const . '_ENTRY_SLUG';
|
224 |
+
$this->hook_before();
|
225 |
+
if ( ! $bp->action_variables[ 0 ] == constant( $entryslug ) )
|
226 |
+
return false;
|
227 |
+
echo '<div class="bp-media-single bp-media-image">';
|
228 |
+
echo $bp_media_current_entry->get_media_single_content();
|
229 |
+
echo $bp_media_current_entry->show_comment_form();
|
230 |
+
echo '</div>';
|
231 |
+
$this->hook_after();
|
232 |
+
}
|
|
|
|
|
|
|
233 |
|
234 |
+
/**
|
235 |
+
*
|
236 |
+
* @global BPMediaHostWordpress $bp_media_current_entry
|
237 |
+
* @global type $bp
|
238 |
+
*/
|
239 |
+
function edit_screen() {
|
240 |
+
global $bp_media_current_entry, $bp;
|
241 |
+
if ( ! isset( $bp->action_variables[ 1 ] ) ) {
|
242 |
+
$this->page_not_exist();
|
243 |
}
|
244 |
+
//Creating global bp_media_current_entry for later use
|
245 |
+
try {
|
246 |
+
$bp_media_current_entry = new BPMediaHostWordpress( $bp->action_variables[ 1 ] );
|
247 |
+
} catch ( Exception $e ) {
|
248 |
+
/* Send the values to the cookie for page reload display */
|
249 |
+
@setcookie( 'bp-message', $e->getMessage(), time() + 60 * 60 * 24, COOKIEPATH );
|
250 |
+
@setcookie( 'bp-message-type', 'error', time() + 60 * 60 * 24, COOKIEPATH );
|
251 |
+
$this->template->redirect( $this->media_const );
|
252 |
+
exit;
|
253 |
}
|
254 |
+
BPMediaFunction::check_user();
|
255 |
|
256 |
+
//For saving the data if the form is submitted
|
257 |
+
if ( array_key_exists( 'bp_media_title', $_POST ) ) {
|
258 |
+
BPMediaFunction::update_media();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
}
|
260 |
+
$this->template_actions( 'edit_screen' );
|
261 |
+
$this->template->loader();
|
262 |
+
}
|
263 |
|
264 |
+
/**
|
265 |
+
*
|
266 |
+
* @global type $bp_media
|
267 |
+
*/
|
268 |
+
function edit_screen_title() {
|
269 |
+
printf( __( 'Edit %s', BP_MEDIA_TXT_DOMAIN ), $this->slug );
|
270 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
+
/**
|
273 |
+
*
|
274 |
+
* @global type $bp
|
275 |
+
* @global BPMediaHostWordpress $bp_media_current_entry
|
276 |
+
* @global type $bp_media_default_excerpts
|
277 |
+
* @global type $bp_media
|
278 |
+
*/
|
279 |
+
function edit_screen_content() {
|
280 |
+
global $bp_media_current_entry, $bp_media_default_excerpts;
|
281 |
+
?>
|
282 |
+
<form method="post" class="standard-form" id="bp-media-upload-form">
|
283 |
+
<label for="bp-media-upload-input-title">
|
284 |
+
<?php printf( __( '%s Title', BP_MEDIA_TXT_DOMAIN ), ucfirst( $this->media_type ) ); ?>
|
285 |
+
</label>
|
286 |
+
<input id="bp-media-upload-input-title" type="text" name="bp_media_title" class="settings-input"
|
287 |
+
maxlength="<?php echo max( array( $bp_media_default_excerpts[ 'single_entry_title' ], $bp_media_default_excerpts[ 'activity_entry_title' ] ) ) ?>"
|
288 |
+
value="<?php echo $bp_media_current_entry->get_title(); ?>" />
|
289 |
+
<label for="bp-media-upload-input-description">
|
290 |
+
<?php printf( __( '%s Description', BP_MEDIA_TXT_DOMAIN ), ucfirst( $this->media_type ) ); ?>
|
291 |
+
</label>
|
292 |
+
<input id="bp-media-upload-input-description" type="text" name="bp_media_description" class="settings-input"
|
293 |
+
maxlength="<?php echo max( array( $bp_media_default_excerpts[ 'single_entry_description' ], $bp_media_default_excerpts[ 'activity_entry_description' ] ) ) ?>"
|
294 |
+
value="<?php echo $bp_media_current_entry->get_content(); ?>" />
|
295 |
+
<?php do_action('bp_media_add_media_fields', $this->media_type); ?>
|
296 |
+
<div class="submit">
|
297 |
+
<input type="submit" class="auto" value="<?php _e( 'Update', BP_MEDIA_TXT_DOMAIN ); ?>" />
|
298 |
+
<a href="<?php echo $bp_media_current_entry->get_url(); ?>" class="button" title="<?php _e( 'Back to Media File', BP_MEDIA_TXT_DOMAIN ); ?>">
|
299 |
+
<?php _e( 'Back to Media', BP_MEDIA_TXT_DOMAIN ); ?>
|
300 |
+
</a>
|
301 |
+
</div>
|
302 |
+
</form>
|
303 |
+
<?php
|
304 |
+
}
|
305 |
|
306 |
+
/**
|
307 |
+
*
|
308 |
+
* @global type $bp
|
309 |
+
* @global type $bp_media
|
310 |
+
* @global BPMediaHostWordpress $bp_media_current_entry
|
311 |
+
*/
|
312 |
+
function entry_delete() {
|
313 |
+
global $bp;
|
314 |
+
if ( bp_loggedin_user_id() != bp_displayed_user_id() ) {
|
315 |
+
bp_core_no_access( array(
|
316 |
+
'message' => __( 'You do not have access to this page.', BP_MEDIA_TXT_DOMAIN ),
|
317 |
+
'root' => bp_displayed_user_domain(),
|
318 |
+
'redirect' => false
|
319 |
+
) );
|
320 |
exit;
|
321 |
}
|
322 |
+
if ( ! isset( $bp->action_variables[ 1 ] ) ) {
|
323 |
+
@setcookie( 'bp-message', __( 'The requested url does not exist', BP_MEDIA_TXT_DOMAIN ), time() + 60 * 60 * 24, COOKIEPATH );
|
324 |
+
@setcookie( 'bp-message-type', 'error', time() + 60 * 60 * 24, COOKIEPATH );
|
325 |
+
$this->template->redirect( $this->media_const );
|
326 |
+
exit;
|
327 |
+
}
|
328 |
+
global $bp_media_current_entry;
|
329 |
+
try {
|
330 |
+
$bp_media_current_entry = new BPMediaHostWordpress( $bp->action_variables[ 1 ] );
|
331 |
+
} catch ( Exception $e ) {
|
332 |
+
/* Send the values to the cookie for page reload display */
|
333 |
+
@setcookie( 'bp-message', $e->getMessage(), time() + 60 * 60 * 24, COOKIEPATH );
|
334 |
+
@setcookie( 'bp-message-type', 'error', time() + 60 * 60 * 24, COOKIEPATH );
|
335 |
+
$this->template->redirect( $this->media_const );
|
336 |
+
exit;
|
337 |
}
|
338 |
+
$post_id = $bp_media_current_entry->get_id();
|
339 |
+
$activity_id = get_post_meta( $post_id, 'bp_media_child_activity', true );
|
340 |
|
341 |
+
bp_activity_delete_by_activity_id( $activity_id );
|
342 |
+
$bp_media_current_entry->delete_media();
|
343 |
|
344 |
+
@setcookie( 'bp-message', __( 'Media deleted successfully', BP_MEDIA_TXT_DOMAIN ), time() + 60 * 60 * 24, COOKIEPATH );
|
345 |
+
@setcookie( 'bp-message-type', 'success', time() + 60 * 60 * 24, COOKIEPATH );
|
346 |
+
$this->template->redirect( $this->media_const );
|
347 |
+
exit;
|
348 |
+
}
|
349 |
|
350 |
+
/**
|
351 |
+
*
|
352 |
+
* @param type $action
|
353 |
+
*/
|
354 |
+
function template_actions( $action ) {
|
355 |
+
add_action( 'bp_template_title', array( $this, $action . '_title' ) );
|
356 |
+
add_action( 'bp_template_content', array( $this, $action . '_content' ) );
|
357 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
|
359 |
+
/**
|
360 |
+
*
|
361 |
+
* @global type $bp
|
362 |
+
* @global type $bp_media_posts_per_page
|
363 |
+
* @global type $bp_media_query
|
364 |
+
*/
|
365 |
+
public function set_query() {
|
366 |
+
global $bp, $bp_media_posts_per_page, $bp_media_query;
|
367 |
+
switch ( $bp->current_action ) {
|
368 |
+
case BP_MEDIA_IMAGES_SLUG:
|
369 |
+
$type = 'image';
|
370 |
+
break;
|
371 |
+
case BP_MEDIA_AUDIO_SLUG:
|
372 |
+
$type = 'audio';
|
373 |
+
break;
|
374 |
+
case BP_MEDIA_VIDEOS_SLUG:
|
375 |
+
$type = 'video';
|
376 |
+
break;
|
377 |
+
default :
|
378 |
+
$type = null;
|
379 |
+
}
|
380 |
+
if ( isset( $bp->action_variables ) && is_array( $bp->action_variables ) && isset( $bp->action_variables[ 0 ] ) && $bp->action_variables[ 0 ] == 'page' && isset( $bp->action_variables[ 1 ] ) && is_numeric( $bp->action_variables[ 1 ] ) ) {
|
381 |
+
$paged = $bp->action_variables[ 1 ];
|
382 |
+
} else {
|
383 |
+
$paged = 1;
|
384 |
+
}
|
385 |
+
if ( $type ) {
|
386 |
+
$args = array(
|
387 |
+
'post_type' => 'attachment',
|
388 |
+
'post_status' => 'any',
|
389 |
+
'post_mime_type' => $type,
|
390 |
+
'author' => $bp->displayed_user->id,
|
391 |
+
'meta_key' => 'bp-media-key',
|
392 |
+
'meta_value' => $bp->displayed_user->id,
|
393 |
+
'meta_compare' => '=',
|
394 |
+
'paged' => $paged,
|
395 |
+
'posts_per_page' => $bp_media_posts_per_page
|
396 |
+
);
|
397 |
+
|
398 |
+
$bp_media_query = new WP_Query( $args );
|
399 |
+
}
|
400 |
}
|
401 |
|
402 |
}
|
app/main/profile/BPMediaTemplate.php
CHANGED
@@ -1,13 +1,12 @@
|
|
1 |
<?php
|
2 |
-
/*
|
3 |
-
* To change this template, choose Tools | Templates
|
4 |
-
* and open the template in the editor.
|
5 |
-
*/
|
6 |
-
|
7 |
/**
|
8 |
-
*
|
9 |
*
|
10 |
-
* @
|
|
|
|
|
|
|
|
|
11 |
*/
|
12 |
class BPMediaTemplate {
|
13 |
|
@@ -159,7 +158,7 @@ class BPMediaTemplate {
|
|
159 |
break;
|
160 |
case 'albums':
|
161 |
global $bp_media_albums_query;
|
162 |
-
if ( isset( $
|
163 |
$showmore = true;
|
164 |
break;
|
165 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
+
* Contains methods for template functions
|
4 |
*
|
5 |
+
* @package BuddyPressMedia
|
6 |
+
* @subpackage Profile
|
7 |
+
*
|
8 |
+
* @author Saurabh Shukla <saurabh.shukla@rtcamp.com>
|
9 |
+
* @author Gagandeep Singh <gagandeep.singh@rtcamp.com>
|
10 |
*/
|
11 |
class BPMediaTemplate {
|
12 |
|
158 |
break;
|
159 |
case 'albums':
|
160 |
global $bp_media_albums_query;
|
161 |
+
if ( isset( $bp_media_albums_query->found_posts ) && $bp_media_albums_query->found_posts > 10 )
|
162 |
$showmore = true;
|
163 |
break;
|
164 |
}
|
app/main/profile/BPMediaUploadScreen.php
CHANGED
@@ -1,13 +1,11 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
/*
|
4 |
-
* To change this template, choose Tools | Templates
|
5 |
-
* and open the template in the editor.
|
6 |
-
*/
|
7 |
-
|
8 |
/**
|
9 |
* Description of BPMediaUploadScreen
|
10 |
*
|
|
|
|
|
|
|
11 |
* @author saurabh
|
12 |
*/
|
13 |
class BPMediaUploadScreen extends BPMediaScreen {
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
3 |
/**
|
4 |
* Description of BPMediaUploadScreen
|
5 |
*
|
6 |
+
* @package BuddyPressMedia
|
7 |
+
* @subpackage Profile
|
8 |
+
*
|
9 |
* @author saurabh
|
10 |
*/
|
11 |
class BPMediaUploadScreen extends BPMediaScreen {
|
app/main/widgets/BPMediaPopularMedia.php
CHANGED
@@ -11,83 +11,99 @@
|
|
11 |
*/
|
12 |
class BPMediaPopularMedia extends WP_Widget {
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
}
|
93 |
?>
|
11 |
*/
|
12 |
class BPMediaPopularMedia extends WP_Widget {
|
13 |
|
14 |
+
function __construct() {
|
15 |
+
$widget_ops = array('classname' => 'BPMediaPopularMedia', 'description' => __("The most popular media on your site", BP_MEDIA_TXT_DOMAIN));
|
16 |
+
parent::__construct('popular-media', __('Popular BuddyPress Media', BP_MEDIA_TXT_DOMAIN), $widget_ops);
|
17 |
+
if (is_active_widget(false, false, "popular-media", true)) {
|
18 |
+
if (defined('WP_DEBUG') && WP_DEBUG)
|
19 |
+
trigger_error(sprintf(__('%1$s will be <strong>deprecated</strong> from version %2$s! Use %3$s instead.'), "Popular BuddyPress Media Widget", "2.5", "BuddyPress Media Widget"));
|
20 |
+
else
|
21 |
+
add_action('admin_notices', array($this, 'deprecated_notice'));
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
function deprecated_notice() {
|
26 |
+
if (current_user_can('edit_theme_options')) {
|
27 |
+
echo '<div class="error"><p>';
|
28 |
+
echo sprintf(__('%1$s will be <strong>deprecated</strong> from version %2$s! Use %3$s instead.'), "Popular BuddyPress Media Widget", "2.5", "BuddyPress Media Widget");
|
29 |
+
echo '</div>';
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
function widget($args, $instance) {
|
34 |
+
extract($args);
|
35 |
+
|
36 |
+
$title = apply_filters('widget_title', empty($instance['title']) ? __('Popular Media', BP_MEDIA_TXT_DOMAIN) : $instance['title'], $instance, $this->id_base);
|
37 |
+
|
38 |
+
if (empty($instance['number']) || !$number = absint($instance['number']))
|
39 |
+
$number = 10;
|
40 |
+
|
41 |
+
echo $before_widget;
|
42 |
+
echo $before_title . $title . $after_title;
|
43 |
+
$this->deprecated_notice();
|
44 |
+
?>
|
45 |
+
<div id="popular-media-tabs" class="media-tabs-container">
|
46 |
+
<!-- <ul>
|
47 |
+
<li><a href="#popular-media-tabs-comments"><?php _e('comments', BP_MEDIA_TXT_DOMAIN); ?></a></li>
|
48 |
+
<li><a href="#popular-media-tabs-views"><?php _e('Views', BP_MEDIA_TXT_DOMAIN); ?></a></li>
|
49 |
+
</ul>-->
|
50 |
+
<div id="popular-media-tabs-comments" class="bp-media-tab-panel">
|
51 |
+
<?php
|
52 |
+
$args = array('post_type' => 'attachment',
|
53 |
+
'post_status' => 'any',
|
54 |
+
'posts_per_page' => $number,
|
55 |
+
'meta_key' => 'bp-media-key',
|
56 |
+
'meta_value' => 0,
|
57 |
+
'meta_compare' => '>',
|
58 |
+
'orderby' => 'comment_count');
|
59 |
+
|
60 |
+
$bp_media_widget_query = new WP_Query($args);
|
61 |
+
|
62 |
+
if ($bp_media_widget_query->have_posts()) {
|
63 |
+
?>
|
64 |
+
|
65 |
+
<ul class="widget-item-listing"><?php
|
66 |
+
while ($bp_media_widget_query->have_posts()) {
|
67 |
+
$bp_media_widget_query->the_post();
|
68 |
+
|
69 |
+
$entry = new BPMediaHostWordpress(get_the_ID());
|
70 |
+
?>
|
71 |
+
|
72 |
+
<?php echo $entry->get_media_gallery_content(); ?><?php }
|
73 |
+
?>
|
74 |
+
|
75 |
+
</ul><!-- .widget-item-listing --><?php
|
76 |
+
}
|
77 |
+
else
|
78 |
+
_e('No popular media found', BP_MEDIA_TXT_DOMAIN);
|
79 |
+
|
80 |
+
wp_reset_query();
|
81 |
+
?>
|
82 |
+
|
83 |
+
</div><!-- #popular-media-tabs-comments -->
|
84 |
+
</div>
|
85 |
+
<?php
|
86 |
+
echo $after_widget;
|
87 |
+
}
|
88 |
+
|
89 |
+
function update($new_instance, $old_instance) {
|
90 |
+
$instance = $old_instance;
|
91 |
+
$instance['title'] = strip_tags($new_instance['title']);
|
92 |
+
$instance['number'] = (int) $new_instance['number'];
|
93 |
+
return $instance;
|
94 |
+
}
|
95 |
+
|
96 |
+
function form($instance) {
|
97 |
+
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
|
98 |
+
$number = isset($instance['number']) ? absint($instance['number']) : 10;
|
99 |
+
?>
|
100 |
+
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', BP_MEDIA_TXT_DOMAIN); ?></label>
|
101 |
+
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
102 |
+
|
103 |
+
<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:', BP_MEDIA_TXT_DOMAIN); ?></label>
|
104 |
+
<input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
|
105 |
+
<?php
|
106 |
+
}
|
107 |
|
108 |
}
|
109 |
?>
|
app/main/widgets/BPMediaRecentMedia.php
CHANGED
@@ -11,192 +11,211 @@
|
|
11 |
*/
|
12 |
class BPMediaRecentMedia extends WP_Widget {
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
201 |
}
|
202 |
?>
|
11 |
*/
|
12 |
class BPMediaRecentMedia extends WP_Widget {
|
13 |
|
14 |
+
function __construct() {
|
15 |
+
$widget_ops = array('classname' => 'widget_recent_media', 'description' => __("The most recent media uploaded on your site", BP_MEDIA_TXT_DOMAIN));
|
16 |
+
parent::__construct('recent-media', __('Recent BuddyPress Media', BP_MEDIA_TXT_DOMAIN), $widget_ops);
|
17 |
+
if (is_active_widget(false, false, "recent-media", true)) {
|
18 |
+
if (defined('WP_DEBUG') && WP_DEBUG)
|
19 |
+
trigger_error(sprintf(__('%1$s will be <strong>deprecated</strong> from version %2$s! Use %3$s instead.'), "Recent Media Widget", "2.5", "BuddyPress Media Widget"));
|
20 |
+
else
|
21 |
+
add_action('admin_notices', array($this, 'deprecated_notice'));
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
function deprecated_notice() {
|
26 |
+
if (current_user_can('edit_theme_options')) {
|
27 |
+
echo '<div class="error"><p>';
|
28 |
+
echo sprintf(__('%1$s will be <strong>deprecated</strong> from version %2$s! Use %3$s instead.'), "Recent BuddyPress Media Widget", "2.5", "BuddyPressMedia Widget");
|
29 |
+
echo '</div>';
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
function widget($args, $instance) {
|
34 |
+
extract($args);
|
35 |
+
|
36 |
+
$title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Media', BP_MEDIA_TXT_DOMAIN) : $instance['title'], $instance, $this->id_base);
|
37 |
+
|
38 |
+
if (empty($instance['number']) || !$number = absint($instance['number']))
|
39 |
+
$number = 10;
|
40 |
+
|
41 |
+
echo $before_widget;
|
42 |
+
echo $before_title . $title . $after_title;
|
43 |
+
$this->deprecated_notice();
|
44 |
+
?>
|
45 |
+
<div id="recent-media-tabs" class="media-tabs-container media-tabs-container-tabs">
|
46 |
+
<ul>
|
47 |
+
<li><a href="#recent-media-tabs-all"><?php _e('All', BP_MEDIA_TXT_DOMAIN); ?></a></li>
|
48 |
+
<li><a href="#recent-media-tabs-photos"><?php _e('Photos', BP_MEDIA_TXT_DOMAIN); ?></a></li>
|
49 |
+
<li><a href="#recent-media-tabs-music"><?php _e('Music', BP_MEDIA_TXT_DOMAIN); ?></a></li>
|
50 |
+
<li><a href="#recent-media-tabs-videos"><?php _e('Videos', BP_MEDIA_TXT_DOMAIN); ?></a></li>
|
51 |
+
</ul>
|
52 |
+
<div id="recent-media-tabs-all" class="bp-media-tab-panel">
|
53 |
+
<?php
|
54 |
+
// All Media
|
55 |
+
$args = array('post_type' => 'attachment',
|
56 |
+
'post_status' => 'any',
|
57 |
+
'posts_per_page' => $number,
|
58 |
+
'meta_key' => 'bp-media-key',
|
59 |
+
'meta_value' => 0,
|
60 |
+
'meta_compare' => '>');
|
61 |
+
|
62 |
+
$bp_media_widget_query = new WP_Query($args);
|
63 |
+
|
64 |
+
if ($bp_media_widget_query->have_posts()) {
|
65 |
+
?>
|
66 |
+
|
67 |
+
<ul class="widget-item-listing"><?php
|
68 |
+
while ($bp_media_widget_query->have_posts()) {
|
69 |
+
$bp_media_widget_query->the_post();
|
70 |
+
|
71 |
+
$entry = new BPMediaHostWordpress(get_the_ID());
|
72 |
+
?>
|
73 |
+
|
74 |
+
<?php echo $entry->get_media_gallery_content(); ?><?php }
|
75 |
+
?>
|
76 |
+
|
77 |
+
</ul><!-- .widget-item-listing --><?php
|
78 |
+
}
|
79 |
+
else
|
80 |
+
_e('No recent media found', BP_MEDIA_TXT_DOMAIN);
|
81 |
+
|
82 |
+
wp_reset_query();
|
83 |
+
?>
|
84 |
+
|
85 |
+
</div><!-- #recent-media-tabs-all -->
|
86 |
+
|
87 |
+
<div id="recent-media-tabs-photos" class="bp-media-tab-panel">
|
88 |
+
<?php
|
89 |
+
// Recent photos
|
90 |
+
$args = array('post_type' => 'attachment',
|
91 |
+
'post_status' => 'any',
|
92 |
+
'post_mime_type' => 'image',
|
93 |
+
'posts_per_page' => $number,
|
94 |
+
'meta_key' => 'bp-media-key',
|
95 |
+
'meta_value' => 0,
|
96 |
+
'meta_compare' => '>');
|
97 |
+
|
98 |
+
|
99 |
+
$bp_media_widget_query = new WP_Query($args);
|
100 |
+
|
101 |
+
if ($bp_media_widget_query->have_posts()) {
|
102 |
+
?>
|
103 |
+
|
104 |
+
<ul class="widget-item-listing"><?php
|
105 |
+
while ($bp_media_widget_query->have_posts()) {
|
106 |
+
$bp_media_widget_query->the_post();
|
107 |
+
|
108 |
+
$entry = new BPMediaHostWordpress(get_the_ID());
|
109 |
+
?>
|
110 |
+
|
111 |
+
<?php echo $entry->get_media_gallery_content(); ?><?php }
|
112 |
+
?>
|
113 |
+
|
114 |
+
</ul><!-- .widget-item-listing --><?php
|
115 |
+
}
|
116 |
+
else
|
117 |
+
_e('No recent photo found', BP_MEDIA_TXT_DOMAIN);
|
118 |
+
|
119 |
+
wp_reset_query();
|
120 |
+
?>
|
121 |
+
|
122 |
+
</div><!-- #media-tabs-photos -->
|
123 |
+
|
124 |
+
<div id="recent-media-tabs-music" class="bp-media-tab-panel">
|
125 |
+
<?php
|
126 |
+
// Recent Audio
|
127 |
+
$args = array('post_type' => 'attachment',
|
128 |
+
'post_status' => 'any',
|
129 |
+
'post_mime_type' => 'audio',
|
130 |
+
'posts_per_page' => $number,
|
131 |
+
'meta_key' => 'bp-media-key',
|
132 |
+
'meta_value' => 0,
|
133 |
+
'meta_compare' => '>');
|
134 |
+
|
135 |
+
$bp_media_widget_query = new WP_Query($args);
|
136 |
+
|
137 |
+
if ($bp_media_widget_query->have_posts()) {
|
138 |
+
?>
|
139 |
+
|
140 |
+
<ul class="widget-item-listing">
|
141 |
+
<?php
|
142 |
+
while ($bp_media_widget_query->have_posts()) {
|
143 |
+
$bp_media_widget_query->the_post();
|
144 |
+
|
145 |
+
$entry = new BPMediaHostWordpress(get_the_ID());
|
146 |
+
echo $entry->get_media_gallery_content();
|
147 |
+
}
|
148 |
+
?>
|
149 |
+
|
150 |
+
</ul><!-- .widget-item-listing --><?php
|
151 |
+
}
|
152 |
+
else
|
153 |
+
_e('No recent audio found', BP_MEDIA_TXT_DOMAIN);
|
154 |
+
|
155 |
+
wp_reset_query();
|
156 |
+
?>
|
157 |
+
|
158 |
+
</div><!-- #recent-media-tabs-music -->
|
159 |
+
|
160 |
+
<div id="recent-media-tabs-videos" class="bp-media-tab-panel">
|
161 |
+
<?php
|
162 |
+
// Recent Video
|
163 |
+
$args = array('post_type' => 'attachment',
|
164 |
+
'post_status' => 'any',
|
165 |
+
'post_mime_type' => 'video',
|
166 |
+
'posts_per_page' => $number,
|
167 |
+
'meta_key' => 'bp-media-key',
|
168 |
+
'meta_value' => 0,
|
169 |
+
'meta_compare' => '>');
|
170 |
+
|
171 |
+
$bp_media_widget_query = new WP_Query($args);
|
172 |
+
|
173 |
+
if ($bp_media_widget_query->have_posts()) {
|
174 |
+
?>
|
175 |
+
|
176 |
+
<ul class="widget-item-listing"><?php
|
177 |
+
while ($bp_media_widget_query->have_posts()) {
|
178 |
+
$bp_media_widget_query->the_post();
|
179 |
+
|
180 |
+
$entry = new BPMediaHostWordpress(get_the_ID());
|
181 |
+
?>
|
182 |
+
|
183 |
+
<?php echo $entry->get_media_gallery_content(); ?><?php }
|
184 |
+
?>
|
185 |
+
|
186 |
+
</ul><!-- .widget-item-listing --><?php
|
187 |
+
}
|
188 |
+
else
|
189 |
+
_e('No recent video found', BP_MEDIA_TXT_DOMAIN);
|
190 |
+
|
191 |
+
wp_reset_query();
|
192 |
+
?>
|
193 |
+
|
194 |
+
</div><!-- #media-tabs-videos -->
|
195 |
+
|
196 |
+
</div>
|
197 |
+
<?php
|
198 |
+
echo $after_widget;
|
199 |
+
}
|
200 |
+
|
201 |
+
function update($new_instance, $old_instance) {
|
202 |
+
$instance = $old_instance;
|
203 |
+
$instance['title'] = strip_tags($new_instance['title']);
|
204 |
+
$instance['number'] = (int) $new_instance['number'];
|
205 |
+
return $instance;
|
206 |
+
}
|
207 |
+
|
208 |
+
function form($instance) {
|
209 |
+
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
|
210 |
+
$number = isset($instance['number']) ? absint($instance['number']) : 10;
|
211 |
+
?>
|
212 |
+
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', BP_MEDIA_TXT_DOMAIN); ?></label>
|
213 |
+
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
214 |
+
|
215 |
+
<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:', BP_MEDIA_TXT_DOMAIN); ?></label>
|
216 |
+
<input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
|
217 |
+
<?php
|
218 |
+
}
|
219 |
|
220 |
}
|
221 |
?>
|
app/main/widgets/BPMediaWidget.php
ADDED
@@ -0,0 +1,281 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Description of BPMediaMediaWidget
|
5 |
+
*
|
6 |
+
* @author faishal
|
7 |
+
*/
|
8 |
+
class BPMediaWidget extends WP_Widget {
|
9 |
+
|
10 |
+
function __construct() {
|
11 |
+
$widget_ops = array('classname' => 'buddypress-media-widget', 'description' => __("The most recent/popular media uploaded on your site", BP_MEDIA_TXT_DOMAIN));
|
12 |
+
parent::__construct('buddypress-media-wid', __('BuddyPress Media Widget', BP_MEDIA_TXT_DOMAIN), $widget_ops);
|
13 |
+
}
|
14 |
+
|
15 |
+
function widget($args, $instance) {
|
16 |
+
extract($args);
|
17 |
+
$title = apply_filters('widget_title', empty($instance['title']) ? __('BuddyPress Media', BP_MEDIA_TXT_DOMAIN) : $instance['title'], $instance, $this->id_base);
|
18 |
+
|
19 |
+
if (empty($instance['number']) || !$number = absint($instance['number']))
|
20 |
+
$number = 10;
|
21 |
+
$wdType = isset($instance['wdType']) ? esc_attr($instance['wdType']) : 'recent';
|
22 |
+
$allowAudio = isset($instance['allow_audio']) ? (bool) $instance['allow_audio'] : true;
|
23 |
+
$allowVideo = isset($instance['allow_video']) ? (bool) $instance['allow_video'] : true;
|
24 |
+
$allowImage = isset($instance['allow_image']) ? (bool) $instance['allow_image'] : true;
|
25 |
+
$allowAll = isset($instance['allow_all']) ? (bool) $instance['allow_all'] : true;
|
26 |
+
$allowMimeType = array();
|
27 |
+
echo $before_widget;
|
28 |
+
echo $before_title . $title . $after_title;
|
29 |
+
if ($wdType == "popular") {
|
30 |
+
$orderby = 'comment_count';
|
31 |
+
} else {
|
32 |
+
$orderby = 'date';
|
33 |
+
}
|
34 |
+
$widgetid = $args['widget_id'];
|
35 |
+
if (!($allowAll || $allowAudio || $allowVideo || $allowImage)) {
|
36 |
+
?>
|
37 |
+
<p><?php printf(__('Please configure this widget <a href="%s" target="_blank" title="Configure BuddyPress Media Widget">here</a>.', 'rtPanel'), admin_url('/widgets.php')); ?></p><?php } else {
|
38 |
+
?>
|
39 |
+
|
40 |
+
<div id="<?php echo $wdType; ?>-media-tabs" class="media-tabs-container media-tabs-container-tabs">
|
41 |
+
<ul>
|
42 |
+
<?php if ($allowAll) { ?>
|
43 |
+
<li><a href="#<?php echo $wdType; ?>-media-tabs-all-<?php echo $widgetid; ?>"><?php _e('All', BP_MEDIA_TXT_DOMAIN); ?></a></li>
|
44 |
+
<?php
|
45 |
+
}
|
46 |
+
if ($allowImage) {
|
47 |
+
array_push($allowMimeType, "image");
|
48 |
+
?>
|
49 |
+
<li><a href="#<?php echo $wdType; ?>-media-tabs-photos-<?php echo $widgetid; ?>"><?php _e('Photos', BP_MEDIA_TXT_DOMAIN); ?></a></li>
|
50 |
+
<?php
|
51 |
+
}
|
52 |
+
if ($allowAudio) {
|
53 |
+
array_push($allowMimeType, "audio");
|
54 |
+
?>
|
55 |
+
<li><a href="#<?php echo $wdType; ?>-media-tabs-music-<?php echo $widgetid; ?>"><?php _e('Music', BP_MEDIA_TXT_DOMAIN); ?></a></li>
|
56 |
+
<?php
|
57 |
+
}
|
58 |
+
if ($allowVideo) {
|
59 |
+
array_push($allowMimeType, "video");
|
60 |
+
?>
|
61 |
+
<li><a href="#<?php echo $wdType; ?>-media-tabs-videos-<?php echo $widgetid; ?>"><?php _e('Videos', BP_MEDIA_TXT_DOMAIN); ?></a></li>
|
62 |
+
<?php }
|
63 |
+
?>
|
64 |
+
</ul>
|
65 |
+
<?php if ($allowAll) { ?>
|
66 |
+
<div id="<?php echo $wdType; ?>-media-tabs-all-<?php echo $widgetid; ?>" class="bp-media-tab-panel">
|
67 |
+
<?php
|
68 |
+
// All Media //'post_mime_type' => $allowMimeType,
|
69 |
+
$args = array('post_type' => 'attachment',
|
70 |
+
'post_status' => 'any',
|
71 |
+
'posts_per_page' => $number,
|
72 |
+
'meta_key' => 'bp-media-key',
|
73 |
+
'meta_value' => 0,
|
74 |
+
'meta_compare' => '>',
|
75 |
+
'orderby' => $orderby
|
76 |
+
);
|
77 |
+
|
78 |
+
$bp_media_widget_query = new WP_Query($args);
|
79 |
+
|
80 |
+
if ($bp_media_widget_query->have_posts()) {
|
81 |
+
?>
|
82 |
+
|
83 |
+
<ul class="widget-item-listing"><?php
|
84 |
+
while ($bp_media_widget_query->have_posts()) {
|
85 |
+
$bp_media_widget_query->the_post();
|
86 |
+
|
87 |
+
$entry = new BPMediaHostWordpress(get_the_ID());
|
88 |
+
?>
|
89 |
+
|
90 |
+
<?php echo $entry->get_media_gallery_content(); ?><?php }
|
91 |
+
?>
|
92 |
+
|
93 |
+
</ul><?php
|
94 |
+
}
|
95 |
+
else
|
96 |
+
_e('No ' . $wdType . ' media found', BP_MEDIA_TXT_DOMAIN);
|
97 |
+
|
98 |
+
wp_reset_query();
|
99 |
+
?>
|
100 |
+
|
101 |
+
</div>
|
102 |
+
<?php
|
103 |
+
}
|
104 |
+
if ($allowImage) {
|
105 |
+
?>
|
106 |
+
<div id="<?php echo $wdType; ?>-media-tabs-photos-<?php echo $widgetid; ?>" class="bp-media-tab-panel">
|
107 |
+
<?php
|
108 |
+
// photos
|
109 |
+
$args = array('post_type' => 'attachment',
|
110 |
+
'post_status' => 'any',
|
111 |
+
'post_mime_type' => 'image',
|
112 |
+
'posts_per_page' => $number,
|
113 |
+
'meta_key' => 'bp-media-key',
|
114 |
+
'meta_value' => 0,
|
115 |
+
'meta_compare' => '>',
|
116 |
+
'orderby' => $orderby);
|
117 |
+
|
118 |
+
$bp_media_widget_query = new WP_Query($args);
|
119 |
+
|
120 |
+
if ($bp_media_widget_query->have_posts()) {
|
121 |
+
?>
|
122 |
+
|
123 |
+
<ul class="widget-item-listing"><?php
|
124 |
+
while ($bp_media_widget_query->have_posts()) {
|
125 |
+
$bp_media_widget_query->the_post();
|
126 |
+
|
127 |
+
$entry = new BPMediaHostWordpress(get_the_ID());
|
128 |
+
?>
|
129 |
+
|
130 |
+
<?php echo $entry->get_media_gallery_content(); ?><?php }
|
131 |
+
?>
|
132 |
+
|
133 |
+
</ul><!-- .widget-item-listing --><?php
|
134 |
+
}
|
135 |
+
else
|
136 |
+
_e('No ' . $wdType . ' photo found', BP_MEDIA_TXT_DOMAIN);
|
137 |
+
|
138 |
+
wp_reset_query();
|
139 |
+
?>
|
140 |
+
|
141 |
+
</div>
|
142 |
+
<?php
|
143 |
+
}
|
144 |
+
if ($allowAudio) {
|
145 |
+
?>
|
146 |
+
|
147 |
+
<div id="<?php echo $wdType; ?>-media-tabs-music-<?php echo $widgetid; ?>" class="bp-media-tab-panel">
|
148 |
+
<?php
|
149 |
+
// Audio
|
150 |
+
$args = array('post_type' => 'attachment',
|
151 |
+
'post_status' => 'any',
|
152 |
+
'post_mime_type' => 'audio',
|
153 |
+
'posts_per_page' => $number,
|
154 |
+
'meta_key' => 'bp-media-key',
|
155 |
+
'meta_value' => 0,
|
156 |
+
'meta_compare' => '>',
|
157 |
+
'orderby' => $orderby);
|
158 |
+
$bp_media_widget_query = new WP_Query($args);
|
159 |
+
|
160 |
+
if ($bp_media_widget_query->have_posts()) {
|
161 |
+
?>
|
162 |
+
|
163 |
+
<ul class="widget-item-listing">
|
164 |
+
<?php
|
165 |
+
while ($bp_media_widget_query->have_posts()) {
|
166 |
+
$bp_media_widget_query->the_post();
|
167 |
+
|
168 |
+
$entry = new BPMediaHostWordpress(get_the_ID());
|
169 |
+
echo $entry->get_media_gallery_content();
|
170 |
+
}
|
171 |
+
?>
|
172 |
+
|
173 |
+
</ul><?php
|
174 |
+
}
|
175 |
+
else
|
176 |
+
_e('No ' . $wdType . ' audio found', BP_MEDIA_TXT_DOMAIN);
|
177 |
+
|
178 |
+
wp_reset_query();
|
179 |
+
?>
|
180 |
+
|
181 |
+
</div>
|
182 |
+
|
183 |
+
<?php
|
184 |
+
}
|
185 |
+
if ($allowVideo) {
|
186 |
+
?>
|
187 |
+
<div id="<?php echo $wdType; ?>-media-tabs-videos-<?php echo $widgetid; ?>" class="bp-media-tab-panel">
|
188 |
+
<?php
|
189 |
+
//Video
|
190 |
+
$args = array('post_type' => 'attachment',
|
191 |
+
'post_status' => 'any',
|
192 |
+
'post_mime_type' => 'video',
|
193 |
+
'posts_per_page' => $number,
|
194 |
+
'meta_key' => 'bp-media-key',
|
195 |
+
'meta_value' => 0,
|
196 |
+
'meta_compare' => '>',
|
197 |
+
'orderby' => $orderby);
|
198 |
+
$bp_media_widget_query = new WP_Query($args);
|
199 |
+
|
200 |
+
if ($bp_media_widget_query->have_posts()) {
|
201 |
+
?>
|
202 |
+
|
203 |
+
<ul class="widget-item-listing"><?php
|
204 |
+
while ($bp_media_widget_query->have_posts()) {
|
205 |
+
$bp_media_widget_query->the_post();
|
206 |
+
|
207 |
+
$entry = new BPMediaHostWordpress(get_the_ID());
|
208 |
+
?>
|
209 |
+
|
210 |
+
<?php echo $entry->get_media_gallery_content(); ?><?php }
|
211 |
+
?>
|
212 |
+
|
213 |
+
</ul><?php
|
214 |
+
}
|
215 |
+
else
|
216 |
+
_e('No ' . $wdType . ' video found', BP_MEDIA_TXT_DOMAIN);
|
217 |
+
|
218 |
+
wp_reset_query();
|
219 |
+
?>
|
220 |
+
|
221 |
+
</div>
|
222 |
+
<?php } ?>
|
223 |
+
</div>
|
224 |
+
<?php
|
225 |
+
}
|
226 |
+
echo $after_widget;
|
227 |
+
}
|
228 |
+
|
229 |
+
function update($new_instance, $old_instance) {
|
230 |
+
$instance = $old_instance;
|
231 |
+
$instance['wdType'] = strip_tags($new_instance['wdType']);
|
232 |
+
$instance['title'] = strip_tags($new_instance['title']);
|
233 |
+
$instance['number'] = (int) $new_instance['number'];
|
234 |
+
$instance['allow_audio'] = !empty($new_instance['allow_audio']) ? 1 : 0;
|
235 |
+
$instance['allow_video'] = !empty($new_instance['allow_video']) ? 1 : 0;
|
236 |
+
$instance['allow_image'] = !empty($new_instance['allow_image']) ? 1 : 0;
|
237 |
+
$instance['allow_all'] = !empty($new_instance['allow_all']) ? 1 : 0;
|
238 |
+
|
239 |
+
return $instance;
|
240 |
+
}
|
241 |
+
|
242 |
+
function form($instance) {
|
243 |
+
$wdType = isset($instance['wdType']) ? esc_attr($instance['wdType']) : '';
|
244 |
+
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
|
245 |
+
$number = isset($instance['number']) ? absint($instance['number']) : 10;
|
246 |
+
$allowAudio = isset($instance['allow_audio']) ? (bool) $instance['allow_audio'] : true;
|
247 |
+
$allowVideo = isset($instance['allow_video']) ? (bool) $instance['allow_video'] : true;
|
248 |
+
$allowImage = isset($instance['allow_image']) ? (bool) $instance['allow_image'] : true;
|
249 |
+
$allowAll = isset($instance['allow_all']) ? (bool) $instance['allow_all'] : true;
|
250 |
+
?>
|
251 |
+
<p><label for="<?php echo $this->get_field_id('wdType'); ?>"><?php _e('Widget Type:', BP_MEDIA_TXT_DOMAIN); ?></label>
|
252 |
+
<select class="widefat" id="<?php echo $this->get_field_id('wdType'); ?>" name="<?php echo $this->get_field_name('wdType'); ?>">
|
253 |
+
<option value="recent" <?php if ($wdType == "recent") echo 'selected="selected"'; ?>><?php _e('Recent Media', BP_MEDIA_TXT_DOMAIN); ?></option>
|
254 |
+
<option value="popular" <?php if ($wdType == "popular") echo 'selected="selected"'; ?>><?php _e('Popular Media', BP_MEDIA_TXT_DOMAIN); ?></option>
|
255 |
+
</select>
|
256 |
+
</p>
|
257 |
+
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', BP_MEDIA_TXT_DOMAIN); ?></label>
|
258 |
+
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
259 |
+
|
260 |
+
<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:', BP_MEDIA_TXT_DOMAIN); ?></label>
|
261 |
+
<input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
|
262 |
+
|
263 |
+
<p>
|
264 |
+
<input role="checkbox" type="checkbox" name="<?php echo $this->get_field_name('allow_all'); ?>" id="<?php echo $this->get_field_id('allow_all'); ?>" <?php checked($allowAll); ?> /><label for="<?php echo $this->get_field_id('allow_all'); ?>"><?php _e('Show All', BP_MEDIA_TXT_DOMAIN); ?></label>
|
265 |
+
</p>
|
266 |
+
<p>
|
267 |
+
<input role="checkbox" type="checkbox" name="<?php echo $this->get_field_name('allow_image'); ?>" id="<?php echo $this->get_field_id('allow_image'); ?>" <?php checked($allowImage); ?> /><label for="<?php echo $this->get_field_id('allow_image'); ?>"><?php _e('Show Photos', BP_MEDIA_TXT_DOMAIN); ?></label>
|
268 |
+
</p>
|
269 |
+
<p>
|
270 |
+
<input role="checkbox" type="checkbox" name="<?php echo $this->get_field_name('allow_audio'); ?>" id="<?php echo $this->get_field_id('allow_audio'); ?>" <?php checked($allowAudio); ?> /> <label for="<?php echo $this->get_field_id('allow_audio'); ?>"><?php _e('Show Music', BP_MEDIA_TXT_DOMAIN); ?></label>
|
271 |
+
</p>
|
272 |
+
<p>
|
273 |
+
<input role="checkbox" type="checkbox" name="<?php echo $this->get_field_name('allow_video'); ?>" id="<?php echo $this->get_field_id('allow_video'); ?>" <?php checked($allowVideo); ?> />
|
274 |
+
<label for="<?php echo $this->get_field_id('allow_video'); ?>"><?php _e('Show Videos', BP_MEDIA_TXT_DOMAIN); ?></label>
|
275 |
+
</p>
|
276 |
+
|
277 |
+
<?php
|
278 |
+
}
|
279 |
+
|
280 |
+
}
|
281 |
+
?>
|
index.php
CHANGED
@@ -3,24 +3,44 @@
|
|
3 |
Plugin Name: BuddyPress Media
|
4 |
Plugin URI: http://rtcamp.com/buddypress-media/
|
5 |
Description: This plugin adds missing media rich features like photos, videos and audios uploading to BuddyPress which are essential if you are building social network, seriously!
|
6 |
-
Version: 2.4
|
7 |
Author: rtCamp
|
8 |
Text Domain: buddypress-media
|
9 |
Author URI: http://rtcamp.com
|
10 |
Text domain: buddypress-media
|
11 |
*/
|
12 |
|
13 |
-
|
14 |
-
*
|
|
|
|
|
|
|
15 |
*/
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
define( 'BP_MEDIA_PATH', plugin_dir_path( __FILE__ ) );
|
|
|
18 |
|
19 |
-
if ( ! defined( 'BP_MEDIA_URL' ) )
|
|
|
|
|
|
|
|
|
|
|
20 |
define( 'BP_MEDIA_URL', plugin_dir_url( __FILE__ ) );
|
|
|
21 |
|
22 |
-
|
23 |
-
*
|
|
|
|
|
|
|
|
|
24 |
*/
|
25 |
function buddypress_media_autoloader( $class_name ) {
|
26 |
$rtlibpath = array(
|
@@ -42,27 +62,17 @@ function buddypress_media_autoloader( $class_name ) {
|
|
42 |
}
|
43 |
}
|
44 |
|
45 |
-
|
46 |
* Register the autoloader function into spl_autoload
|
47 |
*/
|
48 |
spl_autoload_register( 'buddypress_media_autoloader' );
|
49 |
|
50 |
-
|
51 |
* Instantiate the BuddyPressMedia class.
|
52 |
*/
|
53 |
global $bp_media;
|
54 |
$bp_media = new BuddyPressMedia();
|
55 |
|
56 |
-
/*
|
57 |
-
* Activating the plugin!
|
58 |
-
*/
|
59 |
-
register_activation_hook( __FILE__, array( $bp_media, 'activate' ) );
|
60 |
-
|
61 |
-
/*
|
62 |
-
* And hooking it to BuddyPress
|
63 |
-
*/
|
64 |
-
add_action( 'bp_include', array($bp_media, 'init') );
|
65 |
-
|
66 |
/*
|
67 |
* Look Ma! Very few includes!
|
68 |
*/
|
3 |
Plugin Name: BuddyPress Media
|
4 |
Plugin URI: http://rtcamp.com/buddypress-media/
|
5 |
Description: This plugin adds missing media rich features like photos, videos and audios uploading to BuddyPress which are essential if you are building social network, seriously!
|
6 |
+
Version: 2.4.1
|
7 |
Author: rtCamp
|
8 |
Text Domain: buddypress-media
|
9 |
Author URI: http://rtcamp.com
|
10 |
Text domain: buddypress-media
|
11 |
*/
|
12 |
|
13 |
+
/**
|
14 |
+
* Main file, contains the plugin metadata and activation processes
|
15 |
+
*
|
16 |
+
* @package BuddyPressMedia
|
17 |
+
* @subpackage Main
|
18 |
*/
|
19 |
+
|
20 |
+
if ( ! defined( 'BP_MEDIA_PATH' ) ){
|
21 |
+
|
22 |
+
/**
|
23 |
+
* The server file system path to the plugin directory
|
24 |
+
*
|
25 |
+
*/
|
26 |
define( 'BP_MEDIA_PATH', plugin_dir_path( __FILE__ ) );
|
27 |
+
}
|
28 |
|
29 |
+
if ( ! defined( 'BP_MEDIA_URL' ) ){
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The url to the plugin directory
|
33 |
+
*
|
34 |
+
*/
|
35 |
define( 'BP_MEDIA_URL', plugin_dir_url( __FILE__ ) );
|
36 |
+
}
|
37 |
|
38 |
+
/**
|
39 |
+
* Auto Loader Function
|
40 |
+
*
|
41 |
+
* Autoloads classes on instantiation. Used by spl_autoload_register.
|
42 |
+
*
|
43 |
+
* @param string $class_name The name of the class to autoload
|
44 |
*/
|
45 |
function buddypress_media_autoloader( $class_name ) {
|
46 |
$rtlibpath = array(
|
62 |
}
|
63 |
}
|
64 |
|
65 |
+
/**
|
66 |
* Register the autoloader function into spl_autoload
|
67 |
*/
|
68 |
spl_autoload_register( 'buddypress_media_autoloader' );
|
69 |
|
70 |
+
/**
|
71 |
* Instantiate the BuddyPressMedia class.
|
72 |
*/
|
73 |
global $bp_media;
|
74 |
$bp_media = new BuddyPressMedia();
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
/*
|
77 |
* Look Ma! Very few includes!
|
78 |
*/
|
lang/buddypress-media.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Buddypress Media\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
"Last-Translator: Saurabh Shukla <saurabh.shukla@rtcamp.com>\n"
|
8 |
"Language-Team: rtCamp <info@rtcamp.com>\n"
|
9 |
"Language: \n"
|
@@ -11,11 +11,10 @@ msgstr ""
|
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
|
14 |
-
"X-Poedit-Basepath:
|
15 |
"X-Poedit-SearchPath-0: .\n"
|
16 |
|
17 |
#: app/helper/BPMediaWidget.php:22
|
18 |
-
#, fuzzy
|
19 |
msgid "Argument missing. id is required."
|
20 |
msgstr ""
|
21 |
|
@@ -35,101 +34,268 @@ msgstr ""
|
|
35 |
msgid "Video"
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: app/helper/BPMediaSettings.php:
|
39 |
msgid "Check to enable video upload functionality"
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: app/helper/BPMediaSettings.php:
|
43 |
msgid "Audio"
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: app/helper/BPMediaSettings.php:
|
47 |
msgid "Check to enable audio upload functionality"
|
48 |
msgstr ""
|
49 |
|
50 |
-
#: app/helper/BPMediaSettings.php:
|
51 |
msgid "Images"
|
52 |
msgstr ""
|
53 |
|
54 |
-
#: app/helper/BPMediaSettings.php:
|
55 |
msgid "Check to enable images upload functionality"
|
56 |
msgstr ""
|
57 |
|
58 |
-
#: app/helper/BPMediaSettings.php:
|
59 |
msgid "Download"
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: app/helper/BPMediaSettings.php:
|
63 |
msgid "Check to enable download functionality"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: app/helper/BPMediaSettings.php:
|
67 |
-
#: app/helper/BPMediaSettings.php:
|
68 |
msgid "Spread the Word"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: app/helper/BPMediaSettings.php:
|
72 |
msgid "Yes, I support BuddyPress Media"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: app/helper/BPMediaSettings.php:
|
76 |
msgid "No, I don't want to support BuddyPress Media"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: app/helper/BPMediaSettings.php:
|
80 |
msgid "BuddyPress Media Other Options"
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: app/helper/BPMediaSettings.php:
|
84 |
msgid "Re-Count Media Entries"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: app/helper/BPMediaSettings.php:
|
88 |
msgid "It will re-count all media entries of all users and correct any discrepancies."
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: app/helper/BPMediaSettings.php:
|
92 |
msgid "BuddyPress Media Addons for Audio/Video Conversion"
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: app/helper/BPMediaSettings.php:
|
96 |
msgid "Submit a request form"
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: app/helper/BPMediaSettings.php:
|
100 |
msgid "Request Type"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: app/helper/BPMediaSettings.php:
|
104 |
msgid "Recounting of media files done successfully"
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: app/helper/BPMediaSettings.php:
|
108 |
msgid "Recounting Failed"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: app/helper/BPMediaSettings.php:
|
112 |
msgid "Please provide \"option\" value ( required ) in the argument. Pass argument to add_settings_field in the following format array( 'option' => 'option_name' ) "
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: app/helper/BPMediaSettings.php:
|
116 |
-
#: app/helper/BPMediaSettings.php:
|
117 |
msgid "Please provide \"option\" value ( required ) in the argument. Pass argument to add_settings_field in the following format array( 'option' => 'option_name' )"
|
118 |
msgstr ""
|
119 |
|
120 |
-
#: app/helper/BPMediaSettings.php:
|
121 |
msgid "Need to specify atleast to radios else use a checkbox instead"
|
122 |
msgstr ""
|
123 |
|
124 |
-
#: app/helper/BPMediaSettings.php:
|
125 |
msgid "Please provide some values to populate the dropdown. Format : array( 'value' => 'option' )"
|
126 |
msgstr ""
|
127 |
|
128 |
-
#: app/helper/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
msgid "Buy Now"
|
130 |
msgstr ""
|
131 |
|
132 |
-
#: app/helper/BPMediaAddon.php:
|
133 |
msgid "Live Demo"
|
134 |
msgstr ""
|
135 |
|
@@ -140,221 +306,238 @@ msgstr ""
|
|
140 |
|
141 |
#: app/helper/BPMediaUpgrade.php:103
|
142 |
#: app/helper/BPMediaUpgrade.php:156
|
143 |
-
#: app/main/group/BPMediaGroupAction.php:
|
144 |
#, php-format
|
145 |
msgid "%1$s added a %2$s"
|
146 |
msgstr ""
|
147 |
|
148 |
-
#: app/admin/BPMediaAdmin.php:
|
149 |
msgid "Buddypress Media Component"
|
150 |
msgstr ""
|
151 |
|
152 |
-
#: app/admin/BPMediaAdmin.php:
|
153 |
msgid "BuddyPress Media"
|
154 |
msgstr ""
|
155 |
|
156 |
-
#: app/admin/BPMediaAdmin.php:
|
157 |
-
#: app/admin/BPMediaAdmin.php:
|
158 |
msgid "Buddypress Media Settings"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: app/admin/BPMediaAdmin.php:
|
162 |
-
#: app/admin/BPMediaAdmin.php:
|
163 |
-
#: app/main/BuddyPressMedia.php:
|
164 |
msgid "Settings"
|
165 |
msgstr ""
|
166 |
|
167 |
-
#: app/admin/BPMediaAdmin.php:
|
168 |
-
#: app/admin/BPMediaAdmin.php:
|
169 |
msgid "Buddypress Media Addons"
|
170 |
msgstr ""
|
171 |
|
172 |
-
#: app/admin/BPMediaAdmin.php:
|
173 |
-
#: app/admin/BPMediaAdmin.php:
|
174 |
msgid "Addons"
|
175 |
msgstr ""
|
176 |
|
177 |
-
#: app/admin/BPMediaAdmin.php:
|
178 |
-
#: app/admin/BPMediaAdmin.php:
|
179 |
msgid "Buddypress Media Support"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: app/admin/BPMediaAdmin.php:
|
183 |
msgid "Support "
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: app/admin/BPMediaAdmin.php:
|
187 |
-
#: app/main/BuddyPressMedia.php:
|
188 |
-
#: app/main/BuddyPressMedia.php:
|
189 |
msgid "Media"
|
190 |
msgstr ""
|
191 |
|
192 |
-
#: app/admin/BPMediaAdmin.php:
|
193 |
-
#: app/admin/BPMediaAdmin.php:
|
194 |
msgid "Buddypress Media"
|
195 |
msgstr ""
|
196 |
|
197 |
-
#: app/admin/BPMediaAdmin.php:
|
198 |
msgid "Support"
|
199 |
msgstr ""
|
200 |
|
201 |
-
#: app/admin/BPMediaAdmin.php:
|
202 |
msgid "Empowering The Web With WordPress"
|
203 |
msgstr ""
|
204 |
|
205 |
-
#: app/admin/BPMediaAdmin.php:
|
206 |
msgid "rtCamp"
|
207 |
msgstr ""
|
208 |
|
209 |
-
#: app/admin/BPMediaAdmin.php:
|
210 |
msgid "Become a fan on Facebook"
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: app/admin/BPMediaAdmin.php:
|
214 |
msgid "Facebook"
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: app/admin/BPMediaAdmin.php:
|
218 |
msgid "Follow us on Twitter"
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: app/admin/BPMediaAdmin.php:
|
222 |
msgid "Twitter"
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: app/admin/BPMediaAdmin.php:
|
226 |
msgid "Subscribe to our feeds"
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: app/admin/BPMediaAdmin.php:
|
230 |
msgid "RSS Feed"
|
231 |
msgstr ""
|
232 |
|
233 |
-
#: app/admin/BPMediaAdmin.php:
|
234 |
-
|
235 |
-
msgid "<a href=\"%s\">Read FAQ</a>"
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: app/admin/BPMediaAdmin.php:
|
239 |
-
|
240 |
-
msgid "<a href=\"%s\">Free Support Forum</a>"
|
241 |
msgstr ""
|
242 |
|
243 |
-
#: app/admin/BPMediaAdmin.php:
|
244 |
-
|
245 |
-
msgid "<a href=\"%s\">Github Issue Tracker</a>"
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: app/admin/BPMediaAdmin.php:
|
249 |
-
|
250 |
-
|
|
|
|
|
|
|
251 |
msgstr ""
|
252 |
|
253 |
-
#: app/admin/BPMediaAdmin.php:
|
254 |
msgid "Need Help?"
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: app/admin/BPMediaAdmin.php:
|
258 |
msgid "Help the development keep going."
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: app/admin/BPMediaAdmin.php:
|
262 |
msgid "Help us release more amazing features faster. Consider making a donation to our consistent efforts."
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: app/admin/BPMediaAdmin.php:
|
266 |
msgid "Donate"
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: app/admin/BPMediaAdmin.php:
|
270 |
msgid "BuddyPress Media Kaltura"
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: app/admin/BPMediaAdmin.php:
|
274 |
msgid "BPM-Kaltura"
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: app/admin/BPMediaAdmin.php:
|
278 |
msgid "Add support for Kaltura.com/Kaltura-CE based video conversion support"
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: app/admin/BPMediaAdmin.php:
|
282 |
msgid "BuddyPress Media FFMPEG"
|
283 |
msgstr ""
|
284 |
|
285 |
-
#: app/admin/BPMediaAdmin.php:
|
286 |
msgid "BPM-FFMPEG"
|
287 |
msgstr ""
|
288 |
|
289 |
-
#: app/admin/BPMediaAdmin.php:
|
290 |
msgid "Add FFMEG-based audio/video conversion support"
|
291 |
msgstr ""
|
292 |
|
293 |
-
#: app/admin/BPMediaAdmin.php:
|
294 |
msgid "Are you a developer?"
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: app/admin/BPMediaAdmin.php:
|
298 |
#, php-format
|
299 |
msgid "If you are developing a BuddyPress Media addon we would like to include it in above list. We can also help you sell them. <a href=\"%s\">More info!</a>"
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: app/admin/BPMediaAdmin.php:
|
303 |
msgid "Premium Addons"
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: app/admin/BPMediaAdmin.php:
|
307 |
msgid "Latest News"
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: app/main/BuddyPressMedia.php:
|
311 |
msgid "Photos"
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: app/main/BuddyPressMedia.php:
|
315 |
msgid "Photo"
|
316 |
msgstr ""
|
317 |
|
318 |
-
#: app/main/BuddyPressMedia.php:
|
319 |
msgid "Videos"
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: app/main/BuddyPressMedia.php:
|
323 |
-
#: app/main/BuddyPressMedia.php:
|
324 |
msgid "Music"
|
325 |
msgstr ""
|
326 |
|
327 |
-
#: app/main/BuddyPressMedia.php:
|
328 |
msgid "Albums"
|
329 |
msgstr ""
|
330 |
|
331 |
-
#: app/main/BuddyPressMedia.php:
|
332 |
msgid "Album"
|
333 |
msgstr ""
|
334 |
|
335 |
-
#: app/main/BuddyPressMedia.php:
|
336 |
msgid "Upload"
|
337 |
msgstr ""
|
338 |
|
339 |
-
#: app/main/BuddyPressMedia.php:
|
340 |
#, php-format
|
341 |
msgid "The BuddyPress version installed is an older version and is not supported, please update BuddyPress to use BuddyPress Media Plugin.<a class=\"alignright\" href=\"%1$s\">X</a>"
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: app/main/BuddyPressMedia.php:
|
345 |
#, php-format
|
346 |
msgid "You have not installed BuddyPress. Please install latest version of BuddyPress to use BuddyPress Media plugin.<a class=\"alignright\" href=\"%1$s\">X</a>"
|
347 |
msgstr ""
|
348 |
|
349 |
-
#: app/main/profile/BPMediaTemplate.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
msgid "Drop files here"
|
351 |
msgstr ""
|
352 |
|
353 |
-
#: app/main/profile/BPMediaTemplate.php:
|
354 |
msgid " or "
|
355 |
msgstr ""
|
356 |
|
357 |
-
#: app/main/profile/BPMediaTemplate.php:
|
358 |
msgid "Select Files"
|
359 |
msgstr ""
|
360 |
|
@@ -450,28 +633,57 @@ msgstr ""
|
|
450 |
msgid "Sorry, the requested album does not exist."
|
451 |
msgstr ""
|
452 |
|
453 |
-
#: app/main/group/
|
|
|
|
|
|
|
|
|
454 |
msgid "Media Settings"
|
455 |
msgstr ""
|
456 |
|
457 |
-
#: app/main/group/
|
458 |
-
#: app/main/group/
|
459 |
-
|
460 |
-
msgid "Sorry, the requested media does not belong to the group"
|
461 |
msgstr ""
|
462 |
|
463 |
-
#: app/main/group/
|
464 |
-
|
|
|
465 |
msgstr ""
|
466 |
|
467 |
-
#: app/main/group/BPMediaGroupsExtension.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
msgid "There was an error saving, please try again"
|
469 |
msgstr ""
|
470 |
|
471 |
-
#: app/main/group/BPMediaGroupsExtension.php:
|
472 |
msgid "Settings saved successfully"
|
473 |
msgstr ""
|
474 |
|
|
|
|
|
|
|
|
|
|
|
|
|
475 |
#: app/main/widgets/BPMediaPopularMedia.php:15
|
476 |
msgid "The most popular media on your site"
|
477 |
msgstr ""
|
@@ -494,10 +706,12 @@ msgid "No popular media found"
|
|
494 |
msgstr ""
|
495 |
|
496 |
#: app/main/widgets/BPMediaPopularMedia.php:84
|
|
|
497 |
msgid "Title:"
|
498 |
msgstr ""
|
499 |
|
500 |
#: app/main/widgets/BPMediaPopularMedia.php:87
|
|
|
501 |
msgid "Number of posts to show:"
|
502 |
msgstr ""
|
503 |
|
@@ -515,19 +729,19 @@ msgid "All"
|
|
515 |
msgstr ""
|
516 |
|
517 |
#: app/main/widgets/BPMediaRecentMedia.php:64
|
518 |
-
msgid "No
|
519 |
msgstr ""
|
520 |
|
521 |
#: app/main/widgets/BPMediaRecentMedia.php:100
|
522 |
-
msgid "No
|
523 |
msgstr ""
|
524 |
|
525 |
#: app/main/widgets/BPMediaRecentMedia.php:135
|
526 |
-
msgid "No
|
527 |
msgstr ""
|
528 |
|
529 |
#: app/main/widgets/BPMediaRecentMedia.php:170
|
530 |
-
msgid "No
|
531 |
msgstr ""
|
532 |
|
533 |
#: app/main/includes/BPMediaHostWordpress.php:46
|
@@ -539,7 +753,7 @@ msgid "Error Uploading File"
|
|
539 |
msgstr ""
|
540 |
|
541 |
#: app/main/includes/BPMediaHostWordpress.php:112
|
542 |
-
msgid "MP4 file you have uploaded is
|
543 |
msgstr ""
|
544 |
|
545 |
#: app/main/includes/BPMediaHostWordpress.php:119
|
@@ -572,301 +786,224 @@ msgstr ""
|
|
572 |
msgid "Error creating attachment for the media file, please try again"
|
573 |
msgstr ""
|
574 |
|
575 |
-
#: app/main/includes/BPMediaHostWordpress.php:
|
576 |
#, php-format
|
577 |
msgid "%s uploaded a media."
|
578 |
msgstr ""
|
579 |
|
580 |
-
#: app/main/includes/BPMediaHostWordpress.php:
|
|
|
|
|
|
|
|
|
581 |
#, php-format
|
582 |
msgid "Comment <span>%s</span>"
|
583 |
msgstr ""
|
584 |
|
585 |
-
#: app/main/includes/BPMediaHostWordpress.php:
|
586 |
msgid "Favorite"
|
587 |
msgstr ""
|
588 |
|
589 |
-
#: app/main/includes/BPMediaHostWordpress.php:
|
590 |
msgid "Remove Favorite"
|
591 |
msgstr ""
|
592 |
|
593 |
-
#: app/main/includes/BPMediaHostWordpress.php:
|
594 |
msgid "Post"
|
595 |
msgstr ""
|
596 |
|
597 |
-
#: app/main/includes/BPMediaHostWordpress.php:
|
598 |
msgid "or press esc to cancel."
|
599 |
msgstr ""
|
600 |
|
601 |
-
#: app/main/includes/
|
602 |
-
msgid "
|
603 |
-
msgstr ""
|
604 |
-
|
605 |
-
#: app/main/includes/bp-media-actions.php:226
|
606 |
-
msgid "Edit"
|
607 |
-
msgstr ""
|
608 |
-
|
609 |
-
#: app/main/includes/bp-media-actions.php:238
|
610 |
-
#: app/main/includes/bp-media-actions.php:243
|
611 |
-
msgid "Featured Media"
|
612 |
-
msgstr ""
|
613 |
-
|
614 |
-
#: app/main/includes/bp-media-actions.php:238
|
615 |
-
msgid "Featured"
|
616 |
-
msgstr ""
|
617 |
-
|
618 |
-
#: app/main/includes/bp-media-actions.php:243
|
619 |
-
msgid "Remove Featured"
|
620 |
-
msgstr ""
|
621 |
-
|
622 |
-
#: app/main/includes/bp-media-actions.php:523
|
623 |
-
#, php-format
|
624 |
-
msgid "%1$s created an album %2$s"
|
625 |
-
msgstr ""
|
626 |
-
|
627 |
-
#: app/main/includes/bp-media-template-functions.php:26
|
628 |
-
msgid "Media Title"
|
629 |
-
msgstr ""
|
630 |
-
|
631 |
-
#: app/main/includes/bp-media-template-functions.php:27
|
632 |
-
msgid "Media Description"
|
633 |
-
msgstr ""
|
634 |
-
|
635 |
-
#: app/main/includes/bp-media-template-functions.php:28
|
636 |
-
msgid "Select Media File"
|
637 |
msgstr ""
|
638 |
|
639 |
-
#: app/main/includes/
|
640 |
msgid "It will migrate your BuddyPress Media's earlier database to new database."
|
641 |
msgstr ""
|
642 |
|
643 |
-
#: app/main/includes/
|
644 |
msgid "Bug Report"
|
645 |
msgstr ""
|
646 |
|
647 |
-
#: app/main/includes/
|
648 |
msgid "New Feature Request"
|
649 |
msgstr ""
|
650 |
|
651 |
-
#: app/main/includes/
|
652 |
msgid "Premium Support Request"
|
653 |
msgstr ""
|
654 |
|
655 |
-
#: app/main/includes/
|
656 |
msgid "Thank you, Your bug report sent successfully."
|
657 |
msgstr ""
|
658 |
|
659 |
-
#: app/main/includes/
|
660 |
msgid "Thank you, Your new feature request sent successfully."
|
661 |
msgstr ""
|
662 |
|
663 |
-
#: app/main/includes/
|
664 |
msgid "Thank you, Your premium support request sent successfully, We will contact you soon."
|
665 |
msgstr ""
|
666 |
|
667 |
-
#: app/main/includes/
|
668 |
-
#: app/main/includes/
|
669 |
msgid "BuddyPress Media Support"
|
670 |
msgstr ""
|
671 |
|
672 |
-
#: app/main/includes/
|
673 |
msgid "Spread the word"
|
674 |
msgstr ""
|
675 |
|
676 |
-
#: app/main/includes/
|
677 |
msgid "BuddyPress Media Other options"
|
678 |
msgstr ""
|
679 |
|
680 |
-
#: app/main/includes/
|
681 |
msgid "Need Help/Support?"
|
682 |
msgstr ""
|
683 |
|
684 |
-
#: app/main/includes/
|
685 |
-
msgid "Read FAQ"
|
686 |
-
msgstr ""
|
687 |
-
|
688 |
-
#: app/main/includes/bp-media-admin.php:605
|
689 |
-
msgid "Free Support Forum"
|
690 |
-
msgstr ""
|
691 |
-
|
692 |
-
#: app/main/includes/bp-media-admin.php:606
|
693 |
-
msgid "Github Issue Tracker"
|
694 |
-
msgstr ""
|
695 |
-
|
696 |
-
#: app/main/includes/bp-media-admin.php:610
|
697 |
msgid "Hire Us!"
|
698 |
msgstr ""
|
699 |
|
700 |
-
#: app/main/includes/
|
701 |
msgid "We are available for customisation and premium support. Get on touch with us. :-)"
|
702 |
msgstr ""
|
703 |
|
704 |
-
#: app/main/includes/
|
705 |
msgid "Request type:"
|
706 |
msgstr ""
|
707 |
|
708 |
-
#: app/main/includes/
|
709 |
msgid "-- Choose Type --"
|
710 |
msgstr ""
|
711 |
|
712 |
-
#: app/main/includes/
|
713 |
msgid "Premium Support"
|
714 |
msgstr ""
|
715 |
|
716 |
-
#: app/main/includes/
|
717 |
msgid "Suggest a New Feature"
|
718 |
msgstr ""
|
719 |
|
720 |
-
#: app/main/includes/
|
721 |
-
|
722 |
-
msgid "
|
723 |
-
|
724 |
-
|
725 |
-
#: app/main/includes/bp-media-admin.php:661
|
726 |
-
msgid "Submit a New Feature Request"
|
727 |
-
msgstr ""
|
728 |
-
|
729 |
-
#: app/main/includes/bp-media-admin.php:664
|
730 |
-
msgid "Submit a Premium Support Request"
|
731 |
-
msgstr ""
|
732 |
-
|
733 |
-
#: app/main/includes/bp-media-admin.php:672
|
734 |
-
msgid "Your Name:"
|
735 |
-
msgstr ""
|
736 |
-
|
737 |
-
#: app/main/includes/bp-media-admin.php:675
|
738 |
-
msgid "Your Email-Id:"
|
739 |
-
msgstr ""
|
740 |
-
|
741 |
-
#: app/main/includes/bp-media-admin.php:678
|
742 |
-
msgid "Your Site Url:"
|
743 |
-
msgstr ""
|
744 |
-
|
745 |
-
#: app/main/includes/bp-media-admin.php:681
|
746 |
-
msgid "Your Phone:"
|
747 |
-
msgstr ""
|
748 |
-
|
749 |
-
#: app/main/includes/bp-media-admin.php:684
|
750 |
-
msgid "Subject:"
|
751 |
-
msgstr ""
|
752 |
-
|
753 |
-
#: app/main/includes/bp-media-admin.php:687
|
754 |
-
msgid "Details:"
|
755 |
-
msgstr ""
|
756 |
-
|
757 |
-
#: app/main/includes/bp-media-admin.php:706
|
758 |
-
msgid "Attachment:"
|
759 |
-
msgstr ""
|
760 |
-
|
761 |
-
#: app/main/includes/bp-media-admin.php:708
|
762 |
-
msgid "Add more attachment"
|
763 |
-
msgstr ""
|
764 |
-
|
765 |
-
#: app/main/includes/bp-media-admin.php:731
|
766 |
-
msgid "Your WP Admin Login:"
|
767 |
-
msgstr ""
|
768 |
-
|
769 |
-
#: app/main/includes/bp-media-admin.php:734
|
770 |
-
msgid "Your WP Admin password:"
|
771 |
-
msgstr ""
|
772 |
-
|
773 |
-
#: app/main/includes/bp-media-admin.php:737
|
774 |
-
msgid "Your SSH / FTP host:"
|
775 |
-
msgstr ""
|
776 |
-
|
777 |
-
#: app/main/includes/bp-media-admin.php:740
|
778 |
-
msgid "Your SSH / FTP login:"
|
779 |
msgstr ""
|
780 |
|
781 |
-
#: app/main/includes/
|
782 |
-
msgid "
|
783 |
msgstr ""
|
784 |
|
785 |
-
#: app/main/includes/
|
786 |
-
msgid "
|
787 |
msgstr ""
|
788 |
|
789 |
-
#: app/main/includes/
|
790 |
-
|
791 |
-
msgid ""
|
792 |
-
" Please use our <a href=\"%s\">free support forum</a>.<br/><span class=\"bpm-aligncenter\">OR</span><br/>\n"
|
793 |
-
"\t\t<a href=\"%s\">Hire us!</a> To get professional customisation/setup service."
|
794 |
msgstr ""
|
795 |
|
796 |
-
#: app/main/includes/BPMediaComponent.php:
|
797 |
msgid "Search Media..."
|
798 |
msgstr ""
|
799 |
|
800 |
-
#: app/main/includes/BPMediaComponent.php:
|
801 |
msgid "Create"
|
802 |
msgstr ""
|
803 |
|
804 |
-
#: app/main/includes/BPMediaComponent.php:
|
805 |
-
msgid "Create Album"
|
806 |
-
msgstr ""
|
807 |
-
|
808 |
-
#: app/main/includes/BPMediaComponent.php:322
|
809 |
msgid "Edit Album"
|
810 |
msgstr ""
|
811 |
|
812 |
-
#: app/main/includes/BPMediaComponent.php:
|
813 |
msgid "New Album"
|
814 |
msgstr ""
|
815 |
|
816 |
-
#: app/main/includes/BPMediaComponent.php:
|
817 |
msgid "All Albums"
|
818 |
msgstr ""
|
819 |
|
820 |
-
#: app/main/includes/BPMediaComponent.php:
|
821 |
msgid "View Album"
|
822 |
msgstr ""
|
823 |
|
824 |
-
#: app/main/includes/BPMediaComponent.php:
|
825 |
msgid "Search Albums"
|
826 |
msgstr ""
|
827 |
|
828 |
-
#: app/main/includes/BPMediaComponent.php:
|
829 |
msgid "No album found"
|
830 |
msgstr ""
|
831 |
|
832 |
-
#: app/main/includes/BPMediaComponent.php:
|
833 |
msgid "No album found in Trash"
|
834 |
msgstr ""
|
835 |
|
836 |
-
#: app/main/includes/BPMediaComponent.php:
|
837 |
msgid "Add New Media"
|
838 |
msgstr ""
|
839 |
|
840 |
-
#: app/main/includes/
|
841 |
-
|
842 |
-
msgid "%1$s added new media in album %2$s"
|
843 |
msgstr ""
|
844 |
|
845 |
-
#: app/main/includes/
|
846 |
-
|
|
|
847 |
msgstr ""
|
848 |
|
849 |
-
#: app/main/includes/
|
850 |
msgid "Users"
|
851 |
msgstr ""
|
852 |
|
853 |
-
#: app/main/includes/
|
854 |
msgid "Total Photos"
|
855 |
msgstr ""
|
856 |
|
857 |
-
#: app/main/includes/
|
858 |
msgid "Total Videos"
|
859 |
msgstr ""
|
860 |
|
861 |
-
#: app/main/includes/
|
862 |
msgid "Total Audio"
|
863 |
msgstr ""
|
864 |
|
865 |
-
#: app/main/includes/
|
866 |
msgid "Total Albums"
|
867 |
msgstr ""
|
868 |
|
869 |
-
#: app/main/includes/
|
870 |
msgid "Groups"
|
871 |
msgstr ""
|
872 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Buddypress Media\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-01-14 17:03+0530\n"
|
6 |
+
"PO-Revision-Date: 2013-01-14 17:03+0530\n"
|
7 |
"Last-Translator: Saurabh Shukla <saurabh.shukla@rtcamp.com>\n"
|
8 |
"Language-Team: rtCamp <info@rtcamp.com>\n"
|
9 |
"Language: \n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
|
14 |
+
"X-Poedit-Basepath: ../.\n"
|
15 |
"X-Poedit-SearchPath-0: .\n"
|
16 |
|
17 |
#: app/helper/BPMediaWidget.php:22
|
|
|
18 |
msgid "Argument missing. id is required."
|
19 |
msgstr ""
|
20 |
|
34 |
msgid "Video"
|
35 |
msgstr ""
|
36 |
|
37 |
+
#: app/helper/BPMediaSettings.php:26
|
38 |
msgid "Check to enable video upload functionality"
|
39 |
msgstr ""
|
40 |
|
41 |
+
#: app/helper/BPMediaSettings.php:28
|
42 |
msgid "Audio"
|
43 |
msgstr ""
|
44 |
|
45 |
+
#: app/helper/BPMediaSettings.php:30
|
46 |
msgid "Check to enable audio upload functionality"
|
47 |
msgstr ""
|
48 |
|
49 |
+
#: app/helper/BPMediaSettings.php:32
|
50 |
msgid "Images"
|
51 |
msgstr ""
|
52 |
|
53 |
+
#: app/helper/BPMediaSettings.php:34
|
54 |
msgid "Check to enable images upload functionality"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: app/helper/BPMediaSettings.php:36
|
58 |
msgid "Download"
|
59 |
msgstr ""
|
60 |
|
61 |
+
#: app/helper/BPMediaSettings.php:38
|
62 |
msgid "Check to enable download functionality"
|
63 |
msgstr ""
|
64 |
|
65 |
+
#: app/helper/BPMediaSettings.php:40
|
66 |
+
#: app/helper/BPMediaSettings.php:41
|
67 |
msgid "Spread the Word"
|
68 |
msgstr ""
|
69 |
|
70 |
+
#: app/helper/BPMediaSettings.php:44
|
71 |
msgid "Yes, I support BuddyPress Media"
|
72 |
msgstr ""
|
73 |
|
74 |
+
#: app/helper/BPMediaSettings.php:45
|
75 |
msgid "No, I don't want to support BuddyPress Media"
|
76 |
msgstr ""
|
77 |
|
78 |
+
#: app/helper/BPMediaSettings.php:48
|
79 |
msgid "BuddyPress Media Other Options"
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: app/helper/BPMediaSettings.php:49
|
83 |
msgid "Re-Count Media Entries"
|
84 |
msgstr ""
|
85 |
|
86 |
+
#: app/helper/BPMediaSettings.php:52
|
87 |
msgid "It will re-count all media entries of all users and correct any discrepancies."
|
88 |
msgstr ""
|
89 |
|
90 |
+
#: app/helper/BPMediaSettings.php:55
|
91 |
msgid "BuddyPress Media Addons for Audio/Video Conversion"
|
92 |
msgstr ""
|
93 |
|
94 |
+
#: app/helper/BPMediaSettings.php:56
|
95 |
msgid "Submit a request form"
|
96 |
msgstr ""
|
97 |
|
98 |
+
#: app/helper/BPMediaSettings.php:57
|
99 |
msgid "Request Type"
|
100 |
msgstr ""
|
101 |
|
102 |
+
#: app/helper/BPMediaSettings.php:73
|
103 |
msgid "Recounting of media files done successfully"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: app/helper/BPMediaSettings.php:75
|
107 |
msgid "Recounting Failed"
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: app/helper/BPMediaSettings.php:96
|
111 |
msgid "Please provide \"option\" value ( required ) in the argument. Pass argument to add_settings_field in the following format array( 'option' => 'option_name' ) "
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: app/helper/BPMediaSettings.php:126
|
115 |
+
#: app/helper/BPMediaSettings.php:156
|
116 |
msgid "Please provide \"option\" value ( required ) in the argument. Pass argument to add_settings_field in the following format array( 'option' => 'option_name' )"
|
117 |
msgstr ""
|
118 |
|
119 |
+
#: app/helper/BPMediaSettings.php:128
|
120 |
msgid "Need to specify atleast to radios else use a checkbox instead"
|
121 |
msgstr ""
|
122 |
|
123 |
+
#: app/helper/BPMediaSettings.php:158
|
124 |
msgid "Please provide some values to populate the dropdown. Format : array( 'value' => 'option' )"
|
125 |
msgstr ""
|
126 |
|
127 |
+
#: app/helper/BPMediaSupport.php:23
|
128 |
+
msgid "Submit a Bug Report"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: app/helper/BPMediaSupport.php:26
|
132 |
+
msgid "Submit a New Feature Request"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: app/helper/BPMediaSupport.php:29
|
136 |
+
msgid "Submit a Premium Support Request"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: app/helper/BPMediaSupport.php:37
|
140 |
+
#: app/helper/BPMediaSupport.php:113
|
141 |
+
msgid "Name"
|
142 |
+
msgstr ""
|
143 |
+
|
144 |
+
#: app/helper/BPMediaSupport.php:40
|
145 |
+
#: app/helper/BPMediaSupport.php:116
|
146 |
+
msgid "Email"
|
147 |
+
msgstr ""
|
148 |
+
|
149 |
+
#: app/helper/BPMediaSupport.php:43
|
150 |
+
#: app/helper/BPMediaSupport.php:119
|
151 |
+
msgid "Website"
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: app/helper/BPMediaSupport.php:46
|
155 |
+
#: app/helper/BPMediaSupport.php:122
|
156 |
+
msgid "Phone"
|
157 |
+
msgstr ""
|
158 |
+
|
159 |
+
#: app/helper/BPMediaSupport.php:49
|
160 |
+
#: app/helper/BPMediaSupport.php:125
|
161 |
+
msgid "Subject"
|
162 |
+
msgstr ""
|
163 |
+
|
164 |
+
#: app/helper/BPMediaSupport.php:52
|
165 |
+
#: app/helper/BPMediaSupport.php:128
|
166 |
+
msgid "Details"
|
167 |
+
msgstr ""
|
168 |
+
|
169 |
+
#: app/helper/BPMediaSupport.php:68
|
170 |
+
msgid "Your WP Admin Login:"
|
171 |
+
msgstr ""
|
172 |
+
|
173 |
+
#: app/helper/BPMediaSupport.php:71
|
174 |
+
msgid "Your WP Admin password:"
|
175 |
+
msgstr ""
|
176 |
+
|
177 |
+
#: app/helper/BPMediaSupport.php:74
|
178 |
+
msgid "Your SSH / FTP host:"
|
179 |
+
msgstr ""
|
180 |
+
|
181 |
+
#: app/helper/BPMediaSupport.php:77
|
182 |
+
msgid "Your SSH / FTP login:"
|
183 |
+
msgstr ""
|
184 |
+
|
185 |
+
#: app/helper/BPMediaSupport.php:80
|
186 |
+
msgid "Your SSH / FTP password:"
|
187 |
+
msgstr ""
|
188 |
+
|
189 |
+
#: app/helper/BPMediaSupport.php:98
|
190 |
+
msgid "BuddyPress Media Premium Support Request from"
|
191 |
+
msgstr ""
|
192 |
+
|
193 |
+
#: app/helper/BPMediaSupport.php:100
|
194 |
+
msgid "BuddyPress Media New Feature Request from"
|
195 |
+
msgstr ""
|
196 |
+
|
197 |
+
#: app/helper/BPMediaSupport.php:102
|
198 |
+
msgid "BuddyPress Media Bug Report from"
|
199 |
+
msgstr ""
|
200 |
+
|
201 |
+
#: app/helper/BPMediaSupport.php:104
|
202 |
+
msgid "BuddyPress Media Contact from"
|
203 |
+
msgstr ""
|
204 |
+
|
205 |
+
#: app/helper/BPMediaSupport.php:131
|
206 |
+
msgid "Request ID"
|
207 |
+
msgstr ""
|
208 |
+
|
209 |
+
#: app/helper/BPMediaSupport.php:134
|
210 |
+
msgid "Server Address"
|
211 |
+
msgstr ""
|
212 |
+
|
213 |
+
#: app/helper/BPMediaSupport.php:137
|
214 |
+
msgid "IP Address"
|
215 |
+
msgstr ""
|
216 |
+
|
217 |
+
#: app/helper/BPMediaSupport.php:140
|
218 |
+
msgid "Server Type"
|
219 |
+
msgstr ""
|
220 |
+
|
221 |
+
#: app/helper/BPMediaSupport.php:143
|
222 |
+
msgid "User Agent"
|
223 |
+
msgstr ""
|
224 |
+
|
225 |
+
#: app/helper/BPMediaSupport.php:147
|
226 |
+
msgid "WordPress Admin Username"
|
227 |
+
msgstr ""
|
228 |
+
|
229 |
+
#: app/helper/BPMediaSupport.php:150
|
230 |
+
msgid "WordPress Admin Password"
|
231 |
+
msgstr ""
|
232 |
+
|
233 |
+
#: app/helper/BPMediaSupport.php:153
|
234 |
+
msgid "SSH FTP Host"
|
235 |
+
msgstr ""
|
236 |
+
|
237 |
+
#: app/helper/BPMediaSupport.php:156
|
238 |
+
msgid "SSH FTP Username"
|
239 |
+
msgstr ""
|
240 |
+
|
241 |
+
#: app/helper/BPMediaSupport.php:159
|
242 |
+
msgid "SSH FTP Password"
|
243 |
+
msgstr ""
|
244 |
+
|
245 |
+
#: app/helper/BPMediaSupport.php:170
|
246 |
+
msgid "Thank you for your Feedback/Suggestion."
|
247 |
+
msgstr ""
|
248 |
+
|
249 |
+
#: app/helper/BPMediaSupport.php:172
|
250 |
+
msgid "Thank you for posting your support request."
|
251 |
+
msgstr ""
|
252 |
+
|
253 |
+
#: app/helper/BPMediaSupport.php:173
|
254 |
+
msgid "We will get back to you shortly."
|
255 |
+
msgstr ""
|
256 |
+
|
257 |
+
#: app/helper/BPMediaSupport.php:176
|
258 |
+
msgid "Your server failed to send an email."
|
259 |
+
msgstr ""
|
260 |
+
|
261 |
+
#: app/helper/BPMediaSupport.php:177
|
262 |
+
msgid "Kindly contact your server support to fix this."
|
263 |
+
msgstr ""
|
264 |
+
|
265 |
+
#: app/helper/BPMediaSupport.php:178
|
266 |
+
#, php-format
|
267 |
+
msgid "You can alternatively create a support request <a href=\"%s\">here</a>"
|
268 |
+
msgstr ""
|
269 |
+
|
270 |
+
#: app/helper/BPMediaAddon.php:26
|
271 |
+
msgid "BuddyPress-Media FFMPEG Add-on"
|
272 |
+
msgstr ""
|
273 |
+
|
274 |
+
#: app/helper/BPMediaAddon.php:29
|
275 |
+
msgid "Add supports for more audio & video formats using open-source media-node."
|
276 |
+
msgstr ""
|
277 |
+
|
278 |
+
#: app/helper/BPMediaAddon.php:30
|
279 |
+
msgid "Media node comes with automated setup script for Ubuntu/Debian."
|
280 |
+
msgstr ""
|
281 |
+
|
282 |
+
#: app/helper/BPMediaAddon.php:36
|
283 |
+
msgid "BuddyPress-Media Kaltura Add-on"
|
284 |
+
msgstr ""
|
285 |
+
|
286 |
+
#: app/helper/BPMediaAddon.php:39
|
287 |
+
msgid "Add support for more video formats using Kaltura video solution."
|
288 |
+
msgstr ""
|
289 |
+
|
290 |
+
#: app/helper/BPMediaAddon.php:40
|
291 |
+
msgid "Works with Kaltura.com, self-hosted Kaltura-CE and Kaltura-on-premise."
|
292 |
+
msgstr ""
|
293 |
+
|
294 |
+
#: app/helper/BPMediaAddon.php:82
|
295 |
msgid "Buy Now"
|
296 |
msgstr ""
|
297 |
|
298 |
+
#: app/helper/BPMediaAddon.php:83
|
299 |
msgid "Live Demo"
|
300 |
msgstr ""
|
301 |
|
306 |
|
307 |
#: app/helper/BPMediaUpgrade.php:103
|
308 |
#: app/helper/BPMediaUpgrade.php:156
|
309 |
+
#: app/main/group/BPMediaGroupAction.php:95
|
310 |
#, php-format
|
311 |
msgid "%1$s added a %2$s"
|
312 |
msgstr ""
|
313 |
|
314 |
+
#: app/admin/BPMediaAdmin.php:54
|
315 |
msgid "Buddypress Media Component"
|
316 |
msgstr ""
|
317 |
|
318 |
+
#: app/admin/BPMediaAdmin.php:54
|
319 |
msgid "BuddyPress Media"
|
320 |
msgstr ""
|
321 |
|
322 |
+
#: app/admin/BPMediaAdmin.php:55
|
323 |
+
#: app/admin/BPMediaAdmin.php:175
|
324 |
msgid "Buddypress Media Settings"
|
325 |
msgstr ""
|
326 |
|
327 |
+
#: app/admin/BPMediaAdmin.php:55
|
328 |
+
#: app/admin/BPMediaAdmin.php:176
|
329 |
+
#: app/main/BuddyPressMedia.php:193
|
330 |
msgid "Settings"
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: app/admin/BPMediaAdmin.php:56
|
334 |
+
#: app/admin/BPMediaAdmin.php:182
|
335 |
msgid "Buddypress Media Addons"
|
336 |
msgstr ""
|
337 |
|
338 |
+
#: app/admin/BPMediaAdmin.php:56
|
339 |
+
#: app/admin/BPMediaAdmin.php:183
|
340 |
msgid "Addons"
|
341 |
msgstr ""
|
342 |
|
343 |
+
#: app/admin/BPMediaAdmin.php:57
|
344 |
+
#: app/admin/BPMediaAdmin.php:189
|
345 |
msgid "Buddypress Media Support"
|
346 |
msgstr ""
|
347 |
|
348 |
+
#: app/admin/BPMediaAdmin.php:57
|
349 |
msgid "Support "
|
350 |
msgstr ""
|
351 |
|
352 |
+
#: app/admin/BPMediaAdmin.php:95
|
353 |
+
#: app/main/BuddyPressMedia.php:128
|
354 |
+
#: app/main/BuddyPressMedia.php:131
|
355 |
msgid "Media"
|
356 |
msgstr ""
|
357 |
|
358 |
+
#: app/admin/BPMediaAdmin.php:148
|
359 |
+
#: app/admin/BPMediaAdmin.php:149
|
360 |
msgid "Buddypress Media"
|
361 |
msgstr ""
|
362 |
|
363 |
+
#: app/admin/BPMediaAdmin.php:190
|
364 |
msgid "Support"
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: app/admin/BPMediaAdmin.php:257
|
368 |
msgid "Empowering The Web With WordPress"
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: app/admin/BPMediaAdmin.php:257
|
372 |
msgid "rtCamp"
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: app/admin/BPMediaAdmin.php:259
|
376 |
msgid "Become a fan on Facebook"
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: app/admin/BPMediaAdmin.php:259
|
380 |
msgid "Facebook"
|
381 |
msgstr ""
|
382 |
|
383 |
+
#: app/admin/BPMediaAdmin.php:260
|
384 |
msgid "Follow us on Twitter"
|
385 |
msgstr ""
|
386 |
|
387 |
+
#: app/admin/BPMediaAdmin.php:260
|
388 |
msgid "Twitter"
|
389 |
msgstr ""
|
390 |
|
391 |
+
#: app/admin/BPMediaAdmin.php:261
|
392 |
msgid "Subscribe to our feeds"
|
393 |
msgstr ""
|
394 |
|
395 |
+
#: app/admin/BPMediaAdmin.php:261
|
396 |
msgid "RSS Feed"
|
397 |
msgstr ""
|
398 |
|
399 |
+
#: app/admin/BPMediaAdmin.php:266
|
400 |
+
msgid "Read FAQ"
|
|
|
401 |
msgstr ""
|
402 |
|
403 |
+
#: app/admin/BPMediaAdmin.php:267
|
404 |
+
msgid "Free Support Forum"
|
|
|
405 |
msgstr ""
|
406 |
|
407 |
+
#: app/admin/BPMediaAdmin.php:268
|
408 |
+
msgid "Github Issue Tracker"
|
|
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: app/admin/BPMediaAdmin.php:269
|
412 |
+
msgid "Hire us!"
|
413 |
+
msgstr ""
|
414 |
+
|
415 |
+
#: app/admin/BPMediaAdmin.php:269
|
416 |
+
msgid "To get professional customisation/setup service."
|
417 |
msgstr ""
|
418 |
|
419 |
+
#: app/admin/BPMediaAdmin.php:271
|
420 |
msgid "Need Help?"
|
421 |
msgstr ""
|
422 |
|
423 |
+
#: app/admin/BPMediaAdmin.php:273
|
424 |
msgid "Help the development keep going."
|
425 |
msgstr ""
|
426 |
|
427 |
+
#: app/admin/BPMediaAdmin.php:274
|
428 |
msgid "Help us release more amazing features faster. Consider making a donation to our consistent efforts."
|
429 |
msgstr ""
|
430 |
|
431 |
+
#: app/admin/BPMediaAdmin.php:275
|
432 |
msgid "Donate"
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: app/admin/BPMediaAdmin.php:278
|
436 |
msgid "BuddyPress Media Kaltura"
|
437 |
msgstr ""
|
438 |
|
439 |
+
#: app/admin/BPMediaAdmin.php:278
|
440 |
msgid "BPM-Kaltura"
|
441 |
msgstr ""
|
442 |
|
443 |
+
#: app/admin/BPMediaAdmin.php:278
|
444 |
msgid "Add support for Kaltura.com/Kaltura-CE based video conversion support"
|
445 |
msgstr ""
|
446 |
|
447 |
+
#: app/admin/BPMediaAdmin.php:279
|
448 |
msgid "BuddyPress Media FFMPEG"
|
449 |
msgstr ""
|
450 |
|
451 |
+
#: app/admin/BPMediaAdmin.php:279
|
452 |
msgid "BPM-FFMPEG"
|
453 |
msgstr ""
|
454 |
|
455 |
+
#: app/admin/BPMediaAdmin.php:279
|
456 |
msgid "Add FFMEG-based audio/video conversion support"
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: app/admin/BPMediaAdmin.php:281
|
460 |
msgid "Are you a developer?"
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: app/admin/BPMediaAdmin.php:282
|
464 |
#, php-format
|
465 |
msgid "If you are developing a BuddyPress Media addon we would like to include it in above list. We can also help you sell them. <a href=\"%s\">More info!</a>"
|
466 |
msgstr ""
|
467 |
|
468 |
+
#: app/admin/BPMediaAdmin.php:283
|
469 |
msgid "Premium Addons"
|
470 |
msgstr ""
|
471 |
|
472 |
+
#: app/admin/BPMediaAdmin.php:286
|
473 |
msgid "Latest News"
|
474 |
msgstr ""
|
475 |
|
476 |
+
#: app/main/BuddyPressMedia.php:134
|
477 |
msgid "Photos"
|
478 |
msgstr ""
|
479 |
|
480 |
+
#: app/main/BuddyPressMedia.php:137
|
481 |
msgid "Photo"
|
482 |
msgstr ""
|
483 |
|
484 |
+
#: app/main/BuddyPressMedia.php:140
|
485 |
msgid "Videos"
|
486 |
msgstr ""
|
487 |
|
488 |
+
#: app/main/BuddyPressMedia.php:146
|
489 |
+
#: app/main/BuddyPressMedia.php:149
|
490 |
msgid "Music"
|
491 |
msgstr ""
|
492 |
|
493 |
+
#: app/main/BuddyPressMedia.php:152
|
494 |
msgid "Albums"
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: app/main/BuddyPressMedia.php:155
|
498 |
msgid "Album"
|
499 |
msgstr ""
|
500 |
|
501 |
+
#: app/main/BuddyPressMedia.php:158
|
502 |
msgid "Upload"
|
503 |
msgstr ""
|
504 |
|
505 |
+
#: app/main/BuddyPressMedia.php:251
|
506 |
#, php-format
|
507 |
msgid "The BuddyPress version installed is an older version and is not supported, please update BuddyPress to use BuddyPress Media Plugin.<a class=\"alignright\" href=\"%1$s\">X</a>"
|
508 |
msgstr ""
|
509 |
|
510 |
+
#: app/main/BuddyPressMedia.php:256
|
511 |
#, php-format
|
512 |
msgid "You have not installed BuddyPress. Please install latest version of BuddyPress to use BuddyPress Media plugin.<a class=\"alignright\" href=\"%1$s\">X</a>"
|
513 |
msgstr ""
|
514 |
|
515 |
+
#: app/main/profile/BPMediaTemplate.php:18
|
516 |
+
msgid "Select Album"
|
517 |
+
msgstr ""
|
518 |
+
|
519 |
+
#: app/main/profile/BPMediaTemplate.php:19
|
520 |
+
#: app/main/profile/BPMediaTemplate.php:66
|
521 |
+
msgid "x"
|
522 |
+
msgstr ""
|
523 |
+
|
524 |
+
#: app/main/profile/BPMediaTemplate.php:65
|
525 |
+
msgid "Create Album"
|
526 |
+
msgstr ""
|
527 |
+
|
528 |
+
#: app/main/profile/BPMediaTemplate.php:69
|
529 |
+
msgid "Album Name"
|
530 |
+
msgstr ""
|
531 |
+
|
532 |
+
#: app/main/profile/BPMediaTemplate.php:79
|
533 |
msgid "Drop files here"
|
534 |
msgstr ""
|
535 |
|
536 |
+
#: app/main/profile/BPMediaTemplate.php:80
|
537 |
msgid " or "
|
538 |
msgstr ""
|
539 |
|
540 |
+
#: app/main/profile/BPMediaTemplate.php:81
|
541 |
msgid "Select Files"
|
542 |
msgstr ""
|
543 |
|
633 |
msgid "Sorry, the requested album does not exist."
|
634 |
msgstr ""
|
635 |
|
636 |
+
#: app/main/group/BPMediaGroupElementExtension.php:62
|
637 |
+
msgid "Sorry, the requested media does not belong to the group"
|
638 |
+
msgstr ""
|
639 |
+
|
640 |
+
#: app/main/group/BPMediaGroup.php:163
|
641 |
msgid "Media Settings"
|
642 |
msgstr ""
|
643 |
|
644 |
+
#: app/main/group/BPMediaGroupsExtension.php:31
|
645 |
+
#: app/main/group/BPMediaGroupsExtension.php:69
|
646 |
+
msgid "Album Creation Control"
|
|
|
647 |
msgstr ""
|
648 |
|
649 |
+
#: app/main/group/BPMediaGroupsExtension.php:32
|
650 |
+
#: app/main/group/BPMediaGroupsExtension.php:70
|
651 |
+
msgid "Who can create Albums in this group?"
|
652 |
msgstr ""
|
653 |
|
654 |
+
#: app/main/group/BPMediaGroupsExtension.php:36
|
655 |
+
#: app/main/group/BPMediaGroupsExtension.php:74
|
656 |
+
msgid "All Group Members"
|
657 |
+
msgstr ""
|
658 |
+
|
659 |
+
#: app/main/group/BPMediaGroupsExtension.php:40
|
660 |
+
#: app/main/group/BPMediaGroupsExtension.php:78
|
661 |
+
msgid "Group Admins and Mods only"
|
662 |
+
msgstr ""
|
663 |
+
|
664 |
+
#: app/main/group/BPMediaGroupsExtension.php:44
|
665 |
+
#: app/main/group/BPMediaGroupsExtension.php:82
|
666 |
+
msgid "Group Admin only"
|
667 |
+
msgstr ""
|
668 |
+
|
669 |
+
#: app/main/group/BPMediaGroupsExtension.php:86
|
670 |
+
msgid "Save Changes"
|
671 |
+
msgstr ""
|
672 |
+
|
673 |
+
#: app/main/group/BPMediaGroupsExtension.php:106
|
674 |
msgid "There was an error saving, please try again"
|
675 |
msgstr ""
|
676 |
|
677 |
+
#: app/main/group/BPMediaGroupsExtension.php:108
|
678 |
msgid "Settings saved successfully"
|
679 |
msgstr ""
|
680 |
|
681 |
+
#: app/main/group/BPMediaGroupsExtension.php:124
|
682 |
+
msgid ""
|
683 |
+
"You could display a small snippet of information from your group extension here. It will show on the group\n"
|
684 |
+
"\t home screen."
|
685 |
+
msgstr ""
|
686 |
+
|
687 |
#: app/main/widgets/BPMediaPopularMedia.php:15
|
688 |
msgid "The most popular media on your site"
|
689 |
msgstr ""
|
706 |
msgstr ""
|
707 |
|
708 |
#: app/main/widgets/BPMediaPopularMedia.php:84
|
709 |
+
#: app/main/widgets/BPMediaRecentMedia.php:193
|
710 |
msgid "Title:"
|
711 |
msgstr ""
|
712 |
|
713 |
#: app/main/widgets/BPMediaPopularMedia.php:87
|
714 |
+
#: app/main/widgets/BPMediaRecentMedia.php:196
|
715 |
msgid "Number of posts to show:"
|
716 |
msgstr ""
|
717 |
|
729 |
msgstr ""
|
730 |
|
731 |
#: app/main/widgets/BPMediaRecentMedia.php:64
|
732 |
+
msgid "No recent media found"
|
733 |
msgstr ""
|
734 |
|
735 |
#: app/main/widgets/BPMediaRecentMedia.php:100
|
736 |
+
msgid "No recent photo found"
|
737 |
msgstr ""
|
738 |
|
739 |
#: app/main/widgets/BPMediaRecentMedia.php:135
|
740 |
+
msgid "No recent audio found"
|
741 |
msgstr ""
|
742 |
|
743 |
#: app/main/widgets/BPMediaRecentMedia.php:170
|
744 |
+
msgid "No recent video found"
|
745 |
msgstr ""
|
746 |
|
747 |
#: app/main/includes/BPMediaHostWordpress.php:46
|
753 |
msgstr ""
|
754 |
|
755 |
#: app/main/includes/BPMediaHostWordpress.php:112
|
756 |
+
msgid "MP4 file you have uploaded is corrupt."
|
757 |
msgstr ""
|
758 |
|
759 |
#: app/main/includes/BPMediaHostWordpress.php:119
|
786 |
msgid "Error creating attachment for the media file, please try again"
|
787 |
msgstr ""
|
788 |
|
789 |
+
#: app/main/includes/BPMediaHostWordpress.php:252
|
790 |
#, php-format
|
791 |
msgid "%s uploaded a media."
|
792 |
msgstr ""
|
793 |
|
794 |
+
#: app/main/includes/BPMediaHostWordpress.php:266
|
795 |
+
msgid "Uploaded by "
|
796 |
+
msgstr ""
|
797 |
+
|
798 |
+
#: app/main/includes/BPMediaHostWordpress.php:393
|
799 |
#, php-format
|
800 |
msgid "Comment <span>%s</span>"
|
801 |
msgstr ""
|
802 |
|
803 |
+
#: app/main/includes/BPMediaHostWordpress.php:397
|
804 |
msgid "Favorite"
|
805 |
msgstr ""
|
806 |
|
807 |
+
#: app/main/includes/BPMediaHostWordpress.php:399
|
808 |
msgid "Remove Favorite"
|
809 |
msgstr ""
|
810 |
|
811 |
+
#: app/main/includes/BPMediaHostWordpress.php:418
|
812 |
msgid "Post"
|
813 |
msgstr ""
|
814 |
|
815 |
+
#: app/main/includes/BPMediaHostWordpress.php:418
|
816 |
msgid "or press esc to cancel."
|
817 |
msgstr ""
|
818 |
|
819 |
+
#: app/main/includes/BPMediaHostWordpress.php:441
|
820 |
+
msgid "Delete"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
821 |
msgstr ""
|
822 |
|
823 |
+
#: app/main/includes/BPMediaUtils.php:37
|
824 |
msgid "It will migrate your BuddyPress Media's earlier database to new database."
|
825 |
msgstr ""
|
826 |
|
827 |
+
#: app/main/includes/BPMediaUtils.php:134
|
828 |
msgid "Bug Report"
|
829 |
msgstr ""
|
830 |
|
831 |
+
#: app/main/includes/BPMediaUtils.php:137
|
832 |
msgid "New Feature Request"
|
833 |
msgstr ""
|
834 |
|
835 |
+
#: app/main/includes/BPMediaUtils.php:140
|
836 |
msgid "Premium Support Request"
|
837 |
msgstr ""
|
838 |
|
839 |
+
#: app/main/includes/BPMediaUtils.php:283
|
840 |
msgid "Thank you, Your bug report sent successfully."
|
841 |
msgstr ""
|
842 |
|
843 |
+
#: app/main/includes/BPMediaUtils.php:286
|
844 |
msgid "Thank you, Your new feature request sent successfully."
|
845 |
msgstr ""
|
846 |
|
847 |
+
#: app/main/includes/BPMediaUtils.php:289
|
848 |
msgid "Thank you, Your premium support request sent successfully, We will contact you soon."
|
849 |
msgstr ""
|
850 |
|
851 |
+
#: app/main/includes/BPMediaUtils.php:339
|
852 |
+
#: app/main/includes/BPMediaUtils.php:637
|
853 |
msgid "BuddyPress Media Support"
|
854 |
msgstr ""
|
855 |
|
856 |
+
#: app/main/includes/BPMediaUtils.php:345
|
857 |
msgid "Spread the word"
|
858 |
msgstr ""
|
859 |
|
860 |
+
#: app/main/includes/BPMediaUtils.php:346
|
861 |
msgid "BuddyPress Media Other options"
|
862 |
msgstr ""
|
863 |
|
864 |
+
#: app/main/includes/BPMediaUtils.php:612
|
865 |
msgid "Need Help/Support?"
|
866 |
msgstr ""
|
867 |
|
868 |
+
#: app/main/includes/BPMediaUtils.php:620
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
869 |
msgid "Hire Us!"
|
870 |
msgstr ""
|
871 |
|
872 |
+
#: app/main/includes/BPMediaUtils.php:621
|
873 |
msgid "We are available for customisation and premium support. Get on touch with us. :-)"
|
874 |
msgstr ""
|
875 |
|
876 |
+
#: app/main/includes/BPMediaUtils.php:652
|
877 |
msgid "Request type:"
|
878 |
msgstr ""
|
879 |
|
880 |
+
#: app/main/includes/BPMediaUtils.php:654
|
881 |
msgid "-- Choose Type --"
|
882 |
msgstr ""
|
883 |
|
884 |
+
#: app/main/includes/BPMediaUtils.php:655
|
885 |
msgid "Premium Support"
|
886 |
msgstr ""
|
887 |
|
888 |
+
#: app/main/includes/BPMediaUtils.php:656
|
889 |
msgid "Suggest a New Feature"
|
890 |
msgstr ""
|
891 |
|
892 |
+
#: app/main/includes/BPMediaUtils.php:688
|
893 |
+
#, php-format
|
894 |
+
msgid ""
|
895 |
+
" Please use our <a href=\"%s\">free support forum</a>.<br/><span class=\"bpm-aligncenter\">OR</span><br/>\n"
|
896 |
+
"\t\t<a href=\"%s\">Hire us!</a> To get professional customisation/setup service."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
897 |
msgstr ""
|
898 |
|
899 |
+
#: app/main/includes/BPMediaTemplateFunctions.php:28
|
900 |
+
msgid "Media Title"
|
901 |
msgstr ""
|
902 |
|
903 |
+
#: app/main/includes/BPMediaTemplateFunctions.php:29
|
904 |
+
msgid "Media Description"
|
905 |
msgstr ""
|
906 |
|
907 |
+
#: app/main/includes/BPMediaTemplateFunctions.php:30
|
908 |
+
msgid "Select Media File"
|
|
|
|
|
|
|
909 |
msgstr ""
|
910 |
|
911 |
+
#: app/main/includes/BPMediaComponent.php:67
|
912 |
msgid "Search Media..."
|
913 |
msgstr ""
|
914 |
|
915 |
+
#: app/main/includes/BPMediaComponent.php:316
|
916 |
msgid "Create"
|
917 |
msgstr ""
|
918 |
|
919 |
+
#: app/main/includes/BPMediaComponent.php:318
|
|
|
|
|
|
|
|
|
920 |
msgid "Edit Album"
|
921 |
msgstr ""
|
922 |
|
923 |
+
#: app/main/includes/BPMediaComponent.php:319
|
924 |
msgid "New Album"
|
925 |
msgstr ""
|
926 |
|
927 |
+
#: app/main/includes/BPMediaComponent.php:320
|
928 |
msgid "All Albums"
|
929 |
msgstr ""
|
930 |
|
931 |
+
#: app/main/includes/BPMediaComponent.php:321
|
932 |
msgid "View Album"
|
933 |
msgstr ""
|
934 |
|
935 |
+
#: app/main/includes/BPMediaComponent.php:322
|
936 |
msgid "Search Albums"
|
937 |
msgstr ""
|
938 |
|
939 |
+
#: app/main/includes/BPMediaComponent.php:323
|
940 |
msgid "No album found"
|
941 |
msgstr ""
|
942 |
|
943 |
+
#: app/main/includes/BPMediaComponent.php:324
|
944 |
msgid "No album found in Trash"
|
945 |
msgstr ""
|
946 |
|
947 |
+
#: app/main/includes/BPMediaComponent.php:348
|
948 |
msgid "Add New Media"
|
949 |
msgstr ""
|
950 |
|
951 |
+
#: app/main/includes/BPMediaComponent.php:355
|
952 |
+
msgid "BuddyPress Media's Media Files"
|
|
|
953 |
msgstr ""
|
954 |
|
955 |
+
#: app/main/includes/BPMediaFunction.php:189
|
956 |
+
#, php-format
|
957 |
+
msgid "%1$s added new media in album %2$s"
|
958 |
msgstr ""
|
959 |
|
960 |
+
#: app/main/includes/BPMediaFilters.php:296
|
961 |
msgid "Users"
|
962 |
msgstr ""
|
963 |
|
964 |
+
#: app/main/includes/BPMediaFilters.php:298
|
965 |
msgid "Total Photos"
|
966 |
msgstr ""
|
967 |
|
968 |
+
#: app/main/includes/BPMediaFilters.php:299
|
969 |
msgid "Total Videos"
|
970 |
msgstr ""
|
971 |
|
972 |
+
#: app/main/includes/BPMediaFilters.php:300
|
973 |
msgid "Total Audio"
|
974 |
msgstr ""
|
975 |
|
976 |
+
#: app/main/includes/BPMediaFilters.php:301
|
977 |
msgid "Total Albums"
|
978 |
msgstr ""
|
979 |
|
980 |
+
#: app/main/includes/BPMediaFilters.php:303
|
981 |
msgid "Groups"
|
982 |
msgstr ""
|
983 |
|
984 |
+
#: app/main/includes/BPMediaActions.php:254
|
985 |
+
msgid "Edit Media"
|
986 |
+
msgstr ""
|
987 |
+
|
988 |
+
#: app/main/includes/BPMediaActions.php:254
|
989 |
+
msgid "Edit"
|
990 |
+
msgstr ""
|
991 |
+
|
992 |
+
#: app/main/includes/BPMediaActions.php:266
|
993 |
+
#: app/main/includes/BPMediaActions.php:271
|
994 |
+
msgid "Featured Media"
|
995 |
+
msgstr ""
|
996 |
+
|
997 |
+
#: app/main/includes/BPMediaActions.php:266
|
998 |
+
msgid "Featured"
|
999 |
+
msgstr ""
|
1000 |
+
|
1001 |
+
#: app/main/includes/BPMediaActions.php:271
|
1002 |
+
msgid "Remove Featured"
|
1003 |
+
msgstr ""
|
1004 |
+
|
1005 |
+
#: app/main/includes/BPMediaActions.php:534
|
1006 |
+
#, php-format
|
1007 |
+
msgid "%1$s created an album %2$s"
|
1008 |
+
msgstr ""
|
1009 |
+
|
readme.txt
CHANGED
@@ -4,9 +4,10 @@ Donate link: http://rtcamp.com/donate
|
|
4 |
Tags: BuddyPress, media, multimedia, album, audio, songs, music, video, photo, image, upload, share, MediaElement.js, ffmpeg, kaltura, media-node
|
5 |
License: GPLv2 or later
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
-
Requires at least: 3.
|
8 |
-
Tested up to: 3.
|
9 |
-
Stable tag: 2.4
|
|
|
10 |
|
11 |
Adds Photos, Music, Videos & Albums to your BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.
|
12 |
|
@@ -14,6 +15,10 @@ Adds Photos, Music, Videos & Albums to your BuddyPress. Supports mobile devices
|
|
14 |
|
15 |
BuddyPress Media adds Photos, Music, Videos & Albums to your BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.
|
16 |
|
|
|
|
|
|
|
|
|
17 |
= Features =
|
18 |
|
19 |
* Images, Music, Videos Upload
|
@@ -73,6 +78,12 @@ Please visit [BuddyPress Media's Features page](http://rtcamp.com/buddypress-med
|
|
73 |
|
74 |
Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/ "Visit BuddyPress Media's Features page") to get some details about future releases.
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
= 2.4 =
|
77 |
* Total code overhaul. Fixed a lot of bugs and optimised a lot of other code.
|
78 |
* Added proper translation support!
|
@@ -168,5 +179,5 @@ Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-medi
|
|
168 |
* HTML5 Video Tag Support (with fallback)
|
169 |
|
170 |
== Upgrade Notice ==
|
171 |
-
=2.4=
|
172 |
-
|
4 |
Tags: BuddyPress, media, multimedia, album, audio, songs, music, video, photo, image, upload, share, MediaElement.js, ffmpeg, kaltura, media-node
|
5 |
License: GPLv2 or later
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
+
Requires at least: 3.5
|
8 |
+
Tested up to: 3.5
|
9 |
+
Stable tag: 2.4.1
|
10 |
+
Text domain: buddypress-media
|
11 |
|
12 |
Adds Photos, Music, Videos & Albums to your BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.
|
13 |
|
15 |
|
16 |
BuddyPress Media adds Photos, Music, Videos & Albums to your BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.
|
17 |
|
18 |
+
= Important =
|
19 |
+
|
20 |
+
BuddyPress Media now includes [full translation support](https://rtcamp.com/tutorials/buddypress-media-translation/). Head over to the [translation project](http://rtcamp.com/translate/projects/buddypress-media/) to contribute your translations. If you don't see the language of your choice, let us know in the support forum, we'll add it.
|
21 |
+
|
22 |
= Features =
|
23 |
|
24 |
* Images, Music, Videos Upload
|
78 |
|
79 |
Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/ "Visit BuddyPress Media's Features page") to get some details about future releases.
|
80 |
|
81 |
+
= 2.4.1 =
|
82 |
+
* New Widget added with more options!
|
83 |
+
* Fixed 'Show More' action on Group Album thanks to [bowoolley](http://profiles.wordpress.org/bowoolley/)
|
84 |
+
* Fixed conflicts with 'BuddyPress Activity Plus', thanks to [number_6] (http://profiles.wordpress.org/number_6/) and param-veer(https://github.com/param-veer)
|
85 |
+
* Some more housekeeping, code cleanup and documentation.
|
86 |
+
|
87 |
= 2.4 =
|
88 |
* Total code overhaul. Fixed a lot of bugs and optimised a lot of other code.
|
89 |
* Added proper translation support!
|
179 |
* HTML5 Video Tag Support (with fallback)
|
180 |
|
181 |
== Upgrade Notice ==
|
182 |
+
=2.4.1=
|
183 |
+
New Widget and Bug Fixes.
|