Search Results for 'events template'
-
AuthorSearch Results
-
August 16, 2010 at 9:20 am #89250
Sandra l***
Participant@Whyameye and PeD,
In the plugin , there is a sub-directory called “events” (under bp-events) that need to be moved under the root of your selected Buddypress theme (i.e. same level as groups, members, activity, etc…)
Other thing I noticed:
When creating an event, one can attach the event to a group. The problem is that the group does not show up later on (it should display “organized by [name of the group]”) when displaying the event. In order to fix this, look for function bp_event_groups_dropdown( $grp_id ) in file bp-events-templatetags.php and replace this loop
foreach ($groups as $group) {
echo “name.”‘”;
if ($grp_id == $group->id)
echo ” selected”;
echo “>”.$group->name.””;
}echo ”;
with
foreach ($groups as $group) {
echo “id.”‘”;
if ($grp_id == $group->id)
echo ” selected”;
echo “>”.$group->name.””;
}echo ”;
(i.e. replace “group->name” with “group->id” in the if statement)
August 14, 2010 at 5:30 pm #89096In reply to: Jet Event System – Order of events upside down?
Jamie Marsland
ParticipantHave you moved the folders in templates as per read me?? I’ve got it installed, but it lists the events in a weird order?? Doesn’t make much sense to do it this way. Pity because otherwise it does everything i need.
August 4, 2010 at 8:09 pm #88017In reply to: Facebook like for BuddyPress
José M. Villar
ParticipantIf U can find the template tags for forum posts, groups, events, post them here please
August 4, 2010 at 3:55 pm #87982In reply to: Facebook like for BuddyPress
gregfielding
ParticipantI’d like to put this on forums, groups, events, etc…is there a list of template tags somewhere?
July 16, 2010 at 10:49 am #85883gpo1
Participant@hnla, The events plugin for BP1.1(dev) had no time to update it,but if we all ask the developer for this great plugin with eventbrite for adapt it for BP
https://wordpress.org/extend/plugins/the-events-calendar/Eventbrite for The Events Calendar now has one piece of standalone functionality. This plugin includes a series of shortcodes that will allow the embedding of Eventbrite Widgets into WordPress post/page/sidebar content. Want to sell tickets or show a registration form for an Eventbrite event that you didn’t create yourself from WordPress? Now you can.
Eventbrite for The Events Calendar
Sell tickets directly from your post
Extensive template tags for customization
MU Compatible
Many of the amazing features of Eventbrite – directly from WordPress
Use shortcode to place any event ticketing on any postApril 25, 2010 at 12:55 pm #75075Brajesh Singh
ParticipantHave you moved the template files to your current theme. It seems you have not moved the template files from bp-events to you theme.
Move them to your theme and the links will work.March 18, 2010 at 3:52 pm #68987In reply to: bp-events update
Hugo Ashmore
ParticipantIn fairness I guess that this post on this thread wasn’t too helpful and got a lot of hopes up especially given the implied timelines and nearness of completion:
https://buddypress.org/forums/topic/most-effective-events-plugin
Great News! Heard back from Erwin re bp-events and he authorized me to post an update (quoted)
I am working with Dave Aubin to make bp-events work with 1.2,
including the new templates. That is just days away (I hope), then
I turn the code over to Sven who has been working on integrating the
excellent jQuery plugin FullCalendar (and has the code ready to go)
once I hand over the bp-events 1.2 code.
I tell you, working with the new template system without any
documentation has been quite the chore as I am sure you know as well.
Once that is all working I will release a preliminary version
and work on some additional features/widgets.
So, I hope bp-events 1.2 comes out within a month of the
official bp 1.2 came out, so in all, not too bad!
BP 1.2 was released on Feb 16th so I think it’s safe to ball-park a working copy around mid march, by his estimation. Suffice to say I am fired up.
March 14, 2010 at 6:56 pm #68264In reply to: Events Plugin
Marcus (aka @msykes)
ParticipantHi pjnu,
Maybe you haven’t defined a template to display your event in the settings menu? I’d need some more information to go on (any errors elsewhere, php error logs etc.)
Please message me on here (just friended you) as I wouldn’t want us to hijack this thread further.
March 5, 2010 at 4:33 pm #66883In reply to: Most effective/stable events plugin?
Mike Pratt
ParticipantUPDATE-IMPORTANT!
Great News! Heard back from Erwin re bp-events and he authorized me to post an update (quoted)
I am working with Dave Aubin to make bp-events work with 1.2,
including the new templates. That is just days away (I hope), then
I turn the code over to Sven who has been working on integrating the
excellent jQuery plugin FullCalendar (and has the code ready to go)
once I hand over the bp-events 1.2 code.
I tell you, working with the new template system without any
documentation has been quite the chore as I am sure you know as well.
Once that is all working I will release a preliminary version
and work on some additional features/widgets.
So, I hope bp-events 1.2 comes out within a month of the
official bp 1.2 came out, so in all, not too bad!BP 1.2 was released on Feb 16th so I think it’s safe to ball-park a working copy around mid march, by his estimation. Suffice to say I am fired up.
March 1, 2010 at 11:46 pm #66231In reply to: FAQ: How To, Code Snippets and Solutions
Tim Nicholson
Participantr-a-y, is there any way to get comments on blog and forum posts (in the BP activity pages) to actually add the comment to the WP blog post or as a reply to the forum post? This would be SO useful. The way it works now is that your user’s comments end up staying only within the BP activity stream and don’t get reflected on your actual main website (blog)! Disabling it prevents that, but also removes the convenience of user’s being able to comment globally from a single place on their BP activity stream pages.
I have to believe this *should* be a pretty easy plugin to develop (depending on how modular the WP and BP code is around this), but would much rather see this built into BP core. I already have a dozen WP plugins that I feel are essential for any blog and as I look to roll out BP, that’s going to add many more. I’m tapping out a dedicated server as it is and all these hooks and plugins and template tags and such require some seriously beefy hardware.
January 23, 2010 at 5:02 am #61418David Lewis
Participant@Erwin: Ya… I don’t blame you at all and I fully support bp-events being 1.2+ only. No backwards compatibility. The new default theme is great… big improvement on the front end… but the file structure has been radically altered. It’s going to be a pain for a lot of people. I tried making new bp-events templates myself for 1.2 and gave up after about a week. I’m glad you’re on the case because I had no luck.
January 22, 2010 at 7:38 pm #61388In reply to: BuddyPress Links 0.2.1 released
Brajesh Singh
ParticipantThanks for pointing

hi Daniel
This is related to theme not to the bp-links plugin. If you feel comfortable with css/xhtml, just use plugin-template.php as a base and create all the files in links directory based on that.
I am currently busy with a plugin and will be back to this theming again after that only, so if you can wait for 3-4 days, I will provide templates for bp-links/bp-events+updated cosmicbuddy for free [which I promised long ago there].
Otherwise, if someone have already templated cosmicbuddy for bp-events/bp-links, please point here.
Thanks
Brajesh
January 7, 2010 at 2:21 am #60231In reply to: 1.1.3 or 1.2?
David Lewis
ParticipantWell… the new default theme for 1.2 works in 1.2
I’ve been working on a child theme based off that for a couple of weeks now. It works great! Altho’ bp-events doesn’t work well with the new theme since bp-events uses the previous 1.1 template structure.
January 6, 2010 at 9:01 pm #60189In reply to: Publishing documets to a group
David Lewis
ParticipantWell… the new default theme is pretty different from the old default theme. The templates are structured in a completely new (and better) way. I had built a child theme off the old default… and it took a fair bit of work to get the same child theme working with the new default. I imagine that any plugin which relied on you adding a folder full of template to your theme (like bp-events for instance) will have some issues with BP1.2 and the default theme. Unless the compatibility thing Andy is talking about will address that too.
Simon Dabkowski
Participant@redyor tx! I build the Classifieds plugin by doing some heavy modification to the BP Events plugin.
@Ted Tx again
The JQuery for the filter effect is based off of http://www.newmediacampaigns.com/page/a-jquery-plugin-to-create-an-interactive-filterable-portfolio-like-ours@Michael Berra Because every plugin is custom build for the h-mag template, I can’t release any of the plugins.
The calendar for BP Events plugin is based off of http://arshaw.com/fullcalendar/
January 2, 2010 at 8:20 pm #59916In reply to: HELP invite friends and events plugin for bp 1.2
David Lewis
ParticipantI’m aware of that plugin. But bp-events is the only events plugin that integrates with BuddyPress. With bp-events you can invite friends, associate events with groups, etc. Very different animal.
Anyway… I haven’t quite given up… but I’m close to it. The new default theme is structured very differently from the old. I understand how it’s organized… such that the main template folder for your component just houses the directory and single views… while the templates for member’s stuff (i.e. your groups, your events, your blogs, etc.) are in “/member/single/…” … and there is only one loop which is loaded below the tabbed navigation via AJAX. I get all that. But trying to re-factor the old bp-events templates to work that way is causing me great pain. LOL. By the time I figure it out… Erwin may have resurfaced and released an update.
All I know is… my site cannot launch without this component. So at the moment anyway… I’m stuck with trying to hack the old bp-events or launching a 1.1 site with the old bp-events. Ergh
December 31, 2009 at 2:37 am #59805In reply to: HELP invite friends and events plugin for bp 1.2
David Lewis
Participant@dre Well… I’m not really much of a programmer. I’m more of a designer / frontend coder. But if I can get the templates for bp-events working with 1.2… I’ll share.
December 30, 2009 at 5:52 pm #59765In reply to: HELP invite friends and events plugin for bp 1.2
David Lewis
Participantbp-events will work with 1.2 with some template modifications. I’ve been hacking it to work with the 1.2 default theme. I’m about 30% done. I’m starting to lose hope that it will be kept up to date however. The last commit was back in November… and the Trac site is down again. Of course… it’s the holidays right now… so if could just be that. But it seems to me like Erwin is either busy with other things (that probably pay better… LOL) or simply losing interest. Either way, it would be good to know so that perhaps someone else could take over the code. Events is a desperately needed feature of any community site.
December 28, 2009 at 9:08 am #59586In reply to: Performance problem 100% CPU
javicarrasco
ParticipantI have been doing some debugging. I have modified plugin.php to record how much time takes (using microtime) to execute every do_action() call.
Look at the results following, it doesn’t look like a code performance problem of any plugin, or at least, it doesn’t happen every time.
muplugins_loaded: 1.2E-5,
plugins_loaded,
_auth_cookie_malformed: 1.5E-5,
_auth_cookie_valid: 1.4E-5,
_set_current_user: 0.000413,
_xprofile_setup_globals: 1.4E-5,
_bp_core_setup_globals: 1.4E-5,
_bp_activity_setup_globals: 1.2E-5,
_bp_blogs_setup_globals: 1.3E-5,
_bp_forums_setup: 1.4E-5,
_friends_setup_globals: 1.3E-5,
_groups_setup_globals: 1.4E-5,
_messages_setup_globals: 1.4E-5,
_bp_wire_setup_globals: 1.3E-5,
_xprofile_setup_globals: 1.3E-5,
_bp_status_setup_globals: 1.3E-5,
_events_setup_globals: 1.7E-5,
_bp_activity_setup_nav: 1.8E-5,
_bp_blogs_setup_nav: 1.9E-5,
_bp_blogs_register_activity_actions: 1.7E-5,
_friends_register_activity_actions: 1.7E-5,
_groups_setup_nav: 1.8E-5,
_groups_register_activity_actions: 1.6E-5,
_messages_setup_nav: 1.7E-5,
_bp_wire_setup_nav: 1.6E-5,
_xprofile_setup_nav: 1.7E-5,
_xprofile_register_activity_actions: 1.6E-5,
_bp_status_register_activity_actions: 1.6E-5,
_events_setup_nav: 1.8E-5
: -0.674134,
sanitize_comment_cookies: 0.000702,
setup_theme: 6.4E-5,
init,
_widgets_init: 0.013721,
_wp_ajax_: 2.3E-5
: 0.137118,
posts_selection: 2.0E-5,
friends_setup_nav: 2.20000000001E-5,
xprofile_screen_display_profile: 3.99999999999E-5,
template_redirect,
_switch_blog: 2.3E-5,
_switch_blog: 2.0E-5
: 0.00442,
get_header: 2.89999999999E-5,
wp_head,
_wp_enqueue_scripts: 0.002232,
_wp_print_styles: 0.001407,
_wp_print_scripts: 0.000719,
_wp_print_scripts: 0.000699,
_wp_print_scripts: 0.000655,
_signup_header: 5.5E-5,
_wp_print_styles: 0.001295,
_wp_print_styles: 0.001268
: 0.0585,
posts_selection: 2.49999999999E-5,
posts_selection: 3.1E-5,
get_sidebar: 3.6E-5,
get_footer: 3.0E-5,
wp_footer,
_bp_adminbar_logo: 0.000711,
_bp_adminbar_menus,
__switch_blog: 3.29999999999E-5,
__switch_blog: 3.30000000001E-5,
__bp_adminbar_random_menu: 3.00000000001E-5
_: 0.031586,
_wp_print_footer_scripts: 2.6E-5
: 0.068475
December 10, 2009 at 8:52 am #58406Mariusooms
Participantbp-invitefriends is not activated yet, I still need to style it to match bp-defaut…I ported it over on a different theme. I probably just use the templates from the original and see how well they hold up.
As far as bp-events, I would suggest wp repository, that’s what I have installed on the Sandbox. I had set up a trac for it on my Dreamhost account, but they completely destroyed it while they “Upgraded” their services. I upgraded too and moved to HostGator, what a headache that was. In any case Erwin has setup a trac on his site I believe and he is continuing development.
My time is very limited, so I have to pick carefully what I do and not do. The basic strucure for bp-events works great and that was my intent to develop. With a bit of help from the community that plugin should reach a greater height.
By the way…I stopped by jobsee.kr. Great play on words and a nice design. I like the logo as well. So thumbs up.
David Lewis
Participantp.s. re: my custom template tag above to show the start dates in the directory view… I just clued in and realized that I should be doing this in the functions.php file rather than hacking Erwin’s plugin. So here’s the function to add to the functions.php file of your theme.
function bp_the_site_event_date_start() {
echo bp_get_the_site_event_date_start();
}
function bp_get_the_site_event_date_start() {
global $site_events_template;
return apply_filters( 'bp_get_the_site_event_date_start', date( ('l M j - Y'), $site_events_template->event->date_start ) );
}
add_action( 'plugins_loaded', 'bp_the_site_event_date_start');Then in the event directory loop template in your theme, just call it like this
<?php p_get_the_site_event_date_start() ?>David Lewis
Participant@simoncreative: Just to clarify… I am NOT part of the bp-events team. I just made up that little template tag function on my own. So I don’t know for sure if it will make it into the trunk or not. Keep that in mind when updating bp-events. This is my own personal little “hack”. When I mentioned it to Erwin, he seemed to think that such a template tag function already exists. But I checked and double-checked and said function does not exist.
David Lewis
ParticipantNice. Good to see someone do some real theme work (not just colors).
Are you using bp-events? The latest trunk lists the directory view by date. Much better than by active. I also added a tiny function to bp-events-templatetags.php to display event dates in the directory. I imagine this will show up in the trunk eventually. Probably just an oversight not to have a site event start date function.
function bp_the_site_event_date_start() {
echo bp_get_the_site_event_date_start();
}
function bp_get_the_site_event_date_start() {
global $site_events_template;
return apply_filters('bp_get_the_site_event_date_start',
date(('l M j - Y'), $site_events_template->event->date_start));
}Of course, you could use whatever date format you like. I happen to like “l M j – Y”.
In your directory loop you’d just use this to display:
<?php bp_the_site_event_date_start() ?>November 10, 2009 at 6:57 pm #56389In reply to: How to display avatars in normal theme at 125px?
Sven Lehnert
Participant@ John James Jacoby,
I had a look in the bp-events-avatar.php to understand more what’s going on there.
I’m thinking the avatar part could be like it is now.
It would be enough, if the original resized image would be available.
I did some changes to the bp-events-avatar.php and make a plugin from it.
For the moment, I will use the modified functions in custom components until you offer a better way to do it. I think it would be really great if the original resized image would be saved by the core.
Be careful!
This Plugin is just a play around on a fun buddypress installation.
<?php
/*
Plugin Name:bp-events-avatar
Description: This plugin add a template tag bp_event_flyer() to display the event flyer
Version: 0.0.1
License: GPL
*/
function bp_event_flyer( $args = '' ) {
echo bp_get_event_flyer( $args );
}
function bp_get_event_flyer( $args = '' ) {
global $bp, $events_template;
$defaults = array(
'type' => 'org',
'width' => 'auto',
'height' => 'auto',
'class' => 'avatar',
'id' => false,
'alt' => __( 'Event avatar', 'bp-events' )
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
/* Fetch the avatar from the folder, if not provide backwards compat. */
if ( !$avatar = bp_event_fetch_avatar( array( 'item_id' => $events_template->event->id, 'object' => 'event', 'type' => $type, 'avatar_dir' => 'event-avatars', 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height ) ) )
$avatar = '<img src="' . attribute_escape( $events_template->event->avatar_thumb ) . '" class="avatar" alt="' . attribute_escape( $events_template->event->name ) . '" />';
return apply_filters( 'bp_get_event_flyer', $avatar );
}
/*
Based on contributions from: Beau Lebens - http://www.dentedreality.com.au/
Modified for BuddyPress by: Andy Peatling - http://apeatling.wordpress.com/
*/
/***
* Set up the constants we need for avatar support
*/
if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
define( 'BP_AVATAR_THUMB_WIDTH', 50 );
if ( !defined( 'BP_AVATAR_THUMB_HEIGHT' ) )
define( 'BP_AVATAR_THUMB_HEIGHT', 50 );
if ( !defined( 'BP_AVATAR_FULL_WIDTH' ) )
define( 'BP_AVATAR_FULL_WIDTH', 150 );
if ( !defined( 'BP_AVATAR_FULL_HEIGHT' ) )
define( 'BP_AVATAR_FULL_HEIGHT', 150 );
if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_WIDTH' ) )
define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) )
define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', get_site_option( 'fileupload_maxk' ) * 1024 );
if ( !defined( 'BP_AVATAR_DEFAULT' ) )
define( 'BP_AVATAR_DEFAULT', BP_PLUGIN_URL . '/bp-xprofile/images/none.gif' );
if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) )
define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . '/bp-xprofile/images/none-thumbnail.gif' );
function bp_event_fetch_avatar( $args = '' ) {
global $bp, $current_blog;
$defaults = array(
'item_id' => false,
'object' => 'user', // user OR group OR blog OR custom type (if you use filters)
'type' => 'thumb',
'avatar_dir' => false,
'width' => false,
'height' => false,
'class' => 'avatar',
'css_id' => false,
'alt' => __( 'Avatar Image', 'buddypress' ),
'no_grav' => false // If there is no avatar found, return false instead of a grav?
);
$params = wp_parse_args( $args, $defaults );
extract( $params, EXTR_SKIP );
if ( !$item_id ) {
if ( 'user' == $object )
$item_id = $bp->displayed_user->id;
else if ( 'group' == $object )
$item_id = $bp->groups->current_group->id;
else if ( 'blog' == $object )
$item_id = $current_blog->id;
$item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object );
if ( !$item_id ) return false;
}
if ( !$avatar_dir ) {
if ( 'user' == $object )
$avatar_dir = 'avatars';
else if ( 'group' == $object )
$avatar_dir = 'group-avatars';
else if ( 'blog' == $object )
$avatar_dir = 'blog-avatars';
$avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object );
if ( !$avatar_dir ) return false;
}
if ( !$css_id )
$css_id = $object . '-' . $item_id . '-avatar';
if ( $width )
$html_width = " width='{$width}'";
else
$html_width = ( 'thumb' == $type ) ? ' width="' . BP_AVATAR_THUMB_WIDTH . '"' : ' width="' . BP_AVATAR_FULL_WIDTH . '"';
if ( $height )
$html_height = " height='{$height}'";
else
$html_height = ( 'thumb' == $type ) ? ' height="' . BP_AVATAR_THUMB_HEIGHT . '"' : ' height="' . BP_AVATAR_FULL_HEIGHT . '"';
$avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', get_blog_option( BP_ROOT_BLOG, 'siteurl' ) . '/' . basename( WP_CONTENT_DIR ) . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
/* If no avatars have been uploaded for this item, display a gravatar */
if ( !file_exists( $avatar_folder_dir ) && !$no_grav ) {
if ( empty( $bp->grav_default->{$object} ) )
$default_grav = 'wavatar';
else if ( 'mystery' == $bp->grav_default->{$object} )
$default_grav = BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg';
else
$default_grav = $bp->grav_default->{$object};
if ( $width ) $grav_size = $width;
else if ( 'full' == $type ) $grav_size = BP_AVATAR_FULL_WIDTH;
else if ( 'thumb' == $type ) $grav_size = BP_AVATAR_THUMB_WIDTH;
if ( 'user' == $object ) {
$ud = get_userdata( $item_id );
$grav_email = $ud->user_email;
} else if ( 'group' == $object || 'blog' == $object ) {
$grav_email = "{$item_id}-{$object}@{$bp->root_domain}";
}
$grav_email = apply_filters( 'bp_core_gravatar_email', $grav_email, $item_id, $object );
$gravatar = apply_filters( 'bp_gravatar_url', 'https://secure.gravatar.com/avatar/' ) . md5( $grav_email ) . '?d=' . $default_grav . '&s=' . $grav_size;
return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params );
} else if ( !file_exists( $avatar_folder_dir ) && $no_grav )
return false;
/* Set the file names to search for to select the full size or thumbnail image. */
$avatar_name = ( 'org' == $type ) ? '-bporg' : '-bpthumb';
$avatar_name = ( 'full' == $type ) ? '-bpfull' : $avatar_name;
$legacy_user_avatar_name = ( 'full' == $type ) ? '-avatar2' : '-avatar1';
$legacy_group_avatar_name = ( 'full' == $type ) ? '-groupavatar-full' : '-groupavatar-thumb';
if ( $av_dir = opendir( $avatar_folder_dir ) ) {
while ( false !== ( $avatar_file = readdir($av_dir) ) ) {
if ( preg_match( "/{$avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_user_avatar_name}/", $avatar_file ) || preg_match( "/{$legacy_group_avatar_name}/", $avatar_file ) )
$avatar_url = $avatar_folder_url . '/' . $avatar_file;
}
}
closedir($av_dir);
return apply_filters( 'bp_core_fetch_avatar', "<img src='{$avatar_url}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params );
}
function bp_events_delete_existing_avatar( $args = '' ) {
global $bp;
$defaults = array(
'item_id' => false,
'object' => 'user', // user OR group OR blog OR custom type (if you use filters)
'avatar_dir' => false
);
$args = wp_parse_args( $args, $defaults );
extract( $args, EXTR_SKIP );
if ( !$item_id ) {
if ( 'user' == $object )
$item_id = $bp->displayed_user->id;
else if ( 'group' == $object )
$item_id = $bp->groups->current_group->id;
else if ( 'blog' == $object )
$item_id = $current_blog->id;
$item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object );
if ( !$item_id ) return false;
}
if ( !$avatar_dir ) {
if ( 'user' == $object )
$avatar_dir = 'avatars';
else if ( 'group' == $object )
$avatar_dir = 'group-avatars';
else if ( 'blog' == $object )
$avatar_dir = 'blog-avatars';
$avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object );
if ( !$avatar_dir ) return false;
}
if ( 'user' == $object ) {
/* Delete any legacy meta entries if this is a user avatar */
delete_usermeta( $item_id, 'bp_core_avatar_v1_path' );
delete_usermeta( $item_id, 'bp_core_avatar_v1' );
delete_usermeta( $item_id, 'bp_core_avatar_v2_path' );
delete_usermeta( $item_id, 'bp_core_avatar_v2' );
}
$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
if ( !file_exists( $avatar_folder_dir ) )
return false;
if ( $av_dir = opendir( $avatar_folder_dir ) ) {
while ( false !== ( $avatar_file = readdir($av_dir) ) ) {
if ( ( preg_match( "/-bpfull/", $avatar_file ) || preg_match( "/-bpthumb/", $avatar_file ) || preg_match( "/-bporg/", $avatar_file ) ) && '.' != $avatar_file && '..' != $avatar_file )
@unlink( $avatar_folder_dir . '/' . $avatar_file );
}
}
closedir($av_dir);
@rmdir( $avatar_folder_dir );
do_action( 'bp_core_delete_existing_avatar', $args );
return true;
}
function bp_events_avatar_handle_crop( $args = '' ) {
global $bp;
$defaults = array(
'object' => 'user',
'avatar_dir' => 'avatars',
'item_id' => false,
'original_file' => false,
'crop_w' => BP_AVATAR_FULL_WIDTH,
'crop_h' => BP_AVATAR_FULL_HEIGHT,
'crop_x' => 0,
'crop_y' => 0
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
if ( !$original_file )
return false;
if ( !file_exists( WP_CONTENT_DIR . '/' . $original_file ) )
return false;
if ( !$item_id )
$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . dirname( $original_file ), $item_id, $object, $avatar_dir );
else
$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
if ( !file_exists( $avatar_folder_dir ) )
return false;
require_once( ABSPATH . '/wp-admin/includes/image.php' );
require_once( ABSPATH . '/wp-admin/includes/file.php' );
/* Delete the existing avatar files for the object */
bp_core_delete_existing_avatar( array( 'object' => $object, 'avatar_path' => $avatar_folder_dir ) );
/* Make sure we at least have a width and height for cropping */
if ( !(int)$crop_w )
$crop_w = BP_AVATAR_FULL_WIDTH;
if ( !(int)$crop_h )
$crop_h = BP_AVATAR_FULL_HEIGHT;
/* Set the full and thumb filenames */
$full_filename = wp_hash( $original_file . time() ) . '-bpfull.jpg';
$thumb_filename = wp_hash( $original_file . time() ) . '-bpthumb.jpg';
$org_filename = wp_hash( $original_file . time() ) . '-bporg.jpg';
/* Crop the image */
$full_cropped = wp_crop_image( WP_CONTENT_DIR . $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, BP_AVATAR_FULL_WIDTH, BP_AVATAR_FULL_HEIGHT, false, $avatar_folder_dir . '/' . $full_filename );
$thumb_cropped = wp_crop_image( WP_CONTENT_DIR . $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, BP_AVATAR_THUMB_WIDTH, BP_AVATAR_THUMB_HEIGHT, false, $avatar_folder_dir . '/' . $thumb_filename );
rename (WP_CONTENT_DIR . $original_file, $avatar_folder_dir . '/' . $org_filename );
/* Remove the original */
@unlink( WP_CONTENT_DIR . $original_file );
return true;
}
?>September 24, 2009 at 7:53 am #52993In reply to: New Groupblog Plugin
Mariusooms
ParticipantAs promised…for now it means changing the code inside the plugin as follows:
* Find this function groupblog_screen_blog() in bp-events.php (somewhere towards the bottom)
* Uncomment that whole function.
* Replace it with the following function:
function groupblog_screen_blog() {
global $bp;
if ( $bp->current_component == $bp->groups->slug && 'blog' == $bp->current_action ) {
bp_core_load_template( apply_filters( 'groupblog_screen_blog', 'groupblog/blog' ) );
}
}
add_action( 'wp', 'groupblog_screen_blog', 4 );* Create a folder in your active theme directory named ‘groupblog’.
* Then create your template file (in this case ‘blog.php’) in the groupblog folder.
Send me a message if you run into problems

The basic difference is that in this function we use bp_core_load_template to load our template file and fire an add_action to register this function.
-
AuthorSearch Results