Limpieza
git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@16 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
@ -1,24 +0,0 @@
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<?php do_action( 'bp_before_404' ); ?>
|
||||
|
||||
<div class="post page-404 error404 not-found" id="post-0">
|
||||
<h2 class="post-title page-title"><?php _e( "Page not found", 'huddle' ); ?></h2>
|
||||
|
||||
<div class="post-content">
|
||||
<p><?php _e( "We're sorry, but we can't find the page that you're looking for.", 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_404' ); ?>
|
||||
</div><!--post-->
|
||||
|
||||
<?php do_action( 'bp_after_404' ) ?>
|
||||
|
||||
</div><!-- #main -->
|
||||
|
||||
<?php get_sidebar('page'); ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
@ -1,54 +0,0 @@
|
||||
|
||||
<?php do_action( 'bp_before_activity_loop' ); ?>
|
||||
|
||||
<?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) ) ) : ?>
|
||||
|
||||
<?php /* Show pagination if JS is not enabled, since the "Load More" link will do nothing */ ?>
|
||||
<noscript>
|
||||
<div class="pagination">
|
||||
<div class="pag-count"><?php bp_activity_pagination_count(); ?></div>
|
||||
<div class="pagination-links"><?php bp_activity_pagination_links(); ?></div>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<?php if ( empty( $_POST['page'] ) ) : ?>
|
||||
|
||||
<ul id="activity-stream" class="activity-list">
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php while ( bp_activities() ) : bp_the_activity(); ?>
|
||||
|
||||
<?php locate_template( array( 'activity/entry.php' ), true, false ); ?>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php if ( bp_activity_has_more_items() ) : ?>
|
||||
|
||||
<li class="load-more">
|
||||
<a href="#more" class="btn-gray"><?php _e( 'Load More', 'huddle' ); ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( empty( $_POST['page'] ) ) : ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_activity_loop' ); ?>
|
||||
|
||||
<form action="" name="activity-loop-form" id="activity-loop-form" method="post">
|
||||
|
||||
<?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ); ?>
|
||||
|
||||
</form>
|
||||
@ -1,41 +0,0 @@
|
||||
|
||||
<?php do_action( 'bp_before_activity_comment' ); ?>
|
||||
|
||||
<li id="acomment-<?php bp_activity_comment_id(); ?>">
|
||||
<div class="acomment-avatar">
|
||||
<a href="<?php bp_activity_comment_user_link(); ?>">
|
||||
<?php bp_activity_avatar( 'type=thumb&user_id=' . bp_get_activity_comment_user_id() ); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="acomment-meta">
|
||||
<?php
|
||||
/* translators: 1: user profile link, 2: user name, 3: activity permalink, 4: activity timestamp */
|
||||
printf( __( '<a href="%1$s">%2$s</a> replied <a href="%3$s" class="activity-time-since"><span class="time-since">%4$s</span></a>', 'huddle' ), bp_get_activity_comment_user_link(), bp_get_activity_comment_name(), bp_get_activity_thread_permalink(), bp_get_activity_comment_date_recorded() );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="acomment-content"><?php bp_activity_comment_content(); ?></div>
|
||||
|
||||
<div class="acomment-options">
|
||||
|
||||
<?php if ( is_user_logged_in() && bp_activity_can_comment_reply( bp_activity_current_comment() ) ) : ?>
|
||||
|
||||
<a href="#acomment-<?php bp_activity_comment_id(); ?>" class="acomment-reply bp-primary-action" id="acomment-reply-<?php bp_activity_id() ?>-from-<?php bp_activity_comment_id() ?>"><?php _e( 'Reply', 'huddle' ); ?></a>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( bp_activity_user_can_delete() ) : ?>
|
||||
|
||||
<a href="<?php bp_activity_comment_delete_link(); ?>" class="delete acomment-delete confirm bp-secondary-action" rel="nofollow"><?php _e( 'Delete', 'huddle' ); ?></a>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_activity_comment_options' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php bp_activity_recurse_comments( bp_activity_current_comment() ); ?>
|
||||
</li>
|
||||
|
||||
<?php do_action( 'bp_after_activity_comment' ); ?>
|
||||
@ -1,111 +0,0 @@
|
||||
|
||||
<?php do_action( 'bp_before_activity_entry' ); ?>
|
||||
|
||||
<li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>">
|
||||
<div class="activity-avatar">
|
||||
<a href="<?php bp_activity_user_link(); ?>">
|
||||
|
||||
<?php bp_activity_avatar( 'width=35&height=35' ); ?>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="activity-content">
|
||||
|
||||
<div class="activity-header">
|
||||
|
||||
<?php bp_activity_action(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>
|
||||
|
||||
<div class="activity-inreplyto">
|
||||
<strong><?php _e( 'In reply to: ', 'huddle' ); ?></strong><?php bp_activity_parent_content(); ?> <a href="<?php bp_activity_thread_permalink(); ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'huddle' ); ?>"><?php _e( 'View', 'huddle' ); ?></a>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( bp_activity_has_content() ) : ?>
|
||||
|
||||
<div class="activity-inner">
|
||||
|
||||
<?php bp_activity_content_body(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_activity_entry_content' ); ?>
|
||||
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
|
||||
<div class="activity-meta">
|
||||
|
||||
<?php if ( bp_activity_can_comment() ) : ?>
|
||||
|
||||
<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>', 'huddle' ), bp_activity_get_comment_count() ); ?></a>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( bp_activity_can_favorite() ) : ?>
|
||||
|
||||
<?php if ( !bp_get_activity_is_favorite() ) : ?>
|
||||
|
||||
<a href="<?php bp_activity_favorite_link(); ?>" class="button fav bp-secondary-action" title="<?php esc_attr_e( 'Mark as Favorite', 'huddle' ); ?>"><?php _e( 'Favorite', 'huddle' ) ?></a>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<a href="<?php bp_activity_unfavorite_link(); ?>" class="button unfav bp-secondary-action" title="<?php esc_attr_e( 'Remove Favorite', 'huddle' ); ?>"><?php _e( 'Remove Favorite', 'huddle' ) ?></a>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>
|
||||
|
||||
<?php do_action( 'bp_activity_entry_meta' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_before_activity_entry_comments' ); ?>
|
||||
|
||||
<?php if ( ( is_user_logged_in() && bp_activity_can_comment() ) || bp_activity_get_comment_count() ) : ?>
|
||||
|
||||
<div class="activity-comments">
|
||||
|
||||
<?php bp_activity_comments(); ?>
|
||||
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
|
||||
<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(); ?>>
|
||||
<div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div>
|
||||
<div class="ac-reply-content">
|
||||
<div class="ac-textarea">
|
||||
<textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
|
||||
</div>
|
||||
<input type="submit" class="btn-gray" name="ac_form_submit" value="<?php _e( 'Post', 'huddle' ); ?>" /> <?php _e( 'or press esc to cancel.', 'huddle' ); ?>
|
||||
<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_activity_entry_comments' ); ?>
|
||||
|
||||
<?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_activity_entry_comments' ); ?>
|
||||
|
||||
</li>
|
||||
|
||||
<?php do_action( 'bp_after_activity_entry' ); ?>
|
||||
@ -1,143 +0,0 @@
|
||||
|
||||
<?php get_header( 'buddypress' ); ?>
|
||||
|
||||
<?php do_action( 'bp_before_directory_activity_page' ); ?>
|
||||
|
||||
<div id="content">
|
||||
<div class="padder">
|
||||
|
||||
<?php do_action( 'bp_before_directory_activity' ); ?>
|
||||
|
||||
<form action="" method="post" id="groups-directory-form" class="dir-form">
|
||||
|
||||
<h3><?php _e( 'Site Activity', 'huddle' ); ?></h3>
|
||||
|
||||
</form>
|
||||
|
||||
<?php do_action( 'bp_before_directory_activity_content' ); ?>
|
||||
|
||||
<?php do_action( 'template_notices' ); ?>
|
||||
|
||||
<div class="item-list-tabs activity-type-tabs" role="navigation">
|
||||
<ul>
|
||||
<?php do_action( 'bp_before_activity_type_tab_all' ); ?>
|
||||
|
||||
<li class="selected" id="activity-all"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/'; ?>" title="<?php _e( 'The public activity for everyone on this site.', 'huddle' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'huddle' ), bp_get_total_site_member_count() ); ?></a></li>
|
||||
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_activity_type_tab_friends' ) ?>
|
||||
|
||||
<?php if ( bp_is_active( 'friends' ) ) : ?>
|
||||
|
||||
<?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
|
||||
|
||||
<li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/'; ?>" title="<?php _e( 'The activity of my friends only.', 'huddle' ); ?>"><?php printf( __( 'My Friends <span>%s</span>', 'huddle' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_before_activity_type_tab_groups' ) ?>
|
||||
|
||||
<?php if ( bp_is_active( 'groups' ) ) : ?>
|
||||
|
||||
<?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
|
||||
|
||||
<li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/'; ?>" title="<?php _e( 'The activity of groups I am a member of.', 'huddle' ); ?>"><?php printf( __( 'My Groups <span>%s</span>', 'huddle' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_before_activity_type_tab_favorites' ); ?>
|
||||
|
||||
<?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?>
|
||||
|
||||
<li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/'; ?>" title="<?php _e( "The activity I've marked as a favorite.", 'huddle' ); ?>"><?php printf( __( 'My Favorites <span>%s</span>', 'huddle' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_activity_type_tabs' ); ?>
|
||||
</ul>
|
||||
</div><!-- .item-list-tabs -->
|
||||
|
||||
<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
|
||||
<ul>
|
||||
<li class="feed"><a href="<?php bp_sitewide_activity_feed_link() ?>" title="<?php _e( 'RSS Feed', 'huddle' ); ?>"><?php _e( 'RSS', 'huddle' ); ?></a></li>
|
||||
|
||||
<?php do_action( 'bp_activity_syndication_options' ); ?>
|
||||
|
||||
<li id="activity-filter-select" class="last">
|
||||
<label for="activity-filter-by"><?php _e( 'Show:', 'huddle' ); ?></label>
|
||||
<select id="activity-filter-by">
|
||||
<option value="-1"><?php _e( 'Everything', 'huddle' ); ?></option>
|
||||
<option value="activity_update"><?php _e( 'Updates', 'huddle' ); ?></option>
|
||||
|
||||
<?php if ( bp_is_active( 'blogs' ) ) : ?>
|
||||
|
||||
<option value="new_blog_post"><?php _e( 'Posts', 'huddle' ); ?></option>
|
||||
<option value="new_blog_comment"><?php _e( 'Comments', 'huddle' ); ?></option>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( bp_is_active( 'forums' ) ) : ?>
|
||||
|
||||
<option value="new_forum_topic"><?php _e( 'Forum Topics', 'huddle' ); ?></option>
|
||||
<option value="new_forum_post"><?php _e( 'Forum Replies', 'huddle' ); ?></option>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( bp_is_active( 'groups' ) ) : ?>
|
||||
|
||||
<option value="created_group"><?php _e( 'New Groups', 'huddle' ); ?></option>
|
||||
<option value="joined_group"><?php _e( 'Group Memberships', 'huddle' ); ?></option>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( bp_is_active( 'friends' ) ) : ?>
|
||||
|
||||
<option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'huddle' ); ?></option>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<option value="new_member"><?php _e( 'New Members', 'huddle' ); ?></option>
|
||||
|
||||
<?php do_action( 'bp_activity_filter_options' ); ?>
|
||||
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
</div><!-- .item-list-tabs -->
|
||||
|
||||
<?php do_action( 'bp_before_directory_activity_list' ); ?>
|
||||
|
||||
<div class="activity" role="main">
|
||||
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
|
||||
<?php locate_template( array( 'activity/post-form.php'), true ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php locate_template( array( 'activity/activity-loop.php' ), true ); ?>
|
||||
|
||||
</div><!-- .activity -->
|
||||
|
||||
<?php do_action( 'bp_after_directory_activity_list' ); ?>
|
||||
|
||||
<?php do_action( 'bp_directory_activity_content' ); ?>
|
||||
|
||||
<?php do_action( 'bp_after_directory_activity_content' ); ?>
|
||||
|
||||
<?php do_action( 'bp_after_directory_activity' ); ?>
|
||||
|
||||
</div><!-- .padder -->
|
||||
</div><!-- #content -->
|
||||
|
||||
<?php do_action( 'bp_after_directory_activity_page' ); ?>
|
||||
|
||||
<?php get_sidebar( 'buddypress' ); ?>
|
||||
<?php get_footer( 'buddypress' ); ?>
|
||||
@ -1,62 +0,0 @@
|
||||
|
||||
<form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form" role="complementary">
|
||||
|
||||
<?php do_action( 'bp_before_activity_post_form' ); ?>
|
||||
|
||||
<div id="whats-new-avatar">
|
||||
<a href="<?php echo bp_loggedin_user_domain(); ?>">
|
||||
<?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<h5><?php if ( bp_is_group() )
|
||||
printf( __( "What's new in %s, %s?", 'huddle' ), bp_get_group_name(), bp_get_user_firstname() );
|
||||
else
|
||||
printf( __( "What's new, %s?", 'huddle' ), bp_get_user_firstname() );
|
||||
?></h5>
|
||||
|
||||
<div id="whats-new-content">
|
||||
<div id="whats-new-textarea">
|
||||
<textarea name="whats-new" id="whats-new" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_attr( $_GET['r'] ); ?> <?php endif; ?></textarea>
|
||||
</div>
|
||||
|
||||
<div id="whats-new-options">
|
||||
<div id="whats-new-submit">
|
||||
<input type="submit" class="btn-gray" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php _e( 'Post Update', 'huddle' ); ?>" />
|
||||
|
||||
<?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>
|
||||
|
||||
<?php _e( 'Post in', 'huddle' ) ?>:
|
||||
|
||||
<select id="whats-new-post-in" name="whats-new-post-in">
|
||||
<option selected="selected" value="0"><?php _e( 'My Profile', 'huddle' ); ?></option>
|
||||
|
||||
<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) :
|
||||
while ( bp_groups() ) : bp_the_group(); ?>
|
||||
|
||||
<option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
|
||||
|
||||
<?php endwhile;
|
||||
endif; ?>
|
||||
|
||||
</select>
|
||||
<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
|
||||
|
||||
<?php elseif ( bp_is_group_home() ) : ?>
|
||||
|
||||
<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
|
||||
<input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_activity_post_form_options' ); ?>
|
||||
|
||||
</div><!-- #whats-new-options -->
|
||||
</div><!-- #whats-new-content -->
|
||||
|
||||
<?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
|
||||
<?php do_action( 'bp_after_activity_post_form' ); ?>
|
||||
|
||||
</form><!-- #whats-new-form -->
|
||||
@ -1,222 +0,0 @@
|
||||
/*-------------------------------------------------------------------------------------------*/
|
||||
/* OptionsFramework Admin Styles */
|
||||
/*-------------------------------------------------------------------------------------------*/
|
||||
|
||||
.updated {
|
||||
max-width:764px;
|
||||
margin-bottom:0px !important;
|
||||
}
|
||||
#optionsframework {
|
||||
position:relative;
|
||||
z-index: 0;
|
||||
max-width:780px;
|
||||
background:#fff;
|
||||
}
|
||||
#optionsframework p {
|
||||
margin-bottom:0;
|
||||
padding-bottom:10px;
|
||||
}
|
||||
#optionsframework .section {
|
||||
padding:10px 10px 0;
|
||||
}
|
||||
#optionsframework .group {
|
||||
padding-bottom:40px;
|
||||
}
|
||||
#optionsframework .section .heading {
|
||||
padding:10px 0px;
|
||||
margin:0 0 15px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
}
|
||||
#optionsframework .section .controls {
|
||||
float: left;
|
||||
min-width:350px;
|
||||
width: 54%;
|
||||
padding-right:2%;
|
||||
}
|
||||
#optionsframework .section .explain {
|
||||
max-width:38%;
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
line-height:16px;
|
||||
color: #777;
|
||||
}
|
||||
#optionsframework .section-checkbox .controls {
|
||||
width: 98%;
|
||||
}
|
||||
#optionsframework .section-checkbox .explain {
|
||||
max-width:94%;
|
||||
}
|
||||
#optionsframework .section-color .controls {
|
||||
min-width:125px;
|
||||
width:125px
|
||||
}
|
||||
#optionsframework .controls input, #optionsframework .controls select, #optionsframework .controls textarea {
|
||||
margin-bottom:10px;
|
||||
width:100%;
|
||||
}
|
||||
#optionsframework .section-radio label, #optionsframework .section-multicheck label {
|
||||
float:left;
|
||||
max-width:90%;
|
||||
line-height: 16px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#optionsframework input.checkbox, #optionsframework input.of-radio {
|
||||
width: 30px;
|
||||
float:left;
|
||||
clear:both;
|
||||
}
|
||||
#optionsframework .controls .of-color {
|
||||
float:left;
|
||||
width: 80px;
|
||||
margin-left:5px;
|
||||
margin-right:5px;
|
||||
}
|
||||
#optionsframework .controls .of-typography-size {
|
||||
width:80px;
|
||||
margin-left:5px;
|
||||
float:left
|
||||
}
|
||||
#optionsframework .controls .of-typography-unit {
|
||||
width:50px;
|
||||
margin-left:5px;
|
||||
float:left
|
||||
}
|
||||
#optionsframework .controls .of-typography-face {
|
||||
width:100px;
|
||||
margin-left:5px;
|
||||
float:left
|
||||
}
|
||||
#optionsframework .controls .of-typography-style {
|
||||
width:80px;
|
||||
margin-left:5px;
|
||||
margin-right:5px;
|
||||
float:left
|
||||
}
|
||||
#optionsframework .of-background-properties {
|
||||
clear:both;
|
||||
margin-top: 18px;
|
||||
}
|
||||
#optionsframework .controls .of-background-repeat {
|
||||
width:125px;
|
||||
margin-right:5px;
|
||||
float:left
|
||||
}
|
||||
#optionsframework .controls .of-background-position {
|
||||
width:125px;
|
||||
margin-right:5px;
|
||||
float:left
|
||||
}
|
||||
#optionsframework .controls .of-background-attachment {
|
||||
width:125px;
|
||||
margin-right:5px;
|
||||
float:left
|
||||
}
|
||||
#optionsframework div.section-background .controls input.upload {
|
||||
width:47%;
|
||||
}
|
||||
#optionsframework .controls .of-radio-img-img {
|
||||
border:3px solid #f9f9f9;
|
||||
margin:0 5px 10px 0;
|
||||
display:none;
|
||||
cursor:pointer;
|
||||
float:left;
|
||||
}
|
||||
#optionsframework .controls .of-radio-img-selected {
|
||||
border:3px solid #ccc
|
||||
}
|
||||
#optionsframework .controls .of-radio-img-img:hover {
|
||||
opacity:.8;
|
||||
}
|
||||
#optionsframework .controls .of-border-width {
|
||||
width:80px;
|
||||
float:left
|
||||
}
|
||||
#optionsframework .controls .of-border-style {
|
||||
width:120px;
|
||||
float:left
|
||||
}
|
||||
#optionsframework .hide {
|
||||
display:none;
|
||||
}
|
||||
#optionsframework .of-option-image {
|
||||
max-width:340px;
|
||||
margin:3px 0 18px 0;
|
||||
}
|
||||
#optionsframework .mini .controls select, #optionsframework .section .mini .controls {
|
||||
width: 140px;
|
||||
}
|
||||
#optionsframework .mini .controls input, #optionsframework .mini .controls {
|
||||
min-width:140px;
|
||||
width: 140px;
|
||||
}
|
||||
#optionsframework .mini .explain {
|
||||
max-width:74%;
|
||||
}
|
||||
/* Image Uploader */
|
||||
|
||||
#optionsframework .controls input.upload {
|
||||
width:80%;
|
||||
}
|
||||
#optionsframework .controls input.upload_button {
|
||||
float:right;
|
||||
width:45px;
|
||||
border-color:#BBBBBB;
|
||||
cursor:pointer;
|
||||
height:16px;
|
||||
}
|
||||
#optionsframework .controls input.upload_button:hover {
|
||||
border-color:#666666;
|
||||
color:#000;
|
||||
}
|
||||
#optionsframework .screenshot {
|
||||
float:left;
|
||||
margin-left:1px;
|
||||
position:relative;
|
||||
width:344px;
|
||||
margin-top:3px;
|
||||
}
|
||||
#optionsframework .screenshot img {
|
||||
background:#FAFAFA;
|
||||
border-color:#ccc #eee #eee #ccc;
|
||||
border-style:solid;
|
||||
border-width:1px;
|
||||
float:left;
|
||||
max-width:334px;
|
||||
padding:4px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
#optionsframework .screenshot .mlu_remove {
|
||||
background:url("../images/ico-delete.png") no-repeat;
|
||||
border:medium none;
|
||||
bottom:4px;
|
||||
display:block;
|
||||
float:left;
|
||||
height:16px;
|
||||
padding:0;
|
||||
position:absolute;
|
||||
left:-4px;
|
||||
text-indent:-9999px;
|
||||
width:16px;
|
||||
}
|
||||
#optionsframework .screenshot .no_image .file_link {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#optionsframework .screenshot .no_image .mlu_remove {
|
||||
bottom: 0px;
|
||||
}
|
||||
#optionsframework .reset-button {
|
||||
float:left;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
/* Bottom Section */
|
||||
|
||||
#optionsframework-submit {
|
||||
padding: 7px 10px;
|
||||
border-top: 1px solid #ECECEC;
|
||||
background-color: #F1F1F1;
|
||||
background-image: -moz-linear-gradient(center top , #F9F9F9, #ECECEC);
|
||||
}
|
||||
#optionsframework .button-primary {
|
||||
float:right;
|
||||
}
|
||||
@ -1,177 +0,0 @@
|
||||
.colorpicker {
|
||||
width: 356px;
|
||||
height: 176px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
background: url(../images/colorpicker/colorpicker_background.png);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
display: none;
|
||||
}
|
||||
.colorpicker_color {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
left: 14px;
|
||||
top: 13px;
|
||||
position: absolute;
|
||||
background: #f00;
|
||||
overflow: hidden;
|
||||
cursor: crosshair;
|
||||
}
|
||||
.colorpicker_color div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
background: url(../images/colorpicker/colorpicker_overlay.png);
|
||||
}
|
||||
.colorpicker_color div div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
overflow: hidden;
|
||||
background: url(../images/colorpicker/colorpicker_select.gif);
|
||||
margin: -5px 0 0 -5px;
|
||||
}
|
||||
.colorpicker_hue {
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
left: 171px;
|
||||
width: 35px;
|
||||
height: 150px;
|
||||
cursor: n-resize;
|
||||
}
|
||||
.colorpicker_hue div {
|
||||
position: absolute;
|
||||
width: 35px;
|
||||
height: 9px;
|
||||
overflow: hidden;
|
||||
background: url(../images/colorpicker/colorpicker_indic.gif) left top;
|
||||
margin: -4px 0 0 0;
|
||||
left: 0px;
|
||||
}
|
||||
.colorpicker_new_color {
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
left: 213px;
|
||||
top: 13px;
|
||||
background: #f00;
|
||||
}
|
||||
.colorpicker_current_color {
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
left: 283px;
|
||||
top: 13px;
|
||||
background: #f00;
|
||||
}
|
||||
.colorpicker input {
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
position: absolute;
|
||||
font-size: 10px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: #898989;
|
||||
top: 4px;
|
||||
right: 11px;
|
||||
text-align: right;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 12px;
|
||||
}
|
||||
.colorpicker_hex {
|
||||
position: absolute;
|
||||
width: 72px;
|
||||
height: 22px;
|
||||
background: url(../images/colorpicker/colorpicker_hex.png) top;
|
||||
left: 212px;
|
||||
top: 142px;
|
||||
}
|
||||
.colorpicker_hex input {
|
||||
right: 6px;
|
||||
}
|
||||
.colorpicker_field {
|
||||
height: 22px;
|
||||
width: 62px;
|
||||
background-position: top;
|
||||
position: absolute;
|
||||
}
|
||||
.colorpicker_field span {
|
||||
position: absolute;
|
||||
width: 12px;
|
||||
height: 22px;
|
||||
overflow: hidden;
|
||||
top: 0;
|
||||
right: 0;
|
||||
cursor: n-resize;
|
||||
}
|
||||
.colorpicker_rgb_r {
|
||||
background-image: url(../images/colorpicker/colorpicker_rgb_r.png);
|
||||
top: 52px;
|
||||
left: 212px;
|
||||
}
|
||||
.colorpicker_rgb_g {
|
||||
background-image: url(../images/colorpicker/colorpicker_rgb_g.png);
|
||||
top: 82px;
|
||||
left: 212px;
|
||||
}
|
||||
.colorpicker_rgb_b {
|
||||
background-image: url(../images/colorpicker/colorpicker_rgb_b.png);
|
||||
top: 112px;
|
||||
left: 212px;
|
||||
}
|
||||
.colorpicker_hsb_h {
|
||||
background-image: url(../images/colorpicker/colorpicker_hsb_h.png);
|
||||
top: 52px;
|
||||
left: 282px;
|
||||
}
|
||||
.colorpicker_hsb_s {
|
||||
background-image: url(../images/colorpicker/colorpicker_hsb_s.png);
|
||||
top: 82px;
|
||||
left: 282px;
|
||||
}
|
||||
.colorpicker_hsb_b {
|
||||
background-image: url(../images/colorpicker/colorpicker_hsb_b.png);
|
||||
top: 112px;
|
||||
left: 282px;
|
||||
}
|
||||
.colorpicker_submit {
|
||||
position: absolute;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
background: url(../images/colorpicker/colorpicker_submit.png) top;
|
||||
left: 322px;
|
||||
top: 142px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.colorpicker_focus {
|
||||
background-position: center;
|
||||
}
|
||||
.colorpicker_hex.colorpicker_focus {
|
||||
background-position: bottom;
|
||||
}
|
||||
.colorpicker_submit.colorpicker_focus {
|
||||
background-position: bottom;
|
||||
}
|
||||
.colorpicker_slider {
|
||||
background-position: bottom;
|
||||
}
|
||||
|
||||
.colorSelector {
|
||||
position: relative;
|
||||
width: 27px;
|
||||
height: 27px;
|
||||
background: url(../images/colorpicker/select.png);
|
||||
float:left;
|
||||
}
|
||||
.colorSelector div {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 3px;
|
||||
width: 21px;
|
||||
height: 19px;
|
||||
background: url(../images/colorpicker/select.png) center;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 45 B |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 532 B |
|
Before Width: | Height: | Size: 970 B |
|
Before Width: | Height: | Size: 1012 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 86 B |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 970 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 78 B |
|
Before Width: | Height: | Size: 984 B |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 715 B |
@ -1,455 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* Color picker
|
||||
* Author: Stefan Petre www.eyecon.ro
|
||||
*
|
||||
* Dependencies: jQuery
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
var ColorPicker = function () {
|
||||
var
|
||||
ids = {},
|
||||
inAction,
|
||||
charMin = 65,
|
||||
visible,
|
||||
tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
|
||||
defaults = {
|
||||
eventName: 'click',
|
||||
onShow: function () {},
|
||||
onBeforeShow: function(){},
|
||||
onHide: function () {},
|
||||
onChange: function () {},
|
||||
onSubmit: function () {},
|
||||
color: 'ff0000',
|
||||
livePreview: true,
|
||||
flat: false
|
||||
},
|
||||
fillRGBFields = function (hsb, cal) {
|
||||
var rgb = HSBToRGB(hsb);
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(1).val(rgb.r).end()
|
||||
.eq(2).val(rgb.g).end()
|
||||
.eq(3).val(rgb.b).end();
|
||||
},
|
||||
fillHSBFields = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(4).val(hsb.h).end()
|
||||
.eq(5).val(hsb.s).end()
|
||||
.eq(6).val(hsb.b).end();
|
||||
},
|
||||
fillHexFields = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(0).val(HSBToHex(hsb)).end();
|
||||
},
|
||||
setSelector = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
|
||||
$(cal).data('colorpicker').selectorIndic.css({
|
||||
left: parseInt(150 * hsb.s/100, 10),
|
||||
top: parseInt(150 * (100-hsb.b)/100, 10)
|
||||
});
|
||||
},
|
||||
setHue = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
|
||||
},
|
||||
setCurrentColor = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
||||
},
|
||||
setNewColor = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
||||
},
|
||||
keyDown = function (ev) {
|
||||
var pressedKey = ev.charCode || ev.keyCode || -1;
|
||||
if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
|
||||
return false;
|
||||
}
|
||||
var cal = $(this).parent().parent();
|
||||
if (cal.data('colorpicker').livePreview === true) {
|
||||
change.apply(this);
|
||||
}
|
||||
},
|
||||
change = function (ev) {
|
||||
var cal = $(this).parent().parent(), col;
|
||||
if (this.parentNode.className.indexOf('_hex') > 0) {
|
||||
cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
|
||||
} else if (this.parentNode.className.indexOf('_hsb') > 0) {
|
||||
cal.data('colorpicker').color = col = fixHSB({
|
||||
h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
|
||||
s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
|
||||
b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
|
||||
});
|
||||
} else {
|
||||
cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
|
||||
r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
|
||||
g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
|
||||
b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
|
||||
}));
|
||||
}
|
||||
if (ev) {
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
}
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
|
||||
},
|
||||
blur = function (ev) {
|
||||
var cal = $(this).parent().parent();
|
||||
cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus')
|
||||
},
|
||||
focus = function () {
|
||||
charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
|
||||
$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
||||
$(this).parent().addClass('colorpicker_focus');
|
||||
},
|
||||
downIncrement = function (ev) {
|
||||
var field = $(this).parent().find('input').focus();
|
||||
var current = {
|
||||
el: $(this).parent().addClass('colorpicker_slider'),
|
||||
max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
|
||||
y: ev.pageY,
|
||||
field: field,
|
||||
val: parseInt(field.val(), 10),
|
||||
preview: $(this).parent().parent().data('colorpicker').livePreview
|
||||
};
|
||||
$(document).bind('mouseup', current, upIncrement);
|
||||
$(document).bind('mousemove', current, moveIncrement);
|
||||
},
|
||||
moveIncrement = function (ev) {
|
||||
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
|
||||
if (ev.data.preview) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
upIncrement = function (ev) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
ev.data.el.removeClass('colorpicker_slider').find('input').focus();
|
||||
$(document).unbind('mouseup', upIncrement);
|
||||
$(document).unbind('mousemove', moveIncrement);
|
||||
return false;
|
||||
},
|
||||
downHue = function (ev) {
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
y: $(this).offset().top
|
||||
};
|
||||
current.preview = current.cal.data('colorpicker').livePreview;
|
||||
$(document).bind('mouseup', current, upHue);
|
||||
$(document).bind('mousemove', current, moveHue);
|
||||
},
|
||||
moveHue = function (ev) {
|
||||
change.apply(
|
||||
ev.data.cal.data('colorpicker')
|
||||
.fields
|
||||
.eq(4)
|
||||
.val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upHue = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
$(document).unbind('mouseup', upHue);
|
||||
$(document).unbind('mousemove', moveHue);
|
||||
return false;
|
||||
},
|
||||
downSelector = function (ev) {
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
pos: $(this).offset()
|
||||
};
|
||||
current.preview = current.cal.data('colorpicker').livePreview;
|
||||
$(document).bind('mouseup', current, upSelector);
|
||||
$(document).bind('mousemove', current, moveSelector);
|
||||
},
|
||||
moveSelector = function (ev) {
|
||||
change.apply(
|
||||
ev.data.cal.data('colorpicker')
|
||||
.fields
|
||||
.eq(6)
|
||||
.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
|
||||
.end()
|
||||
.eq(5)
|
||||
.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upSelector = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
$(document).unbind('mouseup', upSelector);
|
||||
$(document).unbind('mousemove', moveSelector);
|
||||
return false;
|
||||
},
|
||||
enterSubmit = function (ev) {
|
||||
$(this).addClass('colorpicker_focus');
|
||||
},
|
||||
leaveSubmit = function (ev) {
|
||||
$(this).removeClass('colorpicker_focus');
|
||||
},
|
||||
clickSubmit = function (ev) {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colorpicker').color;
|
||||
cal.data('colorpicker').origColor = col;
|
||||
setCurrentColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col));
|
||||
cal.hide();
|
||||
},
|
||||
show = function (ev) {
|
||||
var cal = $('#' + $(this).data('colorpickerId'));
|
||||
cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
|
||||
var pos = $(this).offset();
|
||||
var viewPort = getViewport();
|
||||
var top = pos.top + this.offsetHeight;
|
||||
var left = pos.left;
|
||||
if (top + 176 > viewPort.t + viewPort.h) {
|
||||
top -= this.offsetHeight + 176;
|
||||
} else {
|
||||
top += 5;
|
||||
}
|
||||
if (left + 356 > viewPort.l + viewPort.w) {
|
||||
left -= 356;
|
||||
}
|
||||
cal.css({left: left + 'px', top: top + 'px'});
|
||||
if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
|
||||
cal.show();
|
||||
}
|
||||
$(document).bind('mousedown', {cal: cal}, hide);
|
||||
return false;
|
||||
},
|
||||
hide = function (ev) {
|
||||
if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
|
||||
if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
|
||||
ev.data.cal.hide();
|
||||
}
|
||||
$(document).unbind('mousedown', hide);
|
||||
}
|
||||
},
|
||||
isChildOf = function(parentEl, el, container) {
|
||||
if (parentEl == el) {
|
||||
return true;
|
||||
}
|
||||
if (parentEl.contains) {
|
||||
return parentEl.contains(el);
|
||||
}
|
||||
if ( parentEl.compareDocumentPosition ) {
|
||||
return !!(parentEl.compareDocumentPosition(el) & 16);
|
||||
}
|
||||
var prEl = el.parentNode;
|
||||
while(prEl && prEl != container) {
|
||||
if (prEl == parentEl)
|
||||
return true;
|
||||
prEl = prEl.parentNode;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getViewport = function () {
|
||||
var m = document.compatMode == 'CSS1Compat';
|
||||
return {
|
||||
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
|
||||
t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
|
||||
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
|
||||
h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
|
||||
};
|
||||
},
|
||||
fixHSB = function (hsb) {
|
||||
return {
|
||||
h: Math.min(360, Math.max(0, hsb.h)),
|
||||
s: Math.min(100, Math.max(0, hsb.s)),
|
||||
b: Math.min(100, Math.max(0, hsb.b))
|
||||
};
|
||||
},
|
||||
fixRGB = function (rgb) {
|
||||
return {
|
||||
r: Math.min(255, Math.max(0, rgb.r)),
|
||||
g: Math.min(255, Math.max(0, rgb.g)),
|
||||
b: Math.min(255, Math.max(0, rgb.b))
|
||||
};
|
||||
},
|
||||
fixHex = function (hex) {
|
||||
var len = 6 - hex.length;
|
||||
if (len > 0) {
|
||||
var o = [];
|
||||
for (var i=0; i<len; i++) {
|
||||
o.push('0');
|
||||
}
|
||||
o.push(hex);
|
||||
hex = o.join('');
|
||||
}
|
||||
return hex;
|
||||
},
|
||||
HexToRGB = function (hex) {
|
||||
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
||||
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
||||
},
|
||||
HexToHSB = function (hex) {
|
||||
return RGBToHSB(HexToRGB(hex));
|
||||
},
|
||||
RGBToHSB = function (rgb) {
|
||||
var hsb = {};
|
||||
hsb.b = Math.max(Math.max(rgb.r,rgb.g),rgb.b);
|
||||
hsb.s = (hsb.b <= 0) ? 0 : Math.round(100*(hsb.b - Math.min(Math.min(rgb.r,rgb.g),rgb.b))/hsb.b);
|
||||
hsb.b = Math.round((hsb.b /255)*100);
|
||||
if((rgb.r==rgb.g) && (rgb.g==rgb.b)) hsb.h = 0;
|
||||
else if(rgb.r>=rgb.g && rgb.g>=rgb.b) hsb.h = 60*(rgb.g-rgb.b)/(rgb.r-rgb.b);
|
||||
else if(rgb.g>=rgb.r && rgb.r>=rgb.b) hsb.h = 60 + 60*(rgb.g-rgb.r)/(rgb.g-rgb.b);
|
||||
else if(rgb.g>=rgb.b && rgb.b>=rgb.r) hsb.h = 120 + 60*(rgb.b-rgb.r)/(rgb.g-rgb.r);
|
||||
else if(rgb.b>=rgb.g && rgb.g>=rgb.r) hsb.h = 180 + 60*(rgb.b-rgb.g)/(rgb.b-rgb.r);
|
||||
else if(rgb.b>=rgb.r && rgb.r>=rgb.g) hsb.h = 240 + 60*(rgb.r-rgb.g)/(rgb.b-rgb.g);
|
||||
else if(rgb.r>=rgb.b && rgb.b>=rgb.g) hsb.h = 300 + 60*(rgb.r-rgb.b)/(rgb.r-rgb.g);
|
||||
else hsb.h = 0;
|
||||
hsb.h = Math.round(hsb.h);
|
||||
return hsb;
|
||||
},
|
||||
HSBToRGB = function (hsb) {
|
||||
var rgb = {};
|
||||
var h = Math.round(hsb.h);
|
||||
var s = Math.round(hsb.s*255/100);
|
||||
var v = Math.round(hsb.b*255/100);
|
||||
if(s == 0) {
|
||||
rgb.r = rgb.g = rgb.b = v;
|
||||
} else {
|
||||
var t1 = v;
|
||||
var t2 = (255-s)*v/255;
|
||||
var t3 = (t1-t2)*(h%60)/60;
|
||||
if(h==360) h = 0;
|
||||
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
|
||||
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
|
||||
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
|
||||
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
|
||||
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
|
||||
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
|
||||
else {rgb.r=0; rgb.g=0; rgb.b=0}
|
||||
}
|
||||
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
|
||||
},
|
||||
RGBToHex = function (rgb) {
|
||||
var hex = [
|
||||
rgb.r.toString(16),
|
||||
rgb.g.toString(16),
|
||||
rgb.b.toString(16)
|
||||
];
|
||||
$.each(hex, function (nr, val) {
|
||||
if (val.length == 1) {
|
||||
hex[nr] = '0' + val;
|
||||
}
|
||||
});
|
||||
return hex.join('');
|
||||
},
|
||||
HSBToHex = function (hsb) {
|
||||
return RGBToHex(HSBToRGB(hsb));
|
||||
};
|
||||
return {
|
||||
init: function (options) {
|
||||
options = $.extend({}, defaults, options||{});
|
||||
if (typeof options.color == 'string') {
|
||||
options.color = HexToHSB(options.color);
|
||||
} else if (options.color.r != undefined && options.color.g != undefined && options.color.b != undefined) {
|
||||
options.color = RGBToHSB(options.color);
|
||||
} else if (options.color.h != undefined && options.color.s != undefined && options.color.b != undefined) {
|
||||
options.color = fixHSB(options.color);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
options.origColor = options.color;
|
||||
return this.each(function () {
|
||||
if (!$(this).data('colorpickerId')) {
|
||||
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
|
||||
$(this).data('colorpickerId', id);
|
||||
var cal = $(tpl).attr('id', id);
|
||||
if (options.flat) {
|
||||
cal.appendTo(this).show();
|
||||
} else {
|
||||
cal.appendTo(document.body);
|
||||
}
|
||||
options.fields = cal
|
||||
.find('input')
|
||||
.bind('keydown', keyDown)
|
||||
.bind('change', change)
|
||||
.bind('blur', blur)
|
||||
.bind('focus', focus);
|
||||
cal.find('span').bind('mousedown', downIncrement);
|
||||
options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
|
||||
options.selectorIndic = options.selector.find('div div');
|
||||
options.hue = cal.find('div.colorpicker_hue div');
|
||||
cal.find('div.colorpicker_hue').bind('mousedown', downHue);
|
||||
options.newColor = cal.find('div.colorpicker_new_color');
|
||||
options.currentColor = cal.find('div.colorpicker_current_color');
|
||||
cal.data('colorpicker', options);
|
||||
cal.find('div.colorpicker_submit')
|
||||
.bind('mouseenter', enterSubmit)
|
||||
.bind('mouseleave', leaveSubmit)
|
||||
.bind('click', clickSubmit);
|
||||
fillRGBFields(options.color, cal.get(0));
|
||||
fillHSBFields(options.color, cal.get(0));
|
||||
fillHexFields(options.color, cal.get(0));
|
||||
setHue(options.color, cal.get(0));
|
||||
setSelector(options.color, cal.get(0));
|
||||
setCurrentColor(options.color, cal.get(0));
|
||||
setNewColor(options.color, cal.get(0));
|
||||
if (options.flat) {
|
||||
cal.css({
|
||||
position: 'relative',
|
||||
display: 'block'
|
||||
});
|
||||
} else {
|
||||
$(this).bind(options.eventName, show);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
showPicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colorpickerId')) {
|
||||
show.apply(this);
|
||||
}
|
||||
});
|
||||
},
|
||||
hidePicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colorpickerId')) {
|
||||
$('#' + $(this).data('colorpickerId')).hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
setColor: function(col) {
|
||||
if (typeof col == 'string') {
|
||||
col = HexToHSB(col);
|
||||
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
||||
col = RGBToHSB(col);
|
||||
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
||||
col = fixHSB(col);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return this.each(function(){
|
||||
if ($(this).data('colorpickerId')) {
|
||||
var cal = $('#' + $(this).data('colorpickerId'));
|
||||
cal.data('colorpicker').color = col;
|
||||
cal.data('colorpicker').origColor = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
setCurrentColor(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}();
|
||||
$.fn.extend({
|
||||
ColorPicker: ColorPicker.init,
|
||||
ColorPickerHide: ColorPicker.hide,
|
||||
ColorPickerShow: ColorPicker.show,
|
||||
ColorPickerSetColor: ColorPicker.setColor
|
||||
});
|
||||
})(jQuery)
|
||||
@ -1,163 +0,0 @@
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* WooFramework Media Library-driven AJAX File Uploader Module
|
||||
/* JavaScript Functions (2010-11-05)
|
||||
/*
|
||||
/* The code below is designed to work as a part of the WooFramework Media Library-driven
|
||||
/* AJAX File Uploader Module. It is included only on screens where this module is used.
|
||||
/*
|
||||
/* Used with (very) slight modifications for Options Framework.
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
(function ($) {
|
||||
|
||||
optionsframeworkMLU = {
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Remove file when the "remove" button is clicked.
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
removeFile: function () {
|
||||
|
||||
$('.mlu_remove').live('click', function(event) {
|
||||
$(this).hide();
|
||||
$(this).parents().parents().children('.upload').attr('value', '');
|
||||
$(this).parents('.screenshot').slideUp();
|
||||
$(this).parents('.screenshot').siblings('.of-background-properties').hide(); //remove background properties
|
||||
return false;
|
||||
});
|
||||
|
||||
// Hide the delete button on the first row
|
||||
$('a.delete-inline', "#option-1").hide();
|
||||
|
||||
}, // End removeFile
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Replace the default file upload field with a customised version.
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
recreateFileField: function () {
|
||||
|
||||
$('input.file').each(function(){
|
||||
var uploadbutton = '<input class="upload_file_button" type="button" value="Upload" />';
|
||||
$(this).wrap('<div class="file_wrap" />');
|
||||
$(this).addClass('file').css('opacity', 0); //set to invisible
|
||||
$(this).parent().append($('<div class="fake_file" />').append($('<input type="text" class="upload" />').attr('id',$(this).attr('id')+'_file')).val( $(this).val() ).append(uploadbutton));
|
||||
|
||||
$(this).bind('change', function() {
|
||||
$('#'+$(this).attr('id')+'_file').val($(this).val());
|
||||
});
|
||||
$(this).bind('mouseout', function() {
|
||||
$('#'+$(this).attr('id')+'_file').val($(this).val());
|
||||
});
|
||||
});
|
||||
|
||||
}, // End recreateFileField
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Use a custom function when working with the Media Uploads popup.
|
||||
/* Requires jQuery, Media Upload and Thickbox JavaScripts.
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
mediaUpload: function () {
|
||||
|
||||
jQuery.noConflict();
|
||||
|
||||
$( 'input.upload_button' ).removeAttr('style');
|
||||
|
||||
var formfield,
|
||||
formID,
|
||||
btnContent = true,
|
||||
tbframe_interval;
|
||||
// On Click
|
||||
$('input.upload_button').live("click", function () {
|
||||
formfield = $(this).prev('input').attr('id');
|
||||
formID = $(this).attr('rel');
|
||||
|
||||
//Change "insert into post" to "Use this Button"
|
||||
tbframe_interval = setInterval(function() {jQuery('#TB_iframeContent').contents().find('.savesend .button').val('Use This Image');}, 2000);
|
||||
|
||||
// Display a custom title for each Thickbox popup.
|
||||
var woo_title = '';
|
||||
|
||||
if ( $(this).parents('.section').find('.heading') ) { woo_title = $(this).parents('.section').find('.heading').text(); } // End IF Statement
|
||||
|
||||
tb_show( woo_title, 'media-upload.php?post_id='+formID+'&TB_iframe=1' );
|
||||
return false;
|
||||
});
|
||||
|
||||
window.original_send_to_editor = window.send_to_editor;
|
||||
window.send_to_editor = function(html) {
|
||||
|
||||
if (formfield) {
|
||||
|
||||
//clear interval for "Use this Button" so button text resets
|
||||
clearInterval(tbframe_interval);
|
||||
|
||||
// itemurl = $(html).attr('href'); // Use the URL to the main image.
|
||||
|
||||
if ( $(html).html(html).find('img').length > 0 ) {
|
||||
|
||||
itemurl = $(html).html(html).find('img').attr('src'); // Use the URL to the size selected.
|
||||
|
||||
} else {
|
||||
|
||||
// It's not an image. Get the URL to the file instead.
|
||||
|
||||
var htmlBits = html.split("'"); // jQuery seems to strip out XHTML when assigning the string to an object. Use alternate method.
|
||||
itemurl = htmlBits[1]; // Use the URL to the file.
|
||||
|
||||
var itemtitle = htmlBits[2];
|
||||
|
||||
itemtitle = itemtitle.replace( '>', '' );
|
||||
itemtitle = itemtitle.replace( '</a>', '' );
|
||||
|
||||
} // End IF Statement
|
||||
|
||||
var image = /(^.*\.jpg|jpeg|png|gif|ico*)/gi;
|
||||
var document = /(^.*\.pdf|doc|docx|ppt|pptx|odt*)/gi;
|
||||
var audio = /(^.*\.mp3|m4a|ogg|wav*)/gi;
|
||||
var video = /(^.*\.mp4|m4v|mov|wmv|avi|mpg|ogv|3gp|3g2*)/gi;
|
||||
|
||||
if (itemurl.match(image)) {
|
||||
btnContent = '<img src="'+itemurl+'" alt="" /><a href="#" class="mlu_remove button">Remove Image</a>';
|
||||
} else {
|
||||
|
||||
// No output preview if it's not an image.
|
||||
// btnContent = '';
|
||||
// Standard generic output if it's not an image.
|
||||
|
||||
html = '<a href="'+itemurl+'" target="_blank" rel="external">View File</a>';
|
||||
btnContent = '<div class="no_image"><span class="file_link">'+html+'</span><a href="#" class="mlu_remove button">Remove</a></div>';
|
||||
}
|
||||
|
||||
$('#' + formfield).val(itemurl);
|
||||
// $('#' + formfield).next().next('div').slideDown().html(btnContent);
|
||||
$('#' + formfield).siblings('.screenshot').slideDown().html(btnContent);
|
||||
$('#' + formfield).siblings('.of-background-properties').show(); //show background properties
|
||||
tb_remove();
|
||||
|
||||
} else {
|
||||
window.original_send_to_editor(html);
|
||||
}
|
||||
|
||||
// Clear the formfield value so the other media library popups can work as they are meant to. - 2010-11-11.
|
||||
formfield = '';
|
||||
}
|
||||
|
||||
} // End mediaUpload
|
||||
|
||||
}; // End optionsframeworkMLU Object // Don't remove this, or the sky will fall on your head.
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Execute the above methods in the optionsframeworkMLU object.
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
optionsframeworkMLU.removeFile();
|
||||
optionsframeworkMLU.recreateFileField();
|
||||
optionsframeworkMLU.mediaUpload();
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@ -1,101 +0,0 @@
|
||||
/**
|
||||
* Prints out the inline javascript needed for the colorpicker and choosing
|
||||
* the tabs in the panel.
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
// Fade out the save message
|
||||
$('.fade').delay(1000).fadeOut(1000);
|
||||
|
||||
// Color Picker
|
||||
$('.colorSelector').each(function(){
|
||||
var Othis = this; //cache a copy of the this variable for use inside nested function
|
||||
var initialColor = $(Othis).next('input').attr('value');
|
||||
$(this).ColorPicker({
|
||||
color: initialColor,
|
||||
onShow: function (colpkr) {
|
||||
$(colpkr).fadeIn(500);
|
||||
return false;
|
||||
},
|
||||
onHide: function (colpkr) {
|
||||
$(colpkr).fadeOut(500);
|
||||
return false;
|
||||
},
|
||||
onChange: function (hsb, hex, rgb) {
|
||||
$(Othis).children('div').css('backgroundColor', '#' + hex);
|
||||
$(Othis).next('input').attr('value','#' + hex);
|
||||
}
|
||||
});
|
||||
}); //end color picker
|
||||
|
||||
// Switches option sections
|
||||
$('.group').hide();
|
||||
var activetab = '';
|
||||
if (typeof(localStorage) != 'undefined' ) {
|
||||
activetab = localStorage.getItem("activetab");
|
||||
}
|
||||
if (activetab != '' && $(activetab).length ) {
|
||||
$(activetab).fadeIn();
|
||||
} else {
|
||||
$('.group:first').fadeIn();
|
||||
}
|
||||
$('.group .collapsed').each(function(){
|
||||
$(this).find('input:checked').parent().parent().parent().nextAll().each(
|
||||
function(){
|
||||
if ($(this).hasClass('last')) {
|
||||
$(this).removeClass('hidden');
|
||||
return false;
|
||||
}
|
||||
$(this).filter('.hidden').removeClass('hidden');
|
||||
});
|
||||
});
|
||||
|
||||
if (activetab != '' && $(activetab + '-tab').length ) {
|
||||
$(activetab + '-tab').addClass('nav-tab-active');
|
||||
}
|
||||
else {
|
||||
$('.nav-tab-wrapper a:first').addClass('nav-tab-active');
|
||||
}
|
||||
$('.nav-tab-wrapper a').click(function(evt) {
|
||||
$('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
||||
$(this).addClass('nav-tab-active').blur();
|
||||
var clicked_group = $(this).attr('href');
|
||||
if (typeof(localStorage) != 'undefined' ) {
|
||||
localStorage.setItem("activetab", $(this).attr('href'));
|
||||
}
|
||||
$('.group').hide();
|
||||
$(clicked_group).fadeIn();
|
||||
evt.preventDefault();
|
||||
});
|
||||
|
||||
$('.group .collapsed input:checkbox').click(unhideHidden);
|
||||
|
||||
function unhideHidden(){
|
||||
if ($(this).attr('checked')) {
|
||||
$(this).parent().parent().parent().nextAll().removeClass('hidden');
|
||||
}
|
||||
else {
|
||||
$(this).parent().parent().parent().nextAll().each(
|
||||
function(){
|
||||
if ($(this).filter('.last').length) {
|
||||
$(this).addClass('hidden');
|
||||
return false;
|
||||
}
|
||||
$(this).addClass('hidden');
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Image Options
|
||||
$('.of-radio-img-img').click(function(){
|
||||
$(this).parent().parent().find('.of-radio-img-img').removeClass('of-radio-img-selected');
|
||||
$(this).addClass('of-radio-img-selected');
|
||||
});
|
||||
|
||||
$('.of-radio-img-label').hide();
|
||||
$('.of-radio-img-img').show();
|
||||
$('.of-radio-img-radio').hide();
|
||||
|
||||
});
|
||||
@ -1,389 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Options Framework
|
||||
Plugin URI: http://www.wptheming.com
|
||||
Description: A framework for building theme options.
|
||||
Version: 0.8
|
||||
Author: Devin Price
|
||||
Author URI: http://www.wptheming.com
|
||||
License: GPLv2
|
||||
*/
|
||||
|
||||
/*
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/* Basic plugin definitions */
|
||||
|
||||
define('OPTIONS_FRAMEWORK_VERSION', '0.9');
|
||||
|
||||
/* Make sure we don't expose any info if called directly */
|
||||
|
||||
if ( !function_exists( 'add_action' ) ) {
|
||||
echo "Hi there! I'm just a little plugin, don't mind me.";
|
||||
exit;
|
||||
}
|
||||
|
||||
/* If the user can't edit theme options, no use running this plugin */
|
||||
|
||||
add_action('init', 'optionsframework_rolescheck' );
|
||||
|
||||
function optionsframework_rolescheck () {
|
||||
if ( current_user_can( 'edit_theme_options' ) ) {
|
||||
// If the user can edit theme options, let the fun begin!
|
||||
add_action( 'admin_menu', 'optionsframework_add_page');
|
||||
add_action( 'admin_init', 'optionsframework_init' );
|
||||
add_action( 'admin_init', 'optionsframework_mlu_init' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Loads the file for option sanitization */
|
||||
|
||||
add_action('init', 'optionsframework_load_sanitization' );
|
||||
|
||||
function optionsframework_load_sanitization() {
|
||||
require_once dirname( __FILE__ ) . '/options-sanitize.php';
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates the settings in the database by looping through the array
|
||||
* we supplied in options.php. This is a neat way to do it since
|
||||
* we won't have to save settings for headers, descriptions, or arguments.
|
||||
*
|
||||
* Read more about the Settings API in the WordPress codex:
|
||||
* http://codex.wordpress.org/Settings_API
|
||||
*
|
||||
*/
|
||||
|
||||
function optionsframework_init() {
|
||||
|
||||
// Include the required files
|
||||
require_once dirname( __FILE__ ) . '/options-interface.php';
|
||||
require_once dirname( __FILE__ ) . '/options-medialibrary-uploader.php';
|
||||
|
||||
// Loads the options array from the theme
|
||||
if ( $optionsfile = locate_template( array('options.php') ) ) {
|
||||
require_once($optionsfile);
|
||||
}
|
||||
else if (file_exists( dirname( __FILE__ ) . '/options.php' ) ) {
|
||||
require_once dirname( __FILE__ ) . '/options.php';
|
||||
}
|
||||
|
||||
$optionsframework_settings = get_option('optionsframework' );
|
||||
|
||||
// Updates the unique option id in the database if it has changed
|
||||
optionsframework_option_name();
|
||||
|
||||
// Gets the unique id, returning a default if it isn't defined
|
||||
if ( isset($optionsframework_settings['id']) ) {
|
||||
$option_name = $optionsframework_settings['id'];
|
||||
}
|
||||
else {
|
||||
$option_name = 'optionsframework';
|
||||
}
|
||||
|
||||
// If the option has no saved data, load the defaults
|
||||
if ( ! get_option($option_name) ) {
|
||||
optionsframework_setdefaults();
|
||||
}
|
||||
|
||||
// Registers the settings fields and callback
|
||||
register_setting( 'optionsframework', $option_name, 'optionsframework_validate' );
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds default options to the database if they aren't already present.
|
||||
* May update this later to load only on plugin activation, or theme
|
||||
* activation since most people won't be editing the options.php
|
||||
* on a regular basis.
|
||||
*
|
||||
* http://codex.wordpress.org/Function_Reference/add_option
|
||||
*
|
||||
*/
|
||||
|
||||
function optionsframework_setdefaults() {
|
||||
|
||||
$optionsframework_settings = get_option('optionsframework');
|
||||
|
||||
// Gets the unique option id
|
||||
$option_name = $optionsframework_settings['id'];
|
||||
|
||||
/*
|
||||
* Each theme will hopefully have a unique id, and all of its options saved
|
||||
* as a separate option set. We need to track all of these option sets so
|
||||
* it can be easily deleted if someone wishes to remove the plugin and
|
||||
* its associated data. No need to clutter the database.
|
||||
*
|
||||
*/
|
||||
|
||||
if ( isset($optionsframework_settings['knownoptions']) ) {
|
||||
$knownoptions = $optionsframework_settings['knownoptions'];
|
||||
if ( !in_array($option_name, $knownoptions) ) {
|
||||
array_push( $knownoptions, $option_name );
|
||||
$optionsframework_settings['knownoptions'] = $knownoptions;
|
||||
update_option('optionsframework', $optionsframework_settings);
|
||||
}
|
||||
} else {
|
||||
$newoptionname = array($option_name);
|
||||
$optionsframework_settings['knownoptions'] = $newoptionname;
|
||||
update_option('optionsframework', $optionsframework_settings);
|
||||
}
|
||||
|
||||
// Gets the default options data from the array in options.php
|
||||
$options = optionsframework_options();
|
||||
|
||||
// If the options haven't been added to the database yet, they are added now
|
||||
$values = of_get_default_values();
|
||||
|
||||
if ( isset($values) ) {
|
||||
add_option( $option_name, $values ); // Add option with default settings
|
||||
}
|
||||
}
|
||||
|
||||
/* Add a subpage called "Theme Options" to the appearance menu. */
|
||||
|
||||
if ( !function_exists( 'optionsframework_add_page' ) ) {
|
||||
function optionsframework_add_page() {
|
||||
|
||||
$of_page = add_theme_page('Theme Options', 'Theme Options', 'edit_theme_options', 'options-framework','optionsframework_page');
|
||||
|
||||
// Adds actions to hook in the required css and javascript
|
||||
add_action("admin_print_styles-$of_page",'optionsframework_load_styles');
|
||||
add_action("admin_print_scripts-$of_page", 'optionsframework_load_scripts');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Loads the CSS */
|
||||
|
||||
function optionsframework_load_styles() {
|
||||
wp_enqueue_style('admin-style', OPTIONS_FRAMEWORK_DIRECTORY.'css/admin-style.css');
|
||||
wp_enqueue_style('color-picker', OPTIONS_FRAMEWORK_DIRECTORY.'css/colorpicker.css');
|
||||
}
|
||||
|
||||
/* Loads the javascript */
|
||||
|
||||
function optionsframework_load_scripts() {
|
||||
|
||||
// Inline scripts from options-interface.php
|
||||
add_action('admin_head', 'of_admin_head');
|
||||
|
||||
// Enqueued scripts
|
||||
wp_enqueue_script('jquery-ui-core');
|
||||
wp_enqueue_script('color-picker', OPTIONS_FRAMEWORK_DIRECTORY.'js/colorpicker.js', array('jquery'));
|
||||
wp_enqueue_script('options-custom', OPTIONS_FRAMEWORK_DIRECTORY.'js/options-custom.js', array('jquery'));
|
||||
}
|
||||
|
||||
function of_admin_head() {
|
||||
|
||||
// Hook to add custom scripts
|
||||
do_action( 'optionsframework_custom_scripts' );
|
||||
}
|
||||
|
||||
/*
|
||||
* Builds out the options panel.
|
||||
*
|
||||
* If we were using the Settings API as it was likely intended we would use
|
||||
* do_settings_sections here. But as we don't want the settings wrapped in a table,
|
||||
* we'll call our own custom optionsframework_fields. See options-interface.php
|
||||
* for specifics on how each individual field is generated.
|
||||
*
|
||||
* Nonces are provided using the settings_fields()
|
||||
*
|
||||
*/
|
||||
|
||||
if ( !function_exists( 'optionsframework_page' ) ) {
|
||||
function optionsframework_page() {
|
||||
$return = optionsframework_fields();
|
||||
settings_errors();
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon( 'themes' ); ?>
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<?php echo $return[1]; ?>
|
||||
</h2>
|
||||
|
||||
<div class="metabox-holder">
|
||||
<div id="optionsframework" class="postbox">
|
||||
<form action="options.php" method="post">
|
||||
<?php settings_fields('optionsframework'); ?>
|
||||
|
||||
<?php echo $return[0]; /* Settings */ ?>
|
||||
|
||||
<div id="optionsframework-submit">
|
||||
<input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options' ); ?>" />
|
||||
<input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e( 'Restore Defaults' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!' ) ); ?>' );" />
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- / #container -->
|
||||
</div>
|
||||
</div> <!-- / .wrap -->
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Options.
|
||||
*
|
||||
* This runs after the submit/reset button has been clicked and
|
||||
* validates the inputs.
|
||||
*
|
||||
* @uses $_POST['reset']
|
||||
* @uses $_POST['update']
|
||||
*/
|
||||
function optionsframework_validate( $input ) {
|
||||
|
||||
/*
|
||||
* Restore Defaults.
|
||||
*
|
||||
* In the event that the user clicked the "Restore Defaults"
|
||||
* button, the options defined in the theme's options.php
|
||||
* file will be added to the option for the active theme.
|
||||
*/
|
||||
|
||||
if ( isset( $_POST['reset'] ) ) {
|
||||
add_settings_error( 'options-framework', 'restore_defaults', __( 'Default options restored.', 'optionsframework' ), 'updated fade' );
|
||||
return of_get_default_values();
|
||||
}
|
||||
|
||||
/*
|
||||
* Udpdate Settings.
|
||||
*/
|
||||
|
||||
if ( isset( $_POST['update'] ) ) {
|
||||
$clean = array();
|
||||
$options = optionsframework_options();
|
||||
foreach ( $options as $option ) {
|
||||
|
||||
if ( ! isset( $option['id'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! isset( $option['type'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$id = preg_replace( '/[^a-zA-Z0-9._\-]/', '', strtolower( $option['id'] ) );
|
||||
|
||||
// Set checkbox to false if it wasn't sent in the $_POST
|
||||
if ( 'checkbox' == $option['type'] && ! isset( $input[$id] ) ) {
|
||||
$input[$id] = '0';
|
||||
}
|
||||
|
||||
// Set each item in the multicheck to false if it wasn't sent in the $_POST
|
||||
if ( 'multicheck' == $option['type'] && ! isset( $input[$id] ) ) {
|
||||
foreach ( $option['options'] as $key => $value ) {
|
||||
$input[$id][$key] = '0';
|
||||
}
|
||||
}
|
||||
|
||||
// For a value to be submitted to database it must pass through a sanitization filter
|
||||
if ( has_filter( 'of_sanitize_' . $option['type'] ) ) {
|
||||
$clean[$id] = apply_filters( 'of_sanitize_' . $option['type'], $input[$id], $option );
|
||||
}
|
||||
}
|
||||
|
||||
add_settings_error( 'options-framework', 'save_options', __( 'Options saved.', 'optionsframework' ), 'updated fade' );
|
||||
return $clean;
|
||||
}
|
||||
|
||||
/*
|
||||
* Request Not Recognized.
|
||||
*/
|
||||
|
||||
return of_get_default_values();
|
||||
}
|
||||
|
||||
/**
|
||||
* Format Configuration Array.
|
||||
*
|
||||
* Get an array of all default values as set in
|
||||
* options.php. The 'id','std' and 'type' keys need
|
||||
* to be defined in the configuration array. In the
|
||||
* event that these keys are not present the option
|
||||
* will not be included in this function's output.
|
||||
*
|
||||
* @return array Rey-keyed options configuration array.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
|
||||
function of_get_default_values() {
|
||||
$output = array();
|
||||
$config = optionsframework_options();
|
||||
foreach ( (array) $config as $option ) {
|
||||
if ( ! isset( $option['id'] ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( ! isset( $option['std'] ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( ! isset( $option['type'] ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( has_filter( 'of_sanitize_' . $option['type'] ) ) {
|
||||
$output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option );
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Theme Options menu item to Admin Bar.
|
||||
*/
|
||||
|
||||
add_action( 'wp_before_admin_bar_render', 'optionsframework_adminbar' );
|
||||
|
||||
function optionsframework_adminbar() {
|
||||
|
||||
global $wp_admin_bar;
|
||||
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'parent' => 'appearance',
|
||||
'id' => 'of_theme_options',
|
||||
'title' => __( 'Theme Options' ),
|
||||
'href' => admin_url( 'themes.php?page=options-framework' )
|
||||
));
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'of_get_option' ) ) {
|
||||
|
||||
/**
|
||||
* Get Option.
|
||||
*
|
||||
* Helper function to return the theme option value.
|
||||
* If no value has been saved, it returns $default.
|
||||
* Needed because options are saved as serialized strings.
|
||||
*/
|
||||
|
||||
function of_get_option( $name, $default = false ) {
|
||||
$config = get_option( 'optionsframework' );
|
||||
|
||||
if ( ! isset( $config['id'] ) ) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
$options = get_option( $config['id'] );
|
||||
|
||||
if ( isset( $options[$name] ) ) {
|
||||
return $options[$name];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
@ -1,318 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Generates the options fields that are used in the form.
|
||||
*/
|
||||
|
||||
function optionsframework_fields() {
|
||||
|
||||
global $allowedtags;
|
||||
$optionsframework_settings = get_option('optionsframework');
|
||||
|
||||
// Get the theme name so we can display it up top
|
||||
$themename = get_theme_data(STYLESHEETPATH . '/style.css');
|
||||
$themename = $themename['Name'];
|
||||
|
||||
// Gets the unique option id
|
||||
if (isset($optionsframework_settings['id'])) {
|
||||
$option_name = $optionsframework_settings['id'];
|
||||
}
|
||||
else {
|
||||
$option_name = 'optionsframework';
|
||||
};
|
||||
|
||||
$settings = get_option($option_name);
|
||||
$options = optionsframework_options();
|
||||
|
||||
$counter = 0;
|
||||
$menu = '';
|
||||
$output = '';
|
||||
|
||||
foreach ($options as $value) {
|
||||
|
||||
$counter++;
|
||||
$val = '';
|
||||
$select_value = '';
|
||||
$checked = '';
|
||||
|
||||
// Wrap all options
|
||||
if ( ($value['type'] != "heading") && ($value['type'] != "info") ) {
|
||||
|
||||
// Keep all ids lowercase with no spaces
|
||||
$value['id'] = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($value['id']) );
|
||||
|
||||
$id = 'section-' . $value['id'];
|
||||
|
||||
$class = 'section ';
|
||||
if ( isset( $value['type'] ) ) {
|
||||
$class .= ' section-' . $value['type'];
|
||||
}
|
||||
if ( isset( $value['class'] ) ) {
|
||||
$class .= ' ' . $value['class'];
|
||||
}
|
||||
|
||||
$output .= '<div id="' . esc_attr( $id ) .'" class="' . esc_attr( $class ) . '">'."\n";
|
||||
$output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
|
||||
$output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
|
||||
}
|
||||
|
||||
// Set default value to $val
|
||||
if ( isset( $value['std']) ) {
|
||||
$val = $value['std'];
|
||||
}
|
||||
|
||||
// If the option is already saved, ovveride $val
|
||||
if ( ($value['type'] != 'heading') && ($value['type'] != 'info')) {
|
||||
if ( isset($settings[($value['id'])]) ) {
|
||||
$val = $settings[($value['id'])];
|
||||
// Striping slashes of non-array options
|
||||
if (!is_array($val)) {
|
||||
$val = stripslashes($val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there is a description save it for labels
|
||||
$explain_value = '';
|
||||
if ( isset( $value['desc'] ) ) {
|
||||
$explain_value = $value['desc'];
|
||||
}
|
||||
|
||||
switch ( $value['type'] ) {
|
||||
|
||||
// Basic text input
|
||||
case 'text':
|
||||
$output .= '<input id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" type="text" value="' . esc_attr( $val ) . '" />';
|
||||
break;
|
||||
|
||||
// Textarea
|
||||
case 'textarea':
|
||||
$cols = '8';
|
||||
$ta_value = '';
|
||||
|
||||
if(isset($value['options'])){
|
||||
$ta_options = $value['options'];
|
||||
if(isset($ta_options['cols'])){
|
||||
$cols = $ta_options['cols'];
|
||||
} else { $cols = '8'; }
|
||||
}
|
||||
|
||||
$val = stripslashes( $val );
|
||||
|
||||
$output .= '<textarea id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" cols="'. esc_attr( $cols ) . '" rows="8">' . esc_textarea( $val ) . '</textarea>';
|
||||
break;
|
||||
|
||||
// Select Box
|
||||
case ($value['type'] == 'select'):
|
||||
$output .= '<select class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" id="' . esc_attr( $value['id'] ) . '">';
|
||||
|
||||
foreach ($value['options'] as $key => $option ) {
|
||||
$selected = '';
|
||||
if( $val != '' ) {
|
||||
if ( $val == $key) { $selected = ' selected="selected"';}
|
||||
}
|
||||
$output .= '<option'. $selected .' value="' . esc_attr( $key ) . '">' . esc_html( $option ) . '</option>';
|
||||
}
|
||||
$output .= '</select>';
|
||||
break;
|
||||
|
||||
|
||||
// Radio Box
|
||||
case "radio":
|
||||
$name = $option_name .'['. $value['id'] .']';
|
||||
foreach ($value['options'] as $key => $option) {
|
||||
$id = $option_name . '-' . $value['id'] .'-'. $key;
|
||||
$output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" value="'. esc_attr( $key ) . '" '. checked( $val, $key, false) .' /><label for="' . esc_attr( $id ) . '">' . esc_html( $option ) . '</label>';
|
||||
}
|
||||
break;
|
||||
|
||||
// Image Selectors
|
||||
case "images":
|
||||
$name = $option_name .'['. $value['id'] .']';
|
||||
foreach ( $value['options'] as $key => $option ) {
|
||||
$selected = '';
|
||||
$checked = '';
|
||||
if ( $val != '' ) {
|
||||
if ( $val == $key ) {
|
||||
$selected = ' of-radio-img-selected';
|
||||
$checked = ' checked="checked"';
|
||||
}
|
||||
}
|
||||
$output .= '<input type="radio" id="' . esc_attr( $value['id'] .'_'. $key) . '" class="of-radio-img-radio" value="' . esc_attr( $key ) . '" name="' . esc_attr( $name ) . '" '. $checked .' />';
|
||||
$output .= '<div class="of-radio-img-label">' . esc_html( $key ) . '</div>';
|
||||
$output .= '<img src="' . esc_url( $option ) . '" alt="' . $option .'" class="of-radio-img-img' . $selected .'" onclick="document.getElementById(\''. esc_attr($value['id'] .'_'. $key) .'\').checked=true;" />';
|
||||
}
|
||||
break;
|
||||
|
||||
// Checkbox
|
||||
case "checkbox":
|
||||
$output .= '<input id="' . esc_attr( $value['id'] ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" '. checked( $val, 1, false) .' />';
|
||||
$output .= '<label class="explain" for="' . esc_attr( $value['id'] ) . '">' . wp_kses( $explain_value, $allowedtags) . '</label>';
|
||||
break;
|
||||
|
||||
// Multicheck
|
||||
case "multicheck":
|
||||
foreach ($value['options'] as $key => $option) {
|
||||
$checked = '';
|
||||
$label = $option;
|
||||
$option = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($key));
|
||||
|
||||
$id = $option_name . '-' . $value['id'] . '-'. $option;
|
||||
$name = $option_name . '[' . $value['id'] . '][' . $option .']';
|
||||
|
||||
if ( isset($val[$option]) ) {
|
||||
$checked = checked($val[$option], 1, false);
|
||||
}
|
||||
|
||||
$output .= '<input id="' . esc_attr( $id ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $name ) . '" ' . $checked . ' /><label for="' . esc_attr( $id ) . '">' . esc_html( $label ) . '</label>';
|
||||
}
|
||||
break;
|
||||
|
||||
// Color picker
|
||||
case "color":
|
||||
$output .= '<div id="' . esc_attr( $value['id'] . '_picker' ) . '" class="colorSelector"><div style="' . esc_attr( 'background-color:' . $val ) . '"></div></div>';
|
||||
$output .= '<input class="of-color" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" id="' . esc_attr( $value['id'] ) . '" type="text" value="' . esc_attr( $val ) . '" />';
|
||||
break;
|
||||
|
||||
// Uploader
|
||||
case "upload":
|
||||
$output .= optionsframework_medialibrary_uploader( $value['id'], $val, null ); // New AJAX Uploader using Media Library
|
||||
break;
|
||||
|
||||
// Typography
|
||||
case 'typography':
|
||||
|
||||
$typography_stored = $val;
|
||||
|
||||
// Font Size
|
||||
$output .= '<select class="of-typography of-typography-size" name="' . esc_attr( $option_name . '[' . $value['id'] . '][size]' ) . '" id="' . esc_attr( $value['id'] . '_size' ) . '">';
|
||||
for ($i = 9; $i < 71; $i++) {
|
||||
$size = $i . 'px';
|
||||
$output .= '<option value="' . esc_attr( $size ) . '" ' . selected( $typography_stored['size'], $size, false ) . '>' . esc_html( $size ) . '</option>';
|
||||
}
|
||||
$output .= '</select>';
|
||||
|
||||
// Font Face
|
||||
$output .= '<select class="of-typography of-typography-face" name="' . esc_attr( $option_name . '[' . $value['id'] . '][face]' ) . '" id="' . esc_attr( $value['id'] . '_face' ) . '">';
|
||||
|
||||
$faces = of_recognized_font_faces();
|
||||
foreach ( $faces as $key => $face ) {
|
||||
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['face'], $key, false ) . '>' . esc_html( $face ) . '</option>';
|
||||
}
|
||||
|
||||
$output .= '</select>';
|
||||
|
||||
// Font Weight
|
||||
$output .= '<select class="of-typography of-typography-style" name="'.$option_name.'['.$value['id'].'][style]" id="'. $value['id'].'_style">';
|
||||
|
||||
/* Font Style */
|
||||
$styles = of_recognized_font_styles();
|
||||
foreach ( $styles as $key => $style ) {
|
||||
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['style'], $key, false ) . '>'. $style .'</option>';
|
||||
}
|
||||
$output .= '</select>';
|
||||
|
||||
// Font Color
|
||||
$output .= '<div id="' . esc_attr( $value['id'] ) . '_color_picker" class="colorSelector"><div style="' . esc_attr( 'background-color:' . $typography_stored['color'] ) . '"></div></div>';
|
||||
$output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" type="text" value="' . esc_attr( $typography_stored['color'] ) . '" />';
|
||||
|
||||
break;
|
||||
|
||||
// Background
|
||||
case 'background':
|
||||
|
||||
$background = $val;
|
||||
|
||||
// Background Color
|
||||
$output .= '<div id="' . esc_attr( $value['id'] ) . '_color_picker" class="colorSelector"><div style="' . esc_attr( 'background-color:' . $background['color'] ) . '"></div></div>';
|
||||
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" type="text" value="' . esc_attr( $background['color'] ) . '" />';
|
||||
|
||||
// Background Image - New AJAX Uploader using Media Library
|
||||
if (!isset($background['image'])) {
|
||||
$background['image'] = '';
|
||||
}
|
||||
|
||||
$output .= optionsframework_medialibrary_uploader( $value['id'], $background['image'], null, '',0,'image');
|
||||
$class = 'of-background-properties';
|
||||
if ( '' == $background['image'] ) {
|
||||
$class .= ' hide';
|
||||
}
|
||||
$output .= '<div class="' . esc_attr( $class ) . '">';
|
||||
|
||||
// Background Repeat
|
||||
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr( $option_name . '[' . $value['id'] . '][repeat]' ) . '" id="' . esc_attr( $value['id'] . '_repeat' ) . '">';
|
||||
$repeats = of_recognized_background_repeat();
|
||||
|
||||
foreach ($repeats as $key => $repeat) {
|
||||
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $background['repeat'], $key, false ) . '>'. esc_html( $repeat ) . '</option>';
|
||||
}
|
||||
$output .= '</select>';
|
||||
|
||||
// Background Position
|
||||
$output .= '<select class="of-background of-background-position" name="' . esc_attr( $option_name . '[' . $value['id'] . '][position]' ) . '" id="' . esc_attr( $value['id'] . '_position' ) . '">';
|
||||
$positions = of_recognized_background_position();
|
||||
|
||||
foreach ($positions as $key=>$position) {
|
||||
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $background['position'], $key, false ) . '>'. esc_html( $position ) . '</option>';
|
||||
}
|
||||
$output .= '</select>';
|
||||
|
||||
// Background Attachment
|
||||
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr( $option_name . '[' . $value['id'] . '][attachment]' ) . '" id="' . esc_attr( $value['id'] . '_attachment' ) . '">';
|
||||
$attachments = of_recognized_background_attachment();
|
||||
|
||||
foreach ($attachments as $key => $attachment) {
|
||||
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $background['attachment'], $key, false ) . '>' . esc_html( $attachment ) . '</option>';
|
||||
}
|
||||
$output .= '</select>';
|
||||
$output .= '</div>';
|
||||
|
||||
break;
|
||||
|
||||
// Info
|
||||
case "info":
|
||||
$class = 'section';
|
||||
if ( isset( $value['type'] ) ) {
|
||||
$class .= ' section-' . $value['type'];
|
||||
}
|
||||
if ( isset( $value['class'] ) ) {
|
||||
$class .= ' ' . $value['class'];
|
||||
}
|
||||
|
||||
$output .= '<div class="' . esc_attr( $class ) . '">' . "\n";
|
||||
if ( isset($value['name']) ) {
|
||||
$output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
|
||||
}
|
||||
if ( $value['desc'] ) {
|
||||
$output .= apply_filters('of_sanitize_info', $value['desc'] ) . "\n";
|
||||
}
|
||||
$output .= '<div class="clear"></div></div>' . "\n";
|
||||
break;
|
||||
|
||||
// Heading for Navigation
|
||||
case "heading":
|
||||
if ($counter >= 2) {
|
||||
$output .= '</div>'."\n";
|
||||
}
|
||||
$jquery_click_hook = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($value['name']) );
|
||||
$jquery_click_hook = "of-option-" . $jquery_click_hook;
|
||||
$menu .= '<a id="'. esc_attr( $jquery_click_hook ) . '-tab" class="nav-tab" title="' . esc_attr( $value['name'] ) . '" href="' . esc_attr( '#'. $jquery_click_hook ) . '">' . esc_html( $value['name'] ) . '</a>';
|
||||
$output .= '<div class="group" id="' . esc_attr( $jquery_click_hook ) . '">';
|
||||
$output .= '<h3>' . esc_html( $value['name'] ) . '</h3>' . "\n";
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) ) {
|
||||
if ( $value['type'] != "checkbox" ) {
|
||||
$output .= '<br/>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
if ( $value['type'] != "checkbox" ) {
|
||||
$output .= '<div class="explain">' . wp_kses( $explain_value, $allowedtags) . '</div>'."\n";
|
||||
}
|
||||
$output .= '<div class="clear"></div></div></div>'."\n";
|
||||
}
|
||||
}
|
||||
$output .= '</div>';
|
||||
return array($output,$menu);
|
||||
}
|
||||
@ -1,291 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WooThemes Media Library-driven AJAX File Uploader Module (2010-11-05)
|
||||
*
|
||||
* Slightly modified for use in the Options Framework.
|
||||
*/
|
||||
|
||||
if ( is_admin() ) {
|
||||
|
||||
// Load additional css and js for image uploads on the Options Framework page
|
||||
$of_page= 'appearance_page_options-framework';
|
||||
add_action( "admin_print_styles-$of_page", 'optionsframework_mlu_css', 0 );
|
||||
add_action( "admin_print_scripts-$of_page", 'optionsframework_mlu_js', 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up a custom post type to attach image to. This allows us to have
|
||||
* individual galleries for different uploaders.
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'optionsframework_mlu_init' ) ) {
|
||||
function optionsframework_mlu_init () {
|
||||
register_post_type( 'optionsframework', array(
|
||||
'labels' => array(
|
||||
'name' => __( 'Options Framework Internal Container' ),
|
||||
),
|
||||
'public' => true,
|
||||
'show_ui' => false,
|
||||
'capability_type' => 'post',
|
||||
'hierarchical' => false,
|
||||
'rewrite' => false,
|
||||
'supports' => array( 'title', 'editor' ),
|
||||
'query_var' => false,
|
||||
'can_export' => true,
|
||||
'show_in_nav_menus' => false
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the Thickbox CSS file and specific loading and button images to the header
|
||||
* on the pages where this function is called.
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'optionsframework_mlu_css' ) ) {
|
||||
|
||||
function optionsframework_mlu_css () {
|
||||
|
||||
$_html = '';
|
||||
$_html .= '<link rel="stylesheet" href="' . site_url() . '/' . WPINC . '/js/thickbox/thickbox.css" type="text/css" media="screen" />' . "\n";
|
||||
$_html .= '<script type="text/javascript">
|
||||
var tb_pathToImage = "' . site_url() . '/' . WPINC . '/js/thickbox/loadingAnimation.gif";
|
||||
var tb_closeImage = "' . site_url() . '/' . WPINC . '/js/thickbox/tb-close.png";
|
||||
</script>' . "\n";
|
||||
|
||||
echo $_html;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers and enqueues (loads) the necessary JavaScript file for working with the
|
||||
* Media Library-driven AJAX File Uploader Module.
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'optionsframework_mlu_js' ) ) {
|
||||
|
||||
function optionsframework_mlu_js () {
|
||||
|
||||
// Registers custom scripts for the Media Library AJAX uploader.
|
||||
wp_register_script( 'of-medialibrary-uploader', OPTIONS_FRAMEWORK_DIRECTORY .'js/of-medialibrary-uploader.js', array( 'jquery', 'thickbox' ) );
|
||||
wp_enqueue_script( 'of-medialibrary-uploader' );
|
||||
wp_enqueue_script( 'media-upload' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Media Uploader Using the WordPress Media Library.
|
||||
*
|
||||
* Parameters:
|
||||
* - string $_id - A token to identify this field (the name).
|
||||
* - string $_value - The value of the field, if present.
|
||||
* - string $_mode - The display mode of the field.
|
||||
* - string $_desc - An optional description of the field.
|
||||
* - int $_postid - An optional post id (used in the meta boxes).
|
||||
*
|
||||
* Dependencies:
|
||||
* - optionsframework_mlu_get_silentpost()
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'optionsframework_medialibrary_uploader' ) ) {
|
||||
|
||||
function optionsframework_medialibrary_uploader( $_id, $_value, $_mode = 'full', $_desc = '', $_postid = 0, $_name = '') {
|
||||
|
||||
$optionsframework_settings = get_option('optionsframework');
|
||||
|
||||
// Gets the unique option id
|
||||
$option_name = $optionsframework_settings['id'];
|
||||
|
||||
$output = '';
|
||||
$id = '';
|
||||
$class = '';
|
||||
$int = '';
|
||||
$value = '';
|
||||
$name = '';
|
||||
|
||||
$id = strip_tags( strtolower( $_id ) );
|
||||
// Change for each field, using a "silent" post. If no post is present, one will be created.
|
||||
$int = optionsframework_mlu_get_silentpost( $id );
|
||||
|
||||
// If a value is passed and we don't have a stored value, use the value that's passed through.
|
||||
if ( $_value != '' && $value == '' ) {
|
||||
$value = $_value;
|
||||
}
|
||||
|
||||
if ($_name != '') {
|
||||
$name = $option_name.'['.$id.']['.$_name.']';
|
||||
}
|
||||
else {
|
||||
$name = $option_name.'['.$id.']';
|
||||
}
|
||||
|
||||
if ( $value ) { $class = ' has-file'; }
|
||||
$output .= '<input id="' . $id . '" class="upload' . $class . '" type="text" name="'.$name.'" value="' . $value . '" />' . "\n";
|
||||
$output .= '<input id="upload_' . $id . '" class="upload_button button" type="button" value="' . __( 'Upload' ) . '" rel="' . $int . '" />' . "\n";
|
||||
|
||||
if ( $_desc != '' ) {
|
||||
$output .= '<span class="of_metabox_desc">' . $_desc . '</span>' . "\n";
|
||||
}
|
||||
|
||||
$output .= '<div class="screenshot" id="' . $id . '_image">' . "\n";
|
||||
|
||||
if ( $value != '' ) {
|
||||
$remove = '<a href="javascript:(void);" class="mlu_remove button">Remove</a>';
|
||||
$image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $value );
|
||||
if ( $image ) {
|
||||
$output .= '<img src="' . $value . '" alt="" />'.$remove.'';
|
||||
} else {
|
||||
$parts = explode( "/", $value );
|
||||
for( $i = 0; $i < sizeof( $parts ); ++$i ) {
|
||||
$title = $parts[$i];
|
||||
}
|
||||
|
||||
// No output preview if it's not an image.
|
||||
$output .= '';
|
||||
|
||||
// Standard generic output if it's not an image.
|
||||
$title = __( 'View File', 'optionsframework' );
|
||||
$output .= '<div class="no_image"><span class="file_link"><a href="' . $value . '" target="_blank" rel="external">'.$title.'</a></span>' . $remove . '</div>';
|
||||
}
|
||||
}
|
||||
$output .= '</div>' . "\n";
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses "silent" posts in the database to store relationships for images.
|
||||
* This also creates the facility to collect galleries of, for example, logo images.
|
||||
*
|
||||
* Return: $_postid.
|
||||
*
|
||||
* If no "silent" post is present, one will be created with the type "optionsframework"
|
||||
* and the post_name of "of-$_token".
|
||||
*
|
||||
* Example Usage:
|
||||
* optionsframework_mlu_get_silentpost ( 'of_logo' );
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'optionsframework_mlu_get_silentpost' ) ) {
|
||||
|
||||
function optionsframework_mlu_get_silentpost ( $_token ) {
|
||||
|
||||
global $wpdb;
|
||||
$_id = 0;
|
||||
|
||||
// Check if the token is valid against a whitelist.
|
||||
// $_whitelist = array( 'of_logo', 'of_custom_favicon', 'of_ad_top_image' );
|
||||
// Sanitise the token.
|
||||
|
||||
$_token = strtolower( str_replace( ' ', '_', $_token ) );
|
||||
|
||||
// if ( in_array( $_token, $_whitelist ) ) {
|
||||
if ( $_token ) {
|
||||
|
||||
// Tell the function what to look for in a post.
|
||||
|
||||
$_args = array( 'post_type' => 'optionsframework', 'post_name' => 'of-' . $_token, 'post_status' => 'draft', 'comment_status' => 'closed', 'ping_status' => 'closed' );
|
||||
|
||||
// Look in the database for a "silent" post that meets our criteria.
|
||||
$query = 'SELECT ID FROM ' . $wpdb->posts . ' WHERE post_parent = 0';
|
||||
foreach ( $_args as $k => $v ) {
|
||||
$query .= ' AND ' . $k . ' = "' . $v . '"';
|
||||
} // End FOREACH Loop
|
||||
|
||||
$query .= ' LIMIT 1';
|
||||
$_posts = $wpdb->get_row( $query );
|
||||
|
||||
// If we've got a post, loop through and get it's ID.
|
||||
if ( count( $_posts ) ) {
|
||||
$_id = $_posts->ID;
|
||||
} else {
|
||||
|
||||
// If no post is present, insert one.
|
||||
// Prepare some additional data to go with the post insertion.
|
||||
$_words = explode( '_', $_token );
|
||||
$_title = join( ' ', $_words );
|
||||
$_title = ucwords( $_title );
|
||||
$_post_data = array( 'post_title' => $_title );
|
||||
$_post_data = array_merge( $_post_data, $_args );
|
||||
$_id = wp_insert_post( $_post_data );
|
||||
}
|
||||
}
|
||||
return $_id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger code inside the Media Library popup.
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'optionsframework_mlu_insidepopup' ) ) {
|
||||
|
||||
function optionsframework_mlu_insidepopup () {
|
||||
|
||||
if ( isset( $_REQUEST['is_optionsframework'] ) && $_REQUEST['is_optionsframework'] == 'yes' ) {
|
||||
|
||||
add_action( 'admin_head', 'optionsframework_mlu_js_popup' );
|
||||
add_filter( 'media_upload_tabs', 'optionsframework_mlu_modify_tabs' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'optionsframework_mlu_js_popup' ) ) {
|
||||
|
||||
function optionsframework_mlu_js_popup () {
|
||||
|
||||
$_of_title = $_REQUEST['of_title'];
|
||||
if ( ! $_of_title ) { $_of_title = 'file'; } // End IF Statement
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
jQuery(function($) {
|
||||
|
||||
jQuery.noConflict();
|
||||
|
||||
// Change the title of each tab to use the custom title text instead of "Media File".
|
||||
$( 'h3.media-title' ).each ( function () {
|
||||
var current_title = $( this ).html();
|
||||
var new_title = current_title.replace( 'media file', '<?php echo $_of_title; ?>' );
|
||||
$( this ).html( new_title );
|
||||
|
||||
} );
|
||||
|
||||
// Change the text of the "Insert into Post" buttons to read "Use this File".
|
||||
$( '.savesend input.button[value*="Insert into Post"], .media-item #go_button' ).attr( 'value', 'Use this File' );
|
||||
|
||||
// Hide the "Insert Gallery" settings box on the "Gallery" tab.
|
||||
$( 'div#gallery-settings' ).hide();
|
||||
|
||||
// Preserve the "is_optionsframework" parameter on the "delete" confirmation button.
|
||||
$( '.savesend a.del-link' ).click ( function () {
|
||||
|
||||
var continueButton = $( this ).next( '.del-attachment' ).children( 'a.button[id*="del"]' );
|
||||
var continueHref = continueButton.attr( 'href' );
|
||||
continueHref = continueHref + '&is_optionsframework=yes';
|
||||
continueButton.attr( 'href', continueHref );
|
||||
|
||||
} );
|
||||
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered inside the Media Library popup to modify the title of the "Gallery" tab.
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'optionsframework_mlu_modify_tabs' ) ) {
|
||||
|
||||
function optionsframework_mlu_modify_tabs ( $tabs ) {
|
||||
$tabs['gallery'] = str_replace( __( 'Gallery', 'optionsframework' ), __( 'Previously Uploaded', 'optionsframework' ), $tabs['gallery'] );
|
||||
return $tabs;
|
||||
}
|
||||
}
|
||||
@ -1,361 +0,0 @@
|
||||
<?php
|
||||
|
||||
/* Text */
|
||||
|
||||
add_filter( 'of_sanitize_text', 'sanitize_text_field' );
|
||||
|
||||
/* Textarea */
|
||||
|
||||
function of_sanitize_textarea($input) {
|
||||
global $allowedposttags;
|
||||
$output = wp_kses( $input, $allowedposttags);
|
||||
return $output;
|
||||
}
|
||||
|
||||
add_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' );
|
||||
|
||||
/* Info */
|
||||
|
||||
add_filter( 'of_sanitize_info', 'of_sanitize_allowedposttags' );
|
||||
|
||||
/* Select */
|
||||
|
||||
add_filter( 'of_sanitize_select', 'of_sanitize_enum', 10, 2);
|
||||
|
||||
/* Radio */
|
||||
|
||||
add_filter( 'of_sanitize_radio', 'of_sanitize_enum', 10, 2);
|
||||
|
||||
/* Images */
|
||||
|
||||
add_filter( 'of_sanitize_images', 'of_sanitize_enum', 10, 2);
|
||||
|
||||
/* Checkbox */
|
||||
|
||||
function of_sanitize_checkbox( $input ) {
|
||||
if ( $input ) {
|
||||
$output = "1";
|
||||
} else {
|
||||
$output = "0";
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'of_sanitize_checkbox', 'of_sanitize_checkbox' );
|
||||
|
||||
/* Multicheck */
|
||||
|
||||
function of_sanitize_multicheck( $input, $option ) {
|
||||
$output = '';
|
||||
if ( is_array( $input ) ) {
|
||||
foreach( $option['options'] as $key => $value ) {
|
||||
$output[$key] = "0";
|
||||
}
|
||||
foreach( $input as $key => $value ) {
|
||||
if ( array_key_exists( $key, $option['options'] ) && $value ) {
|
||||
$output[$key] = "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'of_sanitize_multicheck', 'of_sanitize_multicheck', 10, 2 );
|
||||
|
||||
/* Color Picker */
|
||||
|
||||
add_filter( 'of_sanitize_color', 'of_sanitize_hex' );
|
||||
|
||||
/* Uploader */
|
||||
|
||||
function of_sanitize_upload( $input ) {
|
||||
$output = '';
|
||||
$filetype = wp_check_filetype($input);
|
||||
if ( $filetype["ext"] ) {
|
||||
$output = $input;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'of_sanitize_upload', 'of_sanitize_upload' );
|
||||
|
||||
/* Allowed Tags */
|
||||
|
||||
function of_sanitize_allowedtags($input) {
|
||||
global $allowedtags;
|
||||
$output = wpautop(wp_kses( $input, $allowedtags));
|
||||
return $output;
|
||||
}
|
||||
|
||||
add_filter( 'of_sanitize_info', 'of_sanitize_allowedtags' );
|
||||
|
||||
/* Allowed Post Tags */
|
||||
|
||||
function of_sanitize_allowedposttags($input) {
|
||||
global $allowedposttags;
|
||||
$output = wpautop(wp_kses( $input, $allowedposttags));
|
||||
return $output;
|
||||
}
|
||||
|
||||
add_filter( 'of_sanitize_info', 'of_sanitize_allowedposttags' );
|
||||
|
||||
|
||||
/* Check that the key value sent is valid */
|
||||
|
||||
function of_sanitize_enum( $input, $option ) {
|
||||
$output = '';
|
||||
if ( array_key_exists( $input, $option['options'] ) ) {
|
||||
$output = $input;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/* Background */
|
||||
|
||||
function of_sanitize_background( $input ) {
|
||||
$output = wp_parse_args( $input, array(
|
||||
'color' => '',
|
||||
'image' => '',
|
||||
'repeat' => 'repeat',
|
||||
'position' => 'top center',
|
||||
'attachment' => 'scroll'
|
||||
) );
|
||||
|
||||
$output['color'] = apply_filters( 'of_sanitize_hex', $input['color'] );
|
||||
$output['image'] = apply_filters( 'of_sanitize_upload', $input['image'] );
|
||||
$output['repeat'] = apply_filters( 'of_background_repeat', $input['repeat'] );
|
||||
$output['position'] = apply_filters( 'of_background_position', $input['position'] );
|
||||
$output['attachment'] = apply_filters( 'of_background_attachment', $input['attachment'] );
|
||||
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'of_sanitize_background', 'of_sanitize_background' );
|
||||
|
||||
function of_sanitize_background_repeat( $value ) {
|
||||
$recognized = of_recognized_background_repeat();
|
||||
if ( array_key_exists( $value, $recognized ) ) {
|
||||
return $value;
|
||||
}
|
||||
return apply_filters( 'of_default_background_repeat', current( $recognized ) );
|
||||
}
|
||||
add_filter( 'of_background_repeat', 'of_sanitize_background_repeat' );
|
||||
|
||||
function of_sanitize_background_position( $value ) {
|
||||
$recognized = of_recognized_background_position();
|
||||
if ( array_key_exists( $value, $recognized ) ) {
|
||||
return $value;
|
||||
}
|
||||
return apply_filters( 'of_default_background_position', current( $recognized ) );
|
||||
}
|
||||
add_filter( 'of_background_position', 'of_sanitize_background_position' );
|
||||
|
||||
function of_sanitize_background_attachment( $value ) {
|
||||
$recognized = of_recognized_background_attachment();
|
||||
if ( array_key_exists( $value, $recognized ) ) {
|
||||
return $value;
|
||||
}
|
||||
return apply_filters( 'of_default_background_attachment', current( $recognized ) );
|
||||
}
|
||||
add_filter( 'of_background_attachment', 'of_sanitize_background_attachment' );
|
||||
|
||||
|
||||
/* Typography */
|
||||
|
||||
function of_sanitize_typography( $input ) {
|
||||
$output = wp_parse_args( $input, array(
|
||||
'size' => '',
|
||||
'face' => '',
|
||||
'style' => '',
|
||||
'color' => ''
|
||||
) );
|
||||
|
||||
$output['size'] = apply_filters( 'of_font_size', $output['size'] );
|
||||
$output['face'] = apply_filters( 'of_font_face', $output['face'] );
|
||||
$output['style'] = apply_filters( 'of_font_style', $output['style'] );
|
||||
$output['color'] = apply_filters( 'of_color', $output['color'] );
|
||||
|
||||
return $output;
|
||||
}
|
||||
add_filter( 'of_sanitize_typography', 'of_sanitize_typography' );
|
||||
|
||||
|
||||
function of_sanitize_font_size( $value ) {
|
||||
$recognized = of_recognized_font_sizes();
|
||||
$value = preg_replace('/px/','', $value);
|
||||
if ( in_array( (int) $value, $recognized ) ) {
|
||||
return (int) $value;
|
||||
}
|
||||
return (int) apply_filters( 'of_default_font_size', $recognized );
|
||||
}
|
||||
add_filter( 'of_font_face', 'of_sanitize_font_face' );
|
||||
|
||||
|
||||
function of_sanitize_font_style( $value ) {
|
||||
$recognized = of_recognized_font_styles();
|
||||
if ( array_key_exists( $value, $recognized ) ) {
|
||||
return $value;
|
||||
}
|
||||
return apply_filters( 'of_default_font_style', current( $recognized ) );
|
||||
}
|
||||
add_filter( 'of_font_style', 'of_sanitize_font_style' );
|
||||
|
||||
|
||||
function of_sanitize_font_face( $value ) {
|
||||
$recognized = of_recognized_font_faces();
|
||||
if ( array_key_exists( $value, $recognized ) ) {
|
||||
return $value;
|
||||
}
|
||||
return apply_filters( 'of_default_font_face', current( $recognized ) );
|
||||
}
|
||||
add_filter( 'of_font_face', 'of_sanitize_font_face' );
|
||||
|
||||
/**
|
||||
* Get recognized background repeat settings
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
function of_recognized_background_repeat() {
|
||||
$default = array(
|
||||
'no-repeat' => 'No Repeat',
|
||||
'repeat-x' => 'Repeat Horizontally',
|
||||
'repeat-y' => 'Repeat Vertically',
|
||||
'repeat' => 'Repeat All',
|
||||
);
|
||||
return apply_filters( 'of_recognized_background_repeat', $default );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recognized background positions
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
function of_recognized_background_position() {
|
||||
$default = array(
|
||||
'top left' => 'Top Left',
|
||||
'top center' => 'Top Center',
|
||||
'top right' => 'Top Right',
|
||||
'center left' => 'Middle Left',
|
||||
'center center' => 'Middle Center',
|
||||
'center right' => 'Middle Right',
|
||||
'bottom left' => 'Bottom Left',
|
||||
'bottom center' => 'Bottom Center',
|
||||
'bottom right' => 'Bottom Right'
|
||||
);
|
||||
return apply_filters( 'of_recognized_background_position', $default );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recognized background attachment
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
function of_recognized_background_attachment() {
|
||||
$default = array(
|
||||
'scroll' => 'Scroll Normally',
|
||||
'fixed' => 'Fixed in Place'
|
||||
);
|
||||
return apply_filters( 'of_recognized_background_attachment', $default );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize a color represented in hexidecimal notation.
|
||||
*
|
||||
* @param string Color in hexidecimal notation. "#" may or may not be prepended to the string.
|
||||
* @param string The value that this function should return if it cannot be recognized as a color.
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
|
||||
function of_sanitize_hex( $hex, $default = '' ) {
|
||||
if ( of_validate_hex( $hex ) ) {
|
||||
return $hex;
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recognized font sizes.
|
||||
*
|
||||
* Returns an indexed array of all recognized font sizes.
|
||||
* Values are integers and represent a range of sizes from
|
||||
* smallest to largest.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
||||
function of_recognized_font_sizes() {
|
||||
$sizes = range( 9, 71 );
|
||||
$sizes = apply_filters( 'of_recognized_font_sizes', $sizes );
|
||||
$sizes = array_map( 'absint', $sizes );
|
||||
return $sizes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recognized font faces.
|
||||
*
|
||||
* Returns an array of all recognized font faces.
|
||||
* Keys are intended to be stored in the database
|
||||
* while values are ready for display in in html.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
function of_recognized_font_faces() {
|
||||
$default = array(
|
||||
'arial' => 'Arial',
|
||||
'verdana' => 'Verdana, Geneva',
|
||||
'trebuchet' => 'Trebuchet',
|
||||
'georgia' => 'Georgia',
|
||||
'times' => 'Times New Roman',
|
||||
'tahoma' => 'Tahoma, Geneva',
|
||||
'palatino' => 'Palatino',
|
||||
'helvetica' => 'Helvetica*'
|
||||
);
|
||||
return apply_filters( 'of_recognized_font_faces', $default );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recognized font styles.
|
||||
*
|
||||
* Returns an array of all recognized font styles.
|
||||
* Keys are intended to be stored in the database
|
||||
* while values are ready for display in in html.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
function of_recognized_font_styles() {
|
||||
$default = array(
|
||||
'normal' => 'Normal',
|
||||
'italic' => 'Italic',
|
||||
'bold' => 'Bold',
|
||||
'bold italic' => 'Bold Italic'
|
||||
);
|
||||
return apply_filters( 'of_recognized_font_styles', $default );
|
||||
}
|
||||
|
||||
/**
|
||||
* Is a given string a color formatted in hexidecimal notation?
|
||||
*
|
||||
* @param string Color in hexidecimal notation. "#" may or may not be prepended to the string.
|
||||
* @return bool
|
||||
*
|
||||
*/
|
||||
|
||||
function of_validate_hex( $hex ) {
|
||||
$hex = trim( $hex );
|
||||
/* Strip recognized prefixes. */
|
||||
if ( 0 === strpos( $hex, '#' ) ) {
|
||||
$hex = substr( $hex, 1 );
|
||||
}
|
||||
elseif ( 0 === strpos( $hex, '%23' ) ) {
|
||||
$hex = substr( $hex, 3 );
|
||||
}
|
||||
/* Regex match. */
|
||||
if ( 0 === preg_match( '/^[0-9a-fA-F]{6}$/', $hex ) ) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1,46 +0,0 @@
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<?php do_action( 'bp_before_archive' ) ?>
|
||||
|
||||
<div class="blog-heading">
|
||||
<?php if ( is_day() ) : ?>
|
||||
<em class="fr"><?php _e('Daily Archives', 'huddle'); ?></em>
|
||||
<h3 class="fl"><?php printf( __( '%s', 'huddle' ), get_the_date() ); ?></h3>
|
||||
<?php elseif ( is_month() ) : ?>
|
||||
<em class="fr"><?php _e('Monthly Archives', 'huddle'); ?></em>
|
||||
<h3 class="fl"><?php printf( __( '%s', 'huddle' ), get_the_date('F Y') ); ?></h3>
|
||||
<?php elseif ( is_year() ) : ?>
|
||||
<em class="fr"><?php _e('Yearly Archives', 'huddle'); ?></em>
|
||||
<h3 class="fl"><?php printf( __( '%s', 'huddle' ), get_the_date('Y') ); ?></h3>
|
||||
<?php elseif ( is_category() ) : ?>
|
||||
<em class="fr"><?php _e('Category', 'huddle'); ?></em>
|
||||
<h3 class="fl"><?php single_cat_title(); ?></h3>
|
||||
<?php elseif ( is_tag() ) : ?>
|
||||
<em class="fr"><?php _e('Tag', 'huddle'); ?></em>
|
||||
<h3 class="fl"><?php single_tag_title(); ?></h3>
|
||||
<?php elseif ( is_author() ) : ?>
|
||||
<?php $curauth = $wp_query->get_queried_object() ?>
|
||||
<h3 class="fl"><?php echo $curauth->display_name; ?></h3>
|
||||
<em class="fr"><?php _e('Author', 'huddle'); ?></em>
|
||||
<?php else : ?>
|
||||
<em class="fr"><?php _e('Blog Archives', 'huddle'); ?></em>
|
||||
<h3 class="fl"><?php printf( __( '%s', 'huddle' ), get_the_date() ); ?></h3>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div><!--.blog-heading-->
|
||||
|
||||
<?php // Include the WordPress loop file
|
||||
load_template( TEMPLATEPATH . '/includes/loop.php' );
|
||||
?>
|
||||
|
||||
<?php do_action( 'bp_after_archive' ) ?>
|
||||
|
||||
</div><!--#main-->
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
@ -1,83 +0,0 @@
|
||||
|
||||
<?php do_action( 'bp_before_blogs_loop' ); ?>
|
||||
|
||||
<?php if ( bp_has_blogs( bp_ajax_querystring( 'blogs' ) ) ) : ?>
|
||||
|
||||
<div id="pag-top" class="pagination">
|
||||
|
||||
<div class="pag-count" id="blog-dir-count-top">
|
||||
<?php bp_blogs_pagination_count(); ?>
|
||||
</div>
|
||||
|
||||
<div class="pagination-links" id="blog-dir-pag-top">
|
||||
<?php bp_blogs_pagination_links(); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_before_directory_blogs_list' ); ?>
|
||||
|
||||
<ul id="blogs-list" class="item-list" role="main">
|
||||
|
||||
<?php while ( bp_blogs() ) : bp_the_blog(); ?>
|
||||
|
||||
<li>
|
||||
<div class="item-avatar">
|
||||
<a href="<?php bp_blog_permalink(); ?>"><?php bp_blog_avatar( 'type=thumb' ); ?></a>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="item-title"><a href="<?php bp_blog_permalink(); ?>"><?php bp_blog_name(); ?></a></div>
|
||||
<div class="item-meta"><span class="activity"><?php bp_blog_last_active(); ?></span></div>
|
||||
|
||||
<?php do_action( 'bp_directory_blogs_item' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="action">
|
||||
|
||||
<?php do_action( 'bp_directory_blogs_actions' ); ?>
|
||||
|
||||
<div class="meta">
|
||||
|
||||
<?php bp_blog_latest_post(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</li>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php do_action( 'bp_after_directory_blogs_list' ); ?>
|
||||
|
||||
<?php bp_blog_hidden_fields(); ?>
|
||||
|
||||
<div id="pag-bottom" class="pagination">
|
||||
|
||||
<div class="pag-count" id="blog-dir-count-bottom">
|
||||
|
||||
<?php bp_blogs_pagination_count(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="pagination-links" id="blog-dir-pag-bottom">
|
||||
|
||||
<?php bp_blogs_pagination_links(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'Sorry, there were no sites found.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_blogs_loop' ); ?>
|
||||
@ -1,36 +0,0 @@
|
||||
|
||||
<?php get_header( 'buddypress' ); ?>
|
||||
|
||||
<?php do_action( 'bp_before_directory_blogs_content' ); ?>
|
||||
|
||||
<div id="content">
|
||||
<div class="padder" role="main">
|
||||
|
||||
<?php do_action( 'template_notices' ); ?>
|
||||
|
||||
<h3><?php _e( 'Create a Site', 'huddle' ); ?> <a class="button" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) ?>"><?php _e( 'Site Directory', 'huddle' ); ?></a></h3>
|
||||
|
||||
<?php do_action( 'bp_before_create_blog_content' ); ?>
|
||||
|
||||
<?php if ( bp_blog_signup_enabled() ) : ?>
|
||||
|
||||
<?php bp_show_blog_signup_form(); ?>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'Site registration is currently disabled', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_create_blog_content' ); ?>
|
||||
|
||||
</div><!-- .padder -->
|
||||
</div><!-- #content -->
|
||||
|
||||
<?php do_action( 'bp_after_directory_blogs_content' ); ?>
|
||||
|
||||
<?php get_sidebar( 'buddypress' ); ?>
|
||||
<?php get_footer( 'buddypress' ); ?>
|
||||
|
||||
@ -1,84 +0,0 @@
|
||||
|
||||
<?php get_header( 'buddypress' ); ?>
|
||||
|
||||
<?php do_action( 'bp_before_directory_blogs_page' ); ?>
|
||||
|
||||
<div id="content">
|
||||
<div class="padder">
|
||||
|
||||
<?php do_action( 'bp_before_directory_blogs' ); ?>
|
||||
|
||||
<form action="" method="post" id="blogs-directory-form" class="dir-form">
|
||||
|
||||
<?php
|
||||
global $bp_blogs, $blogs_template;
|
||||
$bp_blogs = bp_has_blogs( bp_ajax_querystring( 'blogs' ) );
|
||||
$max_pages = max( ceil( $blogs_template->total_blog_count / 14 ), 1 );
|
||||
?>
|
||||
|
||||
<h3><?php _e( 'Site Directory', 'huddle' ); ?></h3>
|
||||
<p class="subtitle">
|
||||
<?php bp_blogs_pagination_count(); ?>
|
||||
<?php if ( is_user_logged_in() && bp_blog_signup_enabled() ) : ?> <a class="btn-gray quick-create-blog" href="<?php echo add_query_arg( 'w-iframe', '1', bp_get_root_domain() . '/' . bp_get_blogs_slug() . '/create/' ) ?>"><?php _e( 'Create a Blog', 'huddle' ); ?></a><?php endif; ?>
|
||||
</p>
|
||||
|
||||
<?php do_action( 'bp_before_directory_blogs_content' ); ?>
|
||||
|
||||
<div id="blog-dir-search" class="dir-search" role="search">
|
||||
|
||||
<?php bp_directory_blogs_search_form(); ?>
|
||||
|
||||
</div><!-- #blog-dir-search -->
|
||||
|
||||
<div class="item-list-tabs" id="subnav" role="navigation">
|
||||
<ul>
|
||||
|
||||
<?php do_action( 'bp_blogs_directory_blog_sub_types' ); ?>
|
||||
|
||||
<li><a class="blogs-sort-link sort-active" href="#active"><?php _e( 'Last Active', 'huddle' ) ?></a></li>
|
||||
<li><a class="blogs-sort-link sort-newest" href="#newest"><?php _e( 'Newly Created', 'huddle' ) ?></a></li>
|
||||
<li><a class="blogs-sort-link sort-alphabetical" href="#alphabetical"><?php _e( 'Alphabetical', 'huddle' ) ?></a></li>
|
||||
|
||||
<li id="blogs-order-select" class="last filter">
|
||||
|
||||
<label for="blogs-order-by"><?php _e( 'Order By:', 'huddle' ); ?></label>
|
||||
<select id="blogs-order-by">
|
||||
<option value="active"><?php _e( 'Last Active', 'huddle' ); ?></option>
|
||||
<option value="newest"><?php _e( 'Newest', 'huddle' ); ?></option>
|
||||
<option value="alphabetical"><?php _e( 'Alphabetical', 'huddle' ); ?></option>
|
||||
|
||||
<?php do_action( 'bp_blogs_directory_order_options' ); ?>
|
||||
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="blogs-dir-list" class="blogs dir-list">
|
||||
|
||||
<?php locate_template( array( 'blogs/blogs-loop.php' ), true ); ?>
|
||||
|
||||
</div><!-- #blogs-dir-list -->
|
||||
|
||||
<div class="item-list-tabs for-bottom">
|
||||
<p class="pagination fl"><?php bp_blogs_pagination_links(); ?></p>
|
||||
<p class="pages-count fr"><?php printf( __( 'Page %d of %d', 'huddle' ), isset( $_GET['upage'] ) ? $_GET['upage'] : 1, $max_pages ) ?></p>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_directory_blogs_content' ); ?>
|
||||
|
||||
<?php wp_nonce_field( 'directory_blogs', '_wpnonce-blogs-filter' ); ?>
|
||||
|
||||
<?php do_action( 'bp_after_directory_blogs_content' ); ?>
|
||||
|
||||
</form><!-- #blogs-directory-form -->
|
||||
|
||||
<?php do_action( 'bp_after_directory_blogs' ); ?>
|
||||
|
||||
</div><!-- .padder -->
|
||||
</div><!-- #content -->
|
||||
|
||||
<?php do_action( 'bp_after_directory_blogs_page' ); ?>
|
||||
|
||||
<?php get_sidebar( 'buddypress' ); ?>
|
||||
<?php get_footer( 'buddypress' ); ?>
|
||||
@ -1,29 +0,0 @@
|
||||
== Changelog ==
|
||||
|
||||
= 1.7 =
|
||||
|
||||
* Better CSS support for plugins
|
||||
* Fix CSS issues for BuddyPress pages
|
||||
* Change directory listing pages to a 2 column layout
|
||||
* Misc small cross-browser CSS corrections
|
||||
* Better integration for child themes
|
||||
|
||||
= 1.6 =
|
||||
|
||||
* Fix redirect url when activating account
|
||||
|
||||
= 1.5 =
|
||||
|
||||
* Fix a bug for Members/Groups Directory, buttons were breaking markup
|
||||
* Fix a bug for Activate Account page
|
||||
* Redirect to single group page after group is created
|
||||
* Fix markup for BuddyPress plugins
|
||||
|
||||
= 1.4 =
|
||||
|
||||
* Fix a bug for 'Create Group' button
|
||||
* CSS changes
|
||||
|
||||
= 1.0 =
|
||||
|
||||
* Initial release
|
||||
@ -1,76 +0,0 @@
|
||||
|
||||
<?php if ( post_password_required() ) : ?>
|
||||
<p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'huddle' ); ?></p>
|
||||
<?php
|
||||
return;
|
||||
endif;
|
||||
?>
|
||||
|
||||
|
||||
<?php if ( have_comments() ) : ?>
|
||||
|
||||
<div class="post-comments" id="comments">
|
||||
|
||||
<p><a class="to-respond" href="#respond"><?php _e( 'Leave Your Comment →', 'huddle' ) ?></a></p>
|
||||
<h3><?php comments_number(__('No comments', 'huddle'), __('1 Comment', 'huddle'), __('% Comments', 'huddle')); ?></h3>
|
||||
|
||||
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
|
||||
<div id="pagination" class="for-comments-top">
|
||||
<span class="pages"><?php _e( 'Pages', 'huddle' ) ?></span>
|
||||
<?php echo paginate_comments_links() ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<ol class="commentlist">
|
||||
<?php wp_list_comments('callback=huddle_comments'); ?>
|
||||
</ol>
|
||||
|
||||
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
|
||||
<div id="pagination" class="for-comments-bottom">
|
||||
<span class="pages"><?php _e( 'Pages', 'huddle' ) ?></span>
|
||||
<?php echo paginate_comments_links() ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php else : // this is displayed if there are no comments so far ?>
|
||||
<?php if ( comments_open() ) : ?>
|
||||
<!-- If comments are open, but there are no comments. -->
|
||||
<?php else : // comments are closed ?>
|
||||
<!-- If comments are closed. -->
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
add_action( 'comment_form', 'huddle_comment_submit_btn' );
|
||||
function huddle_comment_submit_btn($post_id) {
|
||||
?>
|
||||
<p><button><?php _e( 'Submit Comment <span>→</span>', 'huddle' ) ?></button></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
global $aria_req;
|
||||
comment_form( array(
|
||||
'comment_field' => '<textarea name="comment" id="comment" tabindex="4" rows="7" cols="10"></textarea><label for="comment"></label><br><br>',
|
||||
'comment_notes_before' => '',
|
||||
'comment_notes_after' => '',
|
||||
'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post->ID ) ) ) ) . '</p><br />',
|
||||
'title_reply' => __( 'Add Your Comment', 'huddle' ),
|
||||
'title_reply_to' => __( 'Add Your Comment', 'huddle' ),
|
||||
'cancel_reply_link' => __( 'Cancel Reply To Comment →', 'huddle' ),
|
||||
'label_submit' => __( 'Submit Comment →', 'huddle' ),
|
||||
'id_submit' => 'comment-submit',
|
||||
'fields' => array(
|
||||
'author' => '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" placeholder="' . __( 'Name', 'huddle' ) . '" ' . $aria_req . ' />' .
|
||||
''. ( $req ? '<span class="required"><span>*</span> '.__('Required', 'huddle').'</span>' : '' ) .'<br><br>',
|
||||
'email' => '<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" placeholder="' . __( 'Email', 'huddle' ) . '" ' . $aria_req . ' />' .
|
||||
''. ( $req ? '<span class="required"><span>*</span> '.__('Required', 'huddle').'</span>' : '' ) .'<br><br>',
|
||||
'url' => '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" placeholder="' . __( 'Website', 'huddle' ) . '" />' .
|
||||
'<br><br>'
|
||||
)
|
||||
) );
|
||||
|
||||
?>
|
||||
@ -1,30 +0,0 @@
|
||||
<?php if( ! isset( $_GET['w-iframe'] ) ) : ?>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php do_action( 'bp_after_container' ) ?>
|
||||
|
||||
<?php if( is_singular( 'post' ) || is_home() ) get_sidebar( 'footer' ) ?>
|
||||
|
||||
<?php do_action( 'bp_before_footer' ) ?>
|
||||
|
||||
<div id="footer">
|
||||
|
||||
<p class="fl"><?php echo of_get_option( 'footer_text', 'Copyright © 2011. All Rights Reserved' ) ?></p>
|
||||
|
||||
<?php wp_nav_menu( array( 'theme_location' => 'footer-menu', 'container' => false ) ); ?>
|
||||
|
||||
<?php do_action( 'bp_footer' ) ?>
|
||||
|
||||
</div><!-- #footer -->
|
||||
|
||||
<?php do_action( 'bp_after_footer' ) ?>
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
</div><!-- #main -->
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,97 +0,0 @@
|
||||
<?php do_action( 'bp_before_forums_loop' ); ?>
|
||||
|
||||
<?php
|
||||
global $bp_forum_topics, $forum_template;
|
||||
if( ! $bp_forum_topics ) $bp_forum_topics = bp_has_forum_topics( bp_ajax_querystring( 'forums' ) );
|
||||
?>
|
||||
|
||||
<?php if ( $bp_forum_topics ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_directory_forums_list' ); ?>
|
||||
|
||||
<table class="forum">
|
||||
<tbody>
|
||||
|
||||
<?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?>
|
||||
|
||||
<tr class="<?php bp_the_topic_css_class(); ?>">
|
||||
<td class="td-title">
|
||||
<?php bp_the_topic_poster_avatar( 'width=35&height=35' ) ?>
|
||||
|
||||
<a class="topic-title" href="<?php bp_the_topic_permalink(); ?>" title="<?php bp_the_topic_title(); ?> - <?php _e( 'Permalink', 'huddle' ); ?>">
|
||||
<?php bp_the_topic_title(); ?>
|
||||
</a>
|
||||
|
||||
<p class="topic-meta">
|
||||
<span class="topic-by"><?php printf( __( 'By · %1$s', 'huddle' ), bp_get_the_topic_poster_name() ); ?></span>,
|
||||
<span class="topic-on"><?php printf( __( 'On · %1$s', 'huddle' ), date( 'm.d.Y', strtotime( bp_get_the_topic_time() ) ) ); ?></span>
|
||||
</p>
|
||||
</td>
|
||||
|
||||
<td class="td-group">
|
||||
<?php if ( !bp_is_group_forum() ) : ?>
|
||||
|
||||
<p class="topic-meta">
|
||||
<?php bp_the_topic_object_avatar( 'width=35&height=35' ) ?>
|
||||
|
||||
<span><?php _e( 'Posted in Group', 'huddle' ) ?></span>
|
||||
</p>
|
||||
|
||||
<p class="topic-meta">
|
||||
<span>
|
||||
<?php
|
||||
$topic_in = '<a href="' . bp_get_the_topic_object_permalink() . '" title="' . bp_get_the_topic_object_name() . '">' . bp_get_the_topic_object_name() .'</a>';
|
||||
|
||||
printf( __( '%1$s', 'huddle' ), $topic_in );
|
||||
?>
|
||||
</span>
|
||||
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
<td class="td-freshness">
|
||||
<?php bp_the_topic_last_poster_avatar( 'width=35&height=35' ); ?>
|
||||
|
||||
<span class="time-since"><?php printf( __( 'Last Reply %s', 'huddle' ), bp_get_the_topic_time_since_last_post() ); ?></span>
|
||||
<p class="topic-meta">
|
||||
<span class="freshness-author">
|
||||
<?php _e( 'By · ', 'huddle' ); bp_the_topic_last_poster_name(); ?>
|
||||
</span>
|
||||
</p>
|
||||
</td>
|
||||
|
||||
<td class="td-postcount">
|
||||
<a href="<?php bp_the_topic_permalink(); ?>">
|
||||
<?php printf( _n( "<b>%d</b> Reply", "<b>%d</b> Replies", bp_get_the_topic_total_posts() ), bp_get_the_topic_total_posts() ); ?>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<?php do_action( 'bp_directory_forums_extra_cell' ); ?>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php do_action( 'bp_directory_forums_extra_row' ); ?>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php do_action( 'bp_after_directory_forums_list' ); ?>
|
||||
|
||||
<div class="item-list-tabs for-bottom ">
|
||||
<p class="pagination fl"><?php bp_forum_pagination(); ?></p>
|
||||
<p class="pages-count fr"><?php printf( __( 'Page %d of %d', 'huddle' ), isset( $_GET['upage'] ) ? $_GET['upage'] : 1, ceil( $forum_template->total_topic_count / 21 ) ) ?></p>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'Sorry, there were no forum topics found.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_forums_loop' ); ?>
|
||||
@ -1,90 +0,0 @@
|
||||
<?php do_action( 'bp_before_forums_loop' ); ?>
|
||||
|
||||
<?php if ( bp_has_forum_topics( bp_ajax_querystring( 'forums' ) ) ) : ?>
|
||||
|
||||
<div id="pag-top" class="pagination">
|
||||
|
||||
<div class="pag-count" id="group-topic-count-top">
|
||||
|
||||
<?php bp_forum_pagination_count(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_before_directory_forums_list' ); ?>
|
||||
|
||||
<table class="forum">
|
||||
<tbody>
|
||||
|
||||
<?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?>
|
||||
|
||||
<tr class="<?php bp_the_topic_css_class(); ?>">
|
||||
<td class="td-title">
|
||||
|
||||
<?php bp_the_topic_poster_avatar( 'width=35&height=35' ) ?>
|
||||
|
||||
<a class="topic-title" href="<?php bp_the_topic_permalink(); ?>" title="<?php bp_the_topic_title(); ?> - <?php _e( 'Permalink', 'huddle' ); ?>">
|
||||
<?php bp_the_topic_title(); ?>
|
||||
</a>
|
||||
|
||||
<p class="topic-meta">
|
||||
<span class="topic-by"><?php printf( __( 'By · %1$s', 'huddle' ), bp_get_the_topic_poster_name() ); ?></span>,
|
||||
<span class="topic-on"><?php printf( __( 'On · %1$s', 'huddle' ), date( 'm.d.Y', strtotime( bp_get_the_topic_time() ) ) ); ?></span>
|
||||
|
||||
<?php if ( !bp_is_group_forum() ) : ?>
|
||||
|
||||
<span class="topic-in">
|
||||
|
||||
<?php
|
||||
$topic_in = '' .
|
||||
'<a href="' . bp_get_the_topic_object_permalink() . '" title="' . bp_get_the_topic_object_name() . '">' . bp_get_the_topic_object_name() .'</a>';
|
||||
|
||||
/* translators: "started by [poster] in [forum]" */
|
||||
printf( __( 'in %1$s', 'huddle' ), $topic_in );
|
||||
?>
|
||||
|
||||
</span>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</p>
|
||||
</td>
|
||||
<td class="td-freshness">
|
||||
<?php bp_the_topic_last_poster_avatar( 'width=35&height=35' ); ?>
|
||||
|
||||
<span class="time-since"><?php _e( 'Last Reply ', 'huddle' ); bp_the_topic_time_since_last_post(); ?></span>
|
||||
<p class="topic-meta">
|
||||
<span class="freshness-author">
|
||||
<?php _e( 'By · ', 'huddle' ); bp_the_topic_last_poster_name(); ?>
|
||||
</span>
|
||||
</p>
|
||||
</td>
|
||||
<td class="td-postcount">
|
||||
<a href="<?php bp_the_topic_permalink(); ?>">
|
||||
<?php printf( _n( "<b>%d</b> Reply", "<b>%d</b> Replies", bp_get_the_topic_total_posts() ), bp_get_the_topic_total_posts() ); ?>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<?php do_action( 'bp_directory_forums_extra_cell' ); ?>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php do_action( 'bp_directory_forums_extra_row' ); ?>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php do_action( 'bp_after_directory_forums_list' ); ?>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'Sorry, there were no forum topics found.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_forums_loop' ); ?>
|
||||
@ -1,165 +0,0 @@
|
||||
|
||||
<?php get_header( 'buddypress' ); ?>
|
||||
|
||||
<?php do_action( 'bp_before_directory_forums_page' ); ?>
|
||||
|
||||
<?php do_action( 'bp_before_directory_forums' ); ?>
|
||||
|
||||
<?php
|
||||
global $bp_forum_topics;
|
||||
$bp_forum_topics = bp_has_forum_topics( bp_ajax_querystring( 'forums' ) );
|
||||
?>
|
||||
|
||||
<form action="" method="post" id="forums-search-form" class="dir-form">
|
||||
|
||||
<h3><?php _e( 'Forums Directory', 'huddle' ); ?></h3>
|
||||
<p class="subtitle">
|
||||
<?php bp_forum_pagination_count(); ?>
|
||||
<?php if ( is_user_logged_in() ) : ?> <a class="button btn-gray show-hide-new" href="#new-topic" id="new-topic-button"><?php _e( 'New Topic', 'huddle' ); ?></a><?php endif; ?>
|
||||
</p>
|
||||
|
||||
<?php do_action( 'bp_before_directory_forums_content' ); ?>
|
||||
|
||||
<div id="forums-dir-search" class="dir-search" role="search">
|
||||
|
||||
<?php bp_directory_forums_search_form(); ?>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<?php do_action( 'bp_before_topics' ); ?>
|
||||
|
||||
<form action="" method="post" id="forums-directory-form" class="dir-form">
|
||||
|
||||
<div class="forums-nav item-list-tabs" role="navigation">
|
||||
<ul>
|
||||
<li class="selected" id="forums-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() ); ?>"><?php printf( __( 'All Topics <span>%s</span>', 'huddle' ), bp_get_forum_topic_count() ); ?></a></li>
|
||||
|
||||
<?php if ( is_user_logged_in() && bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ) : ?>
|
||||
|
||||
<li id="forums-personal"><a href="<?php echo trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() . '/topics' ); ?>"><?php printf( __( 'My Topics <span>%s</span>', 'huddle' ), bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_forums_directory_group_types' ); ?>
|
||||
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
<li><a class="button show-hide-new" href="#new-topic" id="new-topic-button"><?php _e( 'New Topic', 'huddle' ); ?></a></li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
|
||||
|
||||
<li id="forums-order-select" class="last filter">
|
||||
|
||||
<label for="forums-order-by"><?php _e( 'Order By:', 'huddle' ); ?></label>
|
||||
<select id="forums-order-by">
|
||||
<option value="active"><?php _e( 'Last Active', 'huddle' ); ?></option>
|
||||
<option value="popular"><?php _e( 'Most Posts', 'huddle' ); ?></option>
|
||||
<option value="unreplied"><?php _e( 'Unreplied', 'huddle' ); ?></option>
|
||||
|
||||
<?php do_action( 'bp_forums_directory_order_options' ); ?>
|
||||
|
||||
</select>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="forums-dir-list" class="forums dir-list" role="main">
|
||||
|
||||
<?php locate_template( array( 'forums/forums-loop.php' ), true ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_directory_forums_content' ); ?>
|
||||
|
||||
<?php wp_nonce_field( 'directory_forums', '_wpnonce-forums-filter' ); ?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php do_action( 'bp_after_directory_forums' ); ?>
|
||||
|
||||
<?php do_action( 'bp_before_new_topic_form' ); ?>
|
||||
|
||||
<div id="new-topic-post" class="message-box">
|
||||
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
|
||||
<?php if ( bp_is_active( 'groups' ) && bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100' ) ) : ?>
|
||||
|
||||
<form action="" method="post" id="forum-topic-form" class="standard-form">
|
||||
|
||||
<?php do_action( 'groups_forum_new_topic_before' ) ?>
|
||||
|
||||
<a name="post-new"></a>
|
||||
<h5><?php _e( 'Create New Topic:', 'huddle' ); ?></h5>
|
||||
<br />
|
||||
|
||||
<?php do_action( 'template_notices' ); ?>
|
||||
|
||||
<p class="editfield">
|
||||
<label><?php _e( 'Title:', 'huddle' ); ?></label>
|
||||
<input type="text" name="topic_title" id="topic_title" value="" />
|
||||
</p>
|
||||
|
||||
<p class="editfield">
|
||||
<label><?php _e( 'Content:', 'huddle' ); ?></label>
|
||||
<textarea name="topic_text" rows="5" cols="31" id="topic_text"></textarea>
|
||||
</p>
|
||||
|
||||
<p class="editfield">
|
||||
<label><?php _e( 'Tags (comma separated):', 'huddle' ); ?></label>
|
||||
<input type="text" name="topic_tags" id="topic_tags" value="" />
|
||||
</p>
|
||||
|
||||
<p class="editfield">
|
||||
<label><?php _e( 'Post In Group Forum:', 'huddle' ); ?></label>
|
||||
<select id="topic_group_id" name="topic_group_id">
|
||||
|
||||
<option value=""><?php /* translators: no option picked in select box */ _e( '----', 'huddle' ); ?></option>
|
||||
|
||||
<?php while ( bp_groups() ) : bp_the_group(); ?>
|
||||
|
||||
<?php if ( bp_group_is_forum_enabled() && ( is_super_admin() || 'public' == bp_get_group_status() || bp_group_is_member() ) ) : ?>
|
||||
|
||||
<option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
</select><!-- #topic_group_id -->
|
||||
</p>
|
||||
|
||||
<?php do_action( 'groups_forum_new_topic_after' ); ?>
|
||||
|
||||
<div class="submit">
|
||||
<input type="submit" class="btn-gray" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'huddle' ); ?>" />
|
||||
<input type="button" class="btn-gray" name="submit_topic_cancel" id="submit_topic_cancel" value="<?php _e( 'Cancel', 'huddle' ); ?>" />
|
||||
</div>
|
||||
|
||||
<?php wp_nonce_field( 'bp_forums_new_topic' ); ?>
|
||||
|
||||
</form><!-- #forum-topic-form -->
|
||||
|
||||
<?php elseif ( bp_is_active( 'groups' ) ) : ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
|
||||
<p><?php printf( __( "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum.", 'huddle' ), site_url( bp_get_groups_root_slug() . '/create/' ) ) ?></p>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
</div><!-- #new-topic-post -->
|
||||
|
||||
<?php do_action( 'bp_after_new_topic_form' ); ?>
|
||||
|
||||
<?php do_action( 'bp_after_directory_forums_content' ); ?>
|
||||
|
||||
<?php do_action( 'bp_after_directory_forums_page' ); ?>
|
||||
|
||||
<?php get_footer( 'buddypress' ); ?>
|
||||
@ -1,93 +0,0 @@
|
||||
<?php do_action( 'bp_before_group_forum_edit_form' ); ?>
|
||||
|
||||
<?php if ( bp_has_forum_topic_posts() ) : ?>
|
||||
|
||||
<form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form">
|
||||
|
||||
<div class="item-list-tabs" id="subnav" role="navigation">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#post-topic-reply"><?php _e( 'Reply', 'huddle' ); ?></a>
|
||||
</li>
|
||||
|
||||
<?php if ( bp_forums_has_directory() ) : ?>
|
||||
|
||||
<li>
|
||||
<a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'huddle'); ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="topic-meta">
|
||||
<h3><?php _e( 'Edit:', 'huddle' ); ?> <?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3>
|
||||
|
||||
<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
|
||||
|
||||
<div class="last admin-links">
|
||||
|
||||
<?php bp_the_topic_admin_links(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_group_forum_topic_meta' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( bp_group_is_member() ) : ?>
|
||||
|
||||
<?php if ( bp_is_edit_topic() ) : ?>
|
||||
|
||||
<div id="edit-topic">
|
||||
|
||||
<?php do_action( 'bp_group_before_edit_forum_topic' ); ?>
|
||||
|
||||
<label for="topic_title"><?php _e( 'Title:', 'huddle' ); ?></label>
|
||||
<input type="text" name="topic_title" id="topic_title" value="<?php bp_the_topic_title(); ?>" />
|
||||
|
||||
<label for="topic_text"><?php _e( 'Content:', 'huddle' ); ?></label>
|
||||
<textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea>
|
||||
|
||||
<?php do_action( 'bp_group_after_edit_forum_topic' ); ?>
|
||||
|
||||
<p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'huddle' ); ?>" /></p>
|
||||
|
||||
<?php wp_nonce_field( 'bp_forums_edit_topic' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div id="edit-post">
|
||||
|
||||
<?php do_action( 'bp_group_before_edit_forum_post' ); ?>
|
||||
|
||||
<textarea name="post_text" id="post_text"><?php bp_the_topic_post_edit_text(); ?></textarea>
|
||||
|
||||
<?php do_action( 'bp_group_after_edit_forum_post' ) ?>
|
||||
|
||||
<p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'huddle' ); ?>" /></p>
|
||||
|
||||
<?php wp_nonce_field( 'bp_forums_edit_post' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</form><!-- #forum-topic-form -->
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'This topic does not exist.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
|
||||
<?php do_action( 'bp_after_group_forum_edit_form' ); ?>
|
||||
@ -1,35 +0,0 @@
|
||||
<?php do_action( 'bp_before_forum_header' ); ?>
|
||||
|
||||
<div id="item-header-avatar">
|
||||
<a href="<?php bp_forum_permalink(); ?>" title="<?php bp_get_forum_name(); ?>">
|
||||
|
||||
<?php //bp_forum_avatar(); ?>
|
||||
|
||||
</a>
|
||||
</div><!-- #item-header-avatar -->
|
||||
|
||||
<div id="item-header-content">
|
||||
<h2><a href="<?php bp_forum_permalink(); ?>" title="<?php bp_forum_name(); ?>"><?php bp_forum_name(); ?></a></h2>
|
||||
<span class="highlight"><?php //bp_forum_type(); ?></span> <span class="activity"><?php printf( __( 'active %s', 'huddle' ), '' ); //bp_get_forum_last_active() ); ?></span>
|
||||
|
||||
<?php do_action( 'bp_before_forum_header_meta' ); ?>
|
||||
|
||||
<div id="item-meta">
|
||||
|
||||
<?php //bp_forum_description(); ?>
|
||||
|
||||
<div id="item-buttons">
|
||||
|
||||
<?php do_action( 'bp_forum_header_actions' ); ?>
|
||||
|
||||
</div><!-- #item-buttons -->
|
||||
|
||||
<?php do_action( 'bp_forum_header_meta' ); ?>
|
||||
|
||||
</div>
|
||||
</div><!-- #item-header-content -->
|
||||
|
||||
<?php
|
||||
do_action( 'bp_after_forum_header' );
|
||||
do_action( 'template_notices' );
|
||||
?>
|
||||
@ -1,59 +0,0 @@
|
||||
<?php get_header( 'buddypress' ); ?>
|
||||
|
||||
<?php do_action( 'bp_before_directory_forums_content' ); ?>
|
||||
|
||||
<div id="item-header" role="complementary">
|
||||
|
||||
<?php locate_template( array( 'forums/single/forum-header.php' ), true ); ?>
|
||||
|
||||
</div><!-- #item-header -->
|
||||
|
||||
<div id="item-nav">
|
||||
<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<a href="#post-new" class="show-hide-new"><?php _e( 'New Topic', 'huddle' ); ?></a>
|
||||
</li>
|
||||
|
||||
<?php if ( bp_forums_has_directory() ) : ?>
|
||||
|
||||
<li>
|
||||
<a href="<?php bp_forums_directory_permalink() ?>"><?php _e( 'Forum Directory', 'huddle'); ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
|
||||
|
||||
<li id="forums-order-select" class="last filter">
|
||||
|
||||
<label for="forums-order-by"><?php _e( 'Order By:', 'huddle' ); ?></label>
|
||||
<select id="forums-order-by">
|
||||
<option value="active"><?php _e( 'Last Active', 'huddle' ); ?></option>
|
||||
<option value="popular"><?php _e( 'Most Posts', 'huddle' ); ?></option>
|
||||
<option value="unreplied"><?php _e( 'Unreplied', 'huddle' ); ?></option>
|
||||
|
||||
<?php do_action( 'bp_forums_directory_order_options' ); ?>
|
||||
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- #item-nav -->
|
||||
|
||||
<div id="item-body">
|
||||
|
||||
<div id="forums-dir-list" class="forums dir-list" role="main">
|
||||
|
||||
<?php locate_template( array( 'forums/forums-loop.php' ), true ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_directory_forums_content' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_after_directory_forums_content' ); ?>
|
||||
|
||||
<?php get_footer( 'buddypress' ); ?>
|
||||
@ -1,190 +0,0 @@
|
||||
<?php get_header( 'buddypress' ); ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_home_content' ) ?>
|
||||
|
||||
<?php if ( bp_has_forum_topic_posts() ) : ?>
|
||||
|
||||
<div id="item-header" role="complementary">
|
||||
|
||||
<?php locate_template( array( 'forums/single/forum-header.php' ), true ); ?>
|
||||
|
||||
</div><!-- #item-header -->
|
||||
|
||||
<div id="item-nav">
|
||||
<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
|
||||
<ul>
|
||||
|
||||
<?php bp_get_options_nav(); ?>
|
||||
|
||||
<?php do_action( 'bp_forum_options_nav' ); ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- #item-nav -->
|
||||
|
||||
<div id="item-body">
|
||||
|
||||
<?php do_action( 'bp_before_group_forum_topic' ); ?>
|
||||
|
||||
<form action="<?php bp_forum_topic_action() ?>" method="post" id="forum-topic-form" class="standard-form">
|
||||
|
||||
<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
|
||||
<ul>
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
<li>
|
||||
<a href="#post-topic-reply" class="show-hide-new"><?php _e( 'New Reply', 'huddle' ) ?></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( bp_forums_has_directory() ) : ?>
|
||||
|
||||
<li>
|
||||
<a href="<?php bp_forums_directory_permalink() ?>"><?php _e( 'Forum Directory', 'huddle') ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="topic-meta">
|
||||
<h3><?php bp_the_topic_title() ?> (<?php bp_the_topic_total_post_count() ?>)</h3>
|
||||
|
||||
<?php if ( is_super_admin() || current_user_can( 'moderate' ) ) : ?>
|
||||
|
||||
<div class="last admin-links">
|
||||
|
||||
<?php bp_the_topic_admin_links(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_group_forum_topic_meta' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="pagination no-ajax">
|
||||
|
||||
<div id="post-count-top" class="pag-count">
|
||||
|
||||
<?php bp_the_topic_pagination_count() ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="pagination-links" id="topic-pag-top">
|
||||
|
||||
<?php bp_the_topic_pagination() ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_before_group_forum_topic_posts' ) ?>
|
||||
|
||||
<ul id="topic-post-list" class="item-list" role="main">
|
||||
<?php while ( bp_forum_topic_posts() ) : bp_the_forum_topic_post(); ?>
|
||||
|
||||
<li id="post-<?php bp_the_topic_post_id() ?>" class="<?php bp_the_topic_post_css_class() ?>">
|
||||
<div class="poster-meta">
|
||||
<a href="<?php bp_the_topic_post_poster_link() ?>">
|
||||
|
||||
<?php bp_the_topic_post_poster_avatar( 'width=35&height=35' ); ?>
|
||||
|
||||
</a>
|
||||
|
||||
<?php echo sprintf( __( '%s said %s ago:', 'huddle' ), bp_get_the_topic_post_poster_name(), bp_get_the_topic_post_time_since() ) ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="post-content">
|
||||
|
||||
<?php bp_the_topic_post_content() ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="admin-links">
|
||||
|
||||
<?php if ( is_super_admin() || current_user_can( 'moderate' ) ) : ?>
|
||||
|
||||
<?php bp_the_topic_post_admin_links() ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_group_forum_post_meta' ); ?>
|
||||
|
||||
<a href="#post-<?php bp_the_topic_post_id() ?>" title="<?php _e( 'Permanent link to this post', 'huddle' ) ?>">#</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php endwhile; ?>
|
||||
</ul><!-- #topic-post-list -->
|
||||
|
||||
<?php do_action( 'bp_after_group_forum_topic_posts' ) ?>
|
||||
|
||||
<div class="pagination no-ajax">
|
||||
|
||||
<div id="post-count-bottom" class="pag-count">
|
||||
|
||||
<?php bp_the_topic_pagination_count() ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="pagination-links" id="topic-pag-bottom">
|
||||
|
||||
<?php bp_the_topic_pagination() ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
|
||||
<?php if ( bp_get_the_topic_is_last_page() ) : ?>
|
||||
|
||||
<?php if ( bp_get_the_topic_is_topic_open() ) : ?>
|
||||
|
||||
<div id="post-topic-reply">
|
||||
<p id="post-reply"></p>
|
||||
|
||||
<?php do_action( 'groups_forum_new_reply_before' ) ?>
|
||||
|
||||
<h4><?php _e( 'Add a reply:', 'huddle' ) ?></h4>
|
||||
|
||||
<textarea name="reply_text" id="reply_text"></textarea>
|
||||
|
||||
<div class="submit">
|
||||
<input type="submit" name="submit_reply" id="submit" value="<?php _e( 'Post Reply', 'huddle' ) ?>" />
|
||||
</div>
|
||||
|
||||
<?php do_action( 'groups_forum_new_reply_after' ) ?>
|
||||
|
||||
<?php wp_nonce_field( 'bp_forums_new_reply' ) ?>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'This topic is closed, replies are no longer accepted.', 'huddle' ) ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</form><!-- #forum-topic-form -->
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'There are no posts for this topic.', 'huddle' ) ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
|
||||
<?php do_action( 'bp_after_group_forum_topic' ) ?>
|
||||
|
||||
<?php get_footer( 'buddypress' ); ?>
|
||||
@ -1,680 +0,0 @@
|
||||
<?php
|
||||
/***
|
||||
* AJAX Functions
|
||||
*
|
||||
* All of these functions enhance the responsiveness of the user interface in the default
|
||||
* theme by adding AJAX functionality.
|
||||
*/
|
||||
|
||||
/***
|
||||
* This function looks scarier than it actually is. :)
|
||||
* Each object loop (activity/members/groups/blogs/forums) contains default parameters to
|
||||
* show specific information based on the page we are currently looking at.
|
||||
* The following function will take into account any cookies set in the JS and allow us
|
||||
* to override the parameters sent. That way we can change the results returned without reloading the page.
|
||||
* By using cookies we can also make sure that user settings are retained across page loads.
|
||||
*/
|
||||
function bp_dtheme_ajax_querystring( $query_string, $object ) {
|
||||
global $bp;
|
||||
|
||||
if ( empty( $object ) )
|
||||
return false;
|
||||
|
||||
/* Set up the cookies passed on this AJAX request. Store a local var to avoid conflicts */
|
||||
if ( !empty( $_POST['cookie'] ) )
|
||||
$_BP_COOKIE = wp_parse_args( str_replace( '; ', '&', urldecode( $_POST['cookie'] ) ) );
|
||||
else
|
||||
$_BP_COOKIE = &$_COOKIE;
|
||||
|
||||
$qs = false;
|
||||
|
||||
/***
|
||||
* Check if any cookie values are set. If there are then override the default params passed to the
|
||||
* template loop
|
||||
*/
|
||||
if ( !empty( $_BP_COOKIE['bp-' . $object . '-filter'] ) && '-1' != $_BP_COOKIE['bp-' . $object . '-filter'] ) {
|
||||
$qs[] = 'type=' . $_BP_COOKIE['bp-' . $object . '-filter'];
|
||||
$qs[] = 'action=' . $_BP_COOKIE['bp-' . $object . '-filter']; // Activity stream filtering on action
|
||||
}
|
||||
|
||||
if ( !empty( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) {
|
||||
if ( 'personal' == $_BP_COOKIE['bp-' . $object . '-scope'] ) {
|
||||
$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
|
||||
$qs[] = 'user_id=' . $user_id;
|
||||
}
|
||||
if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && empty( $bp->displayed_user->id ) && !$bp->is_single_item )
|
||||
$qs[] = 'scope=' . $_BP_COOKIE['bp-' . $object . '-scope']; // Activity stream scope only on activity directory.
|
||||
}
|
||||
|
||||
/* If page and search_terms have been passed via the AJAX post request, use those */
|
||||
if ( !empty( $_POST['page'] ) && '-1' != $_POST['page'] )
|
||||
$qs[] = 'page=' . $_POST['page'];
|
||||
|
||||
$object_search_text = bp_get_search_default_text( $object );
|
||||
if ( !empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
|
||||
$qs[] = 'search_terms=' . $_POST['search_terms'];
|
||||
|
||||
$qs[] = 'per_page=14';
|
||||
|
||||
/* Now pass the querystring to override default values. */
|
||||
$query_string = empty( $qs ) ? '' : join( '&', (array)$qs );
|
||||
|
||||
$object_filter = '';
|
||||
if ( isset( $_BP_COOKIE['bp-' . $object . '-filter'] ) )
|
||||
$object_filter = $_BP_COOKIE['bp-' . $object . '-filter'];
|
||||
|
||||
$object_scope = '';
|
||||
if ( isset( $_BP_COOKIE['bp-' . $object . '-scope'] ) )
|
||||
$object_scope = $_BP_COOKIE['bp-' . $object . '-scope'];
|
||||
|
||||
$object_page = '';
|
||||
if ( isset( $_BP_COOKIE['bp-' . $object . '-page'] ) )
|
||||
$object_page = $_BP_COOKIE['bp-' . $object . '-page'];
|
||||
|
||||
$object_search_terms = '';
|
||||
if ( isset( $_BP_COOKIE['bp-' . $object . '-search-terms'] ) )
|
||||
$object_search_terms = $_BP_COOKIE['bp-' . $object . '-search-terms'];
|
||||
|
||||
$object_extras = '';
|
||||
if ( isset( $_BP_COOKIE['bp-' . $object . '-extras'] ) )
|
||||
$object_extras = $_BP_COOKIE['bp-' . $object . '-extras'];
|
||||
|
||||
return apply_filters( 'bp_dtheme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras );
|
||||
}
|
||||
add_filter( 'bp_ajax_querystring', 'bp_dtheme_ajax_querystring', 10, 2 );
|
||||
|
||||
/* This function will simply load the template loop for the current object. On an AJAX request */
|
||||
function bp_dtheme_object_template_loader() {
|
||||
|
||||
/**
|
||||
* AJAX requests happen too early to be seen by bp_update_is_directory()
|
||||
* so we do it manually here to ensure templates load with the correct
|
||||
* context. Without this check, templates will load the 'single' version
|
||||
* of themselves rather than the directory version.
|
||||
*/
|
||||
if ( !bp_current_action() )
|
||||
bp_update_is_directory( true, bp_current_component() );
|
||||
|
||||
// Sanitize the post object
|
||||
$object = esc_attr( $_POST['object'] );
|
||||
|
||||
// Locate the object template
|
||||
locate_template( array( "$object/$object-loop.php" ), true );
|
||||
}
|
||||
add_action( 'wp_ajax_members_filter', 'bp_dtheme_object_template_loader' );
|
||||
add_action( 'wp_ajax_groups_filter', 'bp_dtheme_object_template_loader' );
|
||||
add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_template_loader' );
|
||||
add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_template_loader' );
|
||||
|
||||
// This function will load the activity loop template when activity is requested via AJAX
|
||||
function bp_dtheme_activity_template_loader() {
|
||||
global $bp;
|
||||
|
||||
$scope = '';
|
||||
if ( !empty( $_POST['scope'] ) )
|
||||
$scope = $_POST['scope'];
|
||||
|
||||
// We need to calculate and return the feed URL for each scope
|
||||
switch ( $scope ) {
|
||||
case 'friends':
|
||||
$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/friends/feed/';
|
||||
break;
|
||||
case 'groups':
|
||||
$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/groups/feed/';
|
||||
break;
|
||||
case 'favorites':
|
||||
$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/favorites/feed/';
|
||||
break;
|
||||
case 'mentions':
|
||||
$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/mentions/feed/';
|
||||
bp_activity_clear_new_mentions( $bp->loggedin_user->id );
|
||||
break;
|
||||
default:
|
||||
$feed_url = home_url( bp_get_activity_root_slug() . '/feed/' );
|
||||
break;
|
||||
}
|
||||
|
||||
/* Buffer the loop in the template to a var for JS to spit out. */
|
||||
ob_start();
|
||||
locate_template( array( 'activity/activity-loop.php' ), true );
|
||||
$result['contents'] = ob_get_contents();
|
||||
$result['feed_url'] = apply_filters( 'bp_dtheme_activity_feed_url', $feed_url, $scope );
|
||||
ob_end_clean();
|
||||
|
||||
echo json_encode( $result );
|
||||
}
|
||||
add_action( 'wp_ajax_activity_widget_filter', 'bp_dtheme_activity_template_loader' );
|
||||
add_action( 'wp_ajax_activity_get_older_updates', 'bp_dtheme_activity_template_loader' );
|
||||
|
||||
/* AJAX update posting */
|
||||
function bp_dtheme_post_update() {
|
||||
global $bp;
|
||||
|
||||
// Check the nonce
|
||||
check_admin_referer( 'post_update', '_wpnonce_post_update' );
|
||||
|
||||
if ( !is_user_logged_in() ) {
|
||||
echo '-1';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( empty( $_POST['content'] ) ) {
|
||||
echo '-1<div id="message" class="error"><p>' . __( 'Please enter some content to post.', 'huddle' ) . '</p></div>';
|
||||
return false;
|
||||
}
|
||||
|
||||
$activity_id = 0;
|
||||
if ( empty( $_POST['object'] ) && bp_is_active( 'activity' ) ) {
|
||||
$activity_id = bp_activity_post_update( array( 'content' => $_POST['content'] ) );
|
||||
|
||||
} elseif ( $_POST['object'] == 'groups' ) {
|
||||
if ( !empty( $_POST['item_id'] ) && bp_is_active( 'groups' ) )
|
||||
$activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $_POST['item_id'] ) );
|
||||
|
||||
} else {
|
||||
$activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] );
|
||||
}
|
||||
|
||||
if ( empty( $activity_id ) ) {
|
||||
echo '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update, please try again.', 'huddle' ) . '</p></div>';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( bp_has_activities ( 'include=' . $activity_id ) ) : ?>
|
||||
<?php while ( bp_activities() ) : bp_the_activity(); ?>
|
||||
<?php locate_template( array( 'activity/entry.php' ), true ) ?>
|
||||
<?php endwhile; ?>
|
||||
<?php endif;
|
||||
}
|
||||
add_action( 'wp_ajax_post_update', 'bp_dtheme_post_update' );
|
||||
|
||||
/* AJAX activity comment posting */
|
||||
function bp_dtheme_new_activity_comment() {
|
||||
global $bp;
|
||||
|
||||
// Check the nonce
|
||||
check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
|
||||
|
||||
if ( !is_user_logged_in() ) {
|
||||
echo '-1';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( empty( $_POST['content'] ) ) {
|
||||
echo '-1<div id="message" class="error"><p>' . __( 'Please do not leave the comment area blank.', 'huddle' ) . '</p></div>';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || !is_numeric( $_POST['form_id'] ) || !is_numeric( $_POST['comment_id'] ) ) {
|
||||
echo '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'huddle' ) . '</p></div>';
|
||||
return false;
|
||||
}
|
||||
|
||||
$comment_id = bp_activity_new_comment( array(
|
||||
'activity_id' => $_POST['form_id'],
|
||||
'content' => $_POST['content'],
|
||||
'parent_id' => $_POST['comment_id']
|
||||
) );
|
||||
|
||||
if ( !$comment_id ) {
|
||||
echo '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'huddle' ) . '</p></div>';
|
||||
return false;
|
||||
}
|
||||
|
||||
global $activities_template;
|
||||
|
||||
// Load the new activity item into the $activities_template global
|
||||
bp_has_activities( 'display_comments=stream&include=' . $comment_id );
|
||||
|
||||
// Swap the current comment with the activity item we just loaded
|
||||
$activities_template->activity->id = $activities_template->activities[0]->item_id;
|
||||
$activities_template->activity->current_comment = $activities_template->activities[0];
|
||||
|
||||
$template = locate_template( 'activity/comment.php', false, false );
|
||||
|
||||
// Backward compatibility. In older versions of BP, the markup was
|
||||
// generated in the PHP instead of a template. This ensures that
|
||||
// older themes (which are not children of bp-default and won't
|
||||
// have the new template) will still work.
|
||||
if ( empty( $template ) )
|
||||
$template = BP_PLUGIN_DIR . '/bp-themes/bp-default/activity/comment.php';
|
||||
|
||||
load_template( $template, false );
|
||||
|
||||
unset( $activities_template );
|
||||
}
|
||||
add_action( 'wp_ajax_new_activity_comment', 'bp_dtheme_new_activity_comment' );
|
||||
|
||||
/* AJAX delete an activity */
|
||||
function bp_dtheme_delete_activity() {
|
||||
global $bp;
|
||||
|
||||
// Check the nonce
|
||||
check_admin_referer( 'bp_activity_delete_link' );
|
||||
|
||||
if ( !is_user_logged_in() ) {
|
||||
echo '-1';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) ) {
|
||||
echo '-1';
|
||||
return false;
|
||||
}
|
||||
|
||||
$activity = new BP_Activity_Activity( (int) $_POST['id'] );
|
||||
|
||||
// Check access
|
||||
if ( empty( $activity->user_id ) || !bp_activity_user_can_delete( $activity ) ) {
|
||||
echo '-1';
|
||||
return false;
|
||||
}
|
||||
|
||||
// Call the action before the delete so plugins can still fetch information about it
|
||||
do_action( 'bp_activity_before_action_delete_activity', $activity->id, $activity->user_id );
|
||||
|
||||
if ( !bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) ) {
|
||||
echo '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'huddle' ) . '</p></div>';
|
||||
return false;
|
||||
}
|
||||
|
||||
do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id );
|
||||
|
||||
return true;
|
||||
}
|
||||
add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' );
|
||||
|
||||
/* AJAX delete an activity comment */
|
||||
function bp_dtheme_delete_activity_comment() {
|
||||
global $bp;
|
||||
|
||||
/* Check the nonce */
|
||||
check_admin_referer( 'bp_activity_delete_link' );
|
||||
|
||||
if ( !is_user_logged_in() ) {
|
||||
echo '-1';
|
||||
return false;
|
||||
}
|
||||
|
||||
$comment = new BP_Activity_Activity( $_POST['id'] );
|
||||
|
||||
/* Check access */
|
||||
if ( !is_super_admin() && $comment->user_id != $bp->loggedin_user->id )
|
||||
return false;
|
||||
|
||||
if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) )
|
||||
return false;
|
||||
|
||||
/* Call the action before the delete so plugins can still fetch information about it */
|
||||
do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $comment->user_id );
|
||||
|
||||
if ( !bp_activity_delete_comment( $comment->item_id, $comment->id ) ) {
|
||||
echo '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'huddle' ) . '</p></div>';
|
||||
return false;
|
||||
}
|
||||
|
||||
do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id );
|
||||
|
||||
return true;
|
||||
}
|
||||
add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity_comment' );
|
||||
|
||||
/* AJAX mark an activity as a favorite */
|
||||
function bp_dtheme_mark_activity_favorite() {
|
||||
global $bp;
|
||||
|
||||
bp_activity_add_user_favorite( $_POST['id'] );
|
||||
_e( 'Remove Favorite', 'huddle' );
|
||||
}
|
||||
add_action( 'wp_ajax_activity_mark_fav', 'bp_dtheme_mark_activity_favorite' );
|
||||
|
||||
/* AJAX mark an activity as not a favorite */
|
||||
function bp_dtheme_unmark_activity_favorite() {
|
||||
global $bp;
|
||||
|
||||
bp_activity_remove_user_favorite( $_POST['id'] );
|
||||
_e( 'Favorite', 'huddle' );
|
||||
}
|
||||
add_action( 'wp_ajax_activity_mark_unfav', 'bp_dtheme_unmark_activity_favorite' );
|
||||
|
||||
/**
|
||||
* AJAX handler for Read More link on long activity items
|
||||
*
|
||||
* @package BuddyPress
|
||||
* @since 1.5
|
||||
*/
|
||||
function bp_dtheme_get_single_activity_content() {
|
||||
$activity_array = bp_activity_get_specific( array(
|
||||
'activity_ids' => $_POST['activity_id'],
|
||||
'display_comments' => 'stream'
|
||||
) );
|
||||
|
||||
$activity = !empty( $activity_array['activities'][0] ) ? $activity_array['activities'][0] : false;
|
||||
|
||||
if ( !$activity )
|
||||
exit(); // todo: error?
|
||||
|
||||
do_action_ref_array( 'bp_dtheme_get_single_activity_content', array( &$activity ) );
|
||||
|
||||
// Activity content retrieved through AJAX should run through normal filters, but not be truncated
|
||||
remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
|
||||
$content = apply_filters( 'bp_get_activity_content_body', $activity->content );
|
||||
|
||||
echo $content;
|
||||
exit();
|
||||
}
|
||||
add_action( 'wp_ajax_get_single_activity_content', 'bp_dtheme_get_single_activity_content' );
|
||||
|
||||
/* AJAX invite a friend to a group functionality */
|
||||
function bp_dtheme_ajax_invite_user() {
|
||||
global $bp;
|
||||
|
||||
check_ajax_referer( 'groups_invite_uninvite_user' );
|
||||
|
||||
if ( !$_POST['friend_id'] || !$_POST['friend_action'] || !$_POST['group_id'] )
|
||||
return false;
|
||||
|
||||
if ( !bp_groups_user_can_send_invites( $_POST['group_id'] ) )
|
||||
return false;
|
||||
|
||||
if ( !friends_check_friendship( $bp->loggedin_user->id, $_POST['friend_id'] ) )
|
||||
return false;
|
||||
|
||||
if ( 'invite' == $_POST['friend_action'] ) {
|
||||
|
||||
if ( !groups_invite_user( array( 'user_id' => $_POST['friend_id'], 'group_id' => $_POST['group_id'] ) ) )
|
||||
return false;
|
||||
|
||||
$user = new BP_Core_User( $_POST['friend_id'] );
|
||||
|
||||
echo '<li id="uid-' . $user->id . '">';
|
||||
echo $user->avatar_thumb;
|
||||
echo '<h4>' . $user->user_link . '</h4>';
|
||||
echo '<span class="activity">' . esc_attr( $user->last_active ) . '</span>';
|
||||
echo '<div class="action">
|
||||
<a class="button remove" href="' . wp_nonce_url( $bp->loggedin_user->domain . bp_get_groups_slug() . '/' . $_POST['group_id'] . '/invites/remove/' . $user->id, 'groups_invite_uninvite_user' ) . '" id="uid-' . esc_attr( $user->id ) . '">' . __( 'Remove Invite', 'huddle' ) . '</a>
|
||||
</div>';
|
||||
echo '</li>';
|
||||
|
||||
} else if ( 'uninvite' == $_POST['friend_action'] ) {
|
||||
|
||||
if ( !groups_uninvite_user( $_POST['friend_id'], $_POST['group_id'] ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
add_action( 'wp_ajax_groups_invite_user', 'bp_dtheme_ajax_invite_user' );
|
||||
|
||||
/* AJAX add/remove a user as a friend when clicking the button */
|
||||
function bp_dtheme_ajax_addremove_friend() {
|
||||
global $bp;
|
||||
|
||||
if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
|
||||
|
||||
check_ajax_referer('friends_remove_friend');
|
||||
|
||||
if ( !friends_remove_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
|
||||
echo __("Friendship could not be canceled.", 'huddle');
|
||||
} else {
|
||||
echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'huddle' ) . '" href="' . wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'huddle' ) . '</a>';
|
||||
}
|
||||
|
||||
} else if ( 'not_friends' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
|
||||
|
||||
check_ajax_referer('friends_add_friend');
|
||||
|
||||
if ( !friends_add_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
|
||||
echo __("Friendship could not be requested.", 'huddle');
|
||||
} else {
|
||||
echo '<a href="' . $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests" class="requested">' . __( 'Friendship Requested', 'huddle' ) . '</a>';
|
||||
}
|
||||
} else {
|
||||
echo __( 'Request Pending', 'huddle' );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
add_action( 'wp_ajax_addremove_friend', 'bp_dtheme_ajax_addremove_friend' );
|
||||
|
||||
/* AJAX accept a user as a friend when clicking the "accept" button */
|
||||
function bp_dtheme_ajax_accept_friendship() {
|
||||
check_admin_referer( 'friends_accept_friendship' );
|
||||
|
||||
if ( !friends_accept_friendship( $_POST['id'] ) )
|
||||
echo "-1<div id='message' class='error'><p>" . __( 'There was a problem accepting that request. Please try again.', 'huddle' ) . '</p></div>';
|
||||
|
||||
return true;
|
||||
}
|
||||
add_action( 'wp_ajax_accept_friendship', 'bp_dtheme_ajax_accept_friendship' );
|
||||
|
||||
/* AJAX reject a user as a friend when clicking the "reject" button */
|
||||
function bp_dtheme_ajax_reject_friendship() {
|
||||
check_admin_referer( 'friends_reject_friendship' );
|
||||
|
||||
if ( !friends_reject_friendship( $_POST['id'] ) )
|
||||
echo "-1<div id='message' class='error'><p>" . __( 'There was a problem rejecting that request. Please try again.', 'huddle' ) . '</p></div>';
|
||||
|
||||
return true;
|
||||
}
|
||||
add_action( 'wp_ajax_reject_friendship', 'bp_dtheme_ajax_reject_friendship' );
|
||||
|
||||
/* AJAX join or leave a group when clicking the "join/leave" button */
|
||||
function bp_dtheme_ajax_joinleave_group() {
|
||||
global $bp;
|
||||
|
||||
if ( groups_is_user_banned( $bp->loggedin_user->id, $_POST['gid'] ) )
|
||||
return false;
|
||||
|
||||
if ( !$group = new BP_Groups_Group( $_POST['gid'], false, false ) )
|
||||
return false;
|
||||
|
||||
if ( !groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) {
|
||||
|
||||
if ( 'public' == $group->status ) {
|
||||
|
||||
check_ajax_referer( 'groups_join_group' );
|
||||
|
||||
if ( !groups_join_group( $group->id ) ) {
|
||||
_e( 'Error joining group', 'huddle' );
|
||||
} else {
|
||||
echo '<a id="group-' . esc_attr( $group->id ) . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'huddle' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'huddle' ) . '</a>';
|
||||
}
|
||||
|
||||
} else if ( 'private' == $group->status ) {
|
||||
|
||||
check_ajax_referer( 'groups_request_membership' );
|
||||
|
||||
if ( !groups_send_membership_request( $bp->loggedin_user->id, $group->id ) ) {
|
||||
_e( 'Error requesting membership', 'huddle' );
|
||||
} else {
|
||||
echo '<a id="group-' . esc_attr( $group->id ) . '" class="membership-requested" rel="membership-requested" title="' . __( 'Membership Requested', 'huddle' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Membership Requested', 'huddle' ) . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
check_ajax_referer( 'groups_leave_group' );
|
||||
|
||||
if ( !groups_leave_group( $group->id ) ) {
|
||||
_e( 'Error leaving group', 'huddle' );
|
||||
} else {
|
||||
if ( 'public' == $group->status ) {
|
||||
echo '<a id="group-' . esc_attr( $group->id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'huddle' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'huddle' ) . '</a>';
|
||||
} else if ( 'private' == $group->status ) {
|
||||
echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'huddle' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'huddle' ) . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'wp_ajax_joinleave_group', 'bp_dtheme_ajax_joinleave_group' );
|
||||
|
||||
/* AJAX close and keep closed site wide notices from an admin in the sidebar */
|
||||
function bp_dtheme_ajax_close_notice() {
|
||||
global $userdata;
|
||||
|
||||
if ( !isset( $_POST['notice_id'] ) ) {
|
||||
echo "-1<div id='message' class='error'><p>" . __('There was a problem closing the notice.', 'huddle') . '</p></div>';
|
||||
} else {
|
||||
$notice_ids = bp_get_user_meta( $userdata->ID, 'closed_notices', true );
|
||||
|
||||
$notice_ids[] = (int) $_POST['notice_id'];
|
||||
|
||||
bp_update_user_meta( $userdata->ID, 'closed_notices', $notice_ids );
|
||||
}
|
||||
}
|
||||
add_action( 'wp_ajax_messages_close_notice', 'bp_dtheme_ajax_close_notice' );
|
||||
|
||||
/* AJAX send a private message reply to a thread */
|
||||
function bp_dtheme_ajax_messages_send_reply() {
|
||||
global $bp;
|
||||
|
||||
check_ajax_referer( 'messages_send_message' );
|
||||
|
||||
$result = messages_new_message( array( 'thread_id' => $_REQUEST['thread_id'], 'content' => $_REQUEST['content'] ) );
|
||||
|
||||
if ( $result ) { ?>
|
||||
<div class="message-box new-message">
|
||||
<div class="message-metadata">
|
||||
<?php do_action( 'bp_before_message_meta' ) ?>
|
||||
<?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?>
|
||||
|
||||
<strong><a href="<?php echo $bp->loggedin_user->domain ?>"><?php echo $bp->loggedin_user->fullname ?></a> <span class="activity"><?php printf( __( 'Sent %s', 'huddle' ), bp_core_time_since( bp_core_current_time() ) ) ?></span></strong>
|
||||
|
||||
<?php do_action( 'bp_after_message_meta' ) ?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_before_message_content' ) ?>
|
||||
|
||||
<div class="message-content">
|
||||
<?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ) ?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_after_message_content' ) ?>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
echo "-1<div id='message' class='error'><p>" . __( 'There was a problem sending that reply. Please try again.', 'huddle' ) . '</p></div>';
|
||||
}
|
||||
}
|
||||
add_action( 'wp_ajax_messages_send_reply', 'bp_dtheme_ajax_messages_send_reply' );
|
||||
|
||||
/* AJAX mark a private message as unread in your inbox */
|
||||
function bp_dtheme_ajax_message_markunread() {
|
||||
global $bp;
|
||||
|
||||
if ( !isset($_POST['thread_ids']) ) {
|
||||
echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as unread.', 'huddle' ) . '</p></div>';
|
||||
} else {
|
||||
$thread_ids = explode( ',', $_POST['thread_ids'] );
|
||||
|
||||
for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) {
|
||||
BP_Messages_Thread::mark_as_unread($thread_ids[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'wp_ajax_messages_markunread', 'bp_dtheme_ajax_message_markunread' );
|
||||
|
||||
/* AJAX mark a private message as read in your inbox */
|
||||
function bp_dtheme_ajax_message_markread() {
|
||||
global $bp;
|
||||
|
||||
if ( !isset($_POST['thread_ids']) ) {
|
||||
echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as read.', 'huddle' ) . '</p></div>';
|
||||
} else {
|
||||
$thread_ids = explode( ',', $_POST['thread_ids'] );
|
||||
|
||||
for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) {
|
||||
BP_Messages_Thread::mark_as_read($thread_ids[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'wp_ajax_messages_markread', 'bp_dtheme_ajax_message_markread' );
|
||||
|
||||
/* AJAX delete a private message or array of messages in your inbox */
|
||||
function bp_dtheme_ajax_messages_delete() {
|
||||
global $bp;
|
||||
|
||||
if ( !isset($_POST['thread_ids']) ) {
|
||||
echo "-1<div id='message' class='error'><p>" . __( 'There was a problem deleting messages.', 'huddle' ) . '</p></div>';
|
||||
} else {
|
||||
$thread_ids = explode( ',', $_POST['thread_ids'] );
|
||||
|
||||
for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i )
|
||||
BP_Messages_Thread::delete($thread_ids[$i]);
|
||||
|
||||
_e( 'Messages deleted.', 'huddle' );
|
||||
}
|
||||
}
|
||||
add_action( 'wp_ajax_messages_delete', 'bp_dtheme_ajax_messages_delete' );
|
||||
|
||||
/**
|
||||
* bp_dtheme_ajax_messages_autocomplete_results()
|
||||
*
|
||||
* AJAX handler for autocomplete. Displays friends only, unless BP_MESSAGES_AUTOCOMPLETE_ALL is defined
|
||||
*
|
||||
* @global object object $bp Global BuddyPress settings object
|
||||
* @return none
|
||||
*/
|
||||
function bp_dtheme_ajax_messages_autocomplete_results() {
|
||||
global $bp;
|
||||
|
||||
// Include everyone in the autocomplete, or just friends?
|
||||
if ( $bp->messages->slug == $bp->current_component )
|
||||
$autocomplete_all = $bp->messages->autocomplete_all;
|
||||
|
||||
$friends = false;
|
||||
$pag_page = 1;
|
||||
|
||||
$limit = $_GET['limit'] ? $_GET['limit'] : apply_filters( 'bp_autocomplete_max_results', 10 );
|
||||
|
||||
// Get the user ids based on the search terms
|
||||
if ( !empty( $autocomplete_all ) ) {
|
||||
$users = BP_Core_User::search_users( $_GET['q'], $limit, $pag_page );
|
||||
|
||||
if ( !empty( $users['users'] ) ) {
|
||||
// Build an array with the correct format
|
||||
$user_ids = array();
|
||||
foreach( $users['users'] as $user ) {
|
||||
if ( $user->id != $bp->loggedin_user->id )
|
||||
$user_ids[] = $user->id;
|
||||
}
|
||||
|
||||
$user_ids = apply_filters( 'bp_core_autocomplete_ids', $user_ids, $_GET['q'], $limit );
|
||||
}
|
||||
} else {
|
||||
if ( bp_is_active( 'friends' ) ) {
|
||||
$users = friends_search_friends( $_GET['q'], $bp->loggedin_user->id, $limit, 1 );
|
||||
|
||||
// Keeping the bp_friends_autocomplete_list filter for backward compatibility
|
||||
$users = apply_filters( 'bp_friends_autocomplete_list', $users, $_GET['q'], $limit );
|
||||
|
||||
if ( !empty( $users['friends'] ) )
|
||||
$user_ids = apply_filters( 'bp_friends_autocomplete_ids', $users['friends'], $_GET['q'], $limit );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !empty( $user_ids ) ) {
|
||||
foreach ( $user_ids as $user_id ) {
|
||||
$ud = get_userdata( $user_id );
|
||||
if ( !$ud )
|
||||
continue;
|
||||
|
||||
if ( bp_is_username_compatibility_mode() )
|
||||
$username = $ud->user_login;
|
||||
else
|
||||
$username = $ud->user_nicename;
|
||||
|
||||
echo '<span id="link-' . $username . '" href="' . bp_core_get_user_domain( $user_id ) . '"></span>' . bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
|
||||
';
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'wp_ajax_messages_autocomplete_results', 'bp_dtheme_ajax_messages_autocomplete_results' );
|
||||
|
||||
?>
|
||||
@ -1,531 +0,0 @@
|
||||
<?php
|
||||
|
||||
/* ------------------------------------------------
|
||||
BuddyPress Functions
|
||||
------------------------------------------------ */
|
||||
|
||||
define( 'BP_AVATAR_THUMB_WIDTH', 35 );
|
||||
define( 'BP_AVATAR_THUMB_HEIGHT', 35 );
|
||||
|
||||
add_action( 'wp_head', 'huddle_bp_unlink_profile_fields' );
|
||||
|
||||
function huddle_bp_unlink_profile_fields() {
|
||||
remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9 );
|
||||
}
|
||||
|
||||
remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9 );
|
||||
|
||||
add_filter( 'bp_get_add_friend_button', 'huddle_bp_get_add_friend_button' );
|
||||
add_filter( 'bp_get_group_join_button', 'huddle_bp_get_add_friend_button' );
|
||||
|
||||
add_filter( 'bp_get_the_profile_field_value', 'huddle_bp_get_the_profile_field_value', 3 );
|
||||
|
||||
function huddle_bp_get_the_profile_field_value( $value, $type = '', $id = '' ) {
|
||||
global $field;
|
||||
|
||||
if( substr_count( strtolower( $field->name ), 'twitter' ) ) {
|
||||
if( !substr_count( $field->data->value, 'twitter.com' ) ) {
|
||||
$value = 'http://twitter.com/' . $value;
|
||||
}
|
||||
} elseif( substr_count( strtolower( $field->name ), 'about' ) ) {
|
||||
|
||||
} else {
|
||||
$values = explode( ',', $value );
|
||||
|
||||
if ( $values ) {
|
||||
foreach ( (array)$values as $value ) {
|
||||
$value = trim( $value );
|
||||
|
||||
// If the value is a URL, skip it and just make it clickable.
|
||||
if ( preg_match( '@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', $value ) ) {
|
||||
$new_values[] = make_clickable( $value );
|
||||
} else {
|
||||
if ( count( explode( ' ', $value ) ) > 5 ) {
|
||||
$new_values[] = $value;
|
||||
} else {
|
||||
$new_values[] = '<a href="' . site_url( bp_get_members_root_slug() ) . '/?s=' . strip_tags( $value ) . '" rel="nofollow">' . $value . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$value = implode( ', ', $new_values );
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
function huddle_bp_get_add_friend_button( $button ) {
|
||||
$button['link_class'] .= ' btn-gray';
|
||||
return $button;
|
||||
}
|
||||
|
||||
add_filter( 'bp_get_group_member_count', 'huddle_bp_get_group_member_count' );
|
||||
|
||||
function huddle_bp_get_group_member_count( $text ) {
|
||||
return ucwords( $text );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
BuddyPress Create Blog
|
||||
------------------------------------------------ */
|
||||
|
||||
function huddle_bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '') {
|
||||
global $current_user, $current_site;
|
||||
global $bp;
|
||||
|
||||
if ( isset($_POST['submit']) ) {
|
||||
huddle_bp_blogs_validate_blog_signup();
|
||||
} else {
|
||||
if ( ! is_wp_error($errors) ) {
|
||||
$errors = new WP_Error();
|
||||
}
|
||||
|
||||
// allow definition of default variables
|
||||
$filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
|
||||
$blogname = $filtered_results['blogname'];
|
||||
$blog_title = $filtered_results['blog_title'];
|
||||
$errors = $filtered_results['errors'];
|
||||
|
||||
if ( $errors->get_error_code() ) {
|
||||
echo "<p>" . __('There was a problem, please correct the form below and try again.', 'buddypress') . "</p>";
|
||||
}
|
||||
?>
|
||||
<p><?php printf(__("By filling out the form below, you can <strong>add a site to your account</strong>. There is no limit to the number of sites that you can have, so create to your heart's content, but blog responsibly!", 'buddypress'), $current_user->display_name) ?></p>
|
||||
|
||||
<p><?php _e("If you’re not going to use a great domain, leave it for a new user. Now have at it!", 'buddypress') ?></p>
|
||||
|
||||
<form class="standard-form" id="setupform" method="post" action="">
|
||||
|
||||
<input type="hidden" name="stage" value="gimmeanotherblog" />
|
||||
<?php do_action( 'signup_hidden_fields' ); ?>
|
||||
|
||||
<?php huddle_bp_blogs_signup_blog($blogname, $blog_title, $errors); ?>
|
||||
|
||||
<p class="editfield">
|
||||
<input id="submit" type="submit" name="submit" class="btn-gray submit" value="<?php _e('Create Site', 'buddypress') ?>" />
|
||||
</p>
|
||||
|
||||
<?php wp_nonce_field( 'bp_blog_signup_form' ) ?>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
function huddle_bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) {
|
||||
global $current_site;
|
||||
|
||||
echo '<p class="editfield">';
|
||||
|
||||
// Blog name
|
||||
if( !is_subdomain_install() )
|
||||
echo '<label for="blogname">' . __('Site Name:', 'buddypress') . '</label>';
|
||||
else
|
||||
echo '<label for="blogname">' . __('Site Domain:', 'buddypress') . '</label>';
|
||||
|
||||
if ( !is_subdomain_install() )
|
||||
echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><br />';
|
||||
else
|
||||
echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /> <span class="suffix_address">.' . preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path . '</span><br />';
|
||||
|
||||
if ( !is_user_logged_in() ) {
|
||||
print '(<strong>' . __( 'Your address will be ' , 'buddypress');
|
||||
|
||||
if ( !is_subdomain_install() ) {
|
||||
print $current_site->domain . $current_site->path . __( 'blogname' , 'buddypress');
|
||||
} else {
|
||||
print __( 'domain.' , 'buddypress') . $current_site->domain . $current_site->path;
|
||||
}
|
||||
|
||||
echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' , 'buddypress') . '</p>';
|
||||
}
|
||||
|
||||
if ( $errmsg = $errors->get_error_message('blogname') ) { ?>
|
||||
|
||||
<span class="error"><?php echo $errmsg ?></span>
|
||||
|
||||
<?php }
|
||||
|
||||
echo '</p>';
|
||||
?>
|
||||
|
||||
<p class="editfield">
|
||||
<label for="blog_title"><?php _e('Site Title:', 'buddypress') ?></label>
|
||||
<input name="blog_title" type="text" id="blog_title" value="<?php echo esc_html($blog_title, 1) ?>" /></p>
|
||||
|
||||
<?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?>
|
||||
<span class="error"><?php echo $errmsg ?></span>
|
||||
<?php }
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p class="editfield">
|
||||
<label for="blog_public_on"><?php _e('Privacy:', 'buddypress') ?></label>
|
||||
|
||||
<label class="checkbox no" for="blog_public_on">
|
||||
<input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || '1' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
|
||||
<strong><?php _e( 'Yes' , 'buddypress'); ?></strong>
|
||||
</label>
|
||||
<label class="checkbox no" for="blog_public_off">
|
||||
<input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
|
||||
<strong><?php _e( 'No' , 'buddypress'); ?></strong>
|
||||
</label>
|
||||
|
||||
<?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
do_action('signup_blogform', $errors);
|
||||
}
|
||||
|
||||
function huddle_bp_blogs_validate_blog_signup() {
|
||||
global $wpdb, $current_user, $blogname, $blog_title, $errors, $domain, $path, $current_site;
|
||||
|
||||
if ( !check_admin_referer( 'bp_blog_signup_form' ) )
|
||||
return false;
|
||||
|
||||
$current_user = wp_get_current_user();
|
||||
|
||||
if( !is_user_logged_in() )
|
||||
die();
|
||||
|
||||
$result = bp_blogs_validate_blog_form();
|
||||
extract($result);
|
||||
|
||||
if ( $errors->get_error_code() ) {
|
||||
unset($_POST['submit']);
|
||||
huddle_bp_show_blog_signup_form( $blogname, $blog_title, $errors );
|
||||
return false;
|
||||
}
|
||||
|
||||
$public = (int) $_POST['blog_public'];
|
||||
|
||||
$meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // depreciated
|
||||
$meta = apply_filters( 'add_signup_meta', $meta );
|
||||
|
||||
// If this is a subdomain install, set up the site inside the root domain.
|
||||
if ( is_subdomain_install() )
|
||||
$domain = $blogname . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
|
||||
|
||||
wpmu_create_blog( $domain, $path, $blog_title, $current_user->id, $meta, $wpdb->siteid );
|
||||
bp_blogs_confirm_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Setup Theme
|
||||
------------------------------------------------ */
|
||||
|
||||
if ( ! isset( $content_width ) ) $content_width = 584;
|
||||
|
||||
add_action( 'after_setup_theme', 'huddle_theme_setup' );
|
||||
|
||||
function huddle_theme_setup() {
|
||||
|
||||
load_theme_textdomain( 'huddle', TEMPLATEPATH . '/languages' );
|
||||
|
||||
$locale = get_locale();
|
||||
$locale_file = TEMPLATEPATH . "/languages/$locale.php";
|
||||
if ( is_readable( $locale_file ) ) require_once( $locale_file );
|
||||
|
||||
add_theme_support( 'automatic-feed-links' );
|
||||
|
||||
register_nav_menus( array(
|
||||
'main-menu' => __( 'Main Menu', 'huddle' ),
|
||||
'footer-menu' => __( 'Footer Menu', 'huddle' )
|
||||
) );
|
||||
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
|
||||
set_post_thumbnail_size( 600, 303, true );
|
||||
|
||||
add_image_size( 'post-medium', 290, 145, true );
|
||||
add_image_size( 'post-small', 35, 35, true );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Load Theme Options
|
||||
------------------------------------------------ */
|
||||
|
||||
if( ! function_exists( 'of_get_option' ) ) {
|
||||
function of_get_option( $name, $default = false ) {
|
||||
$config = get_option( 'optionsframework' );
|
||||
|
||||
if ( ! isset( $config['id'] ) ) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
$options = get_option( $config['id'] );
|
||||
|
||||
if ( isset( $options[$name] ) && ! empty( $options[$name] ) ) {
|
||||
return $options[$name];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'optionsframework_init' ) ) {
|
||||
|
||||
if ( STYLESHEETPATH == TEMPLATEPATH ) {
|
||||
define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');
|
||||
define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/admin/');
|
||||
} else {
|
||||
define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');
|
||||
define('OPTIONS_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri() . '/admin/');
|
||||
}
|
||||
|
||||
require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Register Dependant Javascript Files
|
||||
------------------------------------------------ */
|
||||
|
||||
add_action('wp_enqueue_scripts', 'huddle_load_js');
|
||||
|
||||
if( ! function_exists( 'huddle_load_js' ) ) {
|
||||
function huddle_load_js() {
|
||||
global $is_IE;
|
||||
|
||||
if ( is_admin() ) {
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
wp_deregister_script( 'jquery' );
|
||||
wp_deregister_script( 'l10n' );
|
||||
|
||||
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' );
|
||||
wp_register_script( 'html5shim', 'http://html5shim.googlecode.com/svn/trunk/html5.js' );
|
||||
wp_register_script( 'superfish', get_template_directory_uri() . '/js/superfish.js', array( 'jquery' ) );
|
||||
wp_register_script( 'buddypress', get_template_directory_uri() . '/js/buddypress.js', array( 'jquery' ) );
|
||||
wp_register_script( 'colorbox', get_template_directory_uri() . '/js/jquery.colorbox-min.js', array( 'jquery' ) );
|
||||
wp_register_script( 'theme_custom', get_template_directory_uri() . '/js/custom.js', array( 'jquery' ), 1.0, TRUE );
|
||||
|
||||
wp_enqueue_script( array( 'superfish', 'colorbox', 'buddypress', 'theme_custom' ) );
|
||||
|
||||
if( is_single() ) wp_enqueue_script( 'comment-reply' );
|
||||
if( $is_IE ) wp_enqueue_script( 'html5shim' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Remove Extra <p> Tags From Excerpt Output
|
||||
------------------------------------------------ */
|
||||
|
||||
function huddle_excerpt($content) {
|
||||
$content = preg_replace(array('#<p>#', '#</p>#'), '', $content);
|
||||
return $content;
|
||||
}
|
||||
add_filter('the_excerpt', 'huddle_excerpt');
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Excerpt Length
|
||||
------------------------------------------------ */
|
||||
|
||||
add_filter( 'excerpt_length', 'huddle_excerpt_length' );
|
||||
|
||||
function huddle_excerpt_length( $length ) {
|
||||
return 40;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Excerpt More Link
|
||||
------------------------------------------------ */
|
||||
|
||||
add_filter( 'excerpt_more', 'huddle_auto_excerpt_more' );
|
||||
|
||||
if( ! function_exists( 'huddle_auto_excerpt_more' ) ) {
|
||||
function huddle_auto_excerpt_more( $more ) {
|
||||
return '.';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Register Sidebars
|
||||
------------------------------------------------ */
|
||||
|
||||
add_action( 'widgets_init', 'huddle_widgets_init' );
|
||||
|
||||
if( ! function_exists( 'huddle_widgets_init' ) ) {
|
||||
function huddle_widgets_init() {
|
||||
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Homepage Sidebar', 'huddle' ),
|
||||
'id' => 'sidebar-home',
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => "</div>",
|
||||
'before_title' => '<h3 class="widget-title">',
|
||||
'after_title' => '</h3>',
|
||||
) );
|
||||
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Blog Sidebar', 'huddle' ),
|
||||
'id' => 'sidebar-blog',
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => "</div><div class='clear'></div>",
|
||||
'before_title' => '<h3 class="widget-title">',
|
||||
'after_title' => '</h3>',
|
||||
) );
|
||||
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Page Sidebar', 'huddle' ),
|
||||
'id' => 'sidebar-page',
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => "</div><div class='clear'></div>",
|
||||
'before_title' => '<h3 class="widget-title">',
|
||||
'after_title' => '</h3>',
|
||||
) );
|
||||
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Footer Sidebar', 'huddle' ),
|
||||
'id' => 'sidebar-footer',
|
||||
'description' => __( 'An optional widget area for your site footer', 'huddle' ),
|
||||
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => "</div><div class='clear'></div>",
|
||||
'before_title' => '<h3 class="widget-title">',
|
||||
'after_title' => '</h3>',
|
||||
) );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Expanding Body Class
|
||||
------------------------------------------------ */
|
||||
|
||||
add_filter( 'body_class', 'huddle_body_class' );
|
||||
|
||||
if( ! function_exists( 'huddle_body_class' ) ) {
|
||||
|
||||
function huddle_body_class( $classes ) {
|
||||
|
||||
if( isset( $_GET['w-iframe'] ) ) $classes[] = 'with-iframe';
|
||||
|
||||
if( isset( $_GET['style'] ) ) {
|
||||
$classes[] = $_GET['style'];
|
||||
} else {
|
||||
$classes[] = of_get_option( 'style' );
|
||||
}
|
||||
|
||||
if( ! is_user_logged_in() ) {
|
||||
$classes[] = 'not-logged-in';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Comments Template
|
||||
------------------------------------------------ */
|
||||
|
||||
if( ! function_exists( 'huddle_comments' ) ) {
|
||||
function huddle_comments($comment, $args, $depth) {
|
||||
$path = get_template_directory_uri();
|
||||
$GLOBALS['comment'] = $comment;
|
||||
?>
|
||||
|
||||
<li <?php comment_class('clf'); ?> id="li-comment-<?php comment_ID() ?>">
|
||||
<div class="comment-box" id="comment-<?php comment_ID(); ?>">
|
||||
<div class="comment-avatar fl"><?php echo get_avatar( $comment, 35 ); ?></div>
|
||||
|
||||
<div class="comment-meta fl">
|
||||
<p class="comment-author"><?php echo get_comment_author_link() ?></p>
|
||||
<p class="comment-date">
|
||||
<a class="comment-date-link" href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><em><?php comment_date('m.d.Y') ?></em></a>
|
||||
<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'before' => ' · ' ) ) ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="comment-body fl">
|
||||
<?php if ( $comment->comment_approved == '0' ) : ?>
|
||||
<em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'huddle' ); ?></em>
|
||||
<br />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo get_comment_text(); ?>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div><!-- #comment-## -->
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Load Files
|
||||
------------------------------------------------ */
|
||||
|
||||
include 'functions/widgets/widget-enews.php'; // E-news Widget
|
||||
include 'functions/widgets/widget-flickr.php'; // Flickr Widget
|
||||
include 'functions/widgets/widget-recent-posts.php';// Recent Posts Widget
|
||||
include 'functions/widgets/widget-tab-archive.php'; // Archives Widget
|
||||
include 'functions/widgets/widget-tab-posts.php'; // Posts Widget
|
||||
include 'functions/widgets/widget-tweets.php'; // Tweets Widget
|
||||
include 'functions/widgets/widget-video.php'; // Video Widget
|
||||
|
||||
include 'functions/shortcodes.php'; // Shortcodes
|
||||
|
||||
include 'functions-buddypress.php'; // BuddyPress Functions
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
Useful functions
|
||||
------------------------------------------------ */
|
||||
|
||||
if( ! function_exists( 'print_pre' ) ) {
|
||||
function print_pre( $s, $var_dump = false ) {
|
||||
echo '<pre>';
|
||||
$var_dump ? var_dump( $s ) : print_r( $s );
|
||||
echo '</pre>';
|
||||
}
|
||||
}
|
||||
|
||||
if( ! function_exists( 'wp_trim_words' ) ) {
|
||||
function wp_trim_words( $excerpt, $charlength, $more = '...' ) {
|
||||
$o = '';
|
||||
$charlength++;
|
||||
if(strlen($excerpt)>$charlength) {
|
||||
$subex = substr($excerpt,0,$charlength-5);
|
||||
$exwords = explode(" ",$subex);
|
||||
$excut = -(strlen($exwords[count($exwords)-1]));
|
||||
if($excut<0) {
|
||||
$o .= substr($subex,0,$excut);
|
||||
} else {
|
||||
$o .= $subex;
|
||||
}
|
||||
$o .= $more;
|
||||
} else {
|
||||
$o .= $excerpt;
|
||||
}
|
||||
return $o;
|
||||
}
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
File name: paginate.php
|
||||
Description: Paginate class for wordpress admin pages
|
||||
Version: 1.0
|
||||
*/
|
||||
|
||||
class paginate {
|
||||
|
||||
private $options = array();
|
||||
private $nav = '';
|
||||
private $limit;
|
||||
|
||||
function __construct($options){
|
||||
$this->options = array_merge(array(
|
||||
'total' => 0,
|
||||
'nr_per_page' => 25,
|
||||
'between' => 3,
|
||||
'qs' => 'pages'
|
||||
),$options);
|
||||
|
||||
$get = 1;
|
||||
if(isset($_GET[$this->options['qs']])) $get = (int) $_GET[$this->options['qs']];
|
||||
|
||||
if(isset($get) && !empty($get)){
|
||||
$limit_x = (($get-1)*$this->options['nr_per_page']);
|
||||
}else{
|
||||
$limit_x = 0;
|
||||
}
|
||||
|
||||
$this->limit = $limit_x.','.$this->options['nr_per_page'];
|
||||
$this->options['pages'] = ceil($this->options['total']/$this->options['nr_per_page']);
|
||||
$last = $this->options['pages'];
|
||||
$this->options['current_page'] = $limit_x/$this->options['nr_per_page']+1;
|
||||
$start = 1;
|
||||
$stop = $this->options['current_page'] + $this->options['between'];
|
||||
if($this->options['current_page'] > $this->options['between']) $start = $this->options['current_page'] - $this->options['between'];
|
||||
if($this->options['pages'] < $stop) $stop = $this->options['pages'];
|
||||
|
||||
if($this->options['total'] > $this->options['nr_per_page']){
|
||||
|
||||
$nav = '<span class="pages">'.__('Page', 'huddle').' '.($this->options['current_page']).' '.__('of', 'huddle').' '.$this->options['pages'].'</span> ';
|
||||
|
||||
$gets = array();
|
||||
foreach($_GET as $gk=>$gv){
|
||||
if($gk != $this->options['qs']) array_push($gets,$gk.'='.$gv);
|
||||
}
|
||||
|
||||
$base_url = current(explode('?', $_SERVER['REQUEST_URI'])).'?'.implode('&',$gets);
|
||||
|
||||
if($limit_x != 0) $nav .= '<a class="previouspostslink" href="'. add_query_arg( 'pages', $get - 1 ) .'"><span>← '.__('Previous', 'huddle').'</span></a> ';
|
||||
|
||||
for($nr = $start; $nr <= $stop; $nr++ ){
|
||||
if($limit_x != ($nr-1)*$this->options['nr_per_page'])
|
||||
$nav .= '<a class="page" href="'. add_query_arg( 'pages', $nr ) .'"><span>'.$nr.'</span></a> ';
|
||||
else
|
||||
$nav .= '<span class="current"><span>'.$nr.'</span></span> ';
|
||||
}
|
||||
|
||||
if($get != $last) $nav .= '<a class="nextpostslink" href="'. add_query_arg( 'pages', $get + 1 ) .'"><span>'.__('Next', 'huddle').' →</span></a> ';
|
||||
|
||||
$this->nav = $nav;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function nav(){
|
||||
return '<div class="wp-pagenavi">'.$this->nav.'</div>';
|
||||
}
|
||||
|
||||
function limit(){
|
||||
return $this->limit;
|
||||
}
|
||||
|
||||
function get($i){
|
||||
if($this->options[$i]) return $this->options[$i];
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,182 +0,0 @@
|
||||
<?php
|
||||
|
||||
/* ------------------------------------------------
|
||||
Theme Shortcodes
|
||||
---------------------------------------------------
|
||||
|
||||
|
||||
TABLE OF CONTENTS
|
||||
|
||||
0.0 - Shotcode Setup
|
||||
1.0 - CSS Columns
|
||||
|
||||
|
||||
------------------------------------------------ */
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
0.0 Setup WP For Shortcodes
|
||||
------------------------------------------------ */
|
||||
|
||||
function huddle_shortcode_formatter($content) {
|
||||
$new_content = '';
|
||||
$pattern_full = '{(\[raw\].*?\[/raw\])}is';
|
||||
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
|
||||
$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
|
||||
foreach ($pieces as $piece) {
|
||||
if (preg_match($pattern_contents, $piece, $matches)) {
|
||||
$new_content .= $matches[1];
|
||||
} else {
|
||||
$new_content .= wptexturize(wpautop($piece));
|
||||
}
|
||||
}
|
||||
|
||||
return $new_content;
|
||||
}
|
||||
|
||||
remove_filter('the_content', 'wpautop');
|
||||
remove_filter('the_content','wptexturize');
|
||||
|
||||
add_filter('the_content', 'huddle_shortcode_formatter', 99);
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------
|
||||
1.0 CSS Columns
|
||||
------------------------------------------------ */
|
||||
|
||||
function huddle_one_third( $atts, $content = null ) {
|
||||
return '<div class="one_third">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('one_third', 'huddle_one_third');
|
||||
|
||||
|
||||
function huddle_one_third_last( $atts, $content = null ) {
|
||||
return '<div class="one_third last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('one_third_last', 'huddle_one_third_last');
|
||||
|
||||
|
||||
function huddle_two_third( $atts, $content = null ) {
|
||||
return '<div class="two_third">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('two_third', 'huddle_two_third');
|
||||
|
||||
|
||||
function huddle_two_third_last( $atts, $content = null ) {
|
||||
return '<div class="two_third last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('two_third_last', 'huddle_two_third_last');
|
||||
|
||||
|
||||
function huddle_one_half( $atts, $content = null ) {
|
||||
return '<div class="one_half">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('one_half', 'huddle_one_half');
|
||||
|
||||
|
||||
function huddle_one_half_last( $atts, $content = null ) {
|
||||
return '<div class="one_half last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('one_half_last', 'huddle_one_half_last');
|
||||
|
||||
|
||||
function huddle_one_fourth( $atts, $content = null ) {
|
||||
return '<div class="one_fourth">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('one_fourth', 'huddle_one_fourth');
|
||||
|
||||
|
||||
function huddle_one_fourth_last( $atts, $content = null ) {
|
||||
return '<div class="one_fourth last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('one_fourth_last', 'huddle_one_fourth_last');
|
||||
|
||||
|
||||
function huddle_three_fourth( $atts, $content = null ) {
|
||||
return '<div class="three_fourth">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('three_fourth', 'huddle_three_fourth');
|
||||
|
||||
|
||||
function huddle_three_fourth_last( $atts, $content = null ) {
|
||||
return '<div class="three_fourth last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('three_fourth_last', 'huddle_three_fourth_last');
|
||||
|
||||
|
||||
function huddle_one_fifth( $atts, $content = null ) {
|
||||
return '<div class="one_fifth">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('one_fifth', 'huddle_one_fifth');
|
||||
|
||||
|
||||
function huddle_one_fifth_last( $atts, $content = null ) {
|
||||
return '<div class="one_fifth last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('one_fifth_last', 'huddle_one_fifth_last');
|
||||
|
||||
|
||||
function huddle_two_fifth( $atts, $content = null ) {
|
||||
return '<div class="two_fifth">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('two_fifth', 'huddle_two_fifth');
|
||||
|
||||
|
||||
function huddle_two_fifth_last( $atts, $content = null ) {
|
||||
return '<div class="two_fifth last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('two_fifth_last', 'huddle_two_fifth_last');
|
||||
|
||||
|
||||
function huddle_three_fifth( $atts, $content = null ) {
|
||||
return '<div class="three_fifth">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('three_fifth', 'huddle_three_fifth');
|
||||
|
||||
|
||||
function huddle_three_fifth_last( $atts, $content = null ) {
|
||||
return '<div class="three_fifth last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('three_fifth_last', 'huddle_three_fifth_last');
|
||||
|
||||
|
||||
function huddle_four_fifth( $atts, $content = null ) {
|
||||
return '<div class="four_fifth">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('four_fifth', 'huddle_four_fifth');
|
||||
|
||||
|
||||
function huddle_four_fifth_last( $atts, $content = null ) {
|
||||
return '<div class="four_fifth last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('four_fifth_last', 'huddle_four_fifth_last');
|
||||
|
||||
|
||||
function huddle_one_sixth( $atts, $content = null ) {
|
||||
return '<div class="one_sixth">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('one_sixth', 'huddle_one_sixth');
|
||||
|
||||
|
||||
function huddle_one_sixth_last( $atts, $content = null ) {
|
||||
return '<div class="one_sixth last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('one_sixth_last', 'huddle_one_sixth_last');
|
||||
|
||||
|
||||
function huddle_five_sixth( $atts, $content = null ) {
|
||||
return '<div class="five_sixth">' . do_shortcode($content) . '</div>';
|
||||
}
|
||||
add_shortcode('five_sixth', 'huddle_five_sixth');
|
||||
|
||||
|
||||
function huddle_five_sixth_last( $atts, $content = null ) {
|
||||
return '<div class="five_sixth last">' . do_shortcode($content) . '</div><div class="clear"></div>';
|
||||
}
|
||||
add_shortcode('five_sixth_last', 'huddle_five_sixth_last');
|
||||
|
||||
|
||||
?>
|
||||
@ -1,110 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Widget Name: eNews Signup
|
||||
*/
|
||||
|
||||
|
||||
add_action( 'widgets_init', 'huddle_enews_widgets' );
|
||||
|
||||
function huddle_enews_widgets() {
|
||||
register_widget( 'huddle_enews_widget' );
|
||||
}
|
||||
|
||||
class huddle_enews_widget extends WP_Widget {
|
||||
|
||||
function huddle_enews_widget() {
|
||||
$widget_ops = array( 'classname' => 'widget-enews', 'description' => __('Subscribe to email updates.', 'huddle') );
|
||||
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'widget-enews' );
|
||||
$this->WP_Widget( 'widget-enews', __('Huddle: eNews Signup','huddle'), $widget_ops, $control_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
$title = apply_filters('widget_title', $instance['title'] );
|
||||
$enews_text = $instance['enews_text'];
|
||||
$enews_input = $instance['enews_input'];
|
||||
$enews_id = $instance['enews_id'];
|
||||
$enews_btn = $instance['enews_btn'];
|
||||
echo $before_widget;
|
||||
?>
|
||||
|
||||
<?php echo $before_title ?>
|
||||
<?php echo $title; ?>
|
||||
|
||||
<?php if($instance['privacy_page']): $page = get_page($instance['privacy_page']); ?>
|
||||
<span><a href="<?php echo get_permalink($page->ID) ?>"><?php echo $page->post_title ?> →</a></span>
|
||||
<?php endif ?>
|
||||
|
||||
<?php echo $after_title ?>
|
||||
|
||||
<?php echo $instance['enews_text']; ?>
|
||||
|
||||
<form id="subscribe" name="subscribe" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=<?php echo esc_js( $instance['enews_id'] ); ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
|
||||
<div class="form-box">
|
||||
<input type="text" name="email" class="field" id="email-address" placeholder="<?php echo $instance['enews_input']; ?>" />
|
||||
<input class="submit" type="submit" value="<?php echo $instance['enews_btn'] ?>" />
|
||||
</div>
|
||||
|
||||
<input type="hidden" value="<?php echo $instance['enews_id']; ?>" name="uri" />
|
||||
<input type="hidden" name="loc" value="en_US" />
|
||||
</form>
|
||||
|
||||
<div class="clear"></div>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
$instance['enews_text'] = $new_instance['enews_text'];
|
||||
$instance['privacy_page'] = $new_instance['privacy_page'];
|
||||
$instance['enews_input'] = strip_tags( $new_instance['enews_input'] );
|
||||
$instance['enews_id'] = strip_tags( $new_instance['enews_id'] );
|
||||
$instance['enews_btn'] = strip_tags( $new_instance['enews_btn'] );
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$defaults = array(
|
||||
'title' => 'Email Updates',
|
||||
'privacy_page' => '0',
|
||||
'enews_text' => '<p>Lorem ipsum dolor sit amet, quae jugis sudo, consequat, distineo, aliquip diam abdo saga citer.</p>',
|
||||
'enews_input' => 'Enter Valid Email Address',
|
||||
'enews_id' => 'TechCrunch',
|
||||
'enews_btn' => 'Sign Up'
|
||||
);
|
||||
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'huddle') ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'privacy_page' ); ?>"><?php _e('\'Privacy Policy\' page:', 'huddle') ?></label>
|
||||
<select class="widefat" id="<?php echo $this->get_field_id( 'privacy_page' ); ?>" name="<?php echo $this->get_field_name( 'privacy_page' ); ?>">
|
||||
<option value="0"><?php _e(' - Select - ', 'huddle') ?></option>
|
||||
<?php foreach(get_pages() as $page): ?>
|
||||
<option <?php selected($instance['privacy_page'], $page->ID) ?> value="<?php echo $page->ID ?>"><?php echo $page->post_title ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'enews_text' ); ?>"><?php _e('Text:', 'huddle') ?></label>
|
||||
<textarea class="widefat" id="<?php echo $this->get_field_id( 'enews_text' ); ?>" name="<?php echo $this->get_field_name( 'enews_text' ); ?>" rows="10"><?php echo $instance['enews_text']; ?></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'enews_input' ); ?>"><?php _e('Default Text for Input Field:', 'huddle') ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'enews_input' ); ?>" name="<?php echo $this->get_field_name( 'enews_input' ); ?>" value="<?php echo $instance['enews_input']; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'enews_id' ); ?>"><?php _e('Feedburner ID:', 'huddle') ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'enews_id' ); ?>" name="<?php echo $this->get_field_name( 'enews_id' ); ?>" value="<?php echo $instance['enews_id']; ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'enews_btn' ); ?>"><?php _e('Button Text:', 'huddle') ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'enews_btn' ); ?>" name="<?php echo $this->get_field_name( 'enews_btn' ); ?>" value="<?php echo $instance['enews_btn']; ?>" />
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Widget Name: Flickr
|
||||
*/
|
||||
|
||||
|
||||
add_action( 'widgets_init', 'huddle_flickr_widgets' );
|
||||
|
||||
function huddle_flickr_widgets() {
|
||||
register_widget( 'huddle_flickr_widget' );
|
||||
}
|
||||
|
||||
class huddle_flickr_widget extends WP_Widget {
|
||||
|
||||
function huddle_flickr_widget() {
|
||||
$widget_ops = array( 'classname' => 'widget-flickr', 'description' => __('Display your flickr photos.', 'huddle') );
|
||||
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'widget-flickr' );
|
||||
$this->WP_Widget( 'widget-flickr', __('Huddle: Flickr Photos', 'huddle'), $widget_ops, $control_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
$title = apply_filters('widget_title', $instance['title'] );
|
||||
$flickr_id = $instance['flickr_id'];
|
||||
$flickr_count = $instance['flickr_count'];
|
||||
$flickr_type = $instance['flickr_type'];
|
||||
echo $before_widget;
|
||||
if ( $title ) {
|
||||
echo $before_title . $title; ?>
|
||||
<?php echo $after_title;
|
||||
} ?>
|
||||
|
||||
<div id="flickr_badge_wrapper">
|
||||
<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=<?php echo $flickr_count ?>&flickr_display=latest&size=s&layout=x&source=<?php echo $flickr_type ?>&<?php echo $flickr_type ?>=<?php echo $flickr_id ?>"></script>
|
||||
<a class="more-photos" href="http://www.flickr.com/<?php echo ($flickr_type == 'user' ? 'photos' : 'groups') ?>/<?php echo $flickr_id ?>"><?php _e( 'View All', 'huddle' ) ?> <span>→</span></a>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
$instance['flickr_id'] = strip_tags( $new_instance['flickr_id'] );
|
||||
$instance['flickr_count'] = $new_instance['flickr_count'];
|
||||
$instance['flickr_type'] = $new_instance['flickr_type'];
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$defaults = array(
|
||||
'title' => 'Flickr Photos',
|
||||
'flickr_id' => '675729@N22',
|
||||
'flickr_count' => '9',
|
||||
'flickr_type' => 'group'
|
||||
);
|
||||
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $instance['title']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'flickr_id' ); ?>"><?php _e('Flickr ID:', 'huddle') ?> (<a href="http://idgettr.com/" target="_blank">Find Flickr ID</a>)</label><input class="widefat" id="<?php echo $this->get_field_id('flickr_id'); ?>" name="<?php echo $this->get_field_name('flickr_id'); ?>" value="<?php echo $instance['flickr_id']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'flickr_count' ); ?>"><?php _e('How Many Photos:', 'huddle') ?></label>
|
||||
<select id="<?php echo $this->get_field_id( 'flickr_count' ); ?>" name="<?php echo $this->get_field_name('flickr_count'); ?>" class="widefat">
|
||||
<?php for($i = 1; $i < 11; $i++) : ?>
|
||||
<option <?php if ( $i == $instance['flickr_count'] ) echo 'selected="selected"'; ?>><?php echo $i; ?></option>
|
||||
<?php endfor; ?>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'flickr_type' ); ?>"><?php _e('flickr_type (user or group):', 'huddle') ?></label>
|
||||
<select id="<?php echo $this->get_field_id( 'flickr_type' ); ?>" name="<?php echo $this->get_field_name('flickr_type'); ?>" class="widefat">
|
||||
<option <?php if ( 'user' == $instance['flickr_type'] ) echo 'selected="selected"'; ?>>user</option>
|
||||
<option <?php if ( 'group' == $instance['flickr_type'] ) echo 'selected="selected"'; ?>>group</option>
|
||||
</select>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
|
||||
add_action('widgets_init', 'huddle_widget_recent_posts');
|
||||
|
||||
function huddle_widget_recent_posts() {
|
||||
unregister_widget('WP_Widget_Recent_Posts');
|
||||
register_widget('huddle_widget_recent_posts');
|
||||
}
|
||||
|
||||
class huddle_widget_recent_posts extends WP_Widget_Recent_Posts {
|
||||
|
||||
function huddle_widget_recent_posts() {
|
||||
parent::__construct();
|
||||
$this->name = __('Huddle: Posts', 'huddle');
|
||||
$this->widget_options['description'] = __('The most recent/popular posts on your site', 'huddle');
|
||||
}
|
||||
|
||||
function widget($args, $instance) {
|
||||
$cache = wp_cache_get('widget_recent_posts', 'widget');
|
||||
|
||||
if ( !is_array($cache) )
|
||||
$cache = array();
|
||||
|
||||
if ( isset($cache[$args['widget_id']]) ) {
|
||||
echo $cache[$args['widget_id']];
|
||||
return;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
extract($args);
|
||||
|
||||
$title = apply_filters('widget_title', empty($instance['title']) ? __( 'Recent Posts', 'huddle' ) : $instance['title'], $instance, $this->id_base);
|
||||
if ( ! $number = absint( $instance['number'] ) )
|
||||
$number = 10;
|
||||
$thumbs = isset($instance['thumbs']) && $instance['thumbs'];
|
||||
$show = isset($instance['show']) ? $instance['show'] : 'recent';
|
||||
|
||||
$wpq_args = array('posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => true);
|
||||
if($show == 'popular') {
|
||||
$wpq_args['orderby'] = 'comment_count';
|
||||
}
|
||||
|
||||
$r = new WP_Query($wpq_args);
|
||||
if ($r->have_posts()) :
|
||||
?>
|
||||
<?php echo $before_widget; ?>
|
||||
<?php if ( $title ) echo $before_title . $title . $after_title; ?>
|
||||
<?php while ($r->have_posts()) : $r->the_post(); ?>
|
||||
<div class="post">
|
||||
<div class="post-img fl"><a href="<?php the_permalink();?>"><?php the_post_thumbnail( 'post-small' ); ?></a></div>
|
||||
<h4 class="post-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></h4>
|
||||
<span>
|
||||
<?php _e( 'On', 'huddle' ) ?>
|
||||
<?php the_time( get_option( 'date_format' ) ) ?>,
|
||||
<?php _e( 'with', 'huddle' ) ?>
|
||||
<?php comments_popup_link(__('0 Comments', 'huddle'), __('1 Comment', 'huddle'), __('% Comments', 'huddle')); ?>
|
||||
</span>
|
||||
<div class="clf"></div>
|
||||
</div><!--post-->
|
||||
<?php endwhile; ?>
|
||||
<?php echo $after_widget; ?>
|
||||
<?php
|
||||
// Reset the global $the_post as this query will have stomped on it
|
||||
wp_reset_postdata();
|
||||
endif;
|
||||
|
||||
$cache[$args['widget_id']] = ob_get_flush();
|
||||
wp_cache_set('widget_recent_posts', $cache, 'widget');
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = parent::update( $new_instance, $old_instance );
|
||||
$instance['thumbs'] = isset($new_instance['thumbs']);
|
||||
$instance['show'] = $new_instance['show'];
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
parent::form($instance);
|
||||
$thumbs = isset($instance['thumbs']) && $instance['thumbs'];
|
||||
$show = isset($instance['show']) ? $instance['show'] : 'recent';
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('show'); ?>"><?php _e('Show ', 'huddle'); ?> <select name="<?php echo $this->get_field_name('show'); ?>">
|
||||
<option value="recent" <?php selected($show, 'recent') ?>><?php _e('recent', 'huddle') ?></option>
|
||||
<option value="popular" <?php selected($show, 'popular') ?>><?php _e('popular', 'huddle') ?></option>
|
||||
</select> <?php _e('posts', 'huddle') ?></label>
|
||||
</p>
|
||||
<p>
|
||||
<input id="<?php echo $this->get_field_id('thumbs'); ?>" name="<?php echo $this->get_field_name('thumbs'); ?>" type="checkbox" <?php checked($thumbs, true) ?> />
|
||||
<label for="<?php echo $this->get_field_id('thumbs'); ?>"><?php _e('Show Post Thumbnails', 'huddle'); ?></label>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Widget Name: Archive Tabbed Widget
|
||||
*/
|
||||
|
||||
|
||||
add_action( 'widgets_init', 'huddle_archive_widgets' );
|
||||
|
||||
function huddle_archive_widgets() {
|
||||
register_widget( 'huddle_archive_widget' );
|
||||
}
|
||||
|
||||
class huddle_archive_widget extends WP_Widget {
|
||||
|
||||
function huddle_archive_widget() {
|
||||
$widget_ops = array( 'classname' => 'widget-archive', 'description' => __('A widget that displays categories, pages, and archives.', 'huddle') );
|
||||
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'widget-archive' );
|
||||
$this->WP_Widget( 'widget-archive', __('Huddle: Tabbed Archive', 'huddle'), $widget_ops, $control_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
global $wpdb;
|
||||
extract( $args );
|
||||
$title = apply_filters('widget_title', $instance['title'] );
|
||||
$title_cats = $instance['title_cats'];
|
||||
$title_pages = $instance['title_pages'];
|
||||
$title_archive = $instance['title_archive'];
|
||||
echo $before_widget;
|
||||
if ( $title )
|
||||
echo $before_title . $title . $after_title;
|
||||
?>
|
||||
<ul class="tabs clf">
|
||||
<li><a class="btn-small"><span><?php echo $title_cats; ?></span></a></li>
|
||||
<li><a><span><?php echo $title_pages; ?></span></a></li>
|
||||
<li><a><span><?php echo $title_archive; ?></span></a></li>
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
<div class="panes">
|
||||
<div class="pane">
|
||||
<ul>
|
||||
<?php wp_list_categories( 'show_count=1&title_li=&orderby=name&depth=1' ) ?>
|
||||
</ul>
|
||||
</div><!--pane-->
|
||||
<div class="pane">
|
||||
<ul>
|
||||
<?php wp_list_pages( 'title_li=&depth=1&' ) ?>
|
||||
</ul>
|
||||
</div><!--pane-->
|
||||
<div class="pane">
|
||||
<ul class="archive-item">
|
||||
<?php wp_get_archives( 'type=monthly&show_post_count=true&format=html' ) ?>
|
||||
</ul>
|
||||
</div><!--pane-->
|
||||
</div><!--panes-->
|
||||
<div class="clf"></div>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
$instance['title_cats'] = $new_instance['title_cats'];
|
||||
$instance['title_pages'] = $new_instance['title_pages'];
|
||||
$instance['title_archive'] = $new_instance['title_archive'];
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$defaults = array(
|
||||
'title' => '',
|
||||
'title_cats' => 'Categories',
|
||||
'title_pages' => 'Pages',
|
||||
'title_archive' => 'Archives',
|
||||
);
|
||||
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title_cats' ); ?>"><?php _e('Popular Posts Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'title_cats' ); ?>" name="<?php echo $this->get_field_name( 'title_cats' ); ?>" value="<?php echo $instance['title_cats']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title_pages' ); ?>"><?php _e('Recent Posts Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'title_pages' ); ?>" name="<?php echo $this->get_field_name( 'title_pages' ); ?>" value="<?php echo $instance['title_pages']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title_archive' ); ?>"><?php _e('Recent Comments Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'title_archive' ); ?>" name="<?php echo $this->get_field_name( 'title_archive' ); ?>" value="<?php echo $instance['title_archive']; ?>" /></p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,156 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Widget Name: Posts Tabbed Widget
|
||||
*/
|
||||
|
||||
|
||||
add_action( 'widgets_init', 'huddle_posts_widgets' );
|
||||
|
||||
function huddle_posts_widgets() {
|
||||
register_widget( 'huddle_posts_widget' );
|
||||
}
|
||||
|
||||
class huddle_posts_widget extends WP_Widget {
|
||||
|
||||
function huddle_posts_widget() {
|
||||
$widget_ops = array( 'classname' => 'widget-posts', 'description' => __('A widget that display popular posts, recent posts, recent comments and tags.', 'huddle') );
|
||||
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'widget-posts' );
|
||||
$this->WP_Widget( 'widget-posts', __('Huddle: Tabbed Posts', 'huddle'), $widget_ops, $control_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
global $wpdb;
|
||||
extract( $args );
|
||||
$title = apply_filters('widget_title', $instance['title'] );
|
||||
$title_popular = $instance['title_popular'];
|
||||
$title_recent = $instance['title_recent'];
|
||||
$title_comments = $instance['title_comments'];
|
||||
$display_count = $instance['display_count'];
|
||||
echo $before_widget;
|
||||
if ( $title )
|
||||
echo $before_title . $title . $after_title;
|
||||
?>
|
||||
<ul class="tabs">
|
||||
<li><a class="btn-small"><span><?php echo $title_popular; ?></span></a></li>
|
||||
<li><a><span><?php echo $title_recent; ?></span></a></li>
|
||||
<li><a><span><?php echo $title_comments; ?></span></a></li>
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
<div class="panes">
|
||||
|
||||
<?php // Popular Posts
|
||||
$huddle_popular_posts = new WP_Query();
|
||||
$huddle_popular_posts->query( 'showposts=' . $display_count . '&orderby=comment_count' ); ?>
|
||||
<div class="pane">
|
||||
<?php // Start the loop
|
||||
while ($huddle_popular_posts->have_posts()) : $huddle_popular_posts->the_post(); ?>
|
||||
<div class="post">
|
||||
<div class="post-img fl"><a href="<?php the_permalink();?>"><?php the_post_thumbnail( 'post-small' ); ?></a></div>
|
||||
<h4 class="post-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></h4>
|
||||
<span>
|
||||
<?php _e( 'On', 'huddle' ) ?>
|
||||
<?php the_time( get_option( 'date_format' ) ) ?>,
|
||||
<?php _e( 'with', 'huddle' ) ?>
|
||||
<?php comments_popup_link(__('0 Comments', 'huddle'), __('1 Comment', 'huddle'), __('% Comments', 'huddle')); ?>
|
||||
</span>
|
||||
<div class="clf"></div>
|
||||
</div><!--post-->
|
||||
<?php // End the loop
|
||||
endwhile; wp_reset_query(); ?>
|
||||
</div><!--pane-->
|
||||
|
||||
<?php // Recent Posts
|
||||
$huddle_recent_posts = new WP_Query();
|
||||
$huddle_recent_posts->query('showposts='.$display_count.''); ?>
|
||||
<div class="pane">
|
||||
<?php // Start the loop
|
||||
while ($huddle_recent_posts->have_posts()) : $huddle_recent_posts->the_post(); ?>
|
||||
<div class="post">
|
||||
<div class="post-img fl"><a href="<?php the_permalink();?>"><?php the_post_thumbnail( 'post-small' ); ?></a></div>
|
||||
<h4 class="post-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></h4>
|
||||
<span>
|
||||
<?php _e( 'On', 'huddle' ) ?>
|
||||
<?php the_time( get_option( 'date_format' ) ) ?>,
|
||||
<?php _e( 'with', 'huddle' ) ?>
|
||||
<?php comments_popup_link(__('0 Comments', 'huddle'), __('1 Comment', 'huddle'), __('% Comments', 'huddle')); ?>
|
||||
</span>
|
||||
<div class="clf"></div>
|
||||
</div><!--post-->
|
||||
<?php // End the loop
|
||||
endwhile; wp_reset_query(); ?>
|
||||
</div><!--pane-->
|
||||
|
||||
<?php // Recent Comments ?>
|
||||
<div class="pane">
|
||||
<?php // Query for comments
|
||||
global $wpdb;
|
||||
$huddle_recent_comments_query = "SELECT DISTINCT ID, post_title, post_password, comment_ID,
|
||||
comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved,
|
||||
comment_type,comment_author_url,
|
||||
SUBSTRING(comment_content,1,50) AS comment_excerpt
|
||||
FROM $wpdb->comments
|
||||
LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =
|
||||
$wpdb->posts.ID)
|
||||
WHERE comment_approved = '1' AND comment_type = '' AND
|
||||
post_password = ''
|
||||
ORDER BY comment_date_gmt DESC LIMIT ".$display_count;
|
||||
$huddle_recent_comments = $wpdb->get_results($huddle_recent_comments_query);
|
||||
foreach ($huddle_recent_comments as $huddle_recent_comment) {
|
||||
?>
|
||||
<div class="post clf">
|
||||
<div class="post-img"><?php echo get_avatar($huddle_recent_comment, 35); ?></div>
|
||||
<div class="post-txt">
|
||||
<h4 class="post-title"><a href="<?php echo get_permalink($huddle_recent_comment->ID); ?>#comment-<?php echo $huddle_recent_comment->comment_ID; ?>"><?php echo strip_tags($huddle_recent_comment->comment_author); ?></a></h4>
|
||||
<span class="em"><?php echo strip_tags($huddle_recent_comment->comment_excerpt); ?>...</span>
|
||||
</div>
|
||||
</div><!--post-->
|
||||
<?php } ?>
|
||||
</div><!--pane-->
|
||||
</div><!--panes-->
|
||||
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
$instance['title_popular'] = $new_instance['title_popular'];
|
||||
$instance['title_recent'] = $new_instance['title_recent'];
|
||||
$instance['title_comments'] = $new_instance['title_comments'];
|
||||
$instance['display_count'] = $new_instance['display_count'];
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$defaults = array(
|
||||
'title' => '',
|
||||
'title_popular' => 'Popular',
|
||||
'title_recent' => 'Recent',
|
||||
'title_comments' => 'Comments',
|
||||
'display_count' => 5,
|
||||
);
|
||||
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title_popular' ); ?>"><?php _e('Popular Posts Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'title_popular' ); ?>" name="<?php echo $this->get_field_name( 'title_popular' ); ?>" value="<?php echo $instance['title_popular']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title_recent' ); ?>"><?php _e('Recent Posts Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'title_recent' ); ?>" name="<?php echo $this->get_field_name( 'title_recent' ); ?>" value="<?php echo $instance['title_recent']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title_comments' ); ?>"><?php _e('Recent Comments Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'title_comments' ); ?>" name="<?php echo $this->get_field_name( 'title_comments' ); ?>" value="<?php echo $instance['title_comments']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'display_count' ); ?>"><?php _e('Number of Results To Display:', 'huddle') ?></label>
|
||||
<select id="<?php echo $this->get_field_id( 'display_count' ); ?>" name="<?php echo $this->get_field_name( 'display_count' ); ?>" class="widefat">
|
||||
<option <?php if ( '1' == $instance['display_count'] ) echo 'selected="selected"'; ?>>1</option>
|
||||
<option <?php if ( '2' == $instance['display_count'] ) echo 'selected="selected"'; ?>>2</option>
|
||||
<option <?php if ( '3' == $instance['display_count'] ) echo 'selected="selected"'; ?>>3</option>
|
||||
<option <?php if ( '4' == $instance['display_count'] ) echo 'selected="selected"'; ?>>4</option>
|
||||
<option <?php if ( '5' == $instance['display_count'] ) echo 'selected="selected"'; ?>>5</option>
|
||||
<option <?php if ( '6' == $instance['display_count'] ) echo 'selected="selected"'; ?>>6</option>
|
||||
<option <?php if ( '7' == $instance['display_count'] ) echo 'selected="selected"'; ?>>7</option>
|
||||
<option <?php if ( '8' == $instance['display_count'] ) echo 'selected="selected"'; ?>>8</option>
|
||||
<option <?php if ( '9' == $instance['display_count'] ) echo 'selected="selected"'; ?>>9</option>
|
||||
<option <?php if ( '10' == $instance['display_count'] ) echo 'selected="selected"'; ?>>10</option>
|
||||
</select>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,71 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Widget Name: Latest Tweets
|
||||
*/
|
||||
|
||||
|
||||
add_action( 'widgets_init', 'huddle_tweets_widgets' );
|
||||
|
||||
function huddle_tweets_widgets() {
|
||||
register_widget( 'huddle_tweet_widget' );
|
||||
}
|
||||
|
||||
class huddle_tweet_widget extends WP_Widget {
|
||||
|
||||
function huddle_tweet_widget() {
|
||||
$widget_ops = array( 'classname' => 'widget-twitter', 'description' => __('Displays your latest tweets.', 'huddle') );
|
||||
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'widget-twitter' );
|
||||
$this->WP_Widget( 'widget-twitter', __('Huddle: Latest Tweets','huddle'), $widget_ops, $control_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
$title = apply_filters('widget_title', $instance['title'] );
|
||||
$huddle_twitter_id = $instance['huddle_twitter_id'];
|
||||
$huddle_twitter_count = $instance['huddle_twitter_count'];
|
||||
$huddle_twitter_text = $instance['huddle_twitter_text'];
|
||||
echo $before_widget;
|
||||
if ( $title ) {
|
||||
echo $before_title . $title; ?>
|
||||
<span><a href="http://twitter.com/<?php echo $instance["huddle_twitter_id"] ?>"><?php echo $instance["huddle_twitter_text"] ?></a></span>
|
||||
<?php echo $after_title;
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/jquery.tweet.js"></script>
|
||||
<div class="tweet"></div>
|
||||
<script type="text/javascript">
|
||||
$( ".tweet" ).tweet( {
|
||||
username: '<?php echo $instance["huddle_twitter_id"]; ?>',
|
||||
count: <?php echo $instance["huddle_twitter_count"]; ?>
|
||||
} );
|
||||
</script>
|
||||
<?php
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
$instance['huddle_twitter_id'] = strip_tags( $new_instance['huddle_twitter_id'] );
|
||||
$instance['huddle_twitter_count'] = strip_tags( $new_instance['huddle_twitter_count'] );
|
||||
$instance['huddle_twitter_text'] = strip_tags( $new_instance['huddle_twitter_text'] );
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$defaults = array(
|
||||
'title' => 'Recent Tweets',
|
||||
'huddle_twitter_id' => 'aaronlynch',
|
||||
'huddle_twitter_count' => '2',
|
||||
'huddle_twitter_text' => 'Follow Us →',
|
||||
);
|
||||
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'huddle_twitter_id' ); ?>"><?php _e('Twitter ID (username):', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'huddle_twitter_id' ); ?>" name="<?php echo $this->get_field_name( 'huddle_twitter_id' ); ?>" value="<?php echo $instance['huddle_twitter_id']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'huddle_twitter_count' ); ?>"><?php _e('Number Of Tweets:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'huddle_twitter_count' ); ?>" name="<?php echo $this->get_field_name( 'huddle_twitter_count' ); ?>" value="<?php echo $instance['huddle_twitter_count']; ?>" /></p>
|
||||
<p><label for="<?php echo $this->get_field_id( 'huddle_twitter_text' ); ?>"><?php _e('Follow Text (ex: Follow me on Twitter):', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id( 'huddle_twitter_text' ); ?>" name="<?php echo $this->get_field_name( 'huddle_twitter_text' ); ?>" value="<?php echo $instance['huddle_twitter_text']; ?>" /></p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Widget Name: Video Widget
|
||||
*/
|
||||
|
||||
|
||||
add_action( 'widgets_init', 'huddle_video_widgets' );
|
||||
|
||||
function huddle_video_widgets() {
|
||||
register_widget( 'huddle_video_widget' );
|
||||
}
|
||||
|
||||
class huddle_video_widget extends WP_Widget {
|
||||
|
||||
function huddle_video_widget() {
|
||||
$widget_ops = array( 'classname' => 'widget-video', 'description' => __('Displays a featured video.', 'huddle') );
|
||||
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'widget-video' );
|
||||
$this->WP_Widget( 'widget-video', __('Huddle: Video Widget', 'huddle'), $widget_ops, $control_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
extract( $args );
|
||||
$title = apply_filters('widget_title', $instance['title'] );
|
||||
$huddle_vid_embed = $instance['huddle_vid_embed1'];
|
||||
$huddle_vid_desc = $instance['huddle_vid_desc1'];
|
||||
|
||||
echo $before_widget;
|
||||
if ( $title )
|
||||
echo $before_title . $title . $after_title;
|
||||
|
||||
if ($huddle_vid_embed) {
|
||||
echo '<div class="post-video">'.$huddle_vid_embed.'</div>
|
||||
<span>'.$huddle_vid_desc.'</span>
|
||||
';
|
||||
}
|
||||
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
$instance['huddle_vid_embed1'] = $new_instance['huddle_vid_embed1'];
|
||||
$instance['huddle_vid_desc1'] = $new_instance['huddle_vid_desc1'];
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$defaults = array();
|
||||
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $instance['title']; ?>" /></p>
|
||||
|
||||
<p style="border-bottom:1px solid #DFDFDF; padding: 20px 0; margin-bottom:20px;"><strong><?php _e('Video', 'huddle'); ?>:</strong></p>
|
||||
<p><label for="<?php echo $this->get_field_id('huddle_vid_embed1'); ?>"><?php _e('Video Embed Code (Best at 265px wide)', 'huddle') ?></label><textarea style="height:200px;" class="widefat" id="<?php echo $this->get_field_id('huddle_vid_embed1'); ?>" name="<?php echo $this->get_field_name('huddle_vid_embed1'); ?>"><?php echo stripslashes(htmlspecialchars(($instance['huddle_vid_embed1']), ENT_QUOTES)); ?></textarea></p>
|
||||
<p><label for="<?php echo $this->get_field_id('huddle_vid_desc1'); ?>"><?php _e('Description:', 'huddle') ?></label><input class="widefat" id="<?php echo $this->get_field_id('huddle_vid_desc1'); ?>" name="<?php echo $this->get_field_name('huddle_vid_desc1'); ?>" value="<?php echo stripslashes(htmlspecialchars(($instance['huddle_vid_desc1']), ENT_QUOTES)); ?>" /></p>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,314 +0,0 @@
|
||||
|
||||
<?php $_GET['w-iframe'] = ''; ?>
|
||||
|
||||
<?php get_header( 'buddypress' ); ?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<form action="<?php bp_group_creation_form_action(); ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
|
||||
<h3><?php _e( 'Create a Group', 'huddle' ); ?></h3>
|
||||
<br />
|
||||
|
||||
<?php do_action( 'bp_before_create_group' ); ?>
|
||||
|
||||
<div class="no-ajax" id="group-create-tabs" role="navigation">
|
||||
<ul>
|
||||
|
||||
<?php bp_group_creation_tabs(); ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php do_action( 'template_notices' ); ?>
|
||||
|
||||
<div class="item-body" id="group-create-body">
|
||||
|
||||
<?php /* Group creation step 1: Basic group details */ ?>
|
||||
<?php if ( bp_is_group_creation_step( 'group-details' ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_details_creation_step' ); ?>
|
||||
|
||||
<p class="editfield">
|
||||
<label for="group-name"><?php _e( 'Group Name (required)', 'huddle' ); ?></label>
|
||||
<input type="text" name="group-name" id="group-name" aria-required="true" value="<?php bp_new_group_name(); ?>" />
|
||||
</p>
|
||||
|
||||
<p class="editfield">
|
||||
<label for="group-desc"><?php _e( 'Group Description (required)', 'huddle' ) ?></label>
|
||||
<textarea name="group-desc" id="group-desc" rows="5" cols="45" aria-required="true"><?php bp_new_group_description(); ?></textarea>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
do_action( 'bp_after_group_details_creation_step' );
|
||||
do_action( 'groups_custom_group_fields_editable' ); // @Deprecated
|
||||
|
||||
wp_nonce_field( 'groups_create_save_group-details' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* Group creation step 2: Group settings */ ?>
|
||||
<?php if ( bp_is_group_creation_step( 'group-settings' ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_settings_creation_step' ); ?>
|
||||
|
||||
<?php if ( bp_is_active( 'forums' ) ) : ?>
|
||||
<?php if ( bp_forums_is_installed_correctly() ) : ?>
|
||||
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php checked( bp_get_new_group_enable_forum(), true, true ); ?> /> <?php _e( 'Enable discussion forum', 'huddle' ); ?></label>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
<?php if ( is_super_admin() ) : ?>
|
||||
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" disabled="disabled" name="disabled" id="disabled" value="0" /> <?php printf( __( '<strong>Attention Site Admin:</strong> Group forums require the <a href="%s">correct setup and configuration</a> of a bbPress installation.', 'huddle' ), bp_get_root_domain() . '/wp-admin/admin.php?page=bb-forums-setup' ); ?></label>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<hr />
|
||||
|
||||
<h4><?php _e( 'Privacy Options', 'huddle' ); ?></h4>
|
||||
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="group-status" value="public"<?php if ( 'public' == bp_get_new_group_status() || !bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
|
||||
<strong><?php _e( 'This is a public group', 'huddle' ); ?></strong>
|
||||
<ul>
|
||||
<li><?php _e( 'Any site member can join this group.', 'huddle' ); ?></li>
|
||||
<li><?php _e( 'This group will be listed in the groups directory and in search results.', 'huddle' ); ?></li>
|
||||
<li><?php _e( 'Group content and activity will be visible to any site member.', 'huddle' ); ?></li>
|
||||
</ul>
|
||||
</label>
|
||||
|
||||
<label><input type="radio" name="group-status" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
|
||||
<strong><?php _e( 'This is a private group', 'huddle' ); ?></strong>
|
||||
<ul>
|
||||
<li><?php _e( 'Only users who request membership and are accepted can join the group.', 'huddle' ); ?></li>
|
||||
<li><?php _e( 'This group will be listed in the groups directory and in search results.', 'huddle' ); ?></li>
|
||||
<li><?php _e( 'Group content and activity will only be visible to members of the group.', 'huddle' ); ?></li>
|
||||
</ul>
|
||||
</label>
|
||||
|
||||
<label><input type="radio" name="group-status" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
|
||||
<strong><?php _e('This is a hidden group', 'huddle'); ?></strong>
|
||||
<ul>
|
||||
<li><?php _e( 'Only users who are invited can join the group.', 'huddle' ); ?></li>
|
||||
<li><?php _e( 'This group will not be listed in the groups directory or search results.', 'huddle' ); ?></li>
|
||||
<li><?php _e( 'Group content and activity will only be visible to members of the group.', 'huddle' ); ?></li>
|
||||
</ul>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<h4><?php _e( 'Group Invitations', 'huddle' ); ?></h4>
|
||||
|
||||
<p><?php _e( 'Which members of this group are allowed to invite others?', 'huddle' ) ?></p>
|
||||
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ) ?> />
|
||||
<strong><?php _e( 'All group members', 'huddle' ) ?></strong>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ) ?> />
|
||||
<strong><?php _e( 'Group admins and mods only', 'huddle' ) ?></strong>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ) ?> />
|
||||
<strong><?php _e( 'Group admins only', 'huddle' ) ?></strong>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<?php do_action( 'bp_after_group_settings_creation_step' ); ?>
|
||||
|
||||
<?php wp_nonce_field( 'groups_create_save_group-settings' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* Group creation step 3: Avatar Uploads */ ?>
|
||||
<?php if ( bp_is_group_creation_step( 'group-avatar' ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_avatar_creation_step' ); ?>
|
||||
|
||||
<?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
|
||||
|
||||
<div class="left-menu">
|
||||
|
||||
<?php bp_new_group_avatar( 'width=35&height=35' ); ?>
|
||||
|
||||
</div><!-- .left-menu -->
|
||||
|
||||
<div class="main-column">
|
||||
<p><?php _e( "Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.", 'huddle' ); ?></p>
|
||||
|
||||
<p>
|
||||
<input type="file" name="file" id="file" />
|
||||
<input type="submit" class="btn-gray" name="upload" id="upload" value="<?php _e( 'Upload Image', 'huddle' ); ?>" />
|
||||
<input type="hidden" name="action" id="action" value="bp_avatar_upload" />
|
||||
</p>
|
||||
|
||||
<p><?php _e( 'To skip the avatar upload process, hit the "Next Step" button.', 'huddle' ); ?></p>
|
||||
</div><!-- .main-column -->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
|
||||
|
||||
<h3><?php _e( 'Crop Group Avatar', 'huddle' ); ?></h3>
|
||||
|
||||
<img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'huddle' ); ?>" />
|
||||
|
||||
<div id="avatar-crop-pane">
|
||||
<img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'huddle' ); ?>" />
|
||||
</div>
|
||||
|
||||
<input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'huddle' ); ?>" />
|
||||
|
||||
<input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" />
|
||||
<input type="hidden" name="upload" id="upload" />
|
||||
<input type="hidden" id="x" name="x" />
|
||||
<input type="hidden" id="y" name="y" />
|
||||
<input type="hidden" id="w" name="w" />
|
||||
<input type="hidden" id="h" name="h" />
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_group_avatar_creation_step' ); ?>
|
||||
|
||||
<?php wp_nonce_field( 'groups_create_save_group-avatar' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* Group creation step 4: Invite friends to group */ ?>
|
||||
<?php if ( bp_is_group_creation_step( 'group-invites' ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_invites_creation_step' ); ?>
|
||||
|
||||
<?php if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
|
||||
|
||||
<div class="left-menu">
|
||||
|
||||
<div id="invite-list">
|
||||
<ul>
|
||||
<?php bp_new_group_invite_friend_list(); ?>
|
||||
</ul>
|
||||
|
||||
<?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ); ?>
|
||||
</div>
|
||||
|
||||
</div><!-- .left-menu -->
|
||||
|
||||
<div class="main-column">
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e('Select people to invite from your friends list.', 'huddle'); ?></p>
|
||||
</div>
|
||||
|
||||
<?php /* The ID 'friend-list' is important for AJAX support. */ ?>
|
||||
<ul id="friend-list" class="item-list" role="main">
|
||||
|
||||
<?php if ( bp_group_has_invites() ) : ?>
|
||||
|
||||
<?php while ( bp_group_invites() ) : bp_group_the_invite(); ?>
|
||||
|
||||
<li id="<?php bp_group_invite_item_id(); ?>">
|
||||
|
||||
<?php bp_group_invite_user_avatar(); ?>
|
||||
|
||||
<h4><?php bp_group_invite_user_link(); ?></h4>
|
||||
<span class="activity"><?php bp_group_invite_user_last_active(); ?></span>
|
||||
|
||||
<div class="action">
|
||||
<a class="remove" href="<?php bp_group_invite_user_remove_invite_url(); ?>" id="<?php bp_group_invite_item_id(); ?>"><?php _e( 'Remove Invite', 'huddle' ); ?></a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
</div><!-- .main-column -->
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group. You can send invites any time in the future by selecting the "Send Invites" option when viewing your new group.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_nonce_field( 'groups_create_save_group-invites' ); ?>
|
||||
|
||||
<?php do_action( 'bp_after_group_invites_creation_step' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'groups_custom_create_steps' ); // Allow plugins to add custom group creation steps ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_creation_step_buttons' ); ?>
|
||||
|
||||
<?php if ( 'crop-image' != bp_get_avatar_admin_step() ) : ?>
|
||||
|
||||
<div class="submit" id="previous-next">
|
||||
|
||||
<?php /* Previous Button */ ?>
|
||||
<?php if ( !bp_is_first_group_creation_step() ) : ?>
|
||||
|
||||
<input type="button" class="btn-gray" value="<?php _e( 'Back to Previous Step', 'huddle' ); ?>" id="group-creation-previous" name="previous" onclick="location.href='<?php bp_group_creation_previous_link(); ?>'" />
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* Next Button */ ?>
|
||||
<?php if ( !bp_is_last_group_creation_step() && !bp_is_first_group_creation_step() ) : ?>
|
||||
|
||||
<input type="submit" class="btn-gray" value="<?php _e( 'Next Step', 'huddle' ); ?>" id="group-creation-next" name="save" />
|
||||
|
||||
<?php endif;?>
|
||||
|
||||
<?php /* Create Button */ ?>
|
||||
<?php if ( bp_is_first_group_creation_step() ) : ?>
|
||||
|
||||
<input type="submit" class="btn-gray" value="<?php _e( 'Create Group and Continue', 'huddle' ); ?>" id="group-creation-create" name="save" />
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* Finish Button */ ?>
|
||||
<?php if ( bp_is_last_group_creation_step() ) : ?>
|
||||
|
||||
<input type="submit" class="btn-gray" value="<?php _e( 'Finish', 'huddle' ); ?>" id="group-creation-finish" name="save" />
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
|
||||
<?php do_action( 'bp_after_group_creation_step_buttons' ); ?>
|
||||
|
||||
<?php /* Don't leave out this hidden field */ ?>
|
||||
<input type="hidden" name="group_id" id="group_id" value="<?php bp_new_group_id(); ?>" />
|
||||
|
||||
<?php do_action( 'bp_directory_groups_content' ); ?>
|
||||
|
||||
</div><!-- .item-body -->
|
||||
|
||||
<?php do_action( 'bp_after_create_group' ); ?>
|
||||
|
||||
</form>
|
||||
|
||||
</div><!-- #content -->
|
||||
|
||||
<?php get_footer( 'buddypress' ); ?>
|
||||
@ -1,98 +0,0 @@
|
||||
|
||||
<?php do_action( 'bp_before_groups_loop' ); ?>
|
||||
|
||||
<?php
|
||||
global $huddle_bp_groups;
|
||||
if( ! $huddle_bp_groups ) $huddle_bp_groups = bp_has_groups( bp_ajax_querystring( 'groups' ) );
|
||||
$url = rtrim( current( explode( '?', $_SERVER['REQUEST_URI'] ) ), '/' );
|
||||
?>
|
||||
|
||||
<?php if ( bp_has_groups( bp_ajax_querystring( 'groups' ) ) ) : ?>
|
||||
|
||||
<div id="pag-top" class="pagination">
|
||||
|
||||
<div class="pag-count" id="group-dir-count-top">
|
||||
|
||||
<?php bp_groups_pagination_count(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="pagination-links" id="group-dir-pag-top">
|
||||
|
||||
<?php bp_groups_pagination_links(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_before_directory_groups_list' ); ?>
|
||||
|
||||
<ul id="groups-list" class="item-list" role="main">
|
||||
|
||||
<?php $i_row = 0; $i = 0; $i_column = 0; while ( bp_groups() ) : bp_the_group(); ?>
|
||||
<?php
|
||||
if( $i++ % 2 == 0 ) $i_row++;
|
||||
$i_column++;
|
||||
if( $i_column > 2 ) $i_column = 1;
|
||||
?>
|
||||
|
||||
<li rel="row<?php echo $i_row ?>" class="column<?php echo $i_column ?> row<?php echo $i_row ?> row-<?php echo $i_row % 2 == 0 ? 'even' : 'odd' ?>">
|
||||
<div class="item-avatar">
|
||||
<a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=35&height=35' ); ?></a>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="item-title"><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a></div>
|
||||
<!--
|
||||
<div class="item-meta"><span class="activity"><?php printf( __( 'active %s', 'huddle' ), bp_get_group_last_active() ); ?></span></div>
|
||||
-->
|
||||
<div class="item-meta"><?php bp_group_member_count(); ?></div>
|
||||
|
||||
<?php do_action( 'bp_directory_groups_item' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="action">
|
||||
|
||||
<?php if( ! in_array( $url, array( '/' . bp_get_groups_root_slug(), '/wp-load.php' ) ) ) : ?>
|
||||
<div class="generic-button"><a class="btn-gray" href="<?php bp_group_permalink(); ?>"><?php _e( 'View', 'huddle' ) ?></a></div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php do_action( 'bp_directory_groups_actions' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</li>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php do_action( 'bp_after_directory_groups_list' ); ?>
|
||||
|
||||
<div id="pag-bottom" class="pagination">
|
||||
|
||||
<div class="pag-count" id="group-dir-count-bottom">
|
||||
|
||||
<?php bp_groups_pagination_count(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="pagination-links" id="group-dir-pag-bottom">
|
||||
|
||||
<?php bp_groups_pagination_links(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'There were no groups found.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_groups_loop' ); ?>
|
||||
@ -1,88 +0,0 @@
|
||||
|
||||
<?php get_header( 'buddypress' ); ?>
|
||||
|
||||
<?php do_action( 'bp_before_directory_groups_page' ); ?>
|
||||
|
||||
<div id="content">
|
||||
<div class="padder">
|
||||
|
||||
<?php do_action( 'bp_before_directory_groups' ); ?>
|
||||
|
||||
<form action="" method="post" id="groups-directory-form" class="dir-form">
|
||||
|
||||
<?php
|
||||
global $huddle_bp_groups, $groups_template;
|
||||
$huddle_bp_groups = bp_has_groups( bp_ajax_querystring( 'groups' ) );
|
||||
?>
|
||||
|
||||
<h3><?php _e( 'Groups Directory', 'huddle' ); ?></h3>
|
||||
<p class="subtitle">
|
||||
<?php bp_groups_pagination_count(); ?>
|
||||
<?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?> <a class="btn-gray" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ); ?>"><?php _e( 'Create a New Group', 'huddle' ); ?></a><?php endif; ?>
|
||||
</p>
|
||||
|
||||
<?php do_action( 'bp_before_directory_groups_content' ); ?>
|
||||
|
||||
<div id="group-dir-search" class="dir-search" role="search">
|
||||
|
||||
<?php bp_directory_groups_search_form() ?>
|
||||
|
||||
</div><!-- #group-dir-search -->
|
||||
|
||||
<?php do_action( 'template_notices' ); ?>
|
||||
|
||||
<div class="item-list-tabs" id="subnav" role="navigation">
|
||||
<ul>
|
||||
|
||||
<?php do_action( 'bp_groups_directory_group_types' ); ?>
|
||||
|
||||
<li><a class="groups-sort-link sort-active" href="#active"><?php _e( 'Last Active', 'huddle' ) ?></a></li>
|
||||
<li><a class="groups-sort-link sort-popular" href="#popular"><?php _e( 'Most Members', 'huddle' ) ?></a></li>
|
||||
<li><a class="groups-sort-link sort-newest" href="#newest"><?php _e( 'Newly Created', 'huddle' ) ?></a></li>
|
||||
<li><a class="groups-sort-link sort-alphabetical" href="#alphabetical"><?php _e( 'Alphabetical', 'huddle' ) ?></a></li>
|
||||
|
||||
<li id="groups-order-select" class="last filter">
|
||||
|
||||
<label for="groups-order-by"><?php _e( 'Order By:', 'huddle' ); ?></label>
|
||||
<select id="groups-order-by">
|
||||
<option value="active"><?php _e( 'Last Active', 'huddle' ); ?></option>
|
||||
<option value="popular"><?php _e( 'Most Members', 'huddle' ); ?></option>
|
||||
<option value="newest"><?php _e( 'Newly Created', 'huddle' ); ?></option>
|
||||
<option value="alphabetical"><?php _e( 'Alphabetical', 'huddle' ); ?></option>
|
||||
|
||||
<?php do_action( 'bp_groups_directory_order_options' ); ?>
|
||||
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="groups-dir-list" class="groups dir-list">
|
||||
|
||||
<?php locate_template( array( 'groups/groups-loop.php' ), true ); ?>
|
||||
|
||||
</div><!-- #groups-dir-list -->
|
||||
|
||||
<div class="item-list-tabs for-bottom">
|
||||
<p class="pagination fl"><?php bp_groups_pagination_links(); ?></p>
|
||||
<p class="pages-count fr"><?php printf( __( 'Page %d of %d', 'huddle' ), isset( $_GET['upage'] ) ? $_GET['upage'] : 1, ceil( $groups_template->total_group_count / 14 ) ) ?></p>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_directory_groups_content' ); ?>
|
||||
|
||||
<?php wp_nonce_field( 'directory_groups', '_wpnonce-groups-filter' ); ?>
|
||||
|
||||
<?php do_action( 'bp_after_directory_groups_content' ); ?>
|
||||
|
||||
</form><!-- #groups-directory-form -->
|
||||
|
||||
<?php do_action( 'bp_after_directory_groups' ); ?>
|
||||
|
||||
</div><!-- .padder -->
|
||||
</div><!-- #content -->
|
||||
|
||||
<?php do_action( 'bp_after_directory_groups_page' ); ?>
|
||||
|
||||
<?php get_sidebar( 'buddypress' ); ?>
|
||||
<?php get_footer( 'buddypress' ); ?>
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
|
||||
<ul>
|
||||
<li class="feed"><a href="<?php bp_group_activity_feed_link() ?>" title="<?php _e( 'RSS Feed', 'huddle' ); ?>"><?php _e( 'RSS', 'huddle' ) ?></a></li>
|
||||
|
||||
<?php do_action( 'bp_group_activity_syndication_options' ) ?>
|
||||
|
||||
<li id="activity-filter-select" class="last">
|
||||
<label for="activity-filter-by"><?php _e( 'Show:', 'huddle' ); ?></label>
|
||||
<select id="activity-filter-by">
|
||||
<option value="-1"><?php _e( 'Everything', 'huddle' ) ?></option>
|
||||
<option value="activity_update"><?php _e( 'Updates', 'huddle' ) ?></option>
|
||||
|
||||
<?php if ( bp_is_active( 'forums' ) ) : ?>
|
||||
<option value="new_forum_topic"><?php _e( 'Forum Topics', 'huddle' ) ?></option>
|
||||
<option value="new_forum_post"><?php _e( 'Forum Replies', 'huddle' ) ?></option>
|
||||
<?php endif; ?>
|
||||
|
||||
<option value="joined_group"><?php _e( 'Group Memberships', 'huddle' ) ?></option>
|
||||
|
||||
<?php do_action( 'bp_group_activity_filter_options' ) ?>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
</div><!-- .item-list-tabs -->
|
||||
|
||||
<?php do_action( 'bp_before_group_activity_post_form' ) ?>
|
||||
|
||||
<?php if ( is_user_logged_in() && bp_group_is_member() ) : ?>
|
||||
<?php locate_template( array( 'activity/post-form.php'), true ) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_group_activity_post_form' ) ?>
|
||||
<?php do_action( 'bp_before_group_activity_content' ) ?>
|
||||
|
||||
<div class="activity single-group" role="main">
|
||||
<?php locate_template( array( 'activity/activity-loop.php' ), true ) ?>
|
||||
</div><!-- .activity.single-group -->
|
||||
|
||||
<?php do_action( 'bp_after_group_activity_content' ) ?>
|
||||
@ -1,414 +0,0 @@
|
||||
<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
|
||||
<ul>
|
||||
<?php bp_group_admin_tabs(); ?>
|
||||
</ul>
|
||||
</div><!-- .item-list-tabs -->
|
||||
|
||||
<form action="<?php bp_group_admin_form_action() ?>" name="group-settings-form" id="group-settings-form" class="standard-form" method="post" enctype="multipart/form-data" role="main">
|
||||
|
||||
<?php do_action( 'bp_before_group_admin_content' ) ?>
|
||||
|
||||
<?php /* Edit Group Details */ ?>
|
||||
<?php if ( bp_is_group_admin_screen( 'edit-details' ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_details_admin' ); ?>
|
||||
|
||||
<p class="editfield">
|
||||
<label for="group-name"><?php _e( 'Group Name (required)', 'huddle' ); ?></label>
|
||||
<input type="text" name="group-name" id="group-name" value="<?php bp_group_name() ?>" aria-required="true" />
|
||||
</p>
|
||||
|
||||
<p class="editfield">
|
||||
<label for="group-desc"><?php _e( 'Group Description (required)', 'huddle' ); ?></label>
|
||||
<textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_group_description_editable() ?></textarea>
|
||||
</p>
|
||||
|
||||
<?php do_action( 'groups_custom_group_fields_editable' ) ?>
|
||||
|
||||
<p class="editfield">
|
||||
<label for="group-notifiy-members"><?php _e( 'Notify group members of changes via email', 'huddle' ); ?></label>
|
||||
<label class="no"><input type="radio" name="group-notify-members" value="1" /> <?php _e( 'Yes', 'huddle' ); ?></label>
|
||||
<label class="no"><input type="radio" name="group-notify-members" value="0" checked="checked" /> <?php _e( 'No', 'huddle' ); ?></label>
|
||||
</p>
|
||||
<br /><br />
|
||||
|
||||
<?php do_action( 'bp_after_group_details_admin' ); ?>
|
||||
|
||||
<p><input type="submit" class="btn-gray" value="<?php _e( 'Save Changes', 'huddle' ) ?>" id="save" name="save" /></p>
|
||||
<?php wp_nonce_field( 'groups_edit_group_details' ) ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* Manage Group Settings */ ?>
|
||||
<?php if ( bp_is_group_admin_screen( 'group-settings' ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_settings_admin' ); ?>
|
||||
|
||||
<?php if ( bp_is_active( 'forums' ) ) : ?>
|
||||
|
||||
<?php if ( bp_forums_is_installed_correctly() ) : ?>
|
||||
|
||||
<h4><?php _e( 'Forum', 'huddle' ); ?></h4>
|
||||
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php bp_group_show_forum_setting() ?> /> <?php _e( 'Enable discussion forum', 'huddle' ) ?></label>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<hr />
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<h4><?php _e( 'Privacy Options', 'huddle' ); ?></h4>
|
||||
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting( 'public' ) ?> />
|
||||
<strong><?php _e( 'This is a public group', 'huddle' ) ?></strong>
|
||||
<ul>
|
||||
<li><?php _e( 'Any site member can join this group.', 'huddle' ) ?></li>
|
||||
<li><?php _e( 'This group will be listed in the groups directory and in search results.', 'huddle' ) ?></li>
|
||||
<li><?php _e( 'Group content and activity will be visible to any site member.', 'huddle' ) ?></li>
|
||||
</ul>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="radio" name="group-status" value="private"<?php bp_group_show_status_setting( 'private' ) ?> />
|
||||
<strong><?php _e( 'This is a private group', 'huddle' ) ?></strong>
|
||||
<ul>
|
||||
<li><?php _e( 'Only users who request membership and are accepted can join the group.', 'huddle' ) ?></li>
|
||||
<li><?php _e( 'This group will be listed in the groups directory and in search results.', 'huddle' ) ?></li>
|
||||
<li><?php _e( 'Group content and activity will only be visible to members of the group.', 'huddle' ) ?></li>
|
||||
</ul>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="radio" name="group-status" value="hidden"<?php bp_group_show_status_setting( 'hidden' ) ?> />
|
||||
<strong><?php _e( 'This is a hidden group', 'huddle' ) ?></strong>
|
||||
<ul>
|
||||
<li><?php _e( 'Only users who are invited can join the group.', 'huddle' ) ?></li>
|
||||
<li><?php _e( 'This group will not be listed in the groups directory or search results.', 'huddle' ) ?></li>
|
||||
<li><?php _e( 'Group content and activity will only be visible to members of the group.', 'huddle' ) ?></li>
|
||||
</ul>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<h4><?php _e( 'Group Invitations', 'huddle' ); ?></h4>
|
||||
|
||||
<p><?php _e( 'Which members of this group are allowed to invite others?', 'huddle' ) ?></p>
|
||||
|
||||
<div class="radio">
|
||||
<p>
|
||||
<label>
|
||||
<input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ) ?> />
|
||||
<strong><?php _e( 'All group members', 'huddle' ) ?></strong>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>
|
||||
<input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ) ?> />
|
||||
<strong><?php _e( 'Group admins and mods only', 'huddle' ) ?></strong>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>
|
||||
<input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ) ?> />
|
||||
<strong><?php _e( 'Group admins only', 'huddle' ) ?></strong>
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<?php do_action( 'bp_after_group_settings_admin' ); ?>
|
||||
|
||||
<p><input type="submit" class="btn-gray" value="<?php _e( 'Save Changes', 'huddle' ) ?>" id="save" name="save" /></p>
|
||||
<?php wp_nonce_field( 'groups_edit_group_settings' ) ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* Group Avatar Settings */ ?>
|
||||
<?php if ( bp_is_group_admin_screen( 'group-avatar' ) ) : ?>
|
||||
|
||||
<?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
|
||||
|
||||
<p><?php _e("Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.", 'huddle') ?></p>
|
||||
|
||||
<p>
|
||||
<input type="file" name="file" id="file" />
|
||||
<input type="submit" class="btn-gray" name="upload" id="upload" value="<?php _e( 'Upload Image', 'huddle' ) ?>" />
|
||||
<input type="hidden" name="action" id="action" value="bp_avatar_upload" />
|
||||
</p>
|
||||
|
||||
<?php if ( bp_get_group_has_avatar() ) : ?>
|
||||
<br /><br />
|
||||
<p><?php _e( "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button.", 'huddle' ) ?></p>
|
||||
|
||||
<?php bp_button( array( 'id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit btn-gray', 'link_href' => bp_get_group_avatar_delete_link(), 'link_title' => __( 'Delete Avatar', 'huddle' ), 'link_text' => __( 'Delete Avatar', 'huddle' ) ) ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_nonce_field( 'bp_avatar_upload' ) ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
|
||||
|
||||
<h3><?php _e( 'Crop Avatar', 'huddle' ) ?></h3>
|
||||
|
||||
<img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'huddle' ) ?>" />
|
||||
|
||||
<div id="avatar-crop-pane">
|
||||
<img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'huddle' ) ?>" />
|
||||
</div>
|
||||
|
||||
<input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'huddle' ) ?>" />
|
||||
|
||||
<input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />
|
||||
<input type="hidden" id="x" name="x" />
|
||||
<input type="hidden" id="y" name="y" />
|
||||
<input type="hidden" id="w" name="w" />
|
||||
<input type="hidden" id="h" name="h" />
|
||||
|
||||
<?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* Manage Group Members */ ?>
|
||||
<?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_manage_members_admin' ); ?>
|
||||
|
||||
<div class="bp-widget">
|
||||
<h4><?php _e( 'Administrators', 'huddle' ); ?></h4>
|
||||
|
||||
<?php if ( bp_has_members( '&include='. bp_group_admin_ids() ) ) : ?>
|
||||
|
||||
<ul id="members-list" class="item-list single-line>">
|
||||
|
||||
<?php while ( bp_members() ) : bp_the_member(); ?>
|
||||
<li>
|
||||
<div class="item-avatar">
|
||||
<?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 35, 'height' => 35, 'alt' => __( 'Profile picture of %s', 'huddle' ) ) ) ?>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="item-title">
|
||||
<a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="action">
|
||||
<a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ) ?>"><?php _e( 'Demote to Member', 'huddle' ) ?></a>
|
||||
</div>
|
||||
</li>
|
||||
<?php endwhile; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( bp_group_has_moderators() ) : ?>
|
||||
<div class="bp-widget">
|
||||
<h4><?php _e( 'Moderators', 'huddle' ) ?></h4>
|
||||
|
||||
<?php if ( bp_has_members( '&include=' . bp_group_mod_ids() ) ) : ?>
|
||||
<ul id="members-list" class="item-list">
|
||||
|
||||
<?php while ( bp_members() ) : bp_the_member(); ?>
|
||||
<li>
|
||||
<div class="item-avatar">
|
||||
<?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 35, 'height' => 35, 'alt' => __( 'Profile picture of %s', 'huddle' ) ) ) ?>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="item-title">
|
||||
<a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="action">
|
||||
<a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => bp_get_member_user_id() ) ) ?>" class="button confirm mod-promote-to-admin" title="<?php _e( 'Promote to Admin', 'huddle' ); ?>"><?php _e( 'Promote to Admin', 'huddle' ); ?></a>
|
||||
<a class="button confirm mod-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ) ?>"><?php _e( 'Demote to Member', 'huddle' ) ?></a>
|
||||
</div>
|
||||
</li>
|
||||
<?php endwhile; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
<div class="bp-widget">
|
||||
<h4><?php _e("Members", "huddle"); ?></h4>
|
||||
|
||||
<?php if ( bp_group_has_members( 'per_page=15&exclude_banned=false' ) ) : ?>
|
||||
|
||||
<?php if ( bp_group_member_needs_pagination() ) : ?>
|
||||
|
||||
<div class="pagination no-ajax">
|
||||
|
||||
<div id="member-count" class="pag-count">
|
||||
<?php bp_group_member_pagination_count() ?>
|
||||
</div>
|
||||
|
||||
<div id="member-admin-pagination" class="pagination-links">
|
||||
<?php bp_group_member_admin_pagination() ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<ul id="members-list" class="item-list single-line">
|
||||
<?php while ( bp_group_members() ) : bp_group_the_member(); ?>
|
||||
|
||||
<li class="<?php bp_group_member_css_class(); ?>">
|
||||
<div class="item-avatar">
|
||||
<?php bp_group_member_avatar_mini() ?>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="item">
|
||||
<?php bp_group_member_link() ?>
|
||||
|
||||
<?php if ( bp_get_group_member_is_banned() ) _e( '(banned)', 'huddle'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="action">
|
||||
<?php if ( bp_get_group_member_is_banned() ) : ?>
|
||||
|
||||
<a href="<?php bp_group_member_unban_link() ?>" class="button confirm member-unban" title="<?php _e( 'Unban this member', 'huddle' ) ?>"><?php _e( 'Remove Ban', 'huddle' ); ?></a> ·
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<a href="<?php bp_group_member_ban_link() ?>" class="button confirm member-ban" title="<?php _e( 'Kick and ban this member', 'huddle' ); ?>"><?php _e( 'Kick & Ban', 'huddle' ); ?></a> ·
|
||||
<a href="<?php bp_group_member_promote_mod_link() ?>" class="button confirm member-promote-to-mod" title="<?php _e( 'Promote to Mod', 'huddle' ); ?>"><?php _e( 'Promote to Mod', 'huddle' ); ?></a> ·
|
||||
<a href="<?php bp_group_member_promote_admin_link() ?>" class="button confirm member-promote-to-admin" title="<?php _e( 'Promote to Admin', 'huddle' ); ?>"><?php _e( 'Promote to Admin', 'huddle' ); ?></a> ·
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<a href="<?php bp_group_member_remove_link() ?>" class="button confirm" title="<?php _e( 'Remove this member', 'huddle' ); ?>"><?php _e( 'Remove from group', 'huddle' ); ?></a>
|
||||
|
||||
<?php do_action( 'bp_group_manage_members_admin_item' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'This group has no members.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_after_group_manage_members_admin' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* Manage Membership Requests */ ?>
|
||||
<?php if ( bp_is_group_admin_screen( 'membership-requests' ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_membership_requests_admin' ); ?>
|
||||
|
||||
<?php if ( bp_group_has_membership_requests() ) : ?>
|
||||
|
||||
<ul id="members-list" class="item-list">
|
||||
<?php while ( bp_group_membership_requests() ) : bp_group_the_membership_request(); ?>
|
||||
|
||||
<li>
|
||||
|
||||
<div class="item-avatar">
|
||||
<?php bp_group_request_user_avatar_thumb( 'width=35&height=35' ) ?>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="item-title">
|
||||
<?php bp_group_request_user_link() ?> <span class="comments"><?php bp_group_request_comment() ?></span>
|
||||
</div>
|
||||
|
||||
<div class="item-meta">
|
||||
<span class="activity"><?php bp_group_request_time_since_requested() ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_group_membership_requests_admin_item' ); ?>
|
||||
|
||||
<div class="action">
|
||||
|
||||
<?php bp_button( array( 'id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __( 'Accept', 'huddle' ), 'link_text' => __( 'Accept', 'huddle' ) ) ); ?>
|
||||
|
||||
<?php bp_button( array( 'id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __( 'Reject', 'huddle' ), 'link_text' => __( 'Reject', 'huddle' ) ) ); ?>
|
||||
|
||||
<?php do_action( 'bp_group_membership_requests_admin_item_action' ); ?>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'There are no pending membership requests.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_group_membership_requests_admin' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'groups_custom_edit_steps' ) // Allow plugins to add custom group edit screens ?>
|
||||
|
||||
<?php /* Delete Group Option */ ?>
|
||||
<?php if ( bp_is_group_admin_screen( 'delete-group' ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_delete_admin' ); ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<p><label><input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-group-button').disabled = ''; } else { document.getElementById('delete-group-button').disabled = 'disabled'; }" /> <?php _e( 'I understand the consequences of deleting this group.', 'huddle' ); ?></label></p>
|
||||
|
||||
<?php do_action( 'bp_after_group_delete_admin' ); ?>
|
||||
|
||||
<div class="submit">
|
||||
<input type="submit" class="btn-gray" disabled="disabled" value="<?php _e( 'Delete Group', 'huddle' ) ?>" id="delete-group-button" name="delete-group-button" />
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id() ?>" />
|
||||
|
||||
<?php wp_nonce_field( 'groups_delete_group' ) ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* This is important, don't forget it */ ?>
|
||||
<input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id() ?>" />
|
||||
|
||||
<?php do_action( 'bp_after_group_admin_content' ) ?>
|
||||
|
||||
</form><!-- #group-settings-form -->
|
||||
|
||||
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
|
||||
do_action( 'bp_before_group_forum_content' );
|
||||
|
||||
if ( bp_is_group_forum_topic_edit() ) :
|
||||
locate_template( array( 'groups/single/forum/edit.php' ), true );
|
||||
|
||||
elseif ( bp_is_group_forum_topic() ) :
|
||||
locate_template( array( 'groups/single/forum/topic.php' ), true );
|
||||
|
||||
else : ?>
|
||||
|
||||
<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
|
||||
<ul>
|
||||
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
|
||||
<li>
|
||||
<a href="#post-new" class="show-hide-new"><?php _e( 'New Topic', 'huddle' ) ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( bp_forums_has_directory() ) : ?>
|
||||
|
||||
<li>
|
||||
<a href="<?php bp_forums_directory_permalink() ?>"><?php _e( 'Forum Directory', 'huddle') ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
|
||||
|
||||
<li id="forums-order-select" class="last filter">
|
||||
|
||||
<label for="forums-order-by"><?php _e( 'Order By:', 'huddle' ); ?></label>
|
||||
<select id="forums-order-by">
|
||||
<option value="active"><?php _e( 'Last Active', 'huddle' ); ?></option>
|
||||
<option value="popular"><?php _e( 'Most Posts', 'huddle' ); ?></option>
|
||||
<option value="unreplied"><?php _e( 'Unreplied', 'huddle' ); ?></option>
|
||||
|
||||
<?php do_action( 'bp_forums_directory_order_options' ); ?>
|
||||
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="forums single-forum" role="main">
|
||||
|
||||
<?php locate_template( array( 'forums/group-forums-loop.php' ), true ) ?>
|
||||
|
||||
</div><!-- .forums.single-forum -->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_group_forum_content' ) ?>
|
||||
|
||||
<?php if ( !bp_is_group_forum_topic_edit() && !bp_is_group_forum_topic() ) : ?>
|
||||
|
||||
<?php if ( !bp_group_is_user_banned() && ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) ) : ?>
|
||||
|
||||
<form action="" method="post" id="forum-topic-form" class="standard-form">
|
||||
<div id="new-topic-post">
|
||||
|
||||
<?php do_action( 'bp_before_group_forum_post_new' ) ?>
|
||||
|
||||
<?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
|
||||
<p><?php _e( 'You will auto join this group when you start a new topic.', 'huddle' ) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<p id="post-new"></p>
|
||||
<h4><?php _e( 'Post a New Topic:', 'huddle' ) ?></h4>
|
||||
|
||||
<label><?php _e( 'Title:', 'huddle' ) ?></label>
|
||||
<input type="text" name="topic_title" id="topic_title" value="" />
|
||||
|
||||
<label><?php _e( 'Content:', 'huddle' ) ?></label>
|
||||
<textarea name="topic_text" id="topic_text"></textarea>
|
||||
|
||||
<label><?php _e( 'Tags (comma separated):', 'huddle' ) ?></label>
|
||||
<input type="text" name="topic_tags" id="topic_tags" value="" />
|
||||
|
||||
<?php do_action( 'bp_after_group_forum_post_new' ) ?>
|
||||
|
||||
<div class="submit">
|
||||
<input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'huddle' ) ?>" />
|
||||
</div>
|
||||
|
||||
<?php wp_nonce_field( 'bp_forums_new_topic' ) ?>
|
||||
</div><!-- #new-topic-post -->
|
||||
</form><!-- #forum-topic-form -->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
@ -1,104 +0,0 @@
|
||||
<?php do_action( 'bp_before_group_forum_edit_form' ); ?>
|
||||
|
||||
<?php if ( bp_has_forum_topic_posts() ) : ?>
|
||||
|
||||
<form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form">
|
||||
|
||||
<div class="item-list-tabs" id="subnav" role="navigation">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#post-topic-reply"><?php _e( 'Reply', 'huddle' ); ?></a>
|
||||
</li>
|
||||
|
||||
<?php if ( bp_forums_has_directory() ) : ?>
|
||||
|
||||
<li>
|
||||
<a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'huddle'); ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="topic-meta">
|
||||
|
||||
<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
|
||||
|
||||
<div class="last admin-links fr">
|
||||
|
||||
<?php bp_the_topic_admin_links( array( 'separator' => '·' ) ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<h3><?php _e( 'Edit:', 'huddle' ); ?> <?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3>
|
||||
<br />
|
||||
|
||||
<?php do_action( 'bp_group_forum_topic_meta' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( bp_group_is_member() ) : ?>
|
||||
|
||||
<?php if ( bp_is_edit_topic() ) : ?>
|
||||
|
||||
<div id="edit-topic">
|
||||
|
||||
<?php do_action( 'bp_group_before_edit_forum_topic' ); ?>
|
||||
|
||||
<p class="editfield">
|
||||
<label for="topic_title"><?php _e( 'Title:', 'huddle' ); ?></label>
|
||||
<input type="text" name="topic_title" id="topic_title" value="<?php bp_the_topic_title(); ?>" />
|
||||
</p>
|
||||
|
||||
<p class="editfield">
|
||||
<label for="topic_text"><?php _e( 'Content:', 'huddle' ); ?></label>
|
||||
<textarea name="topic_text" rows="5" cols="40" id="topic_text"><?php bp_the_topic_text(); ?></textarea>
|
||||
</p>
|
||||
|
||||
<p class="editfield">
|
||||
<label><?php _e( 'Tags (comma separated):', 'huddle' ) ?></label>
|
||||
<input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list() ?>" />
|
||||
</p>
|
||||
|
||||
<?php do_action( 'bp_group_after_edit_forum_topic' ); ?>
|
||||
|
||||
<p class="submit"><input type="submit" class="btn-gray" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'huddle' ); ?>" /></p>
|
||||
|
||||
<?php wp_nonce_field( 'bp_forums_edit_topic' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div id="edit-post">
|
||||
|
||||
<?php do_action( 'bp_group_before_edit_forum_post' ); ?>
|
||||
|
||||
<textarea name="post_text" id="post_text"><?php bp_the_topic_post_edit_text(); ?></textarea>
|
||||
|
||||
<?php do_action( 'bp_group_after_edit_forum_post' ) ?>
|
||||
|
||||
<p class="submit"><input type="submit" class="btn-gray" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'huddle' ); ?>" /></p>
|
||||
|
||||
<?php wp_nonce_field( 'bp_forums_edit_post' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</form><!-- #forum-topic-form -->
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'This topic does not exist.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
|
||||
<?php do_action( 'bp_after_group_forum_edit_form' ); ?>
|
||||
@ -1,139 +0,0 @@
|
||||
<?php do_action( 'bp_before_group_forum_topic' ); ?>
|
||||
|
||||
<?php if ( bp_has_forum_topic_posts() ) : ?>
|
||||
|
||||
<form action="<?php bp_forum_topic_action() ?>" method="post" id="forum-topic-form" class="standard-form">
|
||||
|
||||
<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
|
||||
<ul>
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
|
||||
<li>
|
||||
<a href="<?php bp_forum_topic_new_reply_link() ?>" class="new-reply-link"><?php _e( 'New Reply', 'huddle' ) ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( bp_forums_has_directory() ) : ?>
|
||||
|
||||
<li>
|
||||
<a href="<?php bp_forums_directory_permalink() ?>"><?php _e( 'Forum Directory', 'huddle') ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="topic-meta">
|
||||
|
||||
<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
|
||||
|
||||
<div class="fr admin-links">
|
||||
|
||||
<?php bp_the_topic_admin_links( array( 'seperator' => '·' ) ) ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<h3><?php bp_the_topic_title() ?></h3>
|
||||
|
||||
<p><?php bp_the_topic_pagination_count() ?></p>
|
||||
|
||||
<?php do_action( 'bp_group_forum_topic_meta' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_before_group_forum_topic_posts' ) ?>
|
||||
|
||||
<ul id="topic-post-list" class="item-liste" role="main">
|
||||
<?php $i = 1; while ( bp_forum_topic_posts() ) : bp_the_forum_topic_post(); ?>
|
||||
|
||||
<li id="post-<?php bp_the_topic_post_id() ?>" class="<?php bp_the_topic_post_css_class() ?>">
|
||||
<a href="<?php bp_the_topic_post_poster_link() ?>"><?php bp_the_topic_post_poster_avatar( 'width=35&height=35' ) ?></a>
|
||||
|
||||
<div class="poster-meta">
|
||||
<a class="fr post-link" href="#post-<?php bp_the_topic_post_id() ?>" title="<?php _e( 'Permanent link to this post', 'huddle' ) ?>"><?php echo $i++ ?></a>
|
||||
|
||||
<p class="poster-name"><?php bp_the_topic_post_poster_name() ?></p>
|
||||
<p class="post-time"><?php bp_the_topic_post_time_since() ?></p>
|
||||
</div>
|
||||
|
||||
<div class="post-content">
|
||||
<?php bp_the_topic_post_content() ?>
|
||||
|
||||
<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?>
|
||||
<p class="admin-links"><?php bp_the_topic_post_admin_links() ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_group_forum_post_meta' ); ?>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php endwhile; ?>
|
||||
</ul><!-- #topic-post-list -->
|
||||
|
||||
<?php do_action( 'bp_after_group_forum_topic_posts' ) ?>
|
||||
|
||||
<div class="no-ajax">
|
||||
|
||||
<div class="pagination pagination-links" id="topic-pag-bottom">
|
||||
<?php bp_the_topic_pagination() ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?>
|
||||
|
||||
<?php if ( bp_get_the_topic_is_last_page() ) : ?>
|
||||
|
||||
<?php if ( bp_get_the_topic_is_topic_open() && !bp_group_is_user_banned() ) : ?>
|
||||
|
||||
<div id="post-topic-reply">
|
||||
<p id="post-reply"></p>
|
||||
|
||||
<?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
|
||||
<p><?php _e( 'You will auto join this group when you reply to this topic.', 'huddle' ) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'groups_forum_new_reply_before' ) ?>
|
||||
|
||||
<h4><?php _e( 'Add a reply:', 'huddle' ) ?></h4>
|
||||
|
||||
<p class="editfield">
|
||||
<textarea name="reply_text" id="reply_text" rows="4" cols="45"></textarea>
|
||||
</p>
|
||||
|
||||
<div class="submit">
|
||||
<input type="submit" class="btn-gray" name="submit_reply" id="submit" value="<?php _e( 'Post Reply', 'huddle' ) ?>" />
|
||||
</div>
|
||||
|
||||
<?php do_action( 'groups_forum_new_reply_after' ) ?>
|
||||
|
||||
<?php wp_nonce_field( 'bp_forums_new_reply' ) ?>
|
||||
</div>
|
||||
|
||||
<?php elseif ( !bp_group_is_user_banned() ) : ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'This topic is closed, replies are no longer accepted.', 'huddle' ) ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</form><!-- #forum-topic-form -->
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'There are no posts for this topic.', 'huddle' ) ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
|
||||
<?php do_action( 'bp_after_group_forum_topic' ) ?>
|
||||
@ -1,79 +0,0 @@
|
||||
<?php
|
||||
|
||||
do_action( 'bp_before_group_header' );
|
||||
|
||||
?>
|
||||
|
||||
<div id="item-header-avatar">
|
||||
<a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>">
|
||||
|
||||
<?php bp_group_avatar(); ?>
|
||||
|
||||
</a>
|
||||
</div><!-- #item-header-avatar -->
|
||||
|
||||
<div id="item-header-content">
|
||||
<h2><a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>"><?php bp_group_name(); ?></a></h2>
|
||||
<span class="highlight"><?php bp_group_type(); ?></span> <span class="activity"><?php printf( __( 'active %s', 'huddle' ), bp_get_group_last_active() ); ?></span>
|
||||
|
||||
<?php do_action( 'bp_before_group_header_meta' ); ?>
|
||||
|
||||
<div id="item-meta">
|
||||
|
||||
<?php bp_group_description(); ?>
|
||||
|
||||
<div id="item-buttons">
|
||||
|
||||
<?php do_action( 'bp_group_header_actions' ); ?>
|
||||
|
||||
</div><!-- #item-buttons -->
|
||||
|
||||
<?php do_action( 'bp_group_header_meta' ); ?>
|
||||
|
||||
</div>
|
||||
</div><!-- #item-header-content -->
|
||||
|
||||
<div id="item-actions">
|
||||
|
||||
<?php if ( bp_group_is_visible() ) : ?>
|
||||
|
||||
<h3><?php _e( 'Group Admins', 'huddle' ); ?></h3>
|
||||
|
||||
<ul id="group-admins">
|
||||
<?php
|
||||
global $groups_template;
|
||||
$group =& $groups_template->group;
|
||||
?>
|
||||
<?php foreach( (array) $group->admins as $admin ) { ?>
|
||||
<li>
|
||||
<a href="<?php echo bp_core_get_user_domain( $admin->user_id, $admin->user_nicename, $admin->user_login ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'email' => $admin->user_email ) ) ?></a>
|
||||
<div class="item-title">
|
||||
<a href="<?php echo bp_core_get_user_domain( $admin->user_id, $admin->user_nicename, $admin->user_login ) ?>"><?php echo get_user_meta( $admin->user_id, 'first_name', true ) . ' ' . get_user_meta( $admin->user_id, 'last_name', true ) ?></a>
|
||||
</div>
|
||||
<div class="item-meta"><span class="nickname"><?php echo get_user_meta( $admin->user_id, 'nickname', true ) ?></span></div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
do_action( 'bp_after_group_menu_admins' );
|
||||
|
||||
if ( bp_group_has_moderators() ) :
|
||||
do_action( 'bp_before_group_menu_mods' ); ?>
|
||||
|
||||
<h3><?php _e( 'Group Mods' , 'huddle' ) ?></h3>
|
||||
|
||||
<?php bp_group_list_mods();
|
||||
|
||||
do_action( 'bp_after_group_menu_mods' );
|
||||
|
||||
endif;
|
||||
|
||||
endif; ?>
|
||||
|
||||
</div><!-- #item-actions -->
|
||||
|
||||
<?php
|
||||
do_action( 'bp_after_group_header' );
|
||||
do_action( 'template_notices' );
|
||||
?>
|
||||
@ -1,86 +0,0 @@
|
||||
<?php get_header( 'buddypress' ); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
if ( top.location != self.location ) top.location = self.location.href;
|
||||
</script>
|
||||
|
||||
<div id="content">
|
||||
<div class="padder">
|
||||
|
||||
<?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_home_content' ) ?>
|
||||
|
||||
<div id="item-header" role="complementary">
|
||||
|
||||
<?php locate_template( array( 'groups/single/group-header.php' ), true ); ?>
|
||||
|
||||
</div><!-- #item-header -->
|
||||
|
||||
<div id="item-nav">
|
||||
<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
|
||||
<ul>
|
||||
|
||||
<?php bp_get_options_nav(); ?>
|
||||
|
||||
<?php do_action( 'bp_group_options_nav' ); ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- #item-nav -->
|
||||
|
||||
<div id="item-body">
|
||||
|
||||
<?php do_action( 'bp_before_group_body' );
|
||||
|
||||
if ( bp_is_group_admin_page() && bp_group_is_visible() ) :
|
||||
locate_template( array( 'groups/single/admin.php' ), true );
|
||||
|
||||
elseif ( bp_is_group_members() && bp_group_is_visible() ) :
|
||||
locate_template( array( 'groups/single/members.php' ), true );
|
||||
|
||||
elseif ( bp_is_group_invites() && bp_group_is_visible() ) :
|
||||
locate_template( array( 'groups/single/send-invites.php' ), true );
|
||||
|
||||
elseif ( bp_is_group_forum() && bp_group_is_visible() && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) :
|
||||
locate_template( array( 'groups/single/forum.php' ), true );
|
||||
|
||||
elseif ( bp_is_group_membership_request() ) :
|
||||
locate_template( array( 'groups/single/request-membership.php' ), true );
|
||||
|
||||
elseif ( bp_group_is_visible() && bp_is_active( 'activity' ) ) :
|
||||
locate_template( array( 'groups/single/activity.php' ), true );
|
||||
|
||||
elseif ( bp_group_is_visible() ) :
|
||||
locate_template( array( 'groups/single/members.php' ), true );
|
||||
|
||||
elseif ( !bp_group_is_visible() ) :
|
||||
// The group is not visible, show the status message
|
||||
|
||||
do_action( 'bp_before_group_status_message' ); ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php bp_group_status_message(); ?></p>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_after_group_status_message' );
|
||||
|
||||
else :
|
||||
// If nothing sticks, just load a group front template if one exists.
|
||||
locate_template( array( 'groups/single/front.php' ), true );
|
||||
|
||||
endif;
|
||||
|
||||
do_action( 'bp_after_group_body' ); ?>
|
||||
|
||||
</div><!-- #item-body -->
|
||||
|
||||
<?php do_action( 'bp_after_group_home_content' ); ?>
|
||||
|
||||
<?php endwhile; endif; ?>
|
||||
|
||||
</div><!-- .padder -->
|
||||
</div><!-- #content -->
|
||||
|
||||
<?php get_sidebar( 'buddypress' ); ?>
|
||||
<?php get_footer( 'buddypress' ); ?>
|
||||
@ -1,82 +0,0 @@
|
||||
<?php if ( bp_group_has_members( 'exclude_admins_mods=0' ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_members_content' ); ?>
|
||||
|
||||
<div id="pag-top" class="pagination no-ajax">
|
||||
|
||||
<div class="pag-count" id="member-count-top">
|
||||
|
||||
<?php bp_members_pagination_count(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="pagination-links" id="member-pag-top">
|
||||
|
||||
<?php bp_members_pagination_links(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_before_group_members_list' ); ?>
|
||||
|
||||
<ul id="member-list" class="item-list" role="main">
|
||||
|
||||
<?php while ( bp_group_members() ) : bp_group_the_member(); ?>
|
||||
|
||||
<li>
|
||||
<a href="<?php bp_group_member_domain(); ?>">
|
||||
|
||||
<?php bp_group_member_avatar_thumb(); ?>
|
||||
|
||||
</a>
|
||||
|
||||
<h5><?php bp_group_member_link(); ?></h5>
|
||||
<span class="activity"><?php bp_group_member_joined_since(); ?></span>
|
||||
|
||||
<?php do_action( 'bp_group_members_list_item' ); ?>
|
||||
|
||||
<?php if ( bp_is_active( 'friends' ) ) : ?>
|
||||
|
||||
<div class="action">
|
||||
|
||||
<?php bp_add_friend_button( bp_get_group_member_id(), bp_get_group_member_is_friend() ); ?>
|
||||
|
||||
<?php do_action( 'bp_group_members_list_item_action' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php do_action( 'bp_after_group_members_list' ); ?>
|
||||
|
||||
<div id="pag-bottom" class="pagination">
|
||||
|
||||
<div class="pag-count" id="member-count-bottom">
|
||||
|
||||
<?php bp_members_pagination_count(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="pagination-links" id="member-pag-bottom">
|
||||
|
||||
<?php bp_members_pagination_links(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_after_group_members_content' ); ?>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e( 'This group has no members.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
@ -1,41 +0,0 @@
|
||||
<?php get_header( 'buddypress' ) ?>
|
||||
|
||||
<div id="content">
|
||||
<div class="padder">
|
||||
<?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?>
|
||||
|
||||
<?php do_action( 'bp_before_group_plugin_template' ) ?>
|
||||
|
||||
<div id="item-header">
|
||||
<?php locate_template( array( 'groups/single/group-header.php' ), true ) ?>
|
||||
</div><!-- #item-header -->
|
||||
|
||||
<div id="item-nav">
|
||||
<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
|
||||
<ul>
|
||||
<?php bp_get_options_nav() ?>
|
||||
|
||||
<?php do_action( 'bp_group_plugin_options_nav' ) ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- #item-nav -->
|
||||
|
||||
<div id="item-body">
|
||||
|
||||
<?php do_action( 'bp_before_group_body' ) ?>
|
||||
|
||||
<?php do_action( 'bp_template_content' ) ?>
|
||||
|
||||
<?php do_action( 'bp_after_group_body' ) ?>
|
||||
</div><!-- #item-body -->
|
||||
|
||||
<?php do_action( 'bp_after_group_plugin_template' ) ?>
|
||||
|
||||
<?php endwhile; endif; ?>
|
||||
|
||||
</div><!-- .padder -->
|
||||
</div><!-- #content -->
|
||||
|
||||
<?php get_sidebar( 'buddypress' ) ?>
|
||||
|
||||
<?php get_footer( 'buddypress' ) ?>
|
||||
@ -1,18 +0,0 @@
|
||||
<?php do_action( 'bp_before_group_request_membership_content' ) ?>
|
||||
|
||||
<?php if ( !bp_group_has_requested_membership() ) : ?>
|
||||
<p><?php printf( __( "You are requesting to become a member of the group '%s'.", "huddle" ), bp_get_group_name( false ) ); ?></p>
|
||||
|
||||
<form action="<?php bp_group_form_action('request-membership') ?>" method="post" name="request-membership-form" id="request-membership-form" class="standard-form">
|
||||
<label for="group-request-membership-comments"><?php _e( 'Comments (optional)', 'huddle' ); ?></label>
|
||||
<textarea name="group-request-membership-comments" id="group-request-membership-comments"></textarea>
|
||||
|
||||
<?php do_action( 'bp_group_request_membership_content' ) ?>
|
||||
|
||||
<p><input type="submit" name="group-request-send" id="group-request-send" value="<?php _e( 'Send Request', 'huddle' ) ?>" />
|
||||
|
||||
<?php wp_nonce_field( 'groups_request_membership' ) ?>
|
||||
</form><!-- #request-membership-form -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_group_request_membership_content' ) ?>
|
||||
@ -1,80 +0,0 @@
|
||||
<?php do_action( 'bp_before_group_send_invites_content' ) ?>
|
||||
|
||||
<?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
|
||||
|
||||
<form action="<?php bp_group_send_invite_form_action() ?>" method="post" id="send-invite-form" class="standard-form" role="main">
|
||||
|
||||
<div class="left-menu">
|
||||
|
||||
<div id="invite-list">
|
||||
<ul>
|
||||
<?php bp_new_group_invite_friend_list() ?>
|
||||
</ul>
|
||||
|
||||
<?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ) ?>
|
||||
</div>
|
||||
|
||||
</div><!-- .left-menu -->
|
||||
|
||||
<div class="main-column">
|
||||
|
||||
<div id="message" class="info">
|
||||
<p><?php _e('Select people to invite from your friends list.', 'huddle'); ?></p>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_before_group_send_invites_list' ) ?>
|
||||
|
||||
<?php /* The ID 'friend-list' is important for AJAX support. */ ?>
|
||||
<ul id="friend-list" class="item-list">
|
||||
<?php if ( bp_group_has_invites() ) : ?>
|
||||
|
||||
<?php while ( bp_group_invites() ) : bp_group_the_invite(); ?>
|
||||
|
||||
<li id="<?php bp_group_invite_item_id() ?>">
|
||||
<?php bp_group_invite_user_avatar() ?>
|
||||
|
||||
<h4><?php bp_group_invite_user_link() ?></h4>
|
||||
<span class="activity"><?php bp_group_invite_user_last_active() ?></span>
|
||||
|
||||
<?php do_action( 'bp_group_send_invites_item' ) ?>
|
||||
|
||||
<div class="action">
|
||||
<a class="button remove" href="<?php bp_group_invite_user_remove_invite_url() ?>" id="<?php bp_group_invite_item_id() ?>"><?php _e( 'Remove Invite', 'huddle
|
||||
' ) ?></a>
|
||||
|
||||
<?php do_action( 'bp_group_send_invites_item_action' ) ?>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
</ul><!-- #friend-list -->
|
||||
|
||||
<?php do_action( 'bp_after_group_send_invites_list' ) ?>
|
||||
|
||||
</div><!-- .main-column -->
|
||||
|
||||
<div class="clear"></div>
|
||||
<br />
|
||||
|
||||
<div class="submit">
|
||||
<input type="submit" name="submit" id="submit" value="<?php _e( 'Send Invites', 'huddle' ) ?>" />
|
||||
</div>
|
||||
|
||||
<?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites') ?>
|
||||
|
||||
<?php /* This is important, don't forget it */ ?>
|
||||
<input type="hidden" name="group_id" id="group_id" value="<?php bp_group_id() ?>" />
|
||||
|
||||
</form><!-- #send-invite-form -->
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div id="message" class="info" role="main">
|
||||
<p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group. You can send invites any time in the future by selecting the "Send Invites" option when viewing your new group.', 'huddle' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'bp_after_group_send_invites_content' ) ?>
|
||||
@ -1,111 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--[if IE 7]>
|
||||
<html id="ie7" <?php language_attributes(); ?>>
|
||||
<![endif]-->
|
||||
<!--[if IE 8]>
|
||||
<html id="ie8" <?php language_attributes(); ?>>
|
||||
<![endif]-->
|
||||
<!--[if IE 9]>
|
||||
<html id="ie9" <?php language_attributes(); ?>>
|
||||
<![endif]-->
|
||||
<!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!-->
|
||||
<html <?php language_attributes(); ?>>
|
||||
<!--<![endif]-->
|
||||
<head>
|
||||
|
||||
<!--Meta Tags-->
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>" />
|
||||
|
||||
<!--Title-->
|
||||
<title><?php wp_title( '|', true, 'right' ); bloginfo( 'name' ); if( is_front_page() ) echo ' - ' . get_bloginfo( 'description' ) ?></title>
|
||||
|
||||
<!--Stylesheets-->
|
||||
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
|
||||
|
||||
<!--RSS Feeds & Pingbacks-->
|
||||
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
|
||||
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
|
||||
|
||||
<!--Hooks-->
|
||||
<?php do_action( 'bp_head' ) ?>
|
||||
<?php wp_head() ?>
|
||||
|
||||
</head>
|
||||
|
||||
<body <?php body_class(); ?>>
|
||||
|
||||
<?php if( ! isset( $_GET['w-iframe'] ) ) : ?>
|
||||
|
||||
<?php do_action( 'bp_before_header' ) ?>
|
||||
|
||||
<div id="header">
|
||||
|
||||
<div class="shadow"></div>
|
||||
|
||||
<div class="overlay">
|
||||
|
||||
<div class="grid">
|
||||
|
||||
<div class="logo">
|
||||
|
||||
<?php if( of_get_option( 'text_logo' ) ) : ?>
|
||||
<h1><a href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ) ?></a></h1>
|
||||
<h2><?php bloginfo( 'description' ) ?></h2>
|
||||
<?php elseif( of_get_option( 'logo' ) ) : ?>
|
||||
<h1><a href="<?php echo home_url() ?>"><img src="<?php echo of_get_option( 'logo' ) ?>" alt="<?php bloginfo( 'name' ) ?>" /></a></h1>
|
||||
<?php else : ?>
|
||||
<h1><a href="<?php echo home_url() ?>"><img src="<?php echo get_template_directory_uri() ?>/images/logo.png" alt="<?php bloginfo( 'name' ) ?>" /></a></h1>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="login">
|
||||
<?php if( is_user_logged_in() ) : ?>
|
||||
<?php
|
||||
global $current_user, $bp;
|
||||
get_currentuserinfo();
|
||||
?>
|
||||
<p><?php printf( __( 'Welcome %s', 'huddle' ), '<a href="' . $bp->loggedin_user->domain . '">' . $bp->loggedin_user->fullname . '</a>' ) ?>. <a href="<?php echo wp_logout_url(); ?>"><?php _e( 'Logout', 'huddle' ) ?></a></p>
|
||||
<?php else : ?>
|
||||
<a class="forgot-pass" href="<?php echo site_url() ?>/wp-login.php?action=lostpassword"><?php _e( 'Forgot Password?', 'huddle' ) ?></a>
|
||||
|
||||
<div class="fields">
|
||||
<form action="<?php echo site_url() ?>/wp-login.php" method="post">
|
||||
<input type="text" class="user-login" name="log" placeholder="<?php _e( 'Username', 'huddle' ) ?>" />
|
||||
<input type="password" class="user-pass" name="pwd" placeholder="<?php _e( 'Password', 'huddle' ) ?>" />
|
||||
<input type="submit" class="btn-submit" value="" />
|
||||
<input type="hidden" name="redirect_to" value="<?php echo substr_count( $_SERVER['REQUEST_URI'], 'activate' ) ? home_url() : $_SERVER['REQUEST_URI'] ?>" />
|
||||
</form>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'bp_header' ) ?>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- #header -->
|
||||
|
||||
<?php do_action( 'bp_after_header' ) ?>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="nav">
|
||||
|
||||
<div class="grid">
|
||||
|
||||
<?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- #nav -->
|
||||
|
||||
<?php do_action( 'bp_before_container' ) ?>
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
<div id="content" class="grid">
|
||||
@ -1,11 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>NEWONE.ORG</title>
|
||||
</head>
|
||||
<frameset rows="100%,*" border="0">
|
||||
<frame src="http://www.newone.org" frameborder="0" />
|
||||
<frame frameborder="0" noresize />
|
||||
</frameset>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 435 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 493 B |
|
Before Width: | Height: | Size: 314 B |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 534 B |
|
Before Width: | Height: | Size: 169 B |
|
Before Width: | Height: | Size: 121 B |
|
Before Width: | Height: | Size: 2.8 KiB |