Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Nevermind, I fixed this by having it check if the current component is my custom component and altered the member feed link to point to that instead. So it now only offers their activity, sitewide and main blog.

    Can I just get someone to confirm that bp-activity-personal-feed.php doesn’t get used for a member’s feed? So I know this doesn’t happen because I broke something.

    Though, even if I broke something there shouldn’t be any content and… there is.

    Strike this… I was stuck looking at the wrong function.

    You’d need to (this is most undoubtedly wrong)
    `
    ‘SELECT wp_bp_activity.id as id
    FROM wp_bp_activity
    LEFT JOIN wp_bp_activity_meta
    ON wp_bp_activity.id = wp_bp_activity_meta.activity_id
    WHERE wp_bp_activity_meta.meta_key = “favorite_count”
    GROUP BY wp_bp_activity.id
    HAVING COUNT (wp_bp_activity_meta.activity_id) > 0
    ORDER BY COUNT (wp_bp_activity.id) DESC
    LIMIT 20′
    `
    The reason I merged these is that you should be able to SELECT * activity and set them all as the $activity_template->activities and use the activity_template loop (bp_has_activities) but my attempts so far have failed.

    You missed the point of avoiding bp_has_activities, in that it automatically reorders the includes through it’s own query.

    `<?php
    $popular_activities = my_get_popular(); // returns an array of activity IDs
    for ($i = 0; $i<count($popular_activities); $i++){

    if (empty($popular_activities[$i])) continue;

    $activity = new BP_Activity_Activity($popular_activities[$i]);

    if (!$activity) continue; ?>

    // your customized activity entry template

    `

    It’s a pretty ugly way of doing it but it got me started. Main defect, as I don’t yet get inserting activities into the activity template (without it doing it’s own query), is that I do one query to get the popular ids and then a query per activity (done in “BP_Activity_Activity”). Also, you’re bypassing all the the filters, pagination and other stuff in the activities_template, or I am. Since I’m just directly printing the values…

    `
    content; ?>
    user_id ); ?>
    user_id ); ?>
    date_recorded ); ?>
    $activity->user_id, ‘width’ => 20, ‘height’ => 20, ’email’ => $activity->user_email) ); ?>
    `

    You would need to do a query … [edit] nevermind ray gave that already

    I’ve been looking to do this as well. But bp_activity_get_specific automatically applies a DESC order as a default. Essentially failing to maintain the ordering of ids

    I can only see this working the way we want is through a custom loop or functions that bypass this.

    BP 1.28, I’m unsure of any changes to this for 1.3

Viewing 7 replies - 1 through 7 (of 7 total)
Skip to toolbar