Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 701 through 725 (of 1,007 total)
  • @rogercoathup

    Participant

    @djpaul – I put some edits in my comment above – it looks like our posts crossed.

    My two streams are independent (i.e. not nested)… I’ll try setting them both up with a full set of parameters specified, and see if that allows them to show different content.

    Cheers, Roger

    @rogercoathup

    Participant

    @djpaul, @nuprn1 –

    I ran into a stack of problems with this approach:

    1. A call to make a new BP_Activity_Template requires a full set of parameters (it doesn’t default them).

    2. All the bp_ functions, e.g. bp_has_activities() work on a single global activities template ($activities_template)

    3. The methods (functions) you can call directly on the BP_Activity_Template calls are very limited (has_activities, next_activity, rewind_activities, user_activities, the_activity).

    [Edit: the call to the_activity() references a global $activity but then doesn’t do anything with it, e.g. it doesn’t instantiate it]

    4. All the presentational / data functions you’d want to use, e.g. for pagination_count, title, avatar, item ids, object names, content, only work on the global $activity_template (not on the $activity global)

    Am I missing something obvious? Or is this really not feasible with the current methods?

    The code I tried:
    `
    $page = 1; $per_page = 10; $scope = ‘ ‘, $max = 200;

    $activities = new BP_Activity_Template ($page, $per_page, $max, false, ‘DESC’, false, false, false, false);

    if ($activities->has_activities()) :
    while ( $activities->user_activities() ) : $activities->the_activity();
    `
    then, I was stuck as there don’t seem to be any easy methods to access the activity content.

    My surmise is that the_activity() should be instantiating the global $activity (but it doesn’t), and then the bp_ functions should work on the $activity global not on the $activity_template global

    @rogercoathup

    Participant

    @djpaul, @nuprn1 : I was thinking both the AJAX and the PHP switching tabs (e.g. between Personal, Friends, etc. on the Profile .. Activity page).

    I have a mini activity sidebar widget that’s permanently around showing all site activity.

    When a user is on a profile activity page, there is also the main activity stream. Essentially, I want them to be able to move between friends, groups, personal in the main activity stream, without it affecting the sidebar widget.

    I’ll play around with my suggested code (now I have your additional votes of confidence), and see how it runs.

    I’ll tackle the AJAX conflicts if and when they arise.

    Thanks guys.

    @rogercoathup

    Participant

    Can I just write something along the lines of:
    `
    $myloop = new bp_activity_template(my args);
    $myloop2 = new bp_activity_template(my args 2);

    while ($myloop->bp_activities()) : $myloop->bp_the_activity();
    …
    endwhile;

    while ($myloop2->bp_activities()) : $myloop2->bp_the_activity();
    …
    endwhile;
    `

    In reply to: listing members

    @rogercoathup

    Participant

    You can do this by writing your own custom profile loops: https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-members-loop/

    You could incorporate a search term to filter each loop, but I suspect you are better to have a field in the profile for venues, djs and promoters, and query that field during the loop.

    For each type of member, it might be an idea to have different profile field groups, and hide them when they are not appropriate.

    @rogercoathup

    Participant

    @dorothysulzmann –

    It’s certainly do-able using BuddyPress, but would take a fair bit of work. What’ve you provided is more like a brief for a full project / strategic consultancy, rather than a support question answerable in a thread like this.

    You can look at the documentation section of this website: https://codex.buddypress.org/home/ as a starting point, although it’s doesn’t really have a basic tutorial.

    You would need to investigate profile fields in depth, and writing logic to handle your different types of user.

    For payments, you might be best looking at one of the “off the shelf” plugins.

    @rogercoathup

    Participant

    @dorothysulzmann – are you looking to hire a developer to build this for you? In which case, you might want to register it as a job on the job board, rather than a support query.

    https://buddypress.org/community/groups/bp-jobs-board/

    @rogercoathup

    Participant

    @kita.huyen: I’m not sure I know what you are asking for.

    Is it the link to jump to specific social pages for the logged in user?

    In which, you can use code like this:

    <li><a href="">Inbox ()</a></li>

    There are slugs for all the standard social pages that you can look up

    @rogercoathup

    Participant

    @psycolor: I gave you a couple of pointers in this thread on how to exclude activities: https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/need-exclude-parameter-for-bp_has_activities/

    To include your code in a thread (it’s not showing above), you need to use backticks at the start and end: ` … code … `

    @rogercoathup

    Participant

    Yep, there are a few threads about how to remove the view link altogether

    @rogercoathup

    Participant

    If you just want to style it for new blog posts:

    `
    li.new_blog_post div.activity-inner {
    }
    `

    @rogercoathup

    Participant

    @mercime: yes, it’s back… it had gone, but the new one was started a week or so back

    @rogercoathup

    Participant

    @mrbeno – you can advertise jobs in this group: https://buddypress.org/community/groups/bp-jobs-board/

    @rogercoathup

    Participant

    @bowromir – I give a solution that uses the post thumbnail at the bottom of this thread: https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/replace-activity-stream-blog-excerpt-with-the_excerpt

    Cheers, Roger

    @rogercoathup

    Participant

    @psycolor –

    where to make changes, really depends on your theme setup.

    If you want a theme similar to the default, but with your own enhancements (such as the ones in this thread), you are best to create a child theme, and make the changes in there. You’ll be editing the activity-loop.php and entry.php files in your child theme.

    Have a look in the documentation for the article on creating child themes.

    I don’t know whether there are many examples on line of alternative activity loops. I posted one example earlier today of some amends we’d done to entry.php to access and enhance the activity template tags: https://buddypress.org/community/groups/requests-feedback/forum/topic/omit-time-stamps-from-activityfeed-so-only-date-stamps-show

    And here’s an example of how we do a custom blog loop from a site I’m working on at the moment:

    `
    <?php $args = array (
    ‘action’ => ‘new_blog_post’,
    ‘max’ => 20); ?>

      <?php $count=0;
      while (bp_activities() && ($count < 8)) : bp_the_activity(); ?>

      <?php $blog_id = bp_get_activity_item_id();

      if ((int)$blog_id == 1) continue; ?>

      <li class="<?php if ($count “>

    `

    @rogercoathup

    Participant

    @adelack – two thoughts:

    1. You can probably do this with the new WordPress custom post types. Build a theme that only gives your users an image upload post type

    or:

    2. Modify the activity status update to support image uploads, and use that instead of blogs for your users

    @rogercoathup

    Participant

    @pjnu

    looking at the filter suggested by @hnla – It looks like you could make that work as well. Rather than setting the content to ” “, you would set it to the date submitted (which I think you are still wanting to display).

    @rogercoathup

    Participant

    @pjnu – unfortunately those “time since” messages are embedded quite deep in the core template tags used by the default theme, and are not the most obvious to remove / change.

    It can be done however.

    The time since text is inserted by a routine called bp_insert_activity_meta() that’s called from the tags the default template uses: bp_activity_action() and bp_activity_content_body().

    There’s no easy way to filter those tags to alter the time presentation [EDIT: perhaps there is – see other comments], so the easiest route is to modify your theme taking out the calls to bp_activity_action() and bp_activity_content_body(), and replacing them with calls to get the parts of the message individually:

    e.g. you can call bp_get_activity_date_recorded() to get the date as a datetime stamp which you can then format with the PHP date() function to display as you want it.

    These template tags are all declared in bp-activity-templatetags.php

    There’s no straight template tag to get the activity_action without the activity_meta (and timestamp) being added – so, we write our own function for that in bp-custom.php and call it from our theme:

    function my_activity_action() {
    global $activities_template;
    
    return ($activities_template->activity->action);
    
    }
    

    You could do something similar for activity_content_body as well.

    Here’s a snippet of what a modified activity/entry.php looks like in one of our themes:

    
    <div class="activity-header">
    
    <p class="metadata">
    <?php if (has_delete_permissions()) {
    echo bp_get_activity_delete_link();
    } ?>
    
    </div>

    I hope that makes sense!

    In reply to: 404 page not found

    @rogercoathup

    Participant

    @irishartisans – did you get the custom permalinks working on your basic WordPress install with BuddyPress de-activated?

    You’ll need that before you attempt to use BuddyPress.

    Does this article help: http://www.benhuson.co.uk/2010/03/01/wordpress-permalinks-zeus-server/

    In reply to: 404 page not found

    @rogercoathup

    Participant

    @irishartisans – where did you remove the mod_rewrite.c directives / add the rewrite.script directives? Wasn’t that in your .htaccess file?

    Most web hosting will allow you access to your .htaccess file. Which hosting company are you using?

    Unfortunately, I don’t know anything about rewrite.script so can’t help further on that.

    Do the steps I suggested though, and check whether your basic WP installation is working properly first.

    @rogercoathup

    Participant

    If only everything was that easy. lycka till!

    In reply to: 404 page not found

    @rogercoathup

    Participant

    @irishartisans – I’ve never known anyone use rewrite.script. Mod_rewrite.c is the norm for WP / BP

    I suggest going back to the original .htaccess file, then de-activate BuddyPress, and then run the following tests:

    Do custom permalinks work (e.g. change them to /%category%/%postname%/ in your wp-admin), can you comment, can you register new sites, and so on.

    Does all this work without problem? If not, check you have correct permissions set on your .htaccess file

    @rogercoathup

    Participant

    wp-admin: settings.. reading.. front page displays.. activity stream

    @rogercoathup

    Participant

    @ipstenu:

    We came up with a solution to include the featured image (post_thumbnail) in the activity stream. The solution avoids the need to use switch_to_blog

    It isn’t simple, but it might help:

    We removed the action bp_blogs_record_post and replaced it with our own version that populates the content field with the post_thumbnail (you could also add the excerpt), i.e. `$activity_content = get_the_post_thumbnail( $post_id );`

    Unfortunately, bp_blogs_record_activity then takes the image and mangles it. To get around this we had to implement our own version of bp_blogs_record_activity, and call that instead from our blogs_record_post function.

    You can see the whole set of code here:

    http://pastebin.com/jKdQ2kLu

    Then in your activity loop, just use bp_activity_content_body() to display the thumbnail / excerpt, etc.

    IMHO – bp_blogs_record_activity() needs a rework in the core to give theme designers much more control.

    @rogercoathup

    Participant

    Ps line spacing, indents, etc don’t matter.. Use as many as you need to make your code clean and readable

Viewing 25 replies - 701 through 725 (of 1,007 total)
Skip to toolbar