Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'custom activity page'

Viewing 25 results - 751 through 775 (of 831 total)
  • Author
    Search Results
  • #72109
    Boone Gorges
    Keymaster

    See 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.

    #72079
    rich! @ etiviti
    Participant

    you 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/

    #71863
    3sixty
    Participant

    My 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.

    #71768
    Mariusooms
    Participant

    It 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.

    #71608
    Hugo Ashmore
    Participant

    It’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.

    joescars
    Member

    I 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

    http://www.561Media.com

    #71455
    3sixty
    Participant

    Jens, 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?

    #71396
    rogscorp
    Participant

    It’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.

    David Lewis
    Participant

    I 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');
    });
    });

    #70904
    Hugo Ashmore
    Participant

    Running 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.

    #70777
    3sixty
    Participant

    Please 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.

    rich! @ etiviti
    Participant
    #70478
    itsalltech1
    Participant

    Creating 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?

    #70388
    brianterry10
    Member

    I 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?

    #70211

    In reply to: Search Activity

    Nahum
    Participant

    Something 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) ) : ?>

    #69964
    nado
    Member

    Can 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.

    #69624
    3sixty
    Participant

    Thank 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’) {

    #69562
    Bowe
    Participant

    First 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!

    #69457
    3sixty
    Participant

    While 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/

    Mariusooms
    Participant

    This 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/

    #67558
    kingfelix23
    Member

    ah, 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.

    #67367
    kingfelix23
    Member

    Yesterday 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?

    #67264
    hypergripe
    Participant

    Hey @modemlooper;

    I’d like to know how you do that… I’m trying to alter the layout of the updates on our (child theme) activity stream page at http://www.hypergripe.com/activity/ so that when a blog update is mentioned, the permalink to the blog post is on the next line and bolded, or in an h3 tag or something to look like a blog title – (the way the code is now the second link does not have a css identifier, and adding css to that specific link is impossible – i think).

    I tried to alter the core bp-blogs.php file on line 433 and line 468, where it SEEMS the code for the activity stream is getting generated, but when I change this line:

    $activity_action = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '' . $post->post_title . '' );

    to this:

    $activity_action = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '
    ' . $post->post_title . '' );

    then upload it, there is no change on the activity stream page….

    I’m baffled. Ya, I know I’m changing core files – I’ve customized a few core files but have made a schedule of changes for future updates – or until there are gentler fixes. :)

    Thanks in advance – your participation in other threads has been very helpful!

    #67061
    bennettberlin
    Participant

    Say I have a site with 2 buttons in the header, “Books” and “Blog”. Blog is my normal WPMU blog which displays all post categories, including “Books”. Books should only display blog posts with the category “Books”. The BP activity stream should display all posts.

    The Blog-in-Blog plugin did the trick, but seems incredibly hard to style. I tested a few other similar plugins (some did not seem to work with WPMU) before settling on the “post-page-association-plugin” which works fine. I have it set just to show the first post from the Books category on a custom page.

    However, I would like to learn how to code this myself so that I can add some buttons to the the Books page so that the user can display other single books posts by clicking these buttons. Clicking would replace the current books post with the selected books post.

    Hope this is less confusing!

    #66781
    joshsadler
    Member

    I’m looking for this too. I don’t want any blogs to display in the activity feed on a custom page.

    I’m using this to limit the number of posts shown at a time to 5 and I don’t want it to be filled up with my blog posts.

    <?php if ( bp_has_activities(‘per_page=5’) ) : ?>

    I’d settle for someone telling me how to only display 5 status updates.

Viewing 25 results - 751 through 775 (of 831 total)
Skip to toolbar