Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'custom activity page'

Viewing 25 results - 426 through 450 (of 831 total)
  • Author
    Search Results
  • #173050
    binutz
    Participant

    Thank you for the response. I created a file named bp-custom.php in the plugin folder and added the code specified above into it. Unfortunately,it didn’t work!
    However,it works when I add the same code into wp-config.php file.
    Only issue that I find with this method is that it always redirects the logged in users to profile page bypassing the activity update. I would like to be redirected to activity updates after loging in. All I need is to show up the profile page when the profile avatar or the user name is clicked ,in the Members page. Can it be done anyway?

    #172893
    danbp
    Participant

    @uabassguy

    BP has no post, it’s WP. 😉
    BP has no rating system, so you need to create it first or use a rating plugin for the blog posts. And probably the votes won’t show up in the activities. I’m afraid that what you want will need some custom coding. 😉

    Can’t help you more, but here are some usefull resource.

    The codex Activity Loop page.

    Some advice to modify the Activity

    A detailed tutorial, by @imath

    A configurable activity widget

    #172370
    bp-help
    Participant

    @tse11
    Patience please! Deactivate the plugin you was using for redirecting and try this in bp-custom.php https://codex.buddypress.org/plugin-development/bp-custom-php/ :

    
    function bphelp_redirect() {
      if( is_user_logged_in() && is_super_admin && is_home) {
        // redirect to dashboard code
        bp_core_redirect( get_option( 'home' ) . '/wp-admin/' );
      }else {
          if( is_user_loggedin() && !is_super_admin  && is_home) {
        // redirect to activity code
        bp_core_redirect( get_option( 'home' ) . '/activity/' );
          }
       }
    }
    add_action( 'template_redirect', 'bphelp_redirect', 1 );
    
    #172365
    bp-help
    Participant

    @tse11
    Search the forum. This has been covered before! You could create a conditional to do this. Basically an if and else statement. You would need to include is_super_admin in the conditional check and the user would be redirected appropriately. For instance:

    
    function bphelp_redirect() {
      if( is_user_logged_in() && is_super_admin ) {
        // redirect to dashboard code
      }else {
          if( is_user_loggedin() && !is_super_admin ) {
        // redirect to activity code
          }
       }
    }
    add_action( 'template_redirect', 'bphelp_redirect', 1 );
    

    This would go in bp-custom.php:
    https://codex.buddypress.org/plugin-development/bp-custom-php/

    #171569
    geoffreysf
    Participant

    Putting this in the functions or bp-custom.php files did not work.

    I finally managed to get the admin and any other user excluded from the members directory by modifying the bp_had_members query that was already in my members-loop.php file.

    <?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ).’&exclude=1,3,25′ . ‘&type=alphabetical&per_page=30’ ) ) : ?> <!– &exclude= user_ids of the people you want to exclude –>

    By adding just this, it also removed the users from the total members count.

    Note: I do not use friends or activity feeds on my site, so I have no idea if it hides from them, but I suppose it wouldn’t.

    I have been looking high and low for the answer to this with my limited PHP knowledge… and wanted to share it back so other people could learn from it too.

    And credit where it is due, this post led me to the answer.
    https://buddypress.org/support/topic/member-parameters-not-working-with-bp_ajax_querystring/

    #170989
    danbp
    Participant

    hi @joesell89,

    first, remove this wrong
    add_filter( 'bp_get_total_member_count', 'bp_core_get_total_member_count' );
    from your bp-custom.php. Correct references are in this file: bp-core-template.php

    See if things went well.

    Pay attention to the cotes. In your example this line has another typo as the the one used for the function.

    The mySql errors are due to mailchimp and wp slim stats plugins. Control first the slim stats settings or search for this problem on the plugin support forum.
    Debug by deactivating both, and check if the errors remain.

    #170864
    hornets2002
    Participant

    I need this too.

    I used to customize my member profile pages using the legacy template file, “profile.php”.

    Now I’m flummoxed as to how I should proceed applying the same modifications in 1.8.

    #170488

    In reply to: two page home page?

    bp-help
    Participant

    @villnoweric
    Just remove Home from the menu, then add activity to your custom menu. Then change the navigational label to “Activity Feed” or whatever you wish!

    #170484

    In reply to: two page home page?

    bp-help
    Participant

    @villnoweric
    Try this it is a slightly modified snippet I did earlier but fits your requirement. Follow the instructions in the code.`
    // PLEASE NOTE FOR THIS TO WORK:
    // Before adding this code to bp-custom.php
    // https://codex.buddypress.org/developer/customizing/bp-custom-php/
    // you will need to create a new page in the dashboard and name it
    // something like “Dummy Page” for example or any name you choose.
    // Do not add this page to your menu because it is just a dummy page
    // for the redirect. Then go to Dashboard/Settings/Reading.
    // Under “Front page displays” select “A static page.” Then use the
    // “Front page” drop-down menu to select the page you created. In my
    // example for instance I selected “Dummy Page” for my front page.
    // Done! Now logged out visitors get redirected to the register page,
    // and logged in users get redirected to the activity stream.

    /* Redirects to profile upon login, and logged out users are redirected to register page */
    function bp_help_redirect_to_profile(){
    if( is_user_logged_in() && bp_is_front_page() ) {
    bp_core_redirect( get_option( ‘home’ ) . ‘/activity/’ );

    }else {
    if ( !is_user_logged_in() && !bp_is_register_page() && !bp_is_activation_page() )
    bp_core_redirect( get_option( ‘home’ ) . ‘/register/’ );
    }
    }

    add_action( ‘get_header’, ‘bp_help_redirect_to_profile’,1 );
    `

    #170240
    yannlossouarn
    Participant

    Hello,

    In fact I’d like to have two distinct behaviours for people who visit http://fablab-lannion.org home page :
    – simple visitors should show the carrousel
    – logged-in users should show a personal, customized view, that would notably contain a filtered activity flow that concern them.

    Is that more clear ?

    neo-tronic
    Participant

    I should have updated this thread ages ago. Yes, I have long had custom post types showing up in my activity stream and it is pretty rock solid.

    I use this snippet (which I found someplace but don’t know where) and add it to bp-custom.php, which is a file you create in your plugins folder.

    http://pastebin.com/SEc32sPf

    The snippet is currently written for MarketPress products, however, you can use it to support any custom post type. Edit the four things below to modify for your custom post type.

    – Edit the function name to whatever you want, it just needs to be unique,
    – Line 19 to be the the custom post type you want to use;
    – Line 28 to reflect the activity record text you want,
    – Line 62 to reflect the name of the function you created for your CPT

    I’m currently using about 7 different edits of it to support that many different CPTs in the activity stream and it works great. Yes, it works in BP 1.7

    I’ve added this to my bp-custom.php file and get an error on the following Sektion. Can anyone help please? ( @prometheus-fire ? )

    			bp_blogs_record_activity( array(
    				'user_id' => (int)$post->post_author,
    				'action' => apply_filters( 'bp_blogs_activity_new_post_action', $activity_action, &$post, $post_permalink ),
    				'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, &$post, $post_permalink ),
    				'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ),
    				'type' => 'new_blog_post',
    				'item_id' => $blog_id,
    				'secondary_item_id' => $post_id,
    				'recorded_time' => $post->post_modified_gmt

    Here the error message: Fatal error: Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of apply_filters(). in /homepages/39/d415915588/htdocs/wp-content/plugins/bp-custom.php on line 35

    Siddharth Pereira
    Participant

    OK. So i found a partial solution.

    I tried adding the below pasted snippet to my bp-custom.php file inside my plugin folder and it worked for the activity page. I dont want to sound like a complete noob but can someone tell me how do i replicate this for the members and group page?

    I tried variations of the code to support _groups_component and _members_component but that didnt work.

    /* Prevent logged out users from accessing bp activity page */
    function nonreg_visitor_redirect() {
    global $bp;
    if ( bp_is_activity_component() ) {
    if(!is_user_logged_in()) { //just a visitor and not logged in
    wp_redirect( get_option(‘siteurl’) . ‘/wp-login.php’ );
    }
    }
    }
    add_filter(‘get_header’,’nonreg_visitor_redirect’,1);

    #169445
    Anonymous User 7600456
    Inactive

    1. Which version of WordPress are you running? – 3.6 (but the problem was there before upgrading from 3.5.2)

    2. Did you install WordPress as a directory or subdomain install? – N/A

    3. If a directory install, is it in root or in a subdirectory? – N/A

    4. Did you upgrade from a previous version of WordPress? If so, from which version? – 3.5.2

    5. Was WordPress functioning properly before installing/upgrading BuddyPress (BP)? e.g. permalinks, creating a new post, commenting. – N/A

    6. Which version of BP are you running? – 1.8.1

    7. Did you upgraded from a previous version of BP? If so, from which version? – 1.8

    8. Do you have any plugins other than BuddyPress installed and activated? If so, which ones? – Many but I have tried disabling them all except Buddypress and the problem is still there.

    9. Are you using the standard BuddyPress themes or customized themes? – Customised theme but problem is persistent even with Twenty Twelve theme.

    10. Have you modified the core files in any way? – No

    11. Do you have any custom functions in bp-custom.php?

    <?php
    // hacks and mods will go here
    
    function activity_publish_custom_post_types($cpts) {
       $cpts[] = 'page';
       $cpts[] = 'attachment';
       return $cpts;
    }
    
    add_filter ( 'bp_blogs_record_post_post_types', 'activity_publish_custom_post_types' );
    add_filter ( 'bp_blogs_record_comment_post_types', 'activity_publish_custom_post_types' );
    
    add_filter( ‘bp_get_total_member_count’, ‘bp_core_get_total_member_count’ );
    
    ?>

    12. If running bbPress, which version? Or did your BuddyPress install come with a copy of bbPress built-in? – 2.3.2

    13. Please provide a list of any errors in your server’s log files.

    
    
    text/x-generic error_log 
    ASCII English text, with very long lines
    [31-Jul-2013 23:00:48 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE meta_key = 'entry_id' AND meta_value = '211'' at line 1 for query SELECT site_id FROM  WHERE meta_key = 'entry_id' AND meta_value = '211' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, call_user_func_array, GFPMoreStripe::parse_request, GFPMoreStripe::cancel_subscription, do_action('gform_subscription_canceled'), call_user_func_array, GFPMoreStripe::downgrade_stripe_user, GFUserData::get_site_by_entry_id
    [01-Aug-2013 04:22:39 UTC] wpMandrill Error: Error : 
    [01-Aug-2013 04:22:39 UTC] 2013-08-01 04:22:39 wpMandrill::sendEmail: Exception Caught => Invalid API Key
    
    [01-Aug-2013 04:22:39 UTC] blah@blah.com ([blah blah] Password Reset)
    
    [01-Aug-2013 16:08:26 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE meta_key = 'entry_id' AND meta_value = '217'' at line 1 for query SELECT site_id FROM  WHERE meta_key = 'entry_id' AND meta_value = '217' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, call_user_func_array, GFPMoreStripe::parse_request, GFPMoreStripe::cancel_subscription, do_action('gform_subscription_canceled'), call_user_func_array, GFPMoreStripe::downgrade_stripe_user, GFUserData::get_site_by_entry_id
    [02-Aug-2013 13:43:45 UTC] wpMandrill Error: Error : 
    [02-Aug-2013 13:43:45 UTC] 2013-08-02 13:43:45 wpMandrill::sendEmail: Exception Caught => Invalid API Key
    
    [02-Aug-2013 13:43:45 UTC] 
    wpMandrill::wp_mail_native: blah@blah.net ([blah blah] First Order)
    
    [02-Aug-2013 17:07:36 UTC] wpMandrill Error: Error : 
    [02-Aug-2013 17:07:36 UTC] 2013-08-02 17:07:36 wpMandrill::sendEmail: Exception Caught => Invalid API Key
    
    [02-Aug-2013 17:07:36 UTC] 
    wpMandrill::wp_mail_native: blah@blah.net ([blah blah] First Order)
    
    [02-Aug-2013 21:57:15 UTC] wpMandrill Error: Error : 
    [02-Aug-2013 21:57:15 UTC] 2013-08-02 21:57:15 wpMandrill::sendEmail: Exception Caught => Invalid API Key
    
    [02-Aug-2013 21:57:15 UTC] 
    wpMandrill::wp_mail_native: blah@blah.com (Welcome to blahblah!)
    
    [06-Aug-2013 03:54:52 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE meta_key = 'entry_id' AND meta_value = '265'' at line 1 for query SELECT site_id FROM  WHERE meta_key = 'entry_id' AND meta_value = '265' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, call_user_func_array, GFPMoreStripe::parse_request, GFPMoreStripe::cancel_subscription, do_action('gform_subscription_canceled'), call_user_func_array, GFPMoreStripe::downgrade_stripe_user, GFUserData::get_site_by_entry_id
    [06-Aug-2013 13:23:34 UTC] WordPress database error Unknown column '$autopurge_interval' in 'where clause' for query DELETE ts FROM wp_slim_stats ts WHERE ts.dt < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $autopurge_interval DAY)) made by do_action_ref_array, call_user_func_array, wp_slimstat::wp_slimstat_purge
    
    

    14. Which company provides your hosting? – OVH.com

    15. Is your server running Windows, or if Linux; Apache, nginx or something else? – Apache

    Thank you @mercime for your reply. I have disabled all plugins and used a fresh Twenty Twelve them and the problem is still there. Thanks in advance.

    Roger Coathup
    Participant

    You shouldn’t be using Genesis Connect with current versions of BuddyPress.

    From the Genesis Connect developer:

    As of BP 1.7 you do not need to have GenesisConnect. We are currently maintaining it for customers who had BP installs prior to BP 1.7.

    #168727
    javiercenteno
    Participant

    Problem solved. There was a conflict with other js libraries so I removed them and used only the ones that come with the default BuddyPress theme.

    Now I have a separate issue where the Activity feed is not filtering when I select a filter. It works well in the Groups or Members page but not in the main “activity” page (or in my case “Newsfeed”). I’m going through each page in my custom theme and comparing it to the default theme to make sure I didn’t forget to include something. Hopefully I’ll figure it out soon!

    #168681
    @mercime
    Participant

    @rayela open up your own text editor – NotePad on PC or TextMate on Mac.
    – File > New
    – Add the content per what I posted above
    – File > Save As – bp-custom.php (note select All Files in dropdown)
    – Upload bp-custom.php via FTP/cpanel to where I noted it above

    #168671
    @mercime
    Participant

    @rayela You create a file bp-custom.php and include the code there – make sure there’s no line or space above or beside opening <?

    Then you upload that file from computer into your server wp-content/plugins/ folder via FTP or cpanel

    #168670
    Rachel Biel
    Participant

    @hnla, since you have been patient with me so far, Hugo, can you help me with my initial question of the Activity streams? I found the following and made notes in my forum help area on my site:

    I want to disable replies on the Activity Streams because they do not carry through to the original post in the Group Forums.

    My notes on how to do this:

    Post on why this is confusing: http://commonsinabox.org/groups/help-support/forum/topic/your-members-might-be-confused-activity-stream-comment-vs-group-forum-reply/

    Discussion about this on GitHub: https://github.com/cuny-academic-commons/commons-in-a-box/issues/73

    Solution by boonebgorges (one of the BuddyPress authors):
    Putting this line in your functions.php or bp-custom.php file will disable all activity stream commenting:

    add_filter( ‘bp_activity_can_comment’, ‘__return_false’ );

    Note on bp-custom.php file:
    Creating your file

    bp-custom.php does not exist by default. If you don’t have a file located at /wp-content/plugins/bp-custom.php, go ahead and create a blank file with the following:

    ?
    1
    2
    3
    < ?php
    // hacks and mods will go here
    ?>
    Next, save the file as “bp-custom.php” and verify that this file is located at /wp-content/plugins/.

    Now, when you encounter a forum thread telling you to put a code snippet in bp-custom.php, you’ll know what to do!
    See: https://codex.buddypress.org/developer/customizing/bp-custom-php/

    Action:
    How is this done? Do I go to my control panel and create a file there?

    #167613
    valuser
    Participant

    Many Thanks, Hugo.

    After rechecking I am now down to just no sidebar control over activity page and group forums page. (though will need a little css tinkering which is no big deal) .

    My resource to date is just https://codex.buddypress.org/theme-compatibility/ and this forum.

    You say

    Theme compatibility already provides for a custom bp version of page.php ‘buddypress.php’ in that you can specify named sidebars.

    bit lost with that i’m afraid. It would be great if you could elaborate on that.

    #166848
    bp-help
    Participant

    @bkypes
    Try adding the below code to bp-custom.php if a logged out visitor tries to go to the activity page then they are redirected to login. For more info on bp-custom.php please see:
    https://codex.buddypress.org/developer/customizing/bp-custom-php/

    
    /* Prevent logged out users from accessing bp activity page */
    function nonreg_visitor_redirect() {
    global $bp;
      if ( bp_is_activity_component() ) {
        if(!is_user_logged_in()) { //just a visitor and not logged in
            wp_redirect( get_option('siteurl') . '/wp-login.php' );
        }
      }
    }
    add_filter('get_header','nonreg_visitor_redirect',1);
    
    #166428
    dpeters
    Participant

    WP Version: 3.5.1
    BuddyPress: 1.7.2

    You want to ‘hide’ the profile page for a member who hasn’t paid their dues?
    What should happen if that page is accessed by that member or another member?
    Redirect? Custom message page ?

    Either redirect to a listing of all active members or display an error page would be fine, (i.e. “This member is not currently an active member.”)

    If ‘paid dues’ is a boolean, then it’s easy to write a function.
    Where is that boolean stored?

    It would be stored in their profile as an Admin-editable field, per the original post.

    Does that member still appear on the Members page? In the Activity stream?

    No to both. Hidden users would be able to login and update information but their profile wouldn’t be public-facing, just them and the admins.

    This would be useful as we have staggered dues, allowing profiles to turn off/on.

    #166426
    shanebp
    Moderator

    You need to state which versions of WP & BP you use.

    You want to ‘hide’ the profile page for a member who hasn’t paid their dues?
    What should happen if that page is accessed by that member or another member?
    Redirect? Custom message page ?

    If ‘paid dues’ is a boolean, then it’s easy to write a function.
    Where is that boolean stored?

    Does that member still appear on the Members page? In the Activity stream?

    iow. you need to be more specific about the behaviour that you want.

    #166344
    bp-help
    Participant

    @famous
    Try this just make sure you follow the instructions in the commented code. Place it in bp-custom.php :

    
    /* Redirects to profile upon login, and upon logout redirects to activity page unless changed */
    function bp_help_redirect_to_profile(){
     global $bp_unfiltered_uri;
    
     $bphelp_my_front_page = 'activity';  // WARNING: make sure you replace 'activity' in this line to the same thing you set dashboard/settings/reading front page to.
    
     if ( !is_user_logged_in() && ( $bp_unfiltered_uri[0] != $bphelp_my_front_page ) ) 
      bp_core_redirect( get_option('home') );
    
     elseif( is_user_logged_in() && ( $bp_unfiltered_uri[0] == $bphelp_my_front_page ) )
    	bp_core_redirect( get_option('home') . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile' );
    
    }
    	
    add_action( 'wp', 'bp_help_redirect_to_profile', 3 );
    
    #166341
    bp-help
    Participant

    @famous
    Try this just make sure you follow the instructions in the commented code. Place it in bp-custom.php :

    
    /* Redirects to profile upon login, and upon logout redirects to activity page unless changed in line 6 */
    function bp_help_redirect_to_profile(){
     global $bp_unfiltered_uri;
    
     $bphelp_my_home_page = 'activity';  // WARNING: make sure you replace 'activity' in this line to the same thing you set dashboard/settings/reading front page to.
    
     if ( !is_user_logged_in() && ( $bp_unfiltered_uri[0] != $bphelp_my_home_page ) ) 
      bp_core_redirect( get_option('home') );
    
     elseif( is_user_logged_in() && ( $bp_unfiltered_uri[0] == 'activity') )
    	bp_core_redirect( get_option('home') . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile' );
    
    }
    	
    add_action( 'wp', 'bp_help_redirect_to_profile', 3 );
    
    #166287

    In reply to: [Resolved] BuddyBlog?

    ldjautobody
    Participant

    Yessssss! Thanks @andrewteg! I was seriously beginning to think I dreamed the whole thing up…not sure why I could not find this page, but that is EXACTLY where I was.

    Now, since I have found what I was looking for, I’d really like to get some opinions of the plugin and see if this will actually do what I am planning for this site. I am open to all opinions and suggestions. My understanding of BuddyPress and bbPress is coming along and the site is starting to look like what I envisioned. You can see the preliminary site at http://accessories.ldjautobody.com.

    First, let me explain what I have planned for this site and, like I said, I am open to all suggestions and comments. I would like to hear what the experts have to say. Good or bad, I need your opinions. You ALL have great ideas and I respect whatever you might have to say or add. 🙂

    This blog and forum are dedicated to custom car and motorcycle enthusiasts everywhere. Car enthusiasts are passionate about their subject, and in addition to giving them a place to share their projects and discuss those among each other, I would also like to let them post some articles, hoping that the fresh content will keep the search engines hanging out on the site and help boost the rankings. I have never run a forum site or used BuddyPress or bbPress before and I’m not really sure how this all works in relation to SEO. I do, however, deal with car and motorcycle enthusiasts on a daily basis and I know that I can most likely count on them to get some very good discussions going among themselves and that is my hope for this site.

    We will also be doing some affiliate marketing from this site, and my hope is that in a perfect World, the fresh content and activity level of the site will keep us ranking well in the search engines and bring some new customers to the site. Since we are an “auto body shop”, our normal advertising is concentrated in a very local area. The affiliate site, however, will have a much broader range and we will be advertising nationwide vs. the small local area that the body shop is limited to. So my hope is that the increased activity on the site will increase the number of people visiting and also help us reach out well beyond our local area. At least, that is our goal for now!

    Thank you all again for all of your help. I am looking forward to hearing anything my experts have to add as we move forward with getting the site ready to launch. 🙂

    Denise

Viewing 25 results - 426 through 450 (of 831 total)
Skip to toolbar