BuddyPress - Version 1.0

Version Description

Download this release

Release Info

Developer apeatling
Plugin Icon 128x128 BuddyPress
Version 1.0
Comparing to
See all releases

Version 1.0

Files changed (400) hide show
  1. bp-activity.php +307 -0
  2. bp-activity/bp-activity-classes.php +332 -0
  3. bp-activity/bp-activity-cssjs.php +10 -0
  4. bp-activity/bp-activity-filters.php +16 -0
  5. bp-activity/bp-activity-templatetags.php +347 -0
  6. bp-activity/bp-activity-widgets.php +84 -0
  7. bp-activity/css/structure.css +15 -0
  8. bp-activity/css/widget-activity.css +9 -0
  9. bp-activity/feeds/bp-activity-friends-feed.php +44 -0
  10. bp-activity/feeds/bp-activity-personal-feed.php +44 -0
  11. bp-activity/feeds/bp-activity-sitewide-feed.php +45 -0
  12. bp-activity/images/rss.png +0 -0
  13. bp-blogs.php +862 -0
  14. bp-blogs/admin-tabs/admin.css +56 -0
  15. bp-blogs/admin-tabs/bp-blogs-comments-tab.php +3 -0
  16. bp-blogs/admin-tabs/bp-blogs-posts-tab.php +3 -0
  17. bp-blogs/admin-tabs/bp-blogs-tab.php +3 -0
  18. bp-blogs/bp-blogs-ajax.php +12 -0
  19. bp-blogs/bp-blogs-classes.php +665 -0
  20. bp-blogs/bp-blogs-cssjs.php +10 -0
  21. bp-blogs/bp-blogs-templatetags.php +1322 -0
  22. bp-blogs/bp-blogs-widgets.php +85 -0
  23. bp-blogs/css/structure.css +84 -0
  24. bp-blogs/css/widget-blogs.css +29 -0
  25. bp-blogs/js/directory-blogs.js +104 -0
  26. bp-core.php +1349 -0
  27. bp-core/bp-core-activation.php +128 -0
  28. bp-core/bp-core-admin.php +275 -0
  29. bp-core/bp-core-adminbar.php +281 -0
  30. bp-core/bp-core-ajax-handler.php +11 -0
  31. bp-core/bp-core-ajax.php +76 -0
  32. bp-core/bp-core-avatars.php +498 -0
  33. bp-core/bp-core-catchuri.php +302 -0
  34. bp-core/bp-core-classes.php +363 -0
  35. bp-core/bp-core-cssjs.php +190 -0
  36. bp-core/bp-core-notifications.php +98 -0
  37. bp-core/bp-core-settings.php +201 -0
  38. bp-core/bp-core-signup.php +420 -0
  39. bp-core/bp-core-templatetags.php +1127 -0
  40. bp-core/bp-core-widgets.php +231 -0
  41. bp-core/css/admin-bar.css +234 -0
  42. bp-core/css/structure.css +321 -0
  43. bp-core/css/widget-members.css +22 -0
  44. bp-core/images/accept_button_side.gif +0 -0
  45. bp-core/images/add_button_side.gif +0 -0
  46. bp-core/images/add_friend_button.gif +0 -0
  47. bp-core/images/admin-menu-arrow.gif +0 -0
  48. bp-core/images/admin_bar_back.gif +0 -0
  49. bp-core/images/admin_bar_logo.gif +0 -0
  50. bp-core/images/ajax-loader.gif +0 -0
  51. bp-core/images/blog.png +0 -0
  52. bp-core/images/button_back.gif +0 -0
  53. bp-core/images/check_button_side.gif +0 -0
  54. bp-core/images/loading_button_side.gif +0 -0
  55. bp-core/images/logout_bullet.gif +0 -0
  56. bp-core/images/member.png +0 -0
  57. bp-core/images/mystery-man.jpg +0 -0
  58. bp-core/images/nav_bullet.gif +0 -0
  59. bp-core/images/reject_button_side.gif +0 -0
  60. bp-core/images/remove_button_side.gif +0 -0
  61. bp-core/images/remove_friend_button.gif +0 -0
  62. bp-core/images/requested_friend_button.gif +0 -0
  63. bp-core/images/view_button_side.gif +0 -0
  64. bp-core/js/account-admin.js +64 -0
  65. bp-core/js/directory-members.js +111 -0
  66. bp-core/js/general.js +112 -0
  67. bp-core/js/jquery/jquery.livequery.pack.js +9 -0
  68. bp-core/js/jquery/jquery.tablednd.js +314 -0
  69. bp-core/js/widget-members.js +49 -0
  70. bp-forums.php +198 -0
  71. bp-forums/bbpress-plugins/buddypress-enable.php +59 -0
  72. bp-forums/bp-forums-admin.php +121 -0
  73. bp-forums/bp-forums-bbpress-live.php +683 -0
  74. bp-forums/bp-forums-filters.php +61 -0
  75. bp-forums/bp-forums-templatetags.php +601 -0
  76. bp-forums/installation-readme.txt +73 -0
  77. bp-friends.php +664 -0
  78. bp-friends/bp-friends-ajax.php +41 -0
  79. bp-friends/bp-friends-classes.php +329 -0
  80. bp-friends/bp-friends-cssjs.php +22 -0
  81. bp-friends/bp-friends-notifications.php +75 -0
  82. bp-friends/bp-friends-templatetags.php +463 -0
  83. bp-friends/css/structure.css +28 -0
  84. bp-friends/images/ajax-loader.gif +0 -0
  85. bp-friends/js/general.js +73 -0
  86. bp-groups.php +2352 -0
  87. bp-groups/bp-groups-admin.php +129 -0
  88. bp-groups/bp-groups-ajax.php +271 -0
  89. bp-groups/bp-groups-classes.php +951 -0
  90. bp-groups/bp-groups-cssjs.php +36 -0
  91. bp-groups/bp-groups-filters.php +54 -0
  92. bp-groups/bp-groups-notifications.php +271 -0
  93. bp-groups/bp-groups-templatetags.php +2361 -0
  94. bp-groups/bp-groups-widgets.php +113 -0
  95. bp-groups/css/structure.css +38 -0
  96. bp-groups/css/widget-groups.css +22 -0
  97. bp-groups/images/ajax-loader.gif +0 -0
  98. bp-groups/images/none-thumbnail.gif +0 -0
  99. bp-groups/images/none.gif +0 -0
  100. bp-groups/js/directory-groups.js +138 -0
  101. bp-groups/js/general.js +197 -0
  102. bp-groups/js/widget-groups.js +49 -0
  103. bp-languages/buddypress.pot +4501 -0
  104. bp-loader.php +54 -0
  105. bp-messages.php +602 -0
  106. bp-messages/autocomplete/bp-messages-autocomplete.php +22 -0
  107. bp-messages/bp-messages-ajax.php +91 -0
  108. bp-messages/bp-messages-classes.php +563 -0
  109. bp-messages/bp-messages-cssjs.php +39 -0
  110. bp-messages/bp-messages-filters.php +48 -0
  111. bp-messages/bp-messages-notifications.php +81 -0
  112. bp-messages/bp-messages-templatetags.php +562 -0
  113. bp-messages/css/autocomplete/jquery.autocompletefb.css +83 -0
  114. bp-messages/css/structure.css +96 -0
  115. bp-messages/images/ajax-loader.gif +0 -0
  116. bp-messages/images/email.gif +0 -0
  117. bp-messages/images/email_draft.gif +0 -0
  118. bp-messages/images/email_open.gif +0 -0
  119. bp-messages/images/email_sent.gif +0 -0
  120. bp-messages/images/loading.gif +0 -0
  121. bp-messages/images/nav_bullet.gif +0 -0
  122. bp-messages/images/warning.gif +0 -0
  123. bp-messages/js/autocomplete/init.php +16 -0
  124. bp-messages/js/autocomplete/jquery.autocomplete.js +728 -0
  125. bp-messages/js/autocomplete/jquery.autocompletefb.js +68 -0
  126. bp-messages/js/autocomplete/jquery.bgiframe.min.js +10 -0
  127. bp-messages/js/autocomplete/jquery.dimensions.js +116 -0
  128. bp-messages/js/general.js +297 -0
  129. bp-themes/bphome/404.php +40 -0
  130. bp-themes/bphome/activate.php +25 -0
  131. bp-themes/bphome/archive.php +69 -0
  132. bp-themes/bphome/archives.php +25 -0
  133. bp-themes/bphome/attachment.php +33 -0
  134. bp-themes/bphome/comments-popup.php +116 -0
  135. bp-themes/bphome/comments.php +112 -0
  136. bp-themes/bphome/css/base.css +822 -0
  137. bp-themes/bphome/css/custom-sample.css +4 -0
  138. bp-themes/bphome/css/ie/ie6.css +35 -0
  139. bp-themes/bphome/css/ie/ie7.css +31 -0
  140. bp-themes/bphome/css/site-wide-sample.css +10 -0
  141. bp-themes/bphome/footer.php +12 -0
  142. bp-themes/bphome/functions.php +92 -0
  143. bp-themes/bphome/header.php +64 -0
  144. bp-themes/bphome/home.php +39 -0
  145. bp-themes/bphome/images/blog_bullet.gif +0 -0
  146. bp-themes/bphome/images/bp_logo.gif +0 -0
  147. bp-themes/bphome/images/button_back.gif +0 -0
  148. bp-themes/bphome/images/centercol_header_back.gif +0 -0
  149. bp-themes/bphome/images/comments_icon.gif +0 -0
  150. bp-themes/bphome/images/create_account_button.gif +0 -0
  151. bp-themes/bphome/images/error_back.gif +0 -0
  152. bp-themes/bphome/images/error_icon.gif +0 -0
  153. bp-themes/bphome/images/friends_bullet.gif +0 -0
  154. bp-themes/bphome/images/groups_bullet.gif +0 -0
  155. bp-themes/bphome/images/info_icon.gif +0 -0
  156. bp-themes/bphome/images/item_list_back.gif +0 -0
  157. bp-themes/bphome/images/leftcol_header_back.gif +0 -0
  158. bp-themes/bphome/images/logo.gif +0 -0
  159. bp-themes/bphome/images/profile_bullet.gif +0 -0
  160. bp-themes/bphome/images/quotes_background.gif +0 -0
  161. bp-themes/bphome/images/rightcol_header_back.gif +0 -0
  162. bp-themes/bphome/images/tag_icon.gif +0 -0
  163. bp-themes/bphome/images/view_button_side.gif +0 -0
  164. bp-themes/bphome/images/welcome_header_back.gif +0 -0
  165. bp-themes/bphome/images/wire_bullet.gif +0 -0
  166. bp-themes/bphome/index.php +44 -0
  167. bp-themes/bphome/links.php +18 -0
  168. bp-themes/bphome/page.php +23 -0
  169. bp-themes/bphome/plugin-sidebar.php +3 -0
  170. bp-themes/bphome/plugin-template.php +7 -0
  171. bp-themes/bphome/register.php +37 -0
  172. bp-themes/bphome/rtl.css +63 -0
  173. bp-themes/bphome/screenshot.png +0 -0
  174. bp-themes/bphome/search.php +46 -0
  175. bp-themes/bphome/searchform.php +5 -0
  176. bp-themes/bphome/sidebar.php +10 -0
  177. bp-themes/bphome/single.php +40 -0
  178. bp-themes/bphome/style.css +24 -0
  179. bp-themes/bpmember/404.php +12 -0
  180. bp-themes/bpmember/activity/just-me.php +60 -0
  181. bp-themes/bpmember/activity/my-friends.php +54 -0
  182. bp-themes/bpmember/blogs/create.php +26 -0
  183. bp-themes/bpmember/blogs/my-blogs.php +30 -0
  184. bp-themes/bpmember/blogs/recent-comments.php +31 -0
  185. bp-themes/bpmember/blogs/recent-posts.php +31 -0
  186. bp-themes/bpmember/css/base.css +566 -0
  187. bp-themes/bpmember/css/components.css +482 -0
  188. bp-themes/bpmember/css/custom-components/readme.txt +2 -0
  189. bp-themes/bpmember/css/custom-sample.css +4 -0
  190. bp-themes/bpmember/css/directories.css +158 -0
  191. bp-themes/bpmember/css/ie/ie6.css +78 -0
  192. bp-themes/bpmember/css/ie/ie7.css +11 -0
  193. bp-themes/bpmember/css/loader.php +26 -0
  194. bp-themes/bpmember/css/settings.css +44 -0
  195. bp-themes/bpmember/directories/blogs/blogs-loop.php +52 -0
  196. bp-themes/bpmember/directories/blogs/index.php +108 -0
  197. bp-themes/bpmember/directories/groups/groups-loop.php +52 -0
  198. bp-themes/bpmember/directories/groups/index.php +115 -0
  199. bp-themes/bpmember/directories/members/index.php +106 -0
  200. bp-themes/bpmember/directories/members/members-loop.php +46 -0
  201. bp-themes/bpmember/footer.php +11 -0
  202. bp-themes/bpmember/friends/friends-loop.php +42 -0
  203. bp-themes/bpmember/friends/index.php +23 -0
  204. bp-themes/bpmember/friends/requests.php +46 -0
  205. bp-themes/bpmember/functions.php +21 -0
  206. bp-themes/bpmember/groups/admin/delete-group.php +34 -0
  207. bp-themes/bpmember/groups/admin/edit-details.php +45 -0
  208. bp-themes/bpmember/groups/admin/group-avatar.php +36 -0
  209. bp-themes/bpmember/groups/admin/group-settings.php +90 -0
  210. bp-themes/bpmember/groups/admin/manage-members.php +76 -0
  211. bp-themes/bpmember/groups/admin/membership-requests.php +51 -0
  212. bp-themes/bpmember/groups/create.php +17 -0
  213. bp-themes/bpmember/groups/forum/index.php +100 -0
  214. bp-themes/bpmember/groups/forum/topic.php +92 -0
  215. bp-themes/bpmember/groups/group-home.php +77 -0
  216. bp-themes/bpmember/groups/group-loop.php +45 -0
  217. bp-themes/bpmember/groups/group-menu.php +21 -0
  218. bp-themes/bpmember/groups/index.php +24 -0
  219. bp-themes/bpmember/groups/leave-group-confirm.php +38 -0
  220. bp-themes/bpmember/groups/list-invites.php +51 -0
  221. bp-themes/bpmember/groups/list-members.php +84 -0
  222. bp-themes/bpmember/groups/request-membership.php +46 -0
  223. bp-themes/bpmember/groups/send-invite.php +39 -0
  224. bp-themes/bpmember/groups/wire.php +37 -0
  225. bp-themes/bpmember/header.php +64 -0
  226. bp-themes/bpmember/images/accept_button.gif +0 -0
  227. bp-themes/bpmember/images/activity_bullet.gif +0 -0
  228. bp-themes/bpmember/images/add_friend_button.gif +0 -0
  229. bp-themes/bpmember/images/add_friend_icon.gif +0 -0
  230. bp-themes/bpmember/images/arrowback_icon.gif +0 -0
  231. bp-themes/bpmember/images/background.gif +0 -0
  232. bp-themes/bpmember/images/background_blog.gif +0 -0
  233. bp-themes/bpmember/images/blog_bullet.gif +0 -0
  234. bp-themes/bpmember/images/blogadmin_icon.gif +0 -0
  235. bp-themes/bpmember/images/button_back.gif +0 -0
  236. bp-themes/bpmember/images/comments_icon.gif +0 -0
  237. bp-themes/bpmember/images/content_back.gif +0 -0
  238. bp-themes/bpmember/images/content_header.gif +0 -0
  239. bp-themes/bpmember/images/cross_bullet.gif +0 -0
  240. bp-themes/bpmember/images/error_back.gif +0 -0
  241. bp-themes/bpmember/images/error_icon.gif +0 -0
  242. bp-themes/bpmember/images/forum_bullet.gif +0 -0
  243. bp-themes/bpmember/images/friends_bullet.gif +0 -0
  244. bp-themes/bpmember/images/group_header.gif +0 -0
  245. bp-themes/bpmember/images/groups_bullet.gif +0 -0
  246. bp-themes/bpmember/images/info_icon.gif +0 -0
  247. bp-themes/bpmember/images/invite_bullet.gif +0 -0
  248. bp-themes/bpmember/images/leftcol_header_back.gif +0 -0
  249. bp-themes/bpmember/images/leftmenu_group_header.gif +0 -0
  250. bp-themes/bpmember/images/logo.gif +0 -0
  251. bp-themes/bpmember/images/logout_bullet.gif +0 -0
  252. bp-themes/bpmember/images/message_thread_back.gif +0 -0
  253. bp-themes/bpmember/images/message_thread_unread_back.gif +0 -0
  254. bp-themes/bpmember/images/messages_bullet.gif +0 -0
  255. bp-themes/bpmember/images/navitem_selected_back.gif +0 -0
  256. bp-themes/bpmember/images/notice_back.gif +0 -0
  257. bp-themes/bpmember/images/optionnavitem_selected_back.gif +0 -0
  258. bp-themes/bpmember/images/optionsbar_header_arrow.gif +0 -0
  259. bp-themes/bpmember/images/optionsbar_header_noarrow.gif +0 -0
  260. bp-themes/bpmember/images/profile_bullet.gif +0 -0
  261. bp-themes/bpmember/images/quotes_background.gif +0 -0
  262. bp-themes/bpmember/images/reject_button.gif +0 -0
  263. bp-themes/bpmember/images/remove_friend_button.gif +0 -0
  264. bp-themes/bpmember/images/request_bullet.gif +0 -0
  265. bp-themes/bpmember/images/requested_friend_button.gif +0 -0
  266. bp-themes/bpmember/images/rightcol_header_back.gif +0 -0
  267. bp-themes/bpmember/images/rss.png +0 -0
  268. bp-themes/bpmember/images/settings_bullet.gif +0 -0
  269. bp-themes/bpmember/images/sidebar_header.gif +0 -0
  270. bp-themes/bpmember/images/tag_icon.gif +0 -0
  271. bp-themes/bpmember/images/topoption_selected_back.gif +0 -0
  272. bp-themes/bpmember/images/updated_back.gif +0 -0
  273. bp-themes/bpmember/images/updated_icon.gif +0 -0
  274. bp-themes/bpmember/images/userbar_header.gif +0 -0
  275. bp-themes/bpmember/images/userbar_selected_arrow.gif +0 -0
  276. bp-themes/bpmember/images/view_button_side.gif +0 -0
  277. bp-themes/bpmember/images/wire_bullet.gif +0 -0
  278. bp-themes/bpmember/index.php +5 -0
  279. bp-themes/bpmember/messages/compose.php +51 -0
  280. bp-themes/bpmember/messages/index.php +57 -0
  281. bp-themes/bpmember/messages/notices.php +49 -0
  282. bp-themes/bpmember/messages/sentbox.php +50 -0
  283. bp-themes/bpmember/messages/view.php +13 -0
  284. bp-themes/bpmember/optionsbar.php +40 -0
  285. bp-themes/bpmember/plugin-template.php +13 -0
  286. bp-themes/bpmember/profile/change-avatar.php +15 -0
  287. bp-themes/bpmember/profile/edit.php +19 -0
  288. bp-themes/bpmember/profile/index.php +82 -0
  289. bp-themes/bpmember/profile/profile-header.php +7 -0
  290. bp-themes/bpmember/profile/profile-loop.php +41 -0
  291. bp-themes/bpmember/screenshot.png +0 -0
  292. bp-themes/bpmember/style.css +10 -0
  293. bp-themes/bpmember/userbar.php +48 -0
  294. bp-themes/bpmember/wire/latest.php +36 -0
  295. bp-themes/bpmember/wire/post-form.php +27 -0
  296. bp-themes/bpmember/wire/post-list.php +46 -0
  297. bp-themes/bpskeletonmember/404.php +20 -0
  298. bp-themes/bpskeletonmember/README.txt +51 -0
  299. bp-themes/bpskeletonmember/activity/activity-list.php +36 -0
  300. bp-themes/bpskeletonmember/activity/just-me.php +54 -0
  301. bp-themes/bpskeletonmember/activity/my-friends.php +49 -0
  302. bp-themes/bpskeletonmember/blogs/create.php +35 -0
  303. bp-themes/bpskeletonmember/blogs/my-blogs.php +47 -0
  304. bp-themes/bpskeletonmember/blogs/recent-comments.php +52 -0
  305. bp-themes/bpskeletonmember/blogs/recent-posts.php +51 -0
  306. bp-themes/bpskeletonmember/css/activity.css +11 -0
  307. bp-themes/bpskeletonmember/css/base.css +104 -0
  308. bp-themes/bpskeletonmember/css/blogs.css +20 -0
  309. bp-themes/bpskeletonmember/css/directories.css +13 -0
  310. bp-themes/bpskeletonmember/css/friends.css +16 -0
  311. bp-themes/bpskeletonmember/css/groups.css +126 -0
  312. bp-themes/bpskeletonmember/css/messages.css +42 -0
  313. bp-themes/bpskeletonmember/css/profile.css +21 -0
  314. bp-themes/bpskeletonmember/css/wire.css +15 -0
  315. bp-themes/bpskeletonmember/directories/blogs/blogs-loop.php +62 -0
  316. bp-themes/bpskeletonmember/directories/blogs/index.php +120 -0
  317. bp-themes/bpskeletonmember/directories/groups/groups-loop.php +62 -0
  318. bp-themes/bpskeletonmember/directories/groups/index.php +127 -0
  319. bp-themes/bpskeletonmember/directories/members/index.php +119 -0
  320. bp-themes/bpskeletonmember/directories/members/members-loop.php +56 -0
  321. bp-themes/bpskeletonmember/footer.php +18 -0
  322. bp-themes/bpskeletonmember/friends/friends-loop.php +48 -0
  323. bp-themes/bpskeletonmember/friends/index.php +36 -0
  324. bp-themes/bpskeletonmember/friends/requests.php +58 -0
  325. bp-themes/bpskeletonmember/functions.php +31 -0
  326. bp-themes/bpskeletonmember/groups/admin/delete-group.php +45 -0
  327. bp-themes/bpskeletonmember/groups/admin/edit-details.php +58 -0
  328. bp-themes/bpskeletonmember/groups/admin/group-avatar.php +47 -0
  329. bp-themes/bpskeletonmember/groups/admin/group-settings.php +109 -0
  330. bp-themes/bpskeletonmember/groups/admin/manage-members.php +99 -0
  331. bp-themes/bpskeletonmember/groups/admin/membership-requests.php +64 -0
  332. bp-themes/bpskeletonmember/groups/create.php +30 -0
  333. bp-themes/bpskeletonmember/groups/forum/index.php +111 -0
  334. bp-themes/bpskeletonmember/groups/forum/topic.php +101 -0
  335. bp-themes/bpskeletonmember/groups/group-home.php +94 -0
  336. bp-themes/bpskeletonmember/groups/group-loop.php +61 -0
  337. bp-themes/bpskeletonmember/groups/group-menu.php +40 -0
  338. bp-themes/bpskeletonmember/groups/index.php +37 -0
  339. bp-themes/bpskeletonmember/groups/leave-group-confirm.php +43 -0
  340. bp-themes/bpskeletonmember/groups/list-invites.php +60 -0
  341. bp-themes/bpskeletonmember/groups/list-members.php +101 -0
  342. bp-themes/bpskeletonmember/groups/request-membership.php +57 -0
  343. bp-themes/bpskeletonmember/groups/send-invite.php +45 -0
  344. bp-themes/bpskeletonmember/groups/wire.php +46 -0
  345. bp-themes/bpskeletonmember/header.php +68 -0
  346. bp-themes/bpskeletonmember/index.php +5 -0
  347. bp-themes/bpskeletonmember/license.txt +281 -0
  348. bp-themes/bpskeletonmember/messages/compose.php +64 -0
  349. bp-themes/bpskeletonmember/messages/index.php +77 -0
  350. bp-themes/bpskeletonmember/messages/notices.php +61 -0
  351. bp-themes/bpskeletonmember/messages/sentbox.php +69 -0
  352. bp-themes/bpskeletonmember/messages/view.php +21 -0
  353. bp-themes/bpskeletonmember/optionsbar.php +34 -0
  354. bp-themes/bpskeletonmember/plugin-template.php +22 -0
  355. bp-themes/bpskeletonmember/profile/change-avatar.php +21 -0
  356. bp-themes/bpskeletonmember/profile/edit.php +36 -0
  357. bp-themes/bpskeletonmember/profile/index.php +88 -0
  358. bp-themes/bpskeletonmember/profile/profile-header.php +14 -0
  359. bp-themes/bpskeletonmember/profile/profile-loop.php +61 -0
  360. bp-themes/bpskeletonmember/profile/profile-menu.php +29 -0
  361. bp-themes/bpskeletonmember/screenshot.png +0 -0
  362. bp-themes/bpskeletonmember/style.css +26 -0
  363. bp-themes/bpskeletonmember/userbar.php +63 -0
  364. bp-themes/bpskeletonmember/wire/latest.php +32 -0
  365. bp-themes/bpskeletonmember/wire/post-form.php +42 -0
  366. bp-themes/bpskeletonmember/wire/post-list.php +61 -0
  367. bp-themes/readme.txt +32 -0
  368. bp-wire.php +152 -0
  369. bp-wire/bp-wire-ajax.php +49 -0
  370. bp-wire/bp-wire-classes.php +119 -0
  371. bp-wire/bp-wire-cssjs.php +10 -0
  372. bp-wire/bp-wire-filters.php +19 -0
  373. bp-wire/bp-wire-templatetags.php +400 -0
  374. bp-wire/css/structure.css +34 -0
  375. bp-wire/images/ajax-loader.gif +0 -0
  376. bp-xprofile.php +975 -0
  377. bp-xprofile/bp-xprofile-admin.php +257 -0
  378. bp-xprofile/bp-xprofile-ajax.php +11 -0
  379. bp-xprofile/bp-xprofile-classes.php +1204 -0
  380. bp-xprofile/bp-xprofile-cssjs.php +55 -0
  381. bp-xprofile/bp-xprofile-filters.php +89 -0
  382. bp-xprofile/bp-xprofile-notifications.php +59 -0
  383. bp-xprofile/bp-xprofile-signup.php +362 -0
  384. bp-xprofile/bp-xprofile-templatetags.php +384 -0
  385. bp-xprofile/css/admin.css +85 -0
  386. bp-xprofile/css/signup.css +0 -0
  387. bp-xprofile/css/structure.css +77 -0
  388. bp-xprofile/images/cross.gif +0 -0
  389. bp-xprofile/images/nav_bullet.gif +0 -0
  390. bp-xprofile/images/none-thumbnail.gif +0 -0
  391. bp-xprofile/images/none.gif +0 -0
  392. bp-xprofile/images/tick.gif +0 -0
  393. bp-xprofile/js/admin.js +137 -0
  394. bp-xprofile/js/general.js +0 -0
  395. bp-xprofile/prebuilt-fields/countries.csv +255 -0
  396. bp-xprofile/prebuilt-fields/languages.csv +156 -0
  397. bp-xprofile/prebuilt-fields/states.csv +68 -0
  398. favicon.ico +0 -0
  399. license.txt +280 -0
  400. readme.txt +60 -0
bp-activity.php ADDED
@@ -0,0 +1,307 @@
1
+ <?php
2
+
3
+ define ( 'BP_ACTIVITY_VERSION', '1.0' );
4
+ define ( 'BP_ACTIVITY_DB_VERSION', '1300' );
5
+
6
+ /* Define the slug for the component */
7
+ if ( !defined( 'BP_ACTIVITY_SLUG' ) )
8
+ define ( 'BP_ACTIVITY_SLUG', 'activity' );
9
+
10
+ /* How long before activity items in streams are re-cached? */
11
+ if ( !defined( 'BP_ACTIVITY_CACHE_LENGTH' ) )
12
+ define ( 'BP_ACTIVITY_CACHE_LENGTH', '6 HOURS' );
13
+
14
+ require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-classes.php' );
15
+ require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-templatetags.php' );
16
+ require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-widgets.php' );
17
+ require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-cssjs.php' );
18
+ require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-filters.php' );
19
+
20
+
21
+ /**************************************************************************
22
+ bp_bp_activity_install()
23
+
24
+ Sets up the component ready for use on a site installation.
25
+ **************************************************************************/
26
+
27
+ function bp_activity_install() {
28
+ global $wpdb, $bp;
29
+
30
+ if ( !empty($wpdb->charset) )
31
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
32
+
33
+ $sql[] = "CREATE TABLE {$bp->activity->table_name_user_activity} (
34
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
35
+ user_id bigint(20) NOT NULL,
36
+ component_name varchar(75) NOT NULL,
37
+ component_action varchar(75) NOT NULL,
38
+ item_id bigint(20) NOT NULL,
39
+ secondary_item_id bigint(20) NOT NULL,
40
+ date_recorded datetime NOT NULL,
41
+ is_private tinyint(1) NOT NULL DEFAULT 0,
42
+ no_sitewide_cache tinyint(1) NOT NULL DEFAULT 0,
43
+ KEY item_id (item_id),
44
+ KEY user_id (user_id),
45
+ KEY is_private (is_private),
46
+ KEY component_name (component_name)
47
+ ) {$charset_collate};";
48
+
49
+ $sql[] = "CREATE TABLE {$bp->activity->table_name_user_activity_cached} (
50
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
51
+ user_id bigint(20) NOT NULL,
52
+ component_name varchar(75) NOT NULL,
53
+ component_action varchar(75) NOT NULL,
54
+ content longtext NOT NULL,
55
+ primary_link varchar(150) NOT NULL,
56
+ item_id bigint(20) NOT NULL,
57
+ secondary_item_id bigint(20) NOT NULL,
58
+ date_cached datetime NOT NULL,
59
+ date_recorded datetime NOT NULL,
60
+ is_private tinyint(1) NOT NULL DEFAULT 0,
61
+ KEY date_cached (date_cached),
62
+ KEY date_recorded (date_recorded),
63
+ KEY is_private (is_private),
64
+ KEY user_id (user_id),
65
+ KEY item_id (item_id),
66
+ KEY component_name (component_name)
67
+ ) {$charset_collate};";
68
+
69
+ $sql[] = "CREATE TABLE {$bp->activity->table_name_sitewide} (
70
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
71
+ user_id bigint(20) NOT NULL,
72
+ item_id bigint(20) NOT NULL,
73
+ secondary_item_id bigint(20),
74
+ content longtext NOT NULL,
75
+ primary_link varchar(150) NOT NULL,
76
+ component_name varchar(75) NOT NULL,
77
+ component_action varchar(75) NOT NULL,
78
+ date_cached datetime NOT NULL,
79
+ date_recorded datetime NOT NULL,
80
+ KEY date_cached (date_cached),
81
+ KEY date_recorded (date_recorded),
82
+ KEY user_id (user_id),
83
+ KEY item_id (item_id),
84
+ KEY component_name (component_name)
85
+ ) {$charset_collate};";
86
+
87
+ require_once( ABSPATH . 'wp-admin/upgrade-functions.php' );
88
+ dbDelta($sql);
89
+
90
+ if ( '' == get_site_option( 'bp-activity-db-merge' ) || !get_site_option( 'bp-activity-db-merge' ) ) {
91
+ $users = $wpdb->get_col( "SELECT ID FROM " . CUSTOM_USER_TABLE );
92
+
93
+ foreach ( $users as $user_id ) {
94
+ BP_Activity_Activity::convert_tables_for_user( $user_id );
95
+ BP_Activity_Activity::kill_tables_for_user( $user_id );
96
+ }
97
+
98
+ add_site_option( 'bp-activity-db-merge', 1 );
99
+ }
100
+
101
+ update_site_option( 'bp-activity-db-version', BP_ACTIVITY_DB_VERSION );
102
+ }
103
+
104
+ /**************************************************************************
105
+ bp_activity_setup_globals()
106
+
107
+ Set up and add all global variables for this component, and add them to
108
+ the $bp global variable array.
109
+ **************************************************************************/
110
+
111
+ function bp_activity_setup_globals() {
112
+ global $bp, $wpdb, $current_blog;
113
+
114
+ $bp->activity->table_name_user_activity = $wpdb->base_prefix . 'bp_activity_user_activity';
115
+ $bp->activity->table_name_user_activity_cached = $wpdb->base_prefix . 'bp_activity_user_activity_cached';
116
+ $bp->activity->table_name_sitewide = $wpdb->base_prefix . 'bp_activity_sitewide';
117
+
118
+ $bp->activity->image_base = BP_PLUGIN_URL . '/bp-activity/images';
119
+ $bp->activity->slug = BP_ACTIVITY_SLUG;
120
+
121
+ $bp->version_numbers->activity = BP_ACTIVITY_VERSION;
122
+
123
+ if ( is_site_admin() && get_site_option( 'bp-activity-db-version' ) < BP_ACTIVITY_DB_VERSION )
124
+ bp_activity_install();
125
+ }
126
+ add_action( 'plugins_loaded', 'bp_activity_setup_globals', 5 );
127
+ add_action( 'admin_menu', 'bp_activity_setup_globals', 1 );
128
+
129
+ function bp_activity_setup_root_component() {
130
+ /* Register 'groups' as a root component */
131
+ bp_core_add_root_component( BP_ACTIVITY_SLUG );
132
+ }
133
+ add_action( 'plugins_loaded', 'bp_activity_setup_root_component', 1 );
134
+
135
+
136
+ /**************************************************************************
137
+ bp_activity_setup_nav()
138
+
139
+ Set up front end navigation.
140
+ **************************************************************************/
141
+
142
+ function bp_activity_setup_nav() {
143
+ global $bp;
144
+
145
+ /* Add 'Activity' to the main navigation */
146
+ bp_core_add_nav_item( __('Activity', 'buddypress'), $bp->activity->slug );
147
+ bp_core_add_nav_default( $bp->activity->slug, 'bp_activity_screen_my_activity', 'just-me' );
148
+
149
+ $activity_link = $bp->loggedin_user->domain . $bp->activity->slug . '/';
150
+
151
+ /* Add the subnav items to the activity nav item */
152
+ bp_core_add_subnav_item( $bp->activity->slug, 'just-me', __('Just Me', 'buddypress'), $activity_link, 'bp_activity_screen_my_activity' );
153
+ bp_core_add_subnav_item( $bp->activity->slug, 'my-friends', __('My Friends', 'buddypress'), $activity_link, 'bp_activity_screen_friends_activity', 'activity-my-friends', bp_is_home() );
154
+
155
+ if ( $bp->current_component == $bp->activity->slug ) {
156
+ if ( bp_is_home() ) {
157
+ $bp->bp_options_title = __( 'My Activity', 'buddypress' );
158
+ } else {
159
+ $bp->bp_options_avatar = bp_core_get_avatar( $bp->displayed_user->id, 1 );
160
+ $bp->bp_options_title = $bp->displayed_user->fullname;
161
+ }
162
+ }
163
+ }
164
+ add_action( 'wp', 'bp_activity_setup_nav', 2 );
165
+ add_action( 'admin_menu', 'bp_activity_setup_nav', 2 );
166
+
167
+ /***** Screens **********/
168
+
169
+ function bp_activity_screen_my_activity() {
170
+ do_action( 'bp_activity_screen_my_activity' );
171
+ bp_core_load_template( apply_filters( 'bp_activity_template_my_activity', 'activity/just-me' ) );
172
+ }
173
+
174
+ function bp_activity_screen_friends_activity() {
175
+ do_action( 'bp_activity_screen_friends_activity' );
176
+ bp_core_load_template( apply_filters( 'bp_activity_template_friends_activity', 'activity/my-friends' ) );
177
+ }
178
+
179
+ /***** Actions **********/
180
+
181
+ function bp_activity_record( $item_id, $component_name, $component_action, $is_private, $secondary_item_id = false, $user_id = false, $secondary_user_id = false, $recorded_time = false ) {
182
+ global $bp, $wpdb;
183
+
184
+ if ( !$user_id )
185
+ $user_id = $bp->loggedin_user->id;
186
+
187
+ if ( !$recorded_time )
188
+ $recorded_time = time();
189
+
190
+ $activity = new BP_Activity_Activity;
191
+ $activity->item_id = $item_id;
192
+ $activity->secondary_item_id = $secondary_item_id;
193
+ $activity->user_id = $user_id;
194
+ $activity->component_name = $component_name;
195
+ $activity->component_action = $component_action;
196
+ $activity->date_recorded = $recorded_time;
197
+ $activity->is_private = $is_private;
198
+
199
+ $loggedin_user_save = $activity->save();
200
+
201
+ /* Save an activity entry for both logged in and secondary user. For example for a new friend connection
202
+ you would want to show "X and Y are now friends" on both users activity stream */
203
+ if ( $secondary_user_id ) {
204
+ $activity = new BP_Activity_Activity;
205
+ $activity->item_id = $item_id;
206
+ $activity->user_id = $secondary_user_id;
207
+ $activity->component_name = $component_name;
208
+ $activity->component_action = $component_action;
209
+ $activity->date_recorded = $recorded_time;
210
+ $activity->is_private = $is_private;
211
+
212
+ // We don't want to record this on the sitewide stream, otherwise we will get duplicates.
213
+ $activity->no_sitewide_cache = true;
214
+
215
+ $secondary_user_save = $activity->save();
216
+ }
217
+
218
+ do_action( 'bp_activity_record', $item_id, $component_name, $component_action, $is_private, $secondary_item_id, $user_id, $secondary_user_id );
219
+
220
+ return true;
221
+ }
222
+
223
+ function bp_activity_action_sitewide_feed() {
224
+ global $bp, $wp_query;
225
+
226
+ if ( $bp->current_component != $bp->activity->slug || $bp->current_action != 'feed' || $bp->displayed_user->id )
227
+ return false;
228
+
229
+ $wp_query->is_404 = false;
230
+ status_header( 200 );
231
+
232
+ include_once( 'bp-activity/feeds/bp-activity-sitewide-feed.php' );
233
+ die;
234
+ }
235
+ add_action( 'wp', 'bp_activity_action_sitewide_feed', 3 );
236
+
237
+ function bp_activity_action_personal_feed() {
238
+ global $bp, $wp_query;
239
+
240
+ if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'feed' )
241
+ return false;
242
+
243
+ $wp_query->is_404 = false;
244
+ status_header( 200 );
245
+
246
+ include_once( 'bp-activity/feeds/bp-activity-personal-feed.php' );
247
+ die;
248
+ }
249
+ add_action( 'wp', 'bp_activity_action_personal_feed', 3 );
250
+
251
+ function bp_activity_action_friends_feed() {
252
+ global $bp, $wp_query;
253
+
254
+ if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'my-friends' || $bp->action_variables[0] != 'feed' )
255
+ return false;
256
+
257
+ $wp_query->is_404 = false;
258
+ status_header( 200 );
259
+
260
+ include_once( 'bp-activity/feeds/bp-activity-friends-feed.php' );
261
+ die;
262
+ }
263
+ add_action( 'wp', 'bp_activity_action_friends_feed', 3 );
264
+
265
+ function bp_activity_get_last_updated() {
266
+ return BP_Activity_Activity::get_last_updated();
267
+ }
268
+
269
+ function bp_activity_get_sitewide_activity( $max_items = 30, $pag_num = false, $pag_page = false ) {
270
+ return BP_Activity_Activity::get_sitewide_activity( $max_items, $pag_num, $pag_page );
271
+ }
272
+
273
+ function bp_activity_get_user_activity( $user_id, $max_items = 30, $since = '-4 weeks', $pag_num = false, $pag_page = false ) {
274
+ return BP_Activity_Activity::get_activity_for_user( $user_id, $max_items, $since, $pag_num, $pag_page );
275
+ }
276
+
277
+ function bp_activity_get_friends_activity( $user_id, $max_items = 30, $since = '-4 weeks', $max_items_per_friend = false, $pag_num = false, $pag_page = false ) {
278
+ return BP_Activity_Activity::get_activity_for_friends( $user_id, $max_items, $since, $max_items_per_friend, $pag_num, $pag_page );
279
+ }
280
+
281
+ function bp_activity_delete( $item_id, $component_name, $component_action, $user_id, $secondary_item_id ) {
282
+ if ( !BP_Activity_Activity::delete( $item_id, $component_name, $component_action, $user_id, $secondary_item_id ) )
283
+ return false;
284
+
285
+ do_action( 'bp_activity_delete', $item_id, $component_name, $component_action, $user_id, $secondary_item_id );
286
+
287
+ return true;
288
+ }
289
+
290
+ function bp_activity_order_by_date( $a, $b ) {
291
+ return strcasecmp( $b['date_recorded'], $a['date_recorded'] );
292
+ }
293
+
294
+ function bp_activity_remove_data( $user_id ) {
295
+ // Clear the user's activity from the sitewide stream and clear their activity tables
296
+ BP_Activity_Activity::delete_activity_for_user( $user_id );
297
+
298
+ // Remove the deleted users activity tables
299
+ BP_Activity_Activity::kill_tables_for_user( $user_id );
300
+
301
+ do_action( 'bp_activity_remove_data', $user_id );
302
+ }
303
+ add_action( 'wpmu_delete_user', 'bp_activity_remove_data' );
304
+ add_action( 'delete_user', 'bp_activity_remove_data' );
305
+
306
+
307
+ ?>
bp-activity/bp-activity-classes.php ADDED
@@ -0,0 +1,332 @@
1
+ <?php
2
+
3
+ Class BP_Activity_Activity {
4
+ var $id;
5
+ var $item_id;
6
+ var $secondary_item_id;
7
+ var $user_id;
8
+ var $primary_link;
9
+ var $component_name;
10
+ var $component_action;
11
+ var $date_recorded;
12
+ var $is_private = false;
13
+ var $no_sitewide_cache = false;
14
+
15
+ var $table_name;
16
+ var $table_name_cached;
17
+ var $for_secondary_user = false;
18
+
19
+ function bp_activity_activity( $id = null, $populate = true ) {
20
+ global $bp;
21
+
22
+ if ( $id ) {
23
+ $this->id = $id;
24
+
25
+ if ( $populate )
26
+ $this->populate();
27
+ }
28
+ }
29
+
30
+ function populate() {
31
+ global $wpdb, $bp;
32
+
33
+ $activity = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$this->table_name} WHERE id = %d", $this->id ) );
34
+
35
+ $this->item_id = $activity->item_id;
36
+ $this->secondary_item_id = $activity->secondary_item_id;
37
+ $this->user_id = $activity->user_id;
38
+ $this->component_name = $activity->component_name;
39
+ $this->component_action = $activity->component_action;
40
+ $this->date_recorded = $activity->date_recorded;
41
+ $this->is_private = $activity->is_private;
42
+ $this->no_sitewide_cache = $activity->no_sitewide_cache;
43
+ }
44
+
45
+ function save() {
46
+ global $wpdb, $bp, $current_user;
47
+
48
+ do_action( 'bp_activity_before_save', $this );
49
+
50
+ if ( !$this->item_id || !$this->user_id || $this->is_private || !$this->component_name )
51
+ return false;
52
+
53
+ // Set the table names
54
+ $this->table_name = $bp->activity->table_name_user_activity;
55
+ $this->table_name_cached = $bp->activity->table_name_user_activity_cached;
56
+
57
+ if ( !$this->exists() ) {
58
+ // Insert the new activity into the activity table.
59
+ $activity = $wpdb->query( $wpdb->prepare( "INSERT INTO {$this->table_name} ( item_id, secondary_item_id, user_id, component_name, component_action, date_recorded, is_private, no_sitewide_cache ) VALUES ( %d, %d, %d, %s, %s, FROM_UNIXTIME(%d), %d, %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_recorded, $this->is_private, $this->no_sitewide_cache ) );
60
+
61
+ // Fetch the formatted activity content so we can add it to the cache.
62
+ if ( function_exists( $bp->{$this->component_name}->format_activity_function ) ) {
63
+ if ( !$activity_content = call_user_func( $bp->{$this->component_name}->format_activity_function, $this->item_id, $this->user_id, $this->component_action, $this->secondary_item_id, $this->for_secondary_user ) )
64
+ return false;
65
+ }
66
+
67
+ // Add the cached version of the activity to the cached activity table.
68
+ $activity_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO {$this->table_name_cached} ( user_id, item_id, secondary_item_id, content, primary_link, component_name, component_action, date_cached, date_recorded, is_private ) VALUES ( %d, %d, %d, %s, %s, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d), %d )", $this->user_id, $this->item_id, $this->secondary_item_id, $activity_content['content'], $activity_content['primary_link'], $this->component_name, $this->component_action, time(), $this->date_recorded, $this->is_private ) );
69
+
70
+ // Add the cached version of the activity to the sitewide activity table.
71
+ if ( !$this->no_sitewide_cache )
72
+ $sitewide_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->activity->table_name_sitewide} ( user_id, item_id, secondary_item_id, content, primary_link, component_name, component_action, date_cached, date_recorded ) VALUES ( %d, %d, %d, %s, %s, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d) )", $this->user_id, $this->item_id, $this->secondary_item_id, $activity_content['content'], $activity_content['primary_link'], $this->component_name, $this->component_action, time(), $this->date_recorded ) );
73
+
74
+ if ( $activity && $activity_cached ) {
75
+ do_action( 'bp_activity_after_save', $this );
76
+ return true;
77
+ }
78
+
79
+ return false;
80
+ }
81
+ }
82
+
83
+ function exists() {
84
+ global $wpdb, $bp;
85
+ return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$this->table_name} WHERE item_id = %d AND secondary_item_id = %d AND user_id = %d AND component_name = %s AND component_action = %s", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action ) );
86
+ }
87
+
88
+ /* Static Functions */
89
+
90
+ function delete( $item_id, $component_name, $component_action, $user_id, $secondary_item_id = false ) {
91
+ global $wpdb, $bp;
92
+
93
+ if ( !$user_id )
94
+ return false;
95
+
96
+ if ( !$bp->activity )
97
+ bp_activity_setup_globals();
98
+
99
+ if ( $secondary_item_id )
100
+ $secondary_sql = $wpdb->prepare( "AND secondary_item_id = %d", $secondary_item_id );
101
+
102
+ if ( $component_action ) {
103
+ $component_action_sql = $wpdb->prepare( "AND component_action = %s AND user_id = %d", $component_action, $user_id );
104
+ $cached_component_action_sql = $wpdb->prepare( "AND component_action = %s", $component_action );
105
+ }
106
+
107
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_user_activity} WHERE item_id = %d {$secondary_sql} AND component_name = %s {$component_action_sql}", $item_id, $component_name ) );
108
+
109
+ // Delete this entry from the user activity cache table and the sitewide cache table
110
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_user_activity_cached} WHERE user_id = %d AND item_id = %d {$secondary_sql} AND component_name = %s {$cached_component_action_sql}", $user_id, $item_id, $component_name ) );
111
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_sitewide} WHERE item_id = %d {$secondary_sql} AND component_name = %s {$component_action_sql}", $item_id, $component_name ) );
112
+
113
+ return true;
114
+ }
115
+
116
+ function get_activity_for_user( $user_id, $max_items, $since, $limit, $page ) {
117
+ global $wpdb, $bp;
118
+
119
+ $since = strtotime($since);
120
+
121
+ if ( $limit && $page )
122
+ $pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
123
+
124
+ if ( $max )
125
+ $max_sql = $wpdb->prepare( "LIMIT %d", $max );
126
+
127
+ if ( !bp_is_home() )
128
+ $privacy_sql = " AND is_private = 0";
129
+
130
+ if ( $limit && $page && $max )
131
+ $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name_user_activity_cached} WHERE user_id = %d AND date_recorded >= FROM_UNIXTIME(%d) $privacy_sql ORDER BY date_recorded DESC $pag_sql", $user_id, $since ) );
132
+ else
133
+ $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name_user_activity_cached} WHERE user_id = %d AND date_recorded >= FROM_UNIXTIME(%d) $privacy_sql ORDER BY date_recorded DESC $pag_sql $max_sql", $user_id, $since ) );
134
+
135
+ $total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->activity->table_name_user_activity_cached} WHERE user_id = %d AND date_recorded >= FROM_UNIXTIME(%d) $privacy_sql ORDER BY date_recorded DESC $max_sql", $user_id, $since ) );
136
+
137
+ for ( $i = 0; $i < count( $activities ); $i++ ) {
138
+ if ( !$activities[$i]->is_private ) {
139
+ $activities_formatted[$i]['content'] = $activities[$i]->content;
140
+ $activities_formatted[$i]['primary_link'] = $activities[$i]->primary_link;
141
+ $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded;
142
+ $activities_formatted[$i]['component_name'] = $activities[$i]->component_name;
143
+ $activities_formatted[$i]['component_action'] = $activities[$i]->component_action;
144
+ $activities_formatted[$i]['is_private'] = $activities[$i]->is_private;
145
+ }
146
+ }
147
+
148
+ return array( 'activities' => $activities_formatted, 'total' => (int)$total_activities );
149
+ }
150
+
151
+ function get_activity_for_friends( $user_id, $max_items, $since, $max_items_per_friend, $limit, $page ) {
152
+ global $wpdb, $bp;
153
+
154
+ // TODO: Max items per friend not yet implemented.
155
+
156
+ if ( !function_exists('friends_get_friend_user_ids') )
157
+ return false;
158
+
159
+ if ( $limit && $page )
160
+ $pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
161
+
162
+ if ( $max )
163
+ $max_sql = $wpdb->prepare( "LIMIT %d", $max );
164
+
165
+ $since = strtotime($since);
166
+
167
+ $friend_ids = friends_get_friend_user_ids( $user_id );
168
+
169
+ if ( !$friend_ids )
170
+ return false;
171
+
172
+ $friend_ids = implode( ',', $friend_ids );
173
+
174
+ if ( $limit && $page && $max )
175
+ $activities = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT user_id, content, primary_link, date_recorded, component_name, component_action FROM {$bp->activity->table_name_sitewide} WHERE user_id IN ({$friend_ids}) AND date_recorded >= FROM_UNIXTIME(%d) ORDER BY date_recorded DESC $pag_sql", $since ) );
176
+ else
177
+ $activities = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT user_id, content, primary_link, date_recorded, component_name, component_action FROM {$bp->activity->table_name_sitewide} WHERE user_id IN ({$friend_ids}) AND date_recorded >= FROM_UNIXTIME(%d) ORDER BY date_recorded DESC $pag_sql $max_sql", $since ) );
178
+
179
+ $total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(user_id) FROM {$bp->activity->table_name_sitewide} WHERE user_id IN ({$friend_ids}) AND date_recorded >= FROM_UNIXTIME(%d) ORDER BY date_recorded DESC $max_sql", $since ) );
180
+
181
+ return array( 'activities' => $activities, 'total' => (int)$total_activities );
182
+ }
183
+
184
+ function get_sitewide_activity( $max, $limit, $page ) {
185
+ global $wpdb, $bp;
186
+
187
+ if ( $limit && $page )
188
+ $pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
189
+
190
+ if ( $max )
191
+ $max_sql = $wpdb->prepare( "LIMIT %d", $max );
192
+
193
+ /* Remove entries that are older than 6 months */
194
+ $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->activity->table_name_sitewide . " WHERE DATE_ADD(date_recorded, INTERVAL 6 MONTH) <= NOW()" ) );
195
+
196
+ if ( $limit && $page && $max )
197
+ $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name_sitewide} ORDER BY date_recorded DESC $pag_sql" ) );
198
+ else
199
+ $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name_sitewide} ORDER BY date_recorded DESC $pag_sql $max_sql" ) );
200
+
201
+ $total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->activity->table_name_sitewide} ORDER BY date_recorded DESC $max_sql" ) );
202
+
203
+ for ( $i = 0; $i < count( $activities ); $i++ ) {
204
+ $activities_formatted[$i]['content'] = $activities[$i]->content;
205
+ $activities_formatted[$i]['primary_link'] = $activities[$i]->primary_link;
206
+ $activities_formatted[$i]['date_recorded'] = $activities[$i]->date_recorded;
207
+ $activities_formatted[$i]['component_name'] = $activities[$i]->component_name;
208
+ $activities_formatted[$i]['component_action'] = $activities[$i]->component_action;
209
+ }
210
+
211
+ return array( 'activities' => $activities_formatted, 'total' => (int)$total_activities );
212
+ }
213
+
214
+ function get_sitewide_items_for_feed( $limit = 35 ) {
215
+ global $wpdb, $bp;
216
+
217
+ $activities = bp_activity_get_sitewide_activity( $limit );
218
+ for ( $i = 0; $i < count($activities); $i++ ) {
219
+ $title = explode( '<span', $activities[$i]['content'] );
220
+
221
+ $activity_feed[$i]['title'] = trim( strip_tags( $title[0] ) );
222
+ $activity_feed[$i]['link'] = $activities[$i]['primary_link'];
223
+ $activity_feed[$i]['description'] = @sprintf( $activities[$i]['content'], '' );
224
+ $activity_feed[$i]['pubdate'] = $activities[$i]['date_recorded'];
225
+ }
226
+
227
+ return $activity_feed;
228
+ }
229
+
230
+ function cache_friends_activities( $activity_array ) {
231
+ global $wpdb, $bp;
232
+
233
+ /* Empty the cache */
234
+ $wpdb->query( "TRUNCATE TABLE {$bp->activity->table_name_loggedin_user_friends_cached}" );
235
+
236
+ for ( $i = 0; $i < count($activity_array); $i++ ) {
237
+ // Cache that sucka...
238
+ $cached = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->activity->table_name_loggedin_user_friends_cached} ( user_id, content, primary_link, component_name, component_action, date_cached, date_recorded ) VALUES ( %d, %s, %s, %s, %s, FROM_UNIXTIME(%d), %s )", $activity_array[$i]['user_id'], $activity_array[$i]['content'], $activity_array[$i]['primary_link'], $activity_array[$i]['component_name'], $activity_array[$i]['component_action'], time(), $activity_array[$i]['date_recorded'] ) );
239
+ }
240
+
241
+ update_usermeta( $bp->loggedin_user->id, 'bp_activity_friends_last_cached', time() );
242
+ }
243
+
244
+ function cache_activities( $activity_array, $user_id ) {
245
+ global $wpdb, $bp;
246
+
247
+ /* Delete cached items older than 30 days for the user */
248
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_user_activity_cached} WHERE user_id = %d AND DATE_ADD(date_recorded, INTERVAL 30 DAY) <= NOW()", $user_id ) );
249
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_sitewide} WHERE user_id = %d AND DATE_ADD(date_recorded, INTERVAL 30 DAY) <= NOW()", $user_id ) );
250
+
251
+ for ( $i = 0; $i < count($activity_array); $i++ ) {
252
+ if ( empty( $activity_array[$i]['content'] ) ) continue;
253
+
254
+ // Cache that sucka...
255
+ $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->activity->table_name_user_activity_cached} ( user_id, content, item_id, secondary_item_id, primary_link, component_name, component_action, date_cached, date_recorded, is_private ) VALUES ( %d, %s, %d, %d, %s, %s, %s, FROM_UNIXTIME(%d), %s, %d )", $user_id, $activity_array[$i]['content'], $activity_array[$i]['item_id'], $activity_array[$i]['secondary_item_id'], $activity_array[$i]['primary_link'], $activity_array[$i]['component_name'], $activity_array[$i]['component_action'], time(), $activity_array[$i]['date_recorded'], $activity_array[$i]['is_private'] ) );
256
+
257
+ // Add to the sitewide activity stream
258
+ if ( !$activity_array[$i]['is_private'] && !$activity_array[$i]['no_sitewide_cache'] )
259
+ $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->activity->table_name_sitewide} ( user_id, content, item_id, secondary_item_id, primary_link, component_name, component_action, date_cached, date_recorded ) VALUES ( %d, %s, %d, %d, %s, %s, %s, FROM_UNIXTIME(%d), %s )", $user_id, $activity_array[$i]['content'], $activity_array[$i]['item_id'], $activity_array[$i]['secondary_item_id'], $activity_array[$i]['primary_link'], $activity_array[$i]['component_name'], $activity_array[$i]['component_action'], time(), $activity_array[$i]['date_recorded'] ) );
260
+ }
261
+
262
+ update_usermeta( $bp->displayed_user->id, 'bp_activity_last_cached', time() );
263
+ }
264
+
265
+ function delete_activity_for_user( $user_id ) {
266
+ global $wpdb, $bp;
267
+
268
+ /* Empty user's activities from the sitewide stream */
269
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_sitewide} WHERE user_id = %d", $user_id ) );
270
+
271
+ /* Empty the user's activity items and cached activity items */
272
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_user_activity} WHERE user_id = %d", $user_id ) );
273
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_user_activity_cached} WHERE user_id = %d", $user_id ) );
274
+
275
+ return true;
276
+ }
277
+
278
+ function get_last_updated() {
279
+ global $bp, $wpdb;
280
+
281
+ return $wpdb->get_var( $wpdb->prepare( "SELECT date_recorded FROM " . $bp->activity->table_name_sitewide . " ORDER BY date_recorded ASC LIMIT 1" ) );
282
+ }
283
+
284
+ function kill_tables_for_user( $user_id ) {
285
+ global $bp, $wpdb;
286
+
287
+ if ( !$wpdb->get_var( "SHOW TABLES LIKE 'wp_user_{$user_id}_activity'" ) )
288
+ return false;
289
+
290
+ $wpdb->query( $wpdb->prepare( "DROP TABLE wp_user_{$user_id}_activity" ) );
291
+ $wpdb->query( $wpdb->prepare( "DROP TABLE wp_user_{$user_id}_activity_cached" ) );
292
+ $wpdb->query( $wpdb->prepare( "DROP TABLE wp_user_{$user_id}_friends_activity_cached" ) );
293
+
294
+ return true;
295
+ }
296
+
297
+ function convert_tables_for_user( $user_id ) {
298
+ global $bp, $wpdb;
299
+
300
+ if ( !$wpdb->get_var( "SHOW TABLES LIKE 'wp_user_{$user_id}_activity'" ) )
301
+ return false;
302
+
303
+ $activity_items = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM wp_user_{$user_id}_activity" ) );
304
+ $activity_cached_items = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM wp_user_{$user_id}_activity_cached" ) );
305
+
306
+ if ( $activity_items ) {
307
+ foreach ( $activity_items as $activity_item ) {
308
+ $wpdb->query( $wpdb->prepare(
309
+ "INSERT INTO {$bp->activity->table_name_user_activity}
310
+ ( item_id, secondary_item_id, user_id, component_name, component_action, date_recorded, is_private, no_sitewide_cache )
311
+ VALUES
312
+ ( %d, %d, %d, %s, %s, %s, %d, %d )",
313
+ $activity_item->item_id, $activity_item->secondary_item_id, $user_id, $activity_item->component_name, $activity_item->component_action, $activity_item->date_recorded, $activity_item->is_private, $activity_item->no_sitewide_cache
314
+ ) );
315
+ }
316
+ }
317
+
318
+ if ( $activity_cached_items ) {
319
+ foreach ( $activity_cached_items as $activity_cached_item ) {
320
+ $wpdb->query( $wpdb->prepare(
321
+ "INSERT INTO {$bp->activity->table_name_user_activity_cached}
322
+ ( content, primary_link, item_id, secondary_item_id, user_id, component_name, component_action, date_recorded, date_cached, is_private )
323
+ VALUES
324
+ ( %s, %s, %d, %d, %d, %s, %s, %s, %s, %d )",
325
+ $activity_cached_item->content, $activity_cached_item->primary_link, $activity_cached_item->item_id, $activity_cached_item->secondary_item_id, $user_id, $activity_cached_item->component_name, $activity_cached_item->component_action, $activity_cached_item->date_recorded, $activity_cached_item->date_cached, $activity_cached_item->is_private
326
+ ) );
327
+ }
328
+ }
329
+ }
330
+ }
331
+
332
+ ?>
bp-activity/bp-activity-cssjs.php ADDED
@@ -0,0 +1,10 @@
1
+ <?php
2
+
3
+ function bp_activity_add_structure_css() {
4
+ /* Enqueue the structure CSS file to give basic positional formatting for components */
5
+ wp_enqueue_style( 'bp-activity-structure', BP_PLUGIN_URL . '/bp-activity/css/structure.css' );
6
+ }
7
+ add_action( 'bp_styles', 'bp_activity_add_structure_css' );
8
+
9
+
10
+ ?>
bp-activity/bp-activity-filters.php ADDED
@@ -0,0 +1,16 @@
1
+ <?php
2
+
3
+ /* Apply WordPress defined filters */
4
+ add_filter( 'bp_get_activity_content', 'wptexturize' );
5
+
6
+ add_filter( 'bp_get_activity_content', 'convert_smilies' );
7
+
8
+ add_filter( 'bp_get_activity_content', 'convert_chars' );
9
+
10
+ add_filter( 'bp_get_activity_content', 'wpautop' );
11
+
12
+ add_filter( 'bp_get_activity_content', 'stripslashes_deep' );
13
+
14
+ add_filter( 'bp_get_activity_content', 'make_clickable' );
15
+
16
+ ?>
bp-activity/bp-activity-templatetags.php ADDED
@@ -0,0 +1,347 @@
1
+ <?php
2
+
3
+ class BP_Activity_Template {
4
+ var $current_activity = -1;
5
+ var $activity_count;
6
+ var $total_activity_count;
7
+ var $activities;
8
+ var $activity;
9
+ var $activity_type;
10
+
11
+ var $in_the_loop;
12
+
13
+ var $pag_page;
14
+ var $pag_num;
15
+ var $pag_links;
16
+
17
+ var $full_name;
18
+
19
+ function bp_activity_template( $type, $user_id, $per_page, $max, $timeframe ) {
20
+ global $bp;
21
+
22
+ $this->pag_page = isset( $_REQUEST['acpage'] ) ? intval( $_REQUEST['acpage'] ) : 1;
23
+ $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
24
+ $this->filter_content = false;
25
+ $this->activity_type = $type;
26
+
27
+ if ( $type == 'sitewide' )
28
+ $this->activities = bp_activity_get_sitewide_activity( $max, $this->pag_num, $this->pag_page );
29
+
30
+ if ( $type == 'personal' )
31
+ $this->activities = bp_activity_get_user_activity( $user_id, $timeframe, $this->page_num, $this->pag_page );
32
+
33
+ if ( $type == 'friends' && ( bp_is_home() || is_site_admin() || $bp->loggedin_user->id == $user_id ) )
34
+ $this->activities = bp_activity_get_friends_activity( $user_id, $timeframe, $this->pag_num, $this->pag_page );
35
+
36
+ if ( !$max )
37
+ $this->total_activity_count = (int)$this->activities['total'];
38
+ else
39
+ $this->total_activity_count = (int)$max;
40
+
41
+ $this->activities = $this->activities['activities'];
42
+
43
+ if ( $max ) {
44
+ if ( $max >= count($this->activities) )
45
+ $this->activity_count = count($this->activities);
46
+ else
47
+ $this->activity_count = (int)$max;
48
+ } else {
49
+ $this->activity_count = count($this->activities);
50
+ }
51
+
52
+ $this->full_name = $bp->displayed_user->fullname;
53
+
54
+ $this->pag_links = paginate_links( array(
55
+ 'base' => add_query_arg( 'acpage', '%#%' ),
56
+ 'format' => '',
57
+ 'total' => ceil( (int)$this->total_activity_count / (int)$this->pag_num ),
58
+ 'current' => (int)$this->pag_page,
59
+ 'prev_text' => '&laquo;',
60
+ 'next_text' => '&raquo;',
61
+ 'mid_size' => 1
62
+ ));
63
+ }
64
+
65
+ function has_activities() {
66
+ if ( $this->activity_count )
67
+ return true;
68
+
69
+ return false;
70
+ }
71
+
72
+ function next_activity() {
73
+ $this->current_activity++;
74
+ $this->activity = $this->activities[$this->current_activity];
75
+
76
+ return $this->activity;
77
+ }
78
+
79
+ function rewind_activities() {
80
+ $this->current_activity = -1;
81
+ if ( $this->activity_count > 0 ) {
82
+ $this->activity = $this->activities[0];
83
+ }
84
+ }
85
+
86
+ function user_activities() {
87
+ if ( $this->current_activity + 1 < $this->activity_count ) {
88
+ return true;
89
+ } elseif ( $this->current_activity + 1 == $this->activity_count ) {
90
+ do_action('loop_end');
91
+ // Do some cleaning up after the loop
92
+ $this->rewind_activities();
93
+ }
94
+
95
+ $this->in_the_loop = false;
96
+ return false;
97
+ }
98
+
99
+ function the_activity() {
100
+ global $activity;
101
+
102
+ $this->in_the_loop = true;
103
+ $this->activity = $this->next_activity();
104
+
105
+ if ( is_array( $this->activity ) )
106
+ $this->activity = (object) $this->activity;
107
+
108
+ if ( $this->current_activity == 0 ) // loop has just started
109
+ do_action('loop_start');
110
+ }
111
+ }
112
+
113
+ function bp_activity_get_list( $user_id, $title, $no_activity, $limit = false ) {
114
+ global $bp_activity_user_id, $bp_activity_limit, $bp_activity_title, $bp_activity_no_activity;
115
+
116
+ $bp_activity_user_id = $user_id;
117
+ $bp_activity_limit = $limit;
118
+ $bp_activity_title = $title;
119
+ $bp_activity_no_activity = $no_activity;
120
+
121
+ load_template( TEMPLATEPATH . '/activity/activity-list.php' );
122
+ }
123
+
124
+ function bp_has_activities( $args = '' ) {
125
+ global $bp, $activities_template, $bp_activity_user_id, $bp_activity_limit;
126
+
127
+ $defaults = array(
128
+ 'type' => 'sitewide',
129
+ 'user_id' => false,
130
+ 'per_page' => 25,
131
+ 'max' => false,
132
+ 'timeframe' => '-4 weeks'
133
+ );
134
+
135
+ $r = wp_parse_args( $args, $defaults );
136
+ extract( $r, EXTR_SKIP );
137
+
138
+ // The following lines are for backwards template compatibility.
139
+ if ( 'my-friends' == $bp->current_action && $bp->activity->slug == $bp->current_component )
140
+ $type = 'friends';
141
+
142
+ if ( $bp->displayed_user->id && $bp->activity->slug == $bp->current_component && ( !$bp->current_action || 'just-me' == $bp->current_action ) )
143
+ $type = 'personal';
144
+
145
+ if ( $bp->displayed_user->id && $bp->profile->slug == $bp->current_component )
146
+ $type = 'personal';
147
+
148
+ if ( $bp_activity_limit )
149
+ $max = $bp_activity_limit;
150
+
151
+ // END backwards compatibility ---
152
+
153
+ if ( ( 'personal' == $type || 'friends' == $type ) && !$user_id )
154
+ $user_id = (int)$bp->displayed_user->id;
155
+
156
+ if ( $max ) {
157
+ if ( $per_page > $max )
158
+ $per_page = $max;
159
+ }
160
+
161
+ $activities_template = new BP_Activity_Template( $type, $user_id, $per_page, $max, $timeframe );
162
+ return $activities_template->has_activities();
163
+ }
164
+
165
+ function bp_activities() {
166
+ global $activities_template;
167
+ return $activities_template->user_activities();
168
+ }
169
+
170
+ function bp_the_activity() {
171
+ global $activities_template;
172
+ return $activities_template->the_activity();
173
+ }
174
+
175
+ function bp_activity_pagination_count() {
176
+ global $bp, $activities_template;
177
+
178
+ $from_num = intval( ( $activities_template->pag_page - 1 ) * $activities_template->pag_num ) + 1;
179
+ $to_num = ( $from_num + ( $activities_template->pag_num - 1 ) > $activities_template->total_activity_count ) ? $activities_template->total_activity_count : $from_num + ( $activities_template->pag_num - 1) ;
180
+
181
+ echo sprintf( __( 'Viewing item %d to %d (of %d items)', 'buddypress' ), $from_num, $to_num, $activities_template->total_activity_count ); ?> &nbsp;
182
+ <img id="ajax-loader-activity" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php
183
+ }
184
+
185
+ function bp_activity_pagination_links() {
186
+ echo bp_get_activity_pagination_links();
187
+ }
188
+ function bp_get_activity_pagination_links() {
189
+ global $activities_template;
190
+
191
+ return apply_filters( 'bp_get_activity_pagination_links', $activities_template->pag_links );
192
+ }
193
+
194
+ function bp_activities_title() {
195
+ global $bp_activity_title;
196
+
197
+ echo bp_get_activities_title();
198
+ }
199
+ function bp_get_activities_title() {
200
+ global $bp_activity_title;
201
+
202
+ return apply_filters( 'bp_get_activities_title', $bp_activity_title );
203
+ }
204
+
205
+ function bp_activities_no_activity() {
206
+ global $bp_activity_no_activity;
207
+
208
+ echo bp_get_activities_no_activity();
209
+ }
210
+ function bp_get_activities_no_activity() {
211
+ global $bp_activity_no_activity;
212
+
213
+ return apply_filters( 'bp_get_activities_no_activity', $bp_activity_no_activity );
214
+ }
215
+
216
+ function bp_activity_content() {
217
+ global $activities_template;
218
+
219
+ echo bp_get_activity_content();
220
+ }
221
+ function bp_get_activity_content() {
222
+ global $activities_template;
223
+
224
+ if ( bp_is_home() && $activities_template->activity_type == 'personal' ) {
225
+ return apply_filters( 'bp_get_activity_content', bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name ) );
226
+ } else {
227
+ $activities_template->activity->content = bp_activity_insert_time_since( $activities_template->activity->content, $activities_template->activity->date_recorded );
228
+ return apply_filters( 'bp_get_activity_content', $activities_template->activity->content );
229
+ }
230
+ }
231
+
232
+ function bp_activity_content_filter( $content, $date_recorded, $full_name, $insert_time = true, $filter_words = true, $filter_you = true ) {
233
+ if ( !$content )
234
+ return false;
235
+
236
+ /* Split the content so we don't evaluate and replace text on content we don't want to */
237
+ $content = explode( '%s', $content );
238
+
239
+ /* Re-add the exploded %s */
240
+ $content[0] .= '%s';
241
+
242
+ /* Insert the time since */
243
+ if ( $insert_time )
244
+ $content[0] = bp_activity_insert_time_since( $content[0], $date_recorded );
245
+
246
+ // The "You" and "Your" conversion is only done in english, if a translation file is present
247
+ // then do not translate as it causes problems in other languages.
248
+ if ( '' == get_locale() ) {
249
+ /* Switch 'their/your' depending on whether the user is logged in or not and viewing their profile */
250
+ if ( $filter_words ) {
251
+ $content[0] = preg_replace( '/their\s/', 'your ', $content[0] );
252
+ }
253
+
254
+ /* Remove the 'You' and replace if with the persons name */
255
+ if ( $filter_you && $full_name != '' ) {
256
+ $content[0] = preg_replace( "/{$full_name}[<]/", 'You<', $content[0] );
257
+ }
258
+ }
259
+
260
+ $content_new = '';
261
+
262
+ for ( $i = 0; $i < count($content); $i++ )
263
+ $content_new .= $content[$i];
264
+
265
+ return apply_filters( 'bp_activity_content_filter', $content_new );
266
+ }
267
+
268
+ function bp_activity_insert_time_since( $content, $date ) {
269
+ if ( !$content || !$date )
270
+ return false;
271
+
272
+ // Make sure we don't have any URL encoding in links when trying to insert the time.
273
+ $content = urldecode($content);
274
+
275
+ return apply_filters( 'bp_activity_insert_time_since', @sprintf( $content, @sprintf( __( '&nbsp; %s ago', 'buddypress' ), bp_core_time_since( strtotime( $date ) ) ) ) );
276
+ }
277
+
278
+ function bp_activity_css_class() {
279
+ echo bp_get_activity_css_class();
280
+ }
281
+ function bp_get_activity_css_class() {
282
+ global $activities_template;
283
+
284
+ return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component_name );
285
+ }
286
+
287
+ function bp_sitewide_activity_feed_link() {
288
+ echo bp_get_sitewide_activity_feed_link();
289
+ }
290
+ function bp_get_sitewide_activity_feed_link() {
291
+ global $bp;
292
+
293
+ return apply_filters( 'bp_get_sitewide_activity_feed_link', site_url() . '/' . $bp->activity->slug . '/feed' );
294
+ }
295
+
296
+ function bp_activities_member_rss_link() {
297
+ echo bp_get_activities_member_rss_link();
298
+ }
299
+ function bp_get_activities_member_rss_link() {
300
+ global $bp;
301
+
302
+ if ( ( $bp->current_component == $bp->profile->slug ) || 'just-me' == $bp->current_action )
303
+ return apply_filters( 'bp_get_activities_member_rss_link', $bp->displayed_user->domain . $bp->activity->slug . '/feed' );
304
+ else
305
+ return apply_filters( 'bp_get_activities_member_rss_link', $bp->displayed_user->domain . $bp->activity->slug . '/my-friends/feed' );
306
+ }
307
+
308
+ /* Template tags for RSS feed output */
309
+
310
+ function bp_activity_feed_item_title() {
311
+ echo bp_get_activity_feed_item_title();
312
+ }
313
+ function bp_get_activity_feed_item_title() {
314
+ global $activities_template;
315
+
316
+ $title = explode( '<span', $activities_template->activity->content );
317
+ return apply_filters( 'bp_get_activity_feed_item_title', trim( strip_tags( html_entity_decode( $title[0] ) ) ) );
318
+ }
319
+
320
+ function bp_activity_feed_item_link() {
321
+ echo bp_get_activity_feed_item_link();
322
+ }
323
+ function bp_get_activity_feed_item_link() {
324
+ global $activities_template;
325
+
326
+ return apply_filters( 'bp_get_activity_feed_item_link', $activities_template->activity->primary_link );
327
+ }
328
+
329
+ function bp_activity_feed_item_date() {
330
+ echo bp_get_activity_feed_item_date();
331
+ }
332
+ function bp_get_activity_feed_item_date() {
333
+ global $activities_template;
334
+
335
+ return apply_filters( 'bp_get_activity_feed_item_date', $activities_template->activity->date_recorded );
336
+ }
337
+
338
+ function bp_activity_feed_item_description() {
339
+ echo bp_get_activity_feed_item_description();
340
+ }
341
+ function bp_get_activity_feed_item_description() {
342
+ global $activities_template;
343
+
344
+ return apply_filters( 'bp_get_activity_feed_item_description', html_entity_decode( str_replace( '%s', '', $activities_template->activity->content ), ENT_COMPAT, 'UTF-8' ) );
345
+ }
346
+
347
+ ?>
bp-activity/bp-activity-widgets.php ADDED
@@ -0,0 +1,84 @@
1
+ <?php
2
+
3
+ /* Register widgets for blogs component */
4
+ function bp_activity_register_widgets() {
5
+ global $current_blog;
6
+
7
+ /* Site Wide Activity Widget */
8
+ wp_register_sidebar_widget( 'buddypress-activity', __('Site Wide Activity', 'buddypress'), 'bp_activity_widget_sitewide_activity');
9
+ wp_register_widget_control( 'buddypress-activity', __('Site Wide Activity', 'buddypress'), 'bp_activity_widget_sitewide_activity_control' );
10
+
11
+ if ( is_active_widget( 'bp_activity_widget_sitewide_activity' ) ) {
12
+ wp_enqueue_style( 'bp-activity-widget-activity-css', BP_PLUGIN_URL . '/bp-activity/css/widget-activity.css' );
13
+ }
14
+ }
15
+ add_action( 'plugins_loaded', 'bp_activity_register_widgets' );
16
+
17
+
18
+ function bp_activity_widget_sitewide_activity($args) {
19
+ global $bp, $current_blog;
20
+
21
+ extract($args);
22
+ $options = get_blog_option( $current_blog->blog_id, 'bp_activity_widget_sitewide_activity' );
23
+ ?>
24
+ <?php echo $before_widget; ?>
25
+ <?php echo $before_title
26
+ . $widget_name
27
+ . $after_title; ?>
28
+
29
+ <?php
30
+ if ( empty( $options['max_items'] ) ) {
31
+ $options['max_items'] = 20;
32
+ }
33
+ ?>
34
+
35
+ <?php
36
+ if ( !$activity = wp_cache_get( 'sitewide_activity', 'bp' ) ) {
37
+ $activity = bp_activity_get_sitewide_activity( $options['max_items'] );
38
+ wp_cache_set( 'sitewide_activity', $activity, 'bp' );
39
+ }
40
+ ?>
41
+
42
+ <?php if ( $activity['activities'] ) : ?>
43
+ <div class="item-options" id="activity-list-options">
44
+ <img src="<?php echo $bp->activity->image_base; ?>/rss.png" alt="<?php _e( 'RSS Feed', 'buddypress' ) ?>" /> <a href="<?php bp_sitewide_activity_feed_link() ?>" title="<?php _e( 'Site Wide Activity RSS Feed', 'buddypress' ) ?>"><?php _e( 'RSS Feed', 'buddypress' ) ?></a>
45
+ </div>
46
+ <ul id="site-wide-stream" class="activity-list">
47
+ <?php foreach( $activity['activities'] as $item ) : ?>
48
+ <li class="<?php echo $item['component_name'] ?>">
49
+ <?php echo apply_filters( 'bp_activity_content', bp_activity_content_filter( $item['content'], $item['date_recorded'], '', true, false, true ) ); ?>
50
+ </li>
51
+ <?php endforeach; ?>
52
+ </ul>
53
+ <?php else: ?>
54
+ <div class="widget-error">
55
+ <?php _e('There has been no recent site activity.', 'buddypress') ?>
56
+ </div>
57
+ <?php endif; ?>
58
+
59
+ <?php echo $after_widget; ?>
60
+ <?php
61
+ }
62
+
63
+ function bp_activity_widget_sitewide_activity_control() {
64
+ global $current_blog;
65
+
66
+ $options = $newoptions = get_blog_option( $current_blog->blog_id, 'bp_activity_widget_sitewide_activity');
67
+
68
+ if ( $_POST['bp-activity-widget-sitewide-submit'] ) {
69
+ $newoptions['max_items'] = strip_tags( stripslashes( $_POST['bp-activity-widget-sitewide-items-max'] ) );
70
+ }
71
+
72
+ if ( $options != $newoptions ) {
73
+ $options = $newoptions;
74
+ update_blog_option( $current_blog->blog_id, 'bp_activity_widget_sitewide_activity', $options );
75
+ }
76
+
77
+ $max_items = attribute_escape( $options['max_items'] );
78
+ ?>
79
+ <p><label for="bp-activity-widget-sitewide-items-max"><?php _e('Max Number of Items:', 'buddypress'); ?> <input class="widefat" id="bp-activity-widget-sitewide-items-max" name="bp-activity-widget-sitewide-items-max" type="text" value="<?php echo $max_items; ?>" style="width: 30%" /></label></p>
80
+ <input type="hidden" id="bp-activity-widget-sitewide-submit" name="bp-activity-widget-sitewide-submit" value="1" />
81
+ <?php
82
+ }
83
+
84
+ ?>
bp-activity/css/structure.css ADDED
@@ -0,0 +1,15 @@
1
+ /*
2
+ Basic layout structure styles for BuddyPress Activity Streams. Formats BuddyPress activity pages within any WordPress theme.
3
+ No colors, fonts or pretty stuff.
4
+
5
+ These structure styles can be overridden by the theme CSS file if needed.
6
+ */
7
+
8
+ #activity-list li {
9
+ margin: 15px 0;
10
+ }
11
+
12
+ #activity-list li blockquote {
13
+ padding: 7px 15px 7px 40px;
14
+ margin: 5px 0;
15
+ }
bp-activity/css/widget-activity.css ADDED
@@ -0,0 +1,9 @@
1
+ .bp_activity_widget_sitewide_activity span.time-since {
2
+ font-size: 11px;
3
+ }
4
+
5
+ .bp_activity_widget_sitewide_activity ul#site-wide-stream {
6
+ margin: 0;
7
+ padding: 0;
8
+ list-style: none;
9
+ }
bp-activity/feeds/bp-activity-friends-feed.php ADDED
@@ -0,0 +1,44 @@
1
+ <?php
2
+ /**
3
+ * RSS2 Feed Template for displaying the site wide activity stream.
4
+ *
5
+ * @package BuddyPress
6
+ */
7
+ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
8
+ header('Status: 200 OK');
9
+ ?>
10
+ <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
11
+
12
+ <rss version="2.0"
13
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
14
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
15
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
16
+ xmlns:atom="http://www.w3.org/2005/Atom"
17
+ <?php do_action('bp_activity_friends_feed'); ?>
18
+ >
19
+
20
+ <channel>
21
+ <title><?php echo $bp->displayed_user->fullname; ?> - <?php _e( 'Friends Activity', 'buddypress' ) ?></title>
22
+ <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
23
+ <link><?php echo $bp->displayed_user->domain . $bp->activity->slug . '/my-friends/feed' ?></link>
24
+ <description><?php printf( __( '%s - Friends Activity Feed', 'buddypress' ), $bp->displayed_user->fullname ) ?></description>
25
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_activity_get_last_updated(), false); ?></pubDate>
26
+ <generator>http://buddypress.org/?bp-activity-version=<?php echo BP_ACTIVITY_VERSION ?></generator>
27
+ <language><?php echo get_option('rss_language'); ?></language>
28
+ <?php do_action('bp_activity_friends_feed_head'); ?>
29
+
30
+ <?php if ( bp_has_activities( 'type=friends&max=50' ) ) : ?>
31
+ <?php while ( bp_activities() ) : bp_the_activity(); ?>
32
+ <item>
33
+ <title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
34
+ <link><?php echo bp_activity_feed_item_link() ?></link>
35
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_activity_feed_item_date(), false); ?></pubDate>
36
+
37
+ <description><![CDATA[<?php bp_activity_feed_item_description() ?>]]></description>
38
+ <?php do_action('bp_activity_personal_feed_item'); ?>
39
+ </item>
40
+ <?php endwhile; ?>
41
+
42
+ <?php endif; ?>
43
+ </channel>
44
+ </rss>
bp-activity/feeds/bp-activity-personal-feed.php ADDED
@@ -0,0 +1,44 @@
1
+ <?php
2
+ /**
3
+ * RSS2 Feed Template for displaying the site wide activity stream.
4
+ *
5
+ * @package BuddyPress
6
+ */
7
+ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
8
+ header('Status: 200 OK');
9
+ ?>
10
+ <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
11
+
12
+ <rss version="2.0"
13
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
14
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
15
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
16
+ xmlns:atom="http://www.w3.org/2005/Atom"
17
+ <?php do_action('bp_activity_personal_feed'); ?>
18
+ >
19
+
20
+ <channel>
21
+ <title><?php echo $bp->displayed_user->fullname; ?> - <?php _e( 'Activity', 'buddypress' ) ?></title>
22
+ <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
23
+ <link><?php echo $bp->displayed_user->domain . $bp->activity->slug . '/feed' ?></link>
24
+ <description><?php printf( __( '%s - Activity Feed', 'buddypress' ), $bp->displayed_user->fullname ) ?></description>
25
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_activity_get_last_updated(), false); ?></pubDate>
26
+ <generator>http://buddypress.org/?bp-activity-version=<?php echo BP_ACTIVITY_VERSION ?></generator>
27
+ <language><?php echo get_option('rss_language'); ?></language>
28
+ <?php do_action('bp_activity_personal_feed_head'); ?>
29
+
30
+ <?php if ( bp_has_activities( 'type=personal&max=50' ) ) : ?>
31
+ <?php while ( bp_activities() ) : bp_the_activity(); ?>
32
+ <item>
33
+ <title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
34
+ <link><?php echo bp_activity_feed_item_link() ?></link>
35
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_activity_feed_item_date(), false); ?></pubDate>
36
+
37
+ <description><![CDATA[<?php bp_activity_feed_item_description() ?>]]></description>
38
+ <?php do_action('bp_activity_personal_feed_item'); ?>
39
+ </item>
40
+ <?php endwhile; ?>
41
+
42
+ <?php endif; ?>
43
+ </channel>
44
+ </rss>
bp-activity/feeds/bp-activity-sitewide-feed.php ADDED
@@ -0,0 +1,45 @@
1
+ <?php
2
+ /**
3
+ * RSS2 Feed Template for displaying the site wide activity stream.
4
+ *
5
+ * @package BuddyPress
6
+ */
7
+
8
+ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
9
+ header('Status: 200 OK');
10
+ ?>
11
+ <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
12
+
13
+ <rss version="2.0"
14
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
15
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
16
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
17
+ xmlns:atom="http://www.w3.org/2005/Atom"
18
+ <?php do_action('bp_activity_sitewide_feed'); ?>
19
+ >
20
+
21
+ <channel>
22
+ <title><?php echo get_site_option( 'site_name' ); ?> - <?php _e( 'Site Wide Activity', 'buddypress' ) ?></title>
23
+ <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
24
+ <link><?php echo site_url() . '/' . $bp->activity->slug . '/feed' ?></link>
25
+ <description><?php _e( 'Site Wide Activity Feed', 'buddypress' ) ?></description>
26
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_activity_get_last_updated(), false); ?></pubDate>
27
+ <generator>http://buddypress.org/?bp-activity-version=<?php echo BP_ACTIVITY_VERSION ?></generator>
28
+ <language><?php echo get_option('rss_language'); ?></language>
29
+ <?php do_action('bp_activity_sitewide_feed_head'); ?>
30
+
31
+ <?php if ( bp_has_activities( 'type=sitewide&max=50' ) ) : ?>
32
+ <?php while ( bp_activities() ) : bp_the_activity(); ?>
33
+ <item>
34
+ <title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
35
+ <link><?php echo bp_activity_feed_item_link() ?></link>
36
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_activity_feed_item_date(), false); ?></pubDate>
37
+
38
+ <description><![CDATA[<?php bp_activity_feed_item_description() ?>]]></description>
39
+ <?php do_action('bp_activity_personal_feed_item'); ?>
40
+ </item>
41
+ <?php endwhile; ?>
42
+
43
+ <?php endif; ?>
44
+ </channel>
45
+ </rss>
bp-activity/images/rss.png ADDED
Binary file
bp-blogs.php ADDED
@@ -0,0 +1,862 @@