Search Results for 'custom activity page'
-
AuthorSearch Results
-
April 9, 2010 at 5:13 pm #72564
Chris Houghton
ParticipantHmm – strange. It mostly works. For some reason on some pages of the site something breaks:
One page would be /groups/GROUPNAME/admin/ – I get the following error:
Warning: Cannot modify header information – headers already sent by (output started at /home/smartauk/public_html/wp-content/plugins/bp-custom.php:3) in /home/smartauk/public_html/wp-includes/pluggable.php on line 868
Any idea what might be causing this?
Thanks
April 7, 2010 at 7:18 pm #722403sixty
ParticipantI’m at a convenient but vaguely unsatisfying stopping point in this saga.
I ended up nuking all the lovely AJAX buttons on the /activity page in favor of HTML form buttons like this one
<li style="float:left;" <?php if ($_POST["activity-tab"] == "friends") { echo 'class="selected"'; }?>">
<form action="" method="post">
<input name="activity-tab" value="friends" type="hidden" />
<input style="border:0px" type="submit" value="My Friends" />
</form>
</li>Then later include()ing a custom stream and resetting the $_POST value to empty:
...
<?php if( $_POST["activity-tab"] == "friends" ) { $_POST["activity-tab"] = ""; include( 'activity-loop-friends.php' ); } ?>
...The ideal solution here would be to somehow rewrite the cookie/display functions in global.js to “forget” the user’s last selected tab, but I was not smart enough to figure that one out…
April 7, 2010 at 1:57 am #72130In reply to: How do you show a member's total post count?
snark
ParticipantThanks @boonebgorges — I got it partially working, but then got stuck. I put the function as is above in my functions.php file, and added this to member-header.php:
<p><?php echo get_activity_count_by_user( bp_current_user_id() ) ?> Forum posts</p>
This returned ALL posts for a user, including blog posts. Obviously, based on the text I added above, I only want to include Forum posts (should include both Topics and Replies). I looked at the page you suggested — https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/ — but I couldn’t figure out how or where to implement the filter: what syntax, and where does it go, in the function or in the call-out?
Also: Using “bp_current_user_id() ” allows the post count to display on the user’s profile page, but how do I display the post count on a different page, such as /single/forum/topic.php, the Forum topics display page, where “bp_current_user_id()” is no longer applicable? On that page I’d like to put a user’s post count in parenthesis next to the user, like this: “John Doe (54 posts)”. That way when you scanned the list of Replies to a Topic, you would quickly see if a user was a long-term and/or hardcore user or a noob based on the number of posts they have contributed to the site, and I’m hoping that little ego boost will help nudge people into posting more frequently. Does that make sense?
Thanks again for all your help.
April 6, 2010 at 11:18 pm #72109In reply to: How do you show a member's total post count?
Boone Gorges
KeymasterSee if this does what you want. Put the following function in [your-theme]/functions.php or [plugin-dir]/bp-custom.php:
function get_activity_count_by_user( $user_id ) {
$args = array(
'per_page' => 10000,
'show_hidden' => true,
'user_id' => $user_id
);
if ( bp_has_activities( $args ) ) {
global $activities_template;
$count = $activities_template->total_activity_count;
} else {
$count = 0;
}
return $count;
}Then call the function somewhere in a template, something like this:
<?php echo get_activity_count_by_user( $user_id ) ?>
making sure that $user_id is populated with the user_id of the person you are querying about.
You could filter this in various ways. To get just one kind of content, or content from just one component of the site, try some of the filters here: https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/. To exclude things (like anything having to do with blogs) is a bit tricker; after calling the $activities_template global, loop through each member of $activities_template->activities and check to see whether it’s the kind of thing you want. If not, reduce $activities_template->total_activity_count by one.
April 6, 2010 at 8:48 pm #72079In reply to: Adding an Activity Stream into any page
rich! @ etiviti
Participantyou can pull in whatever from the activity stream loop and place it anywhere (surprised no one has created a “stream widget” )
https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/
April 5, 2010 at 8:01 pm #71863In reply to: exclude admin in activitystream
3sixty
ParticipantMy aforementioned Privacy Component will offer fine-grained filtering of any activity stream content–that is as long as the plugin developer made sure to register all the activity stream actions for their component. No need for fancy bp-custom.php functions, core hacks, and the like.
wow… nice!! Another great plugin to melt our heads.
April 5, 2010 at 8:01 am #71768In reply to: Editing Activity Stream Front Page
Mariusooms
ParticipantIt depends which page. You’ve got three instances or so, the directory activity page, the profile page and single group page.
To always show your slider above all instance you could stick it inside the post-form.php with the following do_action:
<?php do_action( 'bp_before_activity_post_form' ) ?>
Otherwise, for the directory activity you’ve got the following do_action:
<?php do_action( 'bp_before_directory_activity_content' ) ?>
Or for profile views and single group views you have:
<?php do_action( 'bp_before_member_activity_post_form' ) ?>
<?php do_action( 'bp_before_group_activity_post_form' ) ?>
That should give you all possible instances. Just code your slider in your bp-customs.php and use an add_action for your area of choice. Hope this helps.
April 3, 2010 at 6:37 pm #71608In reply to: How to Create a 2nd Sidebar
Hugo Ashmore
ParticipantIt’s no problem of any kind you can do what ever you wish within reason, how you layout the data is your concern really, I’ve approached it from both adding another simple locate_template() to mirror the existing primary sidebar call creating a new file to hold whatever required and by creating a new custom Page along with a new file with a three column layout with two flanking columns containing new widget aware sidebars and the fluid centre column containing the activity loop, that page is simply set as the static index page and posts page set to a new blank Page.
April 3, 2010 at 1:45 am #71536joescars
MemberI fixed it!! Woohoo!!! After much research I found similar issues with IIS 6 and the handling of redirects. I was lead to this page: http://ikailo.com/94/url-modrewrite-workaround-iis-60/ which has a fix for IIS6.. Well, with some tweaking and some magic I was able to come up with a fix for IIS7. it is as folows:
1. Create a new file called 404-handler.php and put the code found here: http://ikailo.com/94/url-modrewrite-workaround-iis-60/ in it.
2. You have to now configure your IIS7 installation (in my case IIS 7.5) to allow for custom redirects and to use this page for 404 errors. To do this you have to do the following:
a) Open up IIS configuration manager (separate install for iis 7, included with iis 7.5).
b) Browse to system.webServer/httpErrors
c) unlock defaultPath
d) unlock allowAbsolutePathsWhenDelegated
e) set allowAbsolutePathsWhenDelegated to TRUE
f) go to Error Pages
g) right click on 404 and click edit
h) select “Execute a url on this site” and set to /404-handler.php, hit ok
i) right click 404 and select Edit Feature Settings
j) set to custom error pages and path to /404-handler.php and path type to execute url
I then had to reset IIS and IT WORKS!!! Woohoo!! I hope this helps others!!
Joe
April 2, 2010 at 5:07 pm #71455In reply to: How to add items to the activity stream
3sixty
ParticipantJens, I think Rich is referring to this page, which has a link to download the BP skeleton component:
https://codex.buddypress.org/developer-docs/creating-a-custom-buddypress-component/
The “skeleton component” is (I think) designed to hook into the Activity Stream, so by looking at that code, you might find what you need?
April 2, 2010 at 5:20 am #71396In reply to: How to customize activity "Load More" button?
rogscorp
ParticipantIt’s not working. I’m supposed to change default.css right?
Do I have to delete some lines after adding that?
I keep wondering why
<?php if ( bp_get_activity_count() == bp_get_activity_per_page() ) : ?>
<li class=”load-more”>
<?php _e( ‘<img src=”something something’, ‘buddypress’ ) ?> <span class=”ajax-loader”></span>
<?php endif; ?>
doesn’t work. The images shows up but the link doesn’t work. Puzzling.
March 31, 2010 at 12:55 pm #71044David Lewis
ParticipantI leveraged the existing drop down method in BuddyPress and created the following code. Three files in my child theme. Modify for your needs.
- header.php
- _inc/css/custom.css
- _inc/scripts/nav.js
header.php
<div id="wp-nav-bar">
<ul id="nav" class="main-nav">
<!-- Community Drop Down -->
<li <?php if (
bp_is_page( BP_ACTIVITY_SLUG ) ||
bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ||
bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() ||
bp_is_page( BP_FORUMS_SLUG ) ||
bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo site_url() ?>/<?php echo BP_ACTIVITY_SLUG ?>/" title="<?php _e( 'Community', 'buddypress' ) ?>"><?php _e( 'Community', 'buddypress' ) ?></a>
<ul>
<?php if ( 'activity' != bp_dtheme_page_on_front() && bp_is_active( 'activity' ) ) : ?>
<li<?php if ( bp_is_page( BP_ACTIVITY_SLUG ) ) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo site_url() ?>/<?php echo BP_ACTIVITY_SLUG ?>/" title="<?php _e( 'Activity', 'buddypress' ) ?>"><?php _e( 'Activity', 'buddypress' ) ?></a>
</li>
<?php endif; ?>
<li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo site_url() ?>/<?php echo BP_MEMBERS_SLUG ?>/" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a>
</li>
<?php if ( bp_is_active( 'groups' ) ) : ?>
<li<?php if ( bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() ) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo site_url() ?>/<?php echo BP_GROUPS_SLUG ?>/" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a>
</li>
<?php if ( bp_is_active( 'forums' ) && bp_is_active( 'groups' ) && ( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) get_site_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() ) : ?>
<li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo site_url() ?>/<?php echo BP_FORUMS_SLUG ?>/" title="<?php _e( 'Forums', 'buddypress' ) ?>"><?php _e( 'Forums', 'buddypress' ) ?></a>
</li>
<?php endif; ?>
<?php endif; ?>
<?php if ( bp_is_active( 'blogs' ) && bp_core_is_multisite() ) : ?>
<li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo site_url() ?>/<?php echo BP_BLOGS_SLUG ?>/" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a>
</li>
<?php endif; ?>
</ul>
</li>
<?php do_action( 'bp_nav_items' ); ?>
</ul>
</div>custom.css
/* Subnav */
ul#nav li ul {width: 30.7%;}
ul#nav li ul li {float: none; width: 100%;}
ul#nav li ul li a {background: none !important; padding: 5px 15px;}
#wp-nav-bar ul li ul {position: absolute; left: -999em; z-index: 1;}
#wp-nav-bar ul li ul li a span {display: none;}
#wp-nav-bar ul li:hover ul,
#wp-nav-bar ul li li:hover ul,
#wp-nav-bar ul li.sfhover ul,
#wp-nav-bar ul li ul li.sfhover ul {left: auto;}nav.js
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes;
if (node.nodeName="LI") {
node.onmouseover=function() {
this.className+" sfhover";
}
node.onmouseout=function() {
this.className=this.className.replace(" sfhover", "");
}
}
}
}
}
window.onload=startList;
j(document).ready( function() {
/* Admin Bar Javascript */
j("#wp-nav-bar ul.main-nav li").mouseover( function() {
j(this).addClass('sfhover');
});
j("#wp-nav-bar ul.main-nav li").mouseout( function() {
j(this).removeClass('sfhover');
});
});March 30, 2010 at 8:41 pm #70904Hugo Ashmore
ParticipantRunning with a custom page used as a static front page complete with dynamic sidebars and posts page set to a blank page causes issues with missing admin bar and no sidebar. Setting front page to Activity stream and posts page left as the new blank page and issue is resolved. At the moment I can’t see where the problem lies especially as the site functions on a mirror version locally with custom front page.
March 30, 2010 at 6:18 am #707773sixty
ParticipantPlease don’t use my customization of Boone’s code above. It seems to be causing a failure of the Activity Stream, at least for me. Have not figured out why yet.
March 28, 2010 at 12:59 pm #70529rich! @ etiviti
ParticipantMarch 27, 2010 at 11:11 pm #70478In reply to: BuddyPress and Mystique theme
itsalltech1
ParticipantCreating a new page worked, but that only worked for the base of the page. Example: itsalltech.com/activity. However, if you go into a subpage of Activity, it will not work. How can I customize the CSS?
March 27, 2010 at 11:29 am #70388In reply to: BP mark as spammers acts wierd in 1.2.2.1
brianterry10
MemberI totally agree with this. It’s quite confusing. I think more than a rewording of the text is needed.
Perhaps you can give people a series of simple steps they should go through to complete setting up their membership?
Step 1: Activate your membership
You give them instructions to visit their email account then click on the activation link in the email.
When they click on the activation link they’re taken to the next step page…
Step 2: Customize your avatar
They do this then press the button to complete, then they’re taken to the final step…
Step 3: They’re then directed to the activity page, at the top of this page could be a message to tell them their account is now active and they can start posting.
This 3 step process gives people a clear path to follow taking them to the page where they can then see what’s going on and begin taking part.
Each step page is nice and simple.
What do you think?
March 26, 2010 at 1:15 am #70211In reply to: Search Activity
Nahum
ParticipantSomething like this? I got it to work this way in a custom page template but not in the activity index. any help…on getting it to work in the activity dir where its bp_ajax_querystring( ‘activity’ ) and some other differences like the filter select.
<?php
$searchterm = $_POST['searchterm'];
?>
<form NAME"form1" METHOD
"post" ACTION = "<?php bloginfo('url'); ?>/search">
<input TYPE = "TEXT" id="whats-new" Name="searchterm" value="" >
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Search Activity">
</form>
<?php if ( bp_has_activities('search_terms=' . $searchterm) ) : ?>March 24, 2010 at 11:14 am #69964In reply to: How to have a landing page for guests?
nado
MemberCan you please explain how to do this?
I’d like to have a custom landing homepage (preferably just a wordpress “page”) with general information for non-logged-in users… then if the user is logged-in the homepage defaults to the activity stream (and becomes the “Home” menu link). i.e. when logged-in the custom landing page is unaccessible.
March 22, 2010 at 3:16 am #696243sixty
ParticipantThank you! This is very powerful.
I customized it to exclude blog comments and forum comments:
if ( $activity->type == ‘new_blog_comment’ || $activity->type == ‘new_forum_post’) {
March 21, 2010 at 4:24 pm #69562In reply to: BP GroupBlog, P2 ready (with bugs)! Please review…
Bowe
ParticipantFirst note: AWESOMEMILICIOUS!
2nd note: Posting new blogposts works great! I can add new posts/photos and videos on the blog page and you get a nice growl like notification when you post something.. This is some serious next level stuff!
The magazine theme layout looks cool, but I feel it’s bit overwhelming for certain users. especially on lower resolutions I feels a bit crammed, with the 3 column recent posts, etc. But I think that’s something personal, and you already said that you’re working on different layouts. I’ve tried to view a different layout in my blog, but could not find the settings. But my suggestion for a third theme would be:
http://emberapp.com/bowromir/images/untitled-8/sizes/o
This is quite simple but powerful enough.. I don’t know if you can add custom text boxes/widgets, but I think that would allow user to be creative with their blog. I forgot to offer a search/archive widget, but that would be handy as well.
3rd note: To avoid confusion I would probably rename Status Update in the groupblog to something like News Update or Blog Update, so that it does not get mixed up with a status/activity update in BuddyPress. To be honest I think that the P2 status update does not add much to it, because a group admin can easily post a status update in the group itself. I understand it’s a added feature in the P2 theme, but I think BP handles it very well.. This is also something personal though
4th: Maybe allow the user to switch to a full markup mode or tiny editor to have more control over longer posts. You already mentioned bringing everything to the front end, but maybe you can solve this by opening a lightbox with the full featured posting of the WP backed (and then remove the navigation in the admin, so the users only sees the posting area). This might be complicated and/ore messy, but it would make for a better user experience.
I’m really really impressed with the current plugin so far and I can’t wait to try it on my site. Thanks so much for sharing this Marius and the rest of YWAM!
March 20, 2010 at 7:10 pm #694573sixty
ParticipantWhile this is an elegant hack, it just occurred to me that this is not optimal if you want to preserve an individual user’s ability to check blog comments in an activity stream. If I read the code correctly, it prevents blog comments from triggering an activity update in the database, so blog comments never get recorded as an activity.
If that’s true, then it would be preferable to still RECORD the activity, but simply not DISPLAY it in the activity loop. Unfortunately, from this codex tutorial, it seems like the “filter” options only allow you to SHOW one type of activity (rather than filtering OUT one type of activity):
https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/
March 19, 2010 at 8:04 am #69188Mariusooms
ParticipantThis is the code for pagination:
<div class="pagination">
<div class="pag-count"><?php bp_activity_pagination_count() ?></div>
<div class="pagination-links"><?php bp_activity_pagination_links() ?></div>
</div>It is already on that page, but it wrapped in
<noscript>
tags. Just remove those tags and should be good for the top of the page. Just repeat that code somewhere at the bottom, preferably just before the<?php else : ?>
statement.To remove to “load More” tab remove or uncomment the following code on that same template:
<?php if ( bp_get_activity_count() == bp_get_activity_per_page() ) : ?>
<li class="load-more">
<a href="#more"><?php _e( 'Load More', 'buddypress' ) ?></a> Â <span class="ajax-loader"></span>
</li>
<?php endif; ?>Also look at this codex page, it could be helpful to show you a number of things:
https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/
March 10, 2010 at 2:31 pm #67558In reply to: Getting theme to work (infocus)
kingfelix23
Memberah, I have discovered another thing I need to look into with that specific theme.
With infocus you can specify any page to use a specific sidebar which you can create and populate with specific widgets. I created a “buddypress” sidebar which I filled with some community related stuff as well as a login and some of the buttons from the menubar. However the pages I have made linked to buddypress. For instance the page that links to http://templeofthewayoflight.org/wp/activity/ ignores this setting and uses the default infocus sidebar.
I am using a “page links to” plugin for that page but I still think it should honor the settings and use the sidebar I have chosen in the backend for that page, I do think that that has worked with other custompage I have made.
March 9, 2010 at 12:10 pm #67367In reply to: Getting theme to work (infocus)
kingfelix23
MemberYesterday I discovered that if I use the links from the last page of bp template thingie:
Navigation Links
You may want to add new navigation tabs or links to your theme to link to BuddyPress directory pages. The default set of links are:
* Activity: http://templeofthewayoflight.org/wp/activity/
* Members: http://templeofthewayoflight.org/wp/members/
* Groups: http://templeofthewayoflight.org/wp/groups/
* Forums: http://templeofthewayoflight.org/wp/forums/
* Register: http://templeofthewayoflight.org/wp/register/ (registration must be enabled)
These do work and use my customized index.php from the folders in my theme file. I have no idea where the bar gets the urls and why it ignores my cutomisation.
I might not want to use the bar anyway, but even if I create a menu of my own I would like to be able to use the more specified links in the bar aside from the standard ones, ie all the subthings, and just copying and paste those obviously wont work.
Is there any widget one can use that has the same things that are in the buddypress bar?
-
AuthorSearch Results