Skip to content
This repository
Browse code

New version Custom Community Free merged from the Pro Version.

Many thanks To: Slava, Jcircel, KonradS, SvenL, Ixiter and all the others
  • Loading branch information...
commit 5c0ce716c96c43869b2af717f1a1c20d825849d3 1 parent df3ae14
Sven Lehnert authored August 31, 2012

Showing 197 changed files with 38,489 additions and 4 deletions. Show diff stats Hide diff stats

  1. 11  .project
  2. 19  404.php
  3. 4  README.md
  4. 665  _inc/ajax.php
  5. 73  _inc/css/reset.css
  6. 54  _inc/css/responsive-rtl.css
  7. 196  _inc/css/responsive.css
  8. 1,269  _inc/global.js
  9. BIN  _inc/images/45pc_black.png
  10. BIN  _inc/images/60pc_black.png
  11. BIN  _inc/images/activity_arrow.gif
  12. BIN  _inc/images/admin-menu-arrow.gif
  13. BIN  _inc/images/ajax-loader.gif
  14. BIN  _inc/images/background.gif
  15. BIN  _inc/images/closed.png
  16. BIN  _inc/images/default_header.jpg
  17. BIN  _inc/images/item_back.gif
  18. BIN  _inc/images/pro_default_header.png
  19. BIN  _inc/images/replyto_arrow.gif
  20. BIN  _inc/images/rss.png
  21. BIN  _inc/images/sidebar_back.gif
  22. BIN  _inc/images/white-grad.png
  23. 11  _inc/js/reflection.js
  24. 66  activity/activity-loop.php
  25. 56  activity/comment.php
  26. 124  activity/entry.php
  27. 156  activity/index.php
  28. 74  activity/post-form.php
  29. 125  admin/cheezcap.php
  30. 925  admin/config.php
  31. 161  admin/css/colorpicker.css
  32. 38  admin/css/fileuploader.css
  33. BIN  admin/css/images/ui-bg_flat_0_aaaaaa_40x100.png
  34. BIN  admin/css/images/ui-bg_flat_75_ffffff_40x100.png
  35. BIN  admin/css/images/ui-bg_glass_55_fbf9ee_1x400.png
  36. BIN  admin/css/images/ui-bg_glass_65_ffffff_1x400.png
  37. BIN  admin/css/images/ui-bg_glass_75_dadada_1x400.png
  38. BIN  admin/css/images/ui-bg_glass_75_e6e6e6_1x400.png
  39. BIN  admin/css/images/ui-bg_glass_95_fef1ec_1x400.png
  40. BIN  admin/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  41. BIN  admin/css/images/ui-icons_222222_256x240.png
  42. BIN  admin/css/images/ui-icons_2e83ff_256x240.png
  43. BIN  admin/css/images/ui-icons_454545_256x240.png
  44. BIN  admin/css/images/ui-icons_888888_256x240.png
  45. BIN  admin/css/images/ui-icons_cd0a0a_256x240.png
  46. 573  admin/css/jquery-ui.css
  47. 218  admin/css/layout.css
  48. 15  admin/get-pro.php
  49. BIN  admin/images/blank.gif
  50. BIN  admin/images/colorpicker_background.png
  51. BIN  admin/images/colorpicker_hex.png
  52. BIN  admin/images/colorpicker_hsb_b.png
  53. BIN  admin/images/colorpicker_hsb_h.png
  54. BIN  admin/images/colorpicker_hsb_s.png
  55. BIN  admin/images/colorpicker_indic.gif
  56. BIN  admin/images/colorpicker_overlay.png
  57. BIN  admin/images/colorpicker_rgb_b.png
  58. BIN  admin/images/colorpicker_rgb_g.png
  59. BIN  admin/images/colorpicker_rgb_r.png
  60. BIN  admin/images/colorpicker_select.gif
  61. BIN  admin/images/colorpicker_submit.png
  62. BIN  admin/images/custom_background.png
  63. BIN  admin/images/custom_hex.png
  64. BIN  admin/images/custom_hsb_b.png
  65. BIN  admin/images/custom_hsb_h.png
  66. BIN  admin/images/custom_hsb_s.png
  67. BIN  admin/images/custom_indic.gif
  68. BIN  admin/images/custom_rgb_b.png
  69. BIN  admin/images/custom_rgb_g.png
  70. BIN  admin/images/custom_rgb_r.png
  71. BIN  admin/images/custom_submit.png
  72. BIN  admin/images/loading.gif
  73. BIN  admin/images/select.png
  74. BIN  admin/images/select2.png
  75. BIN  admin/images/slider.png
  76. 484  admin/js/colorpicker.js
  77. 161  admin/js/jquery.autogrow-textarea.js
  78. 606  admin/js/jquery.ui.accordion.js
  79. 24  admin/js/uploader.js
  80. 600  admin/library.php
  81. 315  admin/post-metabox.php
  82. 87  archive.php
  83. 47  attachment.php
  84. 95  blogs/blogs-loop.php
  85. 44  blogs/create.php
  86. 89  blogs/index.php
  87. 57  comments.php
  88. 164  core/custom-community.php
  89. 88  core/includes/bp/buddydev-search.php
  90. 355  core/includes/bp/templatetags.php
  91. 482  core/includes/helper-functions.php
  92. 4,808  core/includes/theme-generator/style.php
  93. 794  core/includes/theme-generator/theme-generator.php
  94. 190  core/includes/tkf/wp/detect.php
  95. 610  core/includes/wp/shortcodes.php
  96. 1  core/includes/wp/templatetags.php
  97. 265  core/includes/wp/widgets.php
  98. 20  core/loader.php
  99. 26  footer.php
  100. 100  forums/forums-loop.php
  101. 163  forums/index.php
  102. 93  forums/single/edit.php
  103. 35  forums/single/forum-header.php
  104. 64  forums/single/forum.php
  105. 194  forums/single/topic.php
  106. 43  full-width.php
  107. 566  functions.php
  108. 317  groups/create.php
  109. 100  groups/groups-loop.php
  110. 93  groups/index.php
  111. 39  groups/single/activity.php
  112. 373  groups/single/admin.php
  113. 93  groups/single/forum.php
  114. 96  groups/single/forum/edit.php
  115. 152  groups/single/forum/topic.php
  116. 50  groups/single/group-header-sidebar.php
  117. 50  groups/single/group-header.php
  118. 11  groups/single/group-sidebar-left.php
  119. 11  groups/single/group-sidebar-right.php
  120. 57  groups/single/home.php
  121. 107  groups/single/members.php
  122. 39  groups/single/plugins.php
  123. 18  groups/single/request-membership.php
  124. 78  groups/single/send-invites.php
  125. 71  header.php
  126. BIN  images/1x1-trans.gif
  127. BIN  images/60pc_black.png
  128. BIN  images/60pc_white.png
  129. BIN  images/ajax-loader.gif
  130. BIN  images/arrow-square-on.gif
  131. BIN  images/arrow-square.gif
  132. BIN  images/bg.png
  133. BIN  images/black/selected-item.png
  134. BIN  images/black/zeile-left.png
  135. BIN  images/black/zeile-right.png
  136. BIN  images/black/zeile.png
  137. BIN  images/dark/selected-item.png
  138. BIN  images/dark/zeile-left.png
  139. BIN  images/dark/zeile-right.png
  140. BIN  images/dark/zeile.png
  141. BIN  images/default-header.png
  142. BIN  images/default-header.png01
  143. BIN  images/default-header.pngxx
  144. BIN  images/get-pro.jpg
  145. BIN  images/grey/selected-item.png
  146. BIN  images/grey/zeile-left.png
  147. BIN  images/grey/zeile-right.png
  148. BIN  images/grey/zeile.png
  149. BIN  images/light/selected-item.png
  150. BIN  images/light/zeile-left.png
  151. BIN  images/light/zeile-right.png
  152. BIN  images/light/zeile.png
  153. BIN  images/natural/selected-item.png
  154. BIN  images/natural/zeile-left.png
  155. BIN  images/natural/zeile-right.png
  156. BIN  images/natural/zeile.png
  157. BIN  images/slideshow/noftrdimg-1006x250.jpg
  158. BIN  images/slideshow/noftrdimg-222x160.jpg
  159. BIN  images/slideshow/noftrdimg-80x50.jpg
  160. BIN  images/slideshow/noftrdimg.jpg
  161. BIN  images/slideshow/selected-item-black.png
  162. BIN  images/slideshow/selected-item-dark.png
  163. BIN  images/slideshow/selected-item-light.png
  164. BIN  images/slideshow/selected-item-natural.png
  165. BIN  images/slideshow/selected-item-white.png
  166. BIN  images/slideshow/selected-item.gif
  167. BIN  images/slideshow/slider-shadow-sharp.png
  168. BIN  images/slideshow/slider-shadow.png
  169. BIN  images/slideshow/slider-shadow.pngx
  170. BIN  images/slideshow/transparent-bg.gif
  171. BIN  images/slideshow/transparent-bg.png
  172. BIN  images/whatsnewspeech.gif
  173. BIN  images/white/selected-item.png
  174. BIN  images/white/zeile-left.png
  175. BIN  images/white/zeile-right.png
  176. BIN  images/white/zeile.png
  177. 70  index.php
  178. BIN  languages/ca_ES.mo
  179. 2,223  languages/ca_ES.po
  180. BIN  languages/da_DK.mo
  181. 2,326  languages/da_DK.po
  182. BIN  languages/de_DE.mo
  183. 2,333  languages/de_DE.po
  184. BIN  languages/es_ES.mo
  185. 2,199  languages/es_ES.po
  186. BIN  languages/fr_FR.mo
  187. 2,192  languages/fr_FR.po
  188. BIN  languages/it_IT.mo
  189. 2,198  languages/it_IT.po
  190. BIN  languages/nl_NL.mo
  191. 2,229  languages/nl_NL.po
  192. BIN  languages/pl_PL.mo
  193. 2,270  languages/pl_PL.po
  194. BIN  languages/pt_BR.mo
  195. 2,195  languages/pt_BR.po
  196. BIN  languages/ru_RU.mo
11  .project
... ...
@@ -0,0 +1,11 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<projectDescription>
  3
+	<name>Custom-Community-Free</name>
  4
+	<comment></comment>
  5
+	<projects>
  6
+	</projects>
  7
+	<buildSpec>
  8
+	</buildSpec>
  9
+	<natures>
  10
+	</natures>
  11
+</projectDescription>
19  404.php
... ...
@@ -0,0 +1,19 @@
  1
+<?php get_header() ?>
  2
+
  3
+	<div id="content">
  4
+		<div class="padder one-column">
  5
+			<?php do_action( 'bp_before_404' ); ?>
  6
+			<div id="post-0" class="post page-404 error404 not-found" role="main">
  7
+				<h2 class="posttitle"><?php _e( "Page not found", 'cc' ); ?></h2>
  8
+
  9
+				<p><?php _e( "We're sorry, but we can't find the page that you're looking for. Perhaps searching will help.", 'cc' ); ?></p>
  10
+				<?php get_search_form(); ?>
  11
+
  12
+				<?php do_action( 'bp_404' ); ?>
  13
+			</div>
  14
+
  15
+			<?php do_action( 'bp_after_404' ) ?>
  16
+		</div><!-- .padder -->
  17
+	</div><!-- #content -->
  18
+
  19
+<?php get_footer() ?>
4  README.md
Source Rendered
... ...
@@ -1,4 +0,0 @@
1  
-Custom-Community
2  
-================
3  
-
4  
-Free Premium Theme for WordPress and BuddyPress
665  _inc/ajax.php
... ...
@@ -0,0 +1,665 @@
  1
+<?php
  2
+/***
  3
+ * AJAX Functions
  4
+ *
  5
+ * All of these functions enhance the responsiveness of the user interface in the default
  6
+ * theme by adding AJAX functionality.
  7
+ */
  8
+
  9
+/***
  10
+ * This function looks scarier than it actually is. :)
  11
+ * Each object loop (activity/members/groups/blogs/forums) contains default parameters to
  12
+ * show specific information based on the page we are currently looking at.
  13
+ * The following function will take into account any cookies set in the JS and allow us
  14
+ * to override the parameters sent. That way we can change the results returned without reloading the page.
  15
+ * By using cookies we can also make sure that user settings are retained across page loads.
  16
+ */
  17
+function bp_dtheme_ajax_querystring( $query_string, $object ) {
  18
+	global $bp;
  19
+
  20
+	if ( empty( $object ) )
  21
+		return false;
  22
+
  23
+	/* Set up the cookies passed on this AJAX request. Store a local var to avoid conflicts */
  24
+	if ( !empty( $_POST['cookie'] ) )
  25
+		$_BP_COOKIE = wp_parse_args( str_replace( '; ', '&', urldecode( $_POST['cookie'] ) ) );
  26
+	else
  27
+		$_BP_COOKIE = &$_COOKIE;
  28
+
  29
+	$qs = false;
  30
+
  31
+	/***
  32
+	 * Check if any cookie values are set. If there are then override the default params passed to the
  33
+	 * template loop
  34
+	 */
  35
+	if ( !empty( $_BP_COOKIE['bp-' . $object . '-filter'] ) && '-1' != $_BP_COOKIE['bp-' . $object . '-filter'] ) {
  36
+		$qs[] = 'type=' . $_BP_COOKIE['bp-' . $object . '-filter'];
  37
+		$qs[] = 'action=' . $_BP_COOKIE['bp-' . $object . '-filter']; // Activity stream filtering on action
  38
+	}
  39
+
  40
+	if ( !empty( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) {
  41
+		if ( 'personal' == $_BP_COOKIE['bp-' . $object . '-scope'] ) {
  42
+			$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
  43
+			$qs[] = 'user_id=' . $user_id;
  44
+		}
  45
+		if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && empty( $bp->displayed_user->id ) && !$bp->is_single_item )
  46
+			$qs[] = 'scope=' . $_BP_COOKIE['bp-' . $object . '-scope']; // Activity stream scope only on activity directory.
  47
+	}
  48
+
  49
+	/* If page and search_terms have been passed via the AJAX post request, use those */
  50
+	if ( !empty( $_POST['page'] ) && '-1' != $_POST['page'] )
  51
+		$qs[] = 'page=' . $_POST['page'];
  52
+
  53
+	$object_search_text = bp_get_search_default_text( $object );
  54
+ 	if ( !empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
  55
+		$qs[] = 'search_terms=' . $_POST['search_terms'];
  56
+
  57
+	/* Now pass the querystring to override default values. */
  58
+	$query_string = empty( $qs ) ? '' : join( '&', (array)$qs );
  59
+
  60
+	$object_filter = '';
  61
+	if ( isset( $_BP_COOKIE['bp-' . $object . '-filter'] ) )
  62
+		$object_filter = $_BP_COOKIE['bp-' . $object . '-filter'];
  63
+
  64
+	$object_scope = '';
  65
+	if ( isset( $_BP_COOKIE['bp-' . $object . '-scope'] ) )
  66
+		$object_scope = $_BP_COOKIE['bp-' . $object . '-scope'];
  67
+
  68
+	$object_page = '';
  69
+	if ( isset( $_BP_COOKIE['bp-' . $object . '-page'] ) )
  70
+		$object_page = $_BP_COOKIE['bp-' . $object . '-page'];
  71
+
  72
+	$object_search_terms = '';
  73
+	if ( isset( $_BP_COOKIE['bp-' . $object . '-search-terms'] ) )
  74
+		$object_search_terms = $_BP_COOKIE['bp-' . $object . '-search-terms'];
  75
+
  76
+	$object_extras = '';
  77
+	if ( isset( $_BP_COOKIE['bp-' . $object . '-extras'] ) )
  78
+		$object_extras = $_BP_COOKIE['bp-' . $object . '-extras'];
  79
+
  80
+	return apply_filters( 'bp_dtheme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras );
  81
+}
  82
+add_filter( 'bp_ajax_querystring', 'bp_dtheme_ajax_querystring', 10, 2 );
  83
+
  84
+/* This function will simply load the template loop for the current object. On an AJAX request */
  85
+function bp_dtheme_object_template_loader() {
  86
+	$object = esc_attr( $_POST['object'] );
  87
+	locate_template( array( "$object/$object-loop.php" ), true );
  88
+}
  89
+add_action( 'wp_ajax_members_filter', 'bp_dtheme_object_template_loader' );
  90
+add_action( 'wp_ajax_groups_filter', 'bp_dtheme_object_template_loader' );
  91
+add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_template_loader' );
  92
+add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_template_loader' );
  93
+
  94
+// This function will load the activity loop template when activity is requested via AJAX
  95
+function bp_dtheme_activity_template_loader() {
  96
+	global $bp;
  97
+
  98
+	$scope = '';
  99
+	if ( !empty( $_POST['scope'] ) )
  100
+		$scope = $_POST['scope'];
  101
+
  102
+	// We need to calculate and return the feed URL for each scope
  103
+	switch ( $scope ) {
  104
+		case 'friends':
  105
+			$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/friends/feed/';
  106
+			break;
  107
+		case 'groups':
  108
+			$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/groups/feed/';
  109
+			break;
  110
+		case 'favorites':
  111
+			$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/favorites/feed/';
  112
+			break;
  113
+		case 'mentions':
  114
+			$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/mentions/feed/';
  115
+			bp_activity_clear_new_mentions( $bp->loggedin_user->id );
  116
+			break;
  117
+		default:
  118
+			$feed_url = home_url( bp_get_activity_root_slug() . '/feed/' );
  119
+			break;
  120
+	}
  121
+
  122
+	/* Buffer the loop in the template to a var for JS to spit out. */
  123
+	ob_start();
  124
+	locate_template( array( 'activity/activity-loop.php' ), true );
  125
+	$result['contents'] = ob_get_contents();
  126
+	$result['feed_url'] = apply_filters( 'bp_dtheme_activity_feed_url', $feed_url, $scope );
  127
+	ob_end_clean();
  128
+
  129
+	echo json_encode( $result );
  130
+}
  131
+add_action( 'wp_ajax_activity_widget_filter', 'bp_dtheme_activity_template_loader' );
  132
+add_action( 'wp_ajax_activity_get_older_updates', 'bp_dtheme_activity_template_loader' );
  133
+
  134
+/* AJAX update posting */
  135
+function bp_dtheme_post_update() {
  136
+	global $bp;
  137
+
  138
+	// Check the nonce
  139
+	check_admin_referer( 'post_update', '_wpnonce_post_update' );
  140
+
  141
+	if ( !is_user_logged_in() ) {
  142
+		echo '-1';
  143
+		return false;
  144
+	}
  145
+
  146
+	if ( empty( $_POST['content'] ) ) {
  147
+		echo '-1<div id="message" class="error"><p>' . __( 'Please enter some content to post.', 'cc' ) . '</p></div>';
  148
+		return false;
  149
+	}
  150
+
  151
+	$activity_id = 0;
  152
+	if ( empty( $_POST['object'] ) && bp_is_active( 'activity' ) ) {
  153
+		$activity_id = bp_activity_post_update( array( 'content' => $_POST['content'] ) );
  154
+
  155
+	} elseif ( $_POST['object'] == 'groups' ) {
  156
+		if ( !empty( $_POST['item_id'] ) && bp_is_active( 'groups' ) )
  157
+			$activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $_POST['item_id'] ) );
  158
+
  159
+	} else {
  160
+		$activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] );
  161
+	}
  162
+
  163
+	if ( empty( $activity_id ) ) {
  164
+		echo '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update, please try again.', 'cc' ) . '</p></div>';
  165
+		return false;
  166
+	}
  167
+
  168
+	if ( bp_has_activities ( 'include=' . $activity_id ) ) : ?>
  169
+		<?php while ( bp_activities() ) : bp_the_activity(); ?>
  170
+			<?php locate_template( array( 'activity/entry.php' ), true ) ?>
  171
+		<?php endwhile; ?>
  172
+	 <?php endif;
  173
+}
  174
+add_action( 'wp_ajax_post_update', 'bp_dtheme_post_update' );
  175
+
  176
+/* AJAX activity comment posting */
  177
+function bp_dtheme_new_activity_comment() {
  178
+	global $bp;
  179
+
  180
+	// Check the nonce
  181
+	check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
  182
+
  183
+	if ( !is_user_logged_in() ) {
  184
+		echo '-1';
  185
+		return false;
  186
+	}
  187
+
  188
+	if ( empty( $_POST['content'] ) ) {
  189
+		echo '-1<div id="message" class="error"><p>' . __( 'Please do not leave the comment area blank.', 'cc' ) . '</p></div>';
  190
+		return false;
  191
+	}
  192
+
  193
+	if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || !is_numeric( $_POST['form_id'] ) || !is_numeric( $_POST['comment_id'] ) ) {
  194
+		echo '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'cc' ) . '</p></div>';
  195
+		return false;
  196
+	}
  197
+
  198
+	$comment_id = bp_activity_new_comment( array(
  199
+		'activity_id' => $_POST['form_id'],
  200
+		'content'     => $_POST['content'],
  201
+		'parent_id'   => $_POST['comment_id']
  202
+	) );
  203
+
  204
+	if ( !$comment_id ) {
  205
+		echo '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'cc' ) . '</p></div>';
  206
+		return false;
  207
+	}
  208
+
  209
+	global $activities_template;
  210
+
  211
+	// Load the new activity item into the $activities_template global
  212
+	bp_has_activities( 'display_comments=stream&include=' . $comment_id );
  213
+
  214
+	// Swap the current comment with the activity item we just loaded
  215
+	$activities_template->activity->id              = $activities_template->activities[0]->item_id;
  216
+	$activities_template->activity->current_comment = $activities_template->activities[0];
  217
+
  218
+	$template = locate_template( 'activity/comment.php', false, false );
  219
+
  220
+	// Backward compatibility. In older versions of BP, the markup was
  221
+	// generated in the PHP instead of a template. This ensures that
  222
+	// older themes (which are not children of bp-default and won't
  223
+	// have the new template) will still work.
  224
+	if ( empty( $template ) )
  225
+		$template = BP_PLUGIN_DIR . '/bp-themes/bp-default/activity/comment.php';
  226
+
  227
+	load_template( $template, false );
  228
+
  229
+	unset( $activities_template );
  230
+}
  231
+add_action( 'wp_ajax_new_activity_comment', 'bp_dtheme_new_activity_comment' );
  232
+
  233
+/* AJAX delete an activity */
  234
+function bp_dtheme_delete_activity() {
  235
+	global $bp;
  236
+
  237
+	// Check the nonce
  238
+	check_admin_referer( 'bp_activity_delete_link' );
  239
+
  240
+	if ( !is_user_logged_in() ) {
  241
+		echo '-1';
  242
+		return false;
  243
+	}
  244
+
  245
+	if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) ) {
  246
+		echo '-1';
  247
+		return false;
  248
+	}
  249
+
  250
+	$activity = new BP_Activity_Activity( (int) $_POST['id'] );
  251
+
  252
+	// Check access
  253
+	if ( empty( $activity->user_id ) || !bp_activity_user_can_delete( $activity ) ) {
  254
+		echo '-1';
  255
+		return false;
  256
+	}
  257
+
  258
+	// Call the action before the delete so plugins can still fetch information about it
  259
+	do_action( 'bp_activity_before_action_delete_activity', $activity->id, $activity->user_id );
  260
+
  261
+	if ( !bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) ) {
  262
+		echo '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'cc' ) . '</p></div>';
  263
+		return false;
  264
+	}
  265
+
  266
+	do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id );
  267
+
  268
+	return true;
  269
+}
  270
+add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' );
  271
+
  272
+/* AJAX delete an activity comment */
  273
+function bp_dtheme_delete_activity_comment() {
  274
+	global $bp;
  275
+
  276
+	/* Check the nonce */
  277
+	check_admin_referer( 'bp_activity_delete_link' );
  278
+
  279
+	if ( !is_user_logged_in() ) {
  280
+		echo '-1';
  281
+		return false;
  282
+	}
  283
+
  284
+	$comment = new BP_Activity_Activity( $_POST['id'] );
  285
+
  286
+	/* Check access */
  287
+	if ( !is_super_admin() && $comment->user_id != $bp->loggedin_user->id )
  288
+		return false;
  289
+
  290
+	if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) )
  291
+		return false;
  292
+
  293
+	/* Call the action before the delete so plugins can still fetch information about it */
  294
+	do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $comment->user_id );
  295
+
  296
+	if ( !bp_activity_delete_comment( $comment->item_id, $comment->id ) ) {
  297
+		echo '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'cc' ) . '</p></div>';
  298
+		return false;
  299
+	}
  300
+
  301
+	do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id );
  302
+
  303
+	return true;
  304
+}
  305
+add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity_comment' );
  306
+
  307
+/* AJAX mark an activity as a favorite */
  308
+function bp_dtheme_mark_activity_favorite() {
  309
+	global $bp;
  310
+
  311
+	bp_activity_add_user_favorite( $_POST['id'] );
  312
+	_e( 'Remove Favorite', 'cc' );
  313
+}
  314
+add_action( 'wp_ajax_activity_mark_fav', 'bp_dtheme_mark_activity_favorite' );
  315
+
  316
+/* AJAX mark an activity as not a favorite */
  317
+function bp_dtheme_unmark_activity_favorite() {
  318
+	global $bp;
  319
+
  320
+	bp_activity_remove_user_favorite( $_POST['id'] );
  321
+	_e( 'Favorite', 'cc' );
  322
+}
  323
+add_action( 'wp_ajax_activity_mark_unfav', 'bp_dtheme_unmark_activity_favorite' );
  324
+
  325
+/**
  326
+ * AJAX handler for Read More link on long activity items
  327
+ *
  328
+ * @package BuddyPress
  329
+ * @since 1.5
  330
+ */
  331
+function bp_dtheme_get_single_activity_content() {
  332
+	$activity_array = bp_activity_get_specific( array(
  333
+		'activity_ids'     => $_POST['activity_id'],
  334
+		'display_comments' => 'stream'
  335
+	) );
  336
+
  337
+	$activity = !empty( $activity_array['activities'][0] ) ? $activity_array['activities'][0] : false;
  338
+
  339
+	if ( !$activity )
  340
+		exit(); // todo: error?
  341
+
  342
+	do_action_ref_array( 'bp_dtheme_get_single_activity_content', array( &$activity ) );
  343
+
  344
+	// Activity content retrieved through AJAX should run through normal filters, but not be truncated
  345
+	remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
  346
+	$content = apply_filters( 'bp_get_activity_content_body', $activity->content );
  347
+
  348
+	echo $content;
  349
+	exit();
  350
+}
  351
+add_action( 'wp_ajax_get_single_activity_content', 'bp_dtheme_get_single_activity_content' );
  352
+
  353
+/* AJAX invite a friend to a group functionality */
  354
+function bp_dtheme_ajax_invite_user() {
  355
+	global $bp;
  356
+
  357
+	check_ajax_referer( 'groups_invite_uninvite_user' );
  358
+
  359
+	if ( !$_POST['friend_id'] || !$_POST['friend_action'] || !$_POST['group_id'] )
  360
+		return false;
  361
+
  362
+	if ( !bp_groups_user_can_send_invites( $_POST['group_id'] ) )
  363
+		return false;
  364
+
  365
+	if ( !friends_check_friendship( $bp->loggedin_user->id, $_POST['friend_id'] ) )
  366
+		return false;
  367
+
  368
+	if ( 'invite' == $_POST['friend_action'] ) {
  369
+
  370
+		if ( !groups_invite_user( array( 'user_id' => $_POST['friend_id'], 'group_id' => $_POST['group_id'] ) ) )
  371
+			return false;
  372
+
  373
+		$user = new BP_Core_User( $_POST['friend_id'] );
  374
+
  375
+		echo '<li id="uid-' . $user->id . '">';
  376
+		echo $user->avatar_thumb;
  377
+		echo '<h4>' . $user->user_link . '</h4>';
  378
+		echo '<span class="activity">' . esc_attr( $user->last_active ) . '</span>';
  379
+		echo '<div class="action">
  380
+				<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', 'cc' ) . '</a>
  381
+			  </div>';
  382
+		echo '</li>';
  383
+
  384
+	} else if ( 'uninvite' == $_POST['friend_action'] ) {
  385
+
  386
+		if ( !groups_uninvite_user( $_POST['friend_id'], $_POST['group_id'] ) )
  387
+			return false;
  388
+
  389
+		return true;
  390
+
  391
+	} else {
  392
+		return false;
  393
+	}
  394
+}
  395
+add_action( 'wp_ajax_groups_invite_user', 'bp_dtheme_ajax_invite_user' );
  396
+
  397
+/* AJAX add/remove a user as a friend when clicking the button */
  398
+function bp_dtheme_ajax_addremove_friend() {
  399
+	global $bp;
  400
+
  401
+	if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
  402
+
  403
+		check_ajax_referer('friends_remove_friend');
  404
+
  405
+		if ( !friends_remove_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
  406
+			echo __("Friendship could not be canceled.", 'cc');
  407
+		} else {
  408
+			echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'cc' ) . '" href="' . wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'cc' ) . '</a>';
  409
+		}
  410
+
  411
+	} else if ( 'not_friends' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
  412
+
  413
+		check_ajax_referer('friends_add_friend');
  414
+
  415
+		if ( !friends_add_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
  416
+			echo __("Friendship could not be requested.", 'cc');
  417
+		} else {
  418
+			echo '<a href="' . $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests" class="requested">' . __( 'Friendship Requested', 'cc' ) . '</a>';
  419
+		}
  420
+	} else {
  421
+		echo __( 'Request Pending', 'cc' );
  422
+	}
  423
+
  424
+	return false;
  425
+}
  426
+add_action( 'wp_ajax_addremove_friend', 'bp_dtheme_ajax_addremove_friend' );
  427
+
  428
+/* AJAX accept a user as a friend when clicking the "accept" button */
  429
+function bp_dtheme_ajax_accept_friendship() {
  430
+	check_admin_referer( 'friends_accept_friendship' );
  431
+
  432
+	if ( !friends_accept_friendship( $_POST['id'] ) )
  433
+		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem accepting that request. Please try again.', 'cc' ) . '</p></div>';
  434
+
  435
+	return true;
  436
+}
  437
+add_action( 'wp_ajax_accept_friendship', 'bp_dtheme_ajax_accept_friendship' );
  438
+
  439
+/* AJAX reject a user as a friend when clicking the "reject" button */
  440
+function bp_dtheme_ajax_reject_friendship() {
  441
+	check_admin_referer( 'friends_reject_friendship' );
  442
+
  443
+	if ( !friends_reject_friendship( $_POST['id'] ) )
  444
+		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem rejecting that request. Please try again.', 'cc' ) . '</p></div>';
  445
+
  446
+	return true;
  447
+}
  448
+add_action( 'wp_ajax_reject_friendship', 'bp_dtheme_ajax_reject_friendship' );
  449
+
  450
+/* AJAX join or leave a group when clicking the "join/leave" button */
  451
+function bp_dtheme_ajax_joinleave_group() {
  452
+	global $bp;
  453
+
  454
+	if ( groups_is_user_banned( $bp->loggedin_user->id, $_POST['gid'] ) )
  455
+		return false;
  456
+
  457
+	if ( !$group = new BP_Groups_Group( $_POST['gid'], false, false ) )
  458
+		return false;
  459
+
  460
+	if ( !groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) {
  461
+
  462
+		if ( 'public' == $group->status ) {
  463
+
  464
+			check_ajax_referer( 'groups_join_group' );
  465
+
  466
+			if ( !groups_join_group( $group->id ) ) {
  467
+				_e( 'Error joining group', 'cc' );
  468
+			} else {
  469
+				echo '<a id="group-' . esc_attr( $group->id ) . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'cc' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'cc' ) . '</a>';
  470
+			}
  471
+
  472
+		} else if ( 'private' == $group->status ) {
  473
+
  474
+			check_ajax_referer( 'groups_request_membership' );
  475
+
  476
+			if ( !groups_send_membership_request( $bp->loggedin_user->id, $group->id ) ) {
  477
+				_e( 'Error requesting membership', 'cc' );
  478
+			} else {
  479
+				echo '<a id="group-' . esc_attr( $group->id ) . '" class="membership-requested" rel="membership-requested" title="' . __( 'Membership Requested', 'cc' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Membership Requested', 'cc' ) . '</a>';
  480
+			}
  481
+		}
  482
+
  483
+	} else {
  484
+
  485
+		check_ajax_referer( 'groups_leave_group' );
  486
+
  487
+		if ( !groups_leave_group( $group->id ) ) {
  488
+			_e( 'Error leaving group', 'cc' );
  489
+		} else {
  490
+			if ( 'public' == $group->status ) {
  491
+				echo '<a id="group-' . esc_attr( $group->id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'cc' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'cc' ) . '</a>';
  492
+			} else if ( 'private' == $group->status ) {
  493
+				echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'cc' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'cc' ) . '</a>';
  494
+			}
  495
+		}
  496
+	}
  497
+}
  498
+add_action( 'wp_ajax_joinleave_group', 'bp_dtheme_ajax_joinleave_group' );
  499
+
  500
+/* AJAX close and keep closed site wide notices from an admin in the sidebar */
  501
+function bp_dtheme_ajax_close_notice() {
  502
+	global $userdata;
  503
+
  504
+	if ( !isset( $_POST['notice_id'] ) ) {
  505
+		echo "-1<div id='message' class='error'><p>" . __('There was a problem closing the notice.', 'cc') . '</p></div>';
  506
+	} else {
  507
+		$notice_ids = bp_get_user_meta( $userdata->ID, 'closed_notices', true );
  508
+
  509
+		$notice_ids[] = (int) $_POST['notice_id'];
  510
+
  511
+		bp_update_user_meta( $userdata->ID, 'closed_notices', $notice_ids );
  512
+	}
  513
+}
  514
+add_action( 'wp_ajax_messages_close_notice', 'bp_dtheme_ajax_close_notice' );
  515
+
  516
+/* AJAX send a private message reply to a thread */
  517
+function bp_dtheme_ajax_messages_send_reply() {
  518
+	global $bp;
  519
+
  520
+	check_ajax_referer( 'messages_send_message' );
  521
+
  522
+	$result = messages_new_message( array( 'thread_id' => $_REQUEST['thread_id'], 'content' => $_REQUEST['content'] ) );
  523
+
  524
+	if ( $result ) { ?>
  525
+		<div class="message-box new-message">
  526
+			<div class="message-metadata">
  527
+				<?php do_action( 'bp_before_message_meta' ) ?>
  528
+				<?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?>
  529
+
  530
+				<strong><a href="<?php echo $bp->loggedin_user->domain ?>"><?php echo $bp->loggedin_user->fullname ?></a> <span class="activity"><?php printf( __( 'Sent %s', 'cc' ), bp_core_time_since( bp_core_current_time() ) ) ?></span></strong>
  531
+
  532
+				<?php do_action( 'bp_after_message_meta' ) ?>
  533
+			</div>
  534
+
  535
+			<?php do_action( 'bp_before_message_content' ) ?>
  536
+
  537
+			<div class="message-content">
  538
+				<?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ) ?>
  539
+			</div>
  540
+
  541
+			<?php do_action( 'bp_after_message_content' ) ?>
  542
+
  543
+			<div class="clear"></div>
  544
+		</div>
  545
+	<?php
  546
+	} else {
  547
+		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem sending that reply. Please try again.', 'cc' ) . '</p></div>';
  548
+	}
  549
+}
  550
+add_action( 'wp_ajax_messages_send_reply', 'bp_dtheme_ajax_messages_send_reply' );
  551
+
  552
+/* AJAX mark a private message as unread in your inbox */
  553
+function bp_dtheme_ajax_message_markunread() {
  554
+	global $bp;
  555
+
  556
+	if ( !isset($_POST['thread_ids']) ) {
  557
+		echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as unread.', 'cc' ) . '</p></div>';
  558
+	} else {
  559
+		$thread_ids = explode( ',', $_POST['thread_ids'] );
  560
+
  561
+		for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) {
  562
+			BP_Messages_Thread::mark_as_unread($thread_ids[$i]);
  563
+		}
  564
+	}
  565
+}
  566
+add_action( 'wp_ajax_messages_markunread', 'bp_dtheme_ajax_message_markunread' );
  567
+
  568
+/* AJAX mark a private message as read in your inbox */
  569
+function bp_dtheme_ajax_message_markread() {
  570
+	global $bp;
  571
+
  572
+	if ( !isset($_POST['thread_ids']) ) {
  573
+		echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as read.', 'cc' ) . '</p></div>';
  574
+	} else {
  575
+		$thread_ids = explode( ',', $_POST['thread_ids'] );
  576
+
  577
+		for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) {
  578
+			BP_Messages_Thread::mark_as_read($thread_ids[$i]);
  579
+		}
  580
+	}
  581
+}
  582
+add_action( 'wp_ajax_messages_markread', 'bp_dtheme_ajax_message_markread' );
  583
+
  584
+/* AJAX delete a private message or array of messages in your inbox */
  585
+function bp_dtheme_ajax_messages_delete() {
  586
+	global $bp;
  587
+
  588
+	if ( !isset($_POST['thread_ids']) ) {
  589
+		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem deleting messages.', 'cc' ) . '</p></div>';
  590
+	} else {
  591
+		$thread_ids = explode( ',', $_POST['thread_ids'] );
  592
+
  593
+		for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i )
  594
+			BP_Messages_Thread::delete($thread_ids[$i]);
  595
+
  596
+		_e( 'Messages deleted.', 'cc' );
  597
+	}
  598
+}
  599
+add_action( 'wp_ajax_messages_delete', 'bp_dtheme_ajax_messages_delete' );
  600
+
  601
+/**
  602
+ * bp_dtheme_ajax_messages_autocomplete_results()
  603
+ *
  604
+ * AJAX handler for autocomplete. Displays friends only, unless BP_MESSAGES_AUTOCOMPLETE_ALL is defined
  605
+ *
  606
+ * @global object object $bp Global BuddyPress settings object
  607
+ * @return none
  608
+ */
  609
+function bp_dtheme_ajax_messages_autocomplete_results() {
  610
+	global $bp;
  611
+
  612
+	// Include everyone in the autocomplete, or just friends?
  613
+	if ( $bp->messages->slug == $bp->current_component )
  614
+		$autocomplete_all = $bp->messages->autocomplete_all;
  615
+
  616
+	$friends  = false;
  617
+	$pag_page = 1;
  618
+
  619
+	$limit = $_GET['limit'] ? $_GET['limit'] : apply_filters( 'bp_autocomplete_max_results', 10 );
  620
+
  621
+	// Get the user ids based on the search terms
  622
+	if ( !empty( $autocomplete_all ) ) {
  623
+		$users = BP_Core_User::search_users( $_GET['q'], $limit, $pag_page );
  624
+
  625
+		if ( !empty( $users['users'] ) ) {
  626
+			// Build an array with the correct format
  627
+			$user_ids = array();
  628
+			foreach( $users['users'] as $user ) {
  629
+				if ( $user->id != $bp->loggedin_user->id )
  630
+					$user_ids[] = $user->id;
  631
+			}
  632
+
  633
+			$user_ids = apply_filters( 'bp_core_autocomplete_ids', $user_ids, $_GET['q'], $limit );
  634
+		}
  635
+	} else {
  636
+		if ( bp_is_active( 'friends' ) ) {
  637
+			$users = friends_search_friends( $_GET['q'], $bp->loggedin_user->id, $limit, 1 );
  638
+
  639
+			// Keeping the bp_friends_autocomplete_list filter for backward compatibility
  640
+			$users = apply_filters( 'bp_friends_autocomplete_list', $users, $_GET['q'], $limit );
  641
+
  642
+			if ( !empty( $users['friends'] ) )
  643
+				$user_ids = apply_filters( 'bp_friends_autocomplete_ids', $users['friends'], $_GET['q'], $limit );
  644
+		}
  645
+	}
  646
+
  647
+	if ( !empty( $user_ids ) ) {
  648
+		foreach ( $user_ids as $user_id ) {
  649
+			$ud = get_userdata( $user_id );
  650
+			if ( !$ud )
  651
+				continue;
  652
+
  653
+			if ( bp_is_username_compatibility_mode() )
  654
+				$username = $ud->user_login;
  655
+			else
  656
+				$username = $ud->user_nicename;
  657
+
  658
+			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 ) ) . ' &nbsp;' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
  659
+			';
  660
+		}
  661
+	}
  662
+}
  663
+add_action( 'wp_ajax_messages_autocomplete_results', 'bp_dtheme_ajax_messages_autocomplete_results' );
  664
+
  665
+?>
73  _inc/css/reset.css
... ...
@@ -0,0 +1,73 @@
  1
+/* --------------------------------------------------------------
  2
+
  3
+   Reset default browser CSS.
  4
+
  5
+   Based on work by Eric Meyer:
  6
+   http://meyerweb.com/eric/tools/css/reset/index.html
  7
+
  8
+-------------------------------------------------------------- */
  9
+
  10
+/* v1.0 | 20080212 */
  11
+
  12
+html, body, div, span, applet, object, iframe,
  13
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  14
+a, abbr, acronym, address, big, cite, code,
  15
+del, dfn, em, font, img, ins, kbd, q, s, samp,
  16
+small, strike, strong, sub, sup, tt, var,
  17
+b, u, i, center,
  18
+dl, dt, dd, ol, ul, li,
  19
+fieldset, form, label, legend,
  20
+table, caption, tbody, tfoot, thead, tr, th, td {
  21
+	margin: 0;
  22
+	padding: 0;
  23
+	border: 0;
  24
+	outline: 0;
  25
+	font-size: 100%;
  26
+	vertical-align: baseline;
  27
+	background: transparent;
  28
+}
  29
+body {
  30
+    background:#fff;
  31
+	line-height: 1;
  32
+}
  33
+ol, ul {
  34
+	list-style: none;
  35
+}
  36
+blockquote, q {
  37
+	quotes: none;
  38
+}
  39
+blockquote:before, blockquote:after,
  40
+q:before, q:after {
  41
+	content: '';
  42
+	content: none;
  43
+}
  44
+
  45
+/* remember to define focus styles! */
  46
+:focus {
  47
+	outline: 0;
  48
+}
  49
+
  50
+/* remember to highlight inserts somehow! */
  51
+ins {
  52
+	text-decoration: none;
  53
+}
  54
+del {
  55
+	text-decoration: line-through;
  56
+}
  57
+
  58
+/* tables still need 'cellspacing="0"' in the markup */
  59
+table {
  60
+	border-collapse: collapse;
  61
+	border-spacing: 0;
  62
+}
  63
+
  64
+a img { border: none; }
  65
+
  66
+.gallery-caption{
  67
+}
  68
+.aligncenter{
  69
+}
  70
+.sticky{
  71
+}
  72
+.bypostauthor {
  73
+}
54  _inc/css/responsive-rtl.css
... ...
@@ -0,0 +1,54 @@
  1
+/*--------------------------------------------------------------
  2
+Hello, this is the BuddyPress Reponsive theme rtl stylesheet.
  3
+Right to left styles. This will transform the theme to read from
  4
+right to left for languages that support this method.
  5
+
  6
+----------------------------------------------------------------
  7
+>>> TABLE OF CONTENTS:
  8
+----------------------------------------------------------------
  9
+1.0 - iPad
  10
+	1.1 - Landscape
  11
+	1.2 - Portrait
  12
+2.0 - iPhone
  13
+--------------------------------------------------------------*/
  14
+
  15
+/*--------------------------------------------------------------
  16
+1.1 - iPad Landscape
  17
+--------------------------------------------------------------*/
  18
+@media only screen and (max-width: 768px) {
  19
+	div#content .padder {
  20
+		margin-left: 0;
  21
+		margin-right: auto;
  22
+	}
  23
+	ul#nav li {
  24
+		margin-left: 0;
  25
+		margin-right: auto;
  26
+	}
  27
+	ul#nav li:nth-child(even) {
  28
+		margin-left: 0;
  29
+		margin-right: 3%;
  30
+	}
  31
+}
  32
+
  33
+
  34
+/*--------------------------------------------------------------
  35
+1.2 - iPad Portrait
  36
+--------------------------------------------------------------*/
  37
+@media only screen and (max-width: 640px) {
  38
+	ul.item-list li div.action {
  39
+		padding-left: auto;
  40
+		padding-right: 64px;
  41
+	}
  42
+}
  43
+
  44
+
  45
+/*--------------------------------------------------------------
  46
+2.0 - iPhone
  47
+--------------------------------------------------------------*/
  48
+@media only screen and (max-width: 320px) {
  49
+	div.post div.post-content,
  50
+	div.comment-content {
  51
+		margin-left: auto;
  52
+		margin-right: 0px;
  53
+	}
  54
+}
196  _inc/css/responsive.css
... ...
@@ -0,0 +1,196 @@
  1
+/*--------------------------------------------------------------
  2
+Hello, this is the BuddyPress Responsive theme stylesheet
  3
+
  4
+----------------------------------------------------------------
  5
+>>> TABLE OF CONTENTS:
  6
+----------------------------------------------------------------
  7
+1.0 - iPad
  8
+	1.1 - Landscape
  9
+	1.2 - Portrait
  10
+2.0 - Smartphone
  11
+3.0 - iPhone
  12
+--------------------------------------------------------------*/
  13
+
  14
+/*--------------------------------------------------------------
  15
+1.1 - iPad Landscape
  16
+--------------------------------------------------------------*/
  17
+@media only screen and (max-width: 768px) {
  18
+	html {
  19
+		background-color: #eaeaea;
  20
+	}
  21
+	body {
  22
+		margin-top: -28px !important;
  23
+		background: #eaeaea;
  24
+	}
  25
+	#wpadminbar {
  26
+		display: none;
  27
+	}
  28
+	div#content .padder {
  29
+		margin-right: 0;
  30
+		width: auto;
  31
+		float: none;
  32
+		border: none;
  33
+	}
  34
+	div#sidebar {
  35
+		width: auto;
  36
+		float: none;
  37
+		margin: 2em 0 0 0;
  38
+		border: none;
  39
+	}
  40
+	ul#nav {
  41
+		padding-bottom: 1em;
  42
+	}
  43
+	ul#nav li {
  44
+		width: 46%;
  45
+		margin-bottom: 1em;
  46
+		margin-right: 0;
  47
+	}
  48
+	ul#nav li:nth-child(even) {
  49
+		margin-left: 3%;
  50
+		margin-right: 0;
  51
+	}
  52
+	ul#nav li a {
  53
+		-moz-border-radius: 0.25em;
  54
+		-webkit-border-radius: 0.25em;
  55
+		border-radius: 0.25em;
  56
+		margin-bottom: 0;
  57
+	}
  58
+}
  59
+
  60
+
  61
+/*--------------------------------------------------------------
  62
+1.2 - iPad Portrait
  63
+--------------------------------------------------------------*/
  64
+@media only screen and (max-width: 640px) {
  65
+	div.dir-search {
  66
+		float: none;
  67
+		margin: 1.25em 0 0;
  68
+	}
  69
+	ul.item-list li div.action {
  70
+		padding-left: 64px;
  71
+		position: relative;
  72
+		right: auto;
  73
+		text-align: left;
  74
+		top: 1em;
  75
+		margin-bottom: 1.25em;
  76
+	}
  77
+}
  78
+
  79
+
  80
+/*--------------------------------------------------------------
  81
+2.0 - Smartphone (any)
  82
+--------------------------------------------------------------*/
  83
+@media only screen and (max-width: 480px) {
  84
+	body {
  85
+		width: 100%;
  86
+		margin: 0;
  87
+	}
  88
+	#container {
  89
+		border: none;
  90
+	}
  91
+	div.item-list-tabs ul li {
  92
+		float: none;
  93
+		margin: 0.3em 0.6em;
  94
+		background:none;
  95
+	}
  96
+	div.item-list-tabs ul li.last {
  97
+		float: none;
  98
+		margin: 0.3em 0.6em;
  99
+	}
  100
+	div#subnav.item-list-tabs ul li.last {
  101
+		margin-top: 1em;
  102
+	}
  103
+	div.item-list-tabs ul li.selected,
  104
+	div.item-list-tabs ul li.current {
  105
+		margin: 0.3em 0.6em;
  106
+	}
  107
+	div.item-list-tabs ul li.selected a,
  108
+	div.item-list-tabs ul li.current a {
  109
+		background: #eee;
  110
+		font-weight: bold;
  111
+	}
  112
+	div.item-list-tabs {
  113
+		background: none;
  114
+	}
  115
+	div.item-list-tabs ul li:first-child {
  116
+		margin: 0.6em 0.6em 0.5em 0.6em;
  117
+	}
  118
+	div.item-list-tabs ul li a,
  119
+	div.item-list-tabs ul li span {
  120
+		padding: 0.3em;
  121
+	}
  122
+	div#subnav ul {
  123
+		padding-top: 0.6em;
  124
+	}
  125
+	div.pagination {
  126
+		padding: 0.6em;
  127
+	}
  128
+	div.item-list-tabs ul {
  129
+		border-top: 1px solid #EAEAEA;
  130
+		padding-top: 0;
  131
+	}
  132
+	div.item-list-tabs ul li {
  133
+		margin-top: 0;
  134
+	}
  135
+	form.standard-form #basic-details-section,
  136
+	form.standard-form #blog-details-section,
  137
+	form.standard-form #profile-details-section {
  138
+		float: none;
  139
+		width: 100%;
  140
+	}
  141
+}
  142
+
  143
+
  144
+/*--------------------------------------------------------------
  145
+3.0 - iPhone
  146
+--------------------------------------------------------------*/
  147
+@media only screen and (max-width: 320px) {
  148
+	ul#nav li {
  149
+		float: none;
  150
+		width: 100%;
  151
+		margin-bottom: 0.6em;
  152
+		margin-right: 0;
  153
+		margin-left: 0;
  154
+	}
  155
+	ul#nav li:nth-child(even) {
  156
+		margin-left: 0;
  157
+		margin-right: 0;
  158
+	}
  159
+	ul#nav li a {
  160
+		-moz-border-radius: 0.25em;
  161
+		-webkit-border-radius: 0.25em;
  162
+		border-radius: 0.25em;
  163
+		margin-bottom: 0;
  164
+	}
  165
+	form#groups-directory-form h3 a {
  166
+		display: block;
  167
+		margin-top: 0.6em;
  168
+	}
  169
+	div.post div.author-box,
  170
+	div.comment-avatar-box {
  171
+		display: none;
  172
+	}
  173
+	div.post div.post-content,
  174
+	div.comment-content {
  175
+		margin-left: 0px;
  176
+	}
  177
+	form#whats-new-form div#whats-new-avatar {
  178
+		display:none;
  179
+	}
  180
+	form#whats-new-form h5 {
  181
+		margin: 0 0 0 0px;
  182
+	}
  183
+	form#whats-new-form #whats-new-content {
  184
+		margin-left: 0px;
  185
+		padding-left: 0px;
  186
+	}
  187
+	ul#activity-stream.item-list li div.activity-avatar {
  188
+		display: none;
  189
+	}
  190
+	body.activity-permalink .activity-list li .activity-content {
  191
+		margin-left: 0;
  192
+	}
  193
+	body.activity-permalink .activity-list li.mini .activity-meta {
  194
+		left: 0;
  195
+	}
  196
+}
1,269  _inc/global.js
... ...
@@ -0,0 +1,1269 @@
  1
+// AJAX Functions
  2
+var jq = jQuery;
  3
+
  4
+// Global variable to prevent multiple AJAX requests
  5
+var bp_ajax_request = null;
  6
+
  7
+jq(document).ready( function() {
  8
+	/**** Page Load Actions *******************************************************/
  9
+
  10
+	/* Hide Forums Post Form */
  11
+	if ( '-1' == window.location.search.indexOf('new') && jq('div.forums').length )
  12
+		jq('div#new-topic-post').hide();
  13
+	else
  14
+		jq('div#new-topic-post').show();
  15
+
  16
+	/* Activity filter and scope set */
  17
+	bp_init_activity();
  18
+
  19
+	/* Object filter and scope set. */
  20
+	var objects = [ 'members', 'groups', 'blogs', 'forums' ];
  21
+	bp_init_objects( objects );
  22
+
  23
+	/* @mention Compose Scrolling */
  24
+	if ( jq.query.get('r') && jq('textarea#whats-new').length ) {
  25
+		jq('#whats-new-options').animate({height:'40px'});
  26
+		jq("form#whats-new-form textarea").animate({height:'50px'});
  27
+		jq.scrollTo( jq('textarea#whats-new'), 500, { offset:-125, easing:'easeOutQuad' } );
  28
+		jq('textarea#whats-new').focus();
  29
+	}
  30
+
  31
+	/**** Activity Posting ********************************************************/
  32
+
  33
+	/* Textarea focus */
  34
+	jq('#whats-new').focus( function(){
  35
+		jq("#whats-new-options").animate({height:'40px'});
  36
+		jq("form#whats-new-form textarea").animate({height:'50px'});
  37
+		jq("#aw-whats-new-submit").prop("disabled", false);
  38
+	});
  39
+
  40
+	/* New posts */
  41
+	jq("input#aw-whats-new-submit").click( function() {
  42
+		var button = jq(this);
  43
+		var form = button.parent().parent().parent().parent();
  44
+
  45
+		form.children().each( function() {
  46
+			if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") )
  47
+				jq(this).prop( 'disabled', true );
  48
+		});
  49
+
  50
+		/* Remove any errors */
  51
+		jq('div.error').remove();
  52
+		button.addClass('loading');
  53
+		button.prop('disabled', true);
  54
+
  55
+		/* Default POST values */
  56
+		var object = '';
  57
+		var item_id = jq("#whats-new-post-in").val();
  58
+		var content = jq("textarea#whats-new").val();
  59
+
  60
+		/* Set object for non-profile posts */
  61
+		if ( item_id > 0 ) {