Skip to:
Content
Pages
Categories
Search
Top
Bottom

Restrict site activity post viewing..

  • Avatar of dude
    dude
    Member

    @pinhit

    hi, I’ve been trying to restrict the ‘viewing’ of my sites activity posts to logged-in/registered members only

    I so far managed to successfully restrict the viewing of members ‘profiles’.. and tried to adapt the same principle using the last bit of code to kill two birds with one stone but alas it didn’t quite work.

    I went try and edit in: members/single/activity/permalinks
    with:-

    `

    `

    Then add this to close the conditional just before the closing padder div tag:

    ``

    Should I try editing in: members/single/activity.php instead..?

    thanks

    Kenny

Viewing 16 replies - 1 through 16 (of 16 total)
  • Avatar of dude
    dude
    Member

    @pinhit

    sorry for the double post, but there was an error that came up for some reason

    Avatar of pcwriter
    pcwriter
    Participant

    @pcwriter

    @pinhit

    That depends what exactly you are trying to restrict. Do you want to restrict those funky View Permalink pages to logged-in users only? Or do you want to restrict the entire Activity Stream to logged-in only? If the latter, do you also want to restrict Group Activity… the list could get quite long :-)

    Avatar of dude
    dude
    Member

    @pinhit

    Hi pcwriter, thanks for the reply.

    In a nutshell.. I’m aiming to achieve results very similar to this: http://swapbbm.com/

    I’m not using groups, so no worries there. I basically wanna restrict all posts/update notifications, but keep the profile pics/avatars viewable.
    as a kind of ‘teaser’ or sneak preview to what goes on inside the site.

    Avatar of dude
    dude
    Member

    @pinhit

    bump

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    kenny you are going to have to just get stuck in and explore the BP file structure and files, we have given a fair bit of advice on this subject across ~ 3 separate threads :)

    Activity stream directory is /activity/activity-loop.php look through that file and identify the sections that output the actual update content or whatever bits you want to hide and wrap them in the code example above, give it a go and if you get stuck tell us what file you have tried to edit and show us the code you have edited and we’ll help you get it right.

    Avatar of dude
    dude
    Member

    @pinhit

    I am ‘getting stuck in’, you’ll notice in my posts I’ve at least tried to have a go myself !

    theres so many files, and so many are similar in name but unless I ask someone who has experience with these things I could end up ruining my site.

    If you take a look at this link: http://swapbbm.com/ you’ll see ‘exactly’ what it is I’m trying to achieve and that is to display a similar notice in the activity stream: ‘please login or register to view the bb pins’ .

    so this would be done in the ‘activity’ files you previously mentioned right ?

    ** update **

    I tried on about 4 attempts to create the wrapper on that page and 2 out of 4 attempts in various different places made this come up on my site:-

    Parse error: syntax error, unexpected T_ELSE in /home2/pinhitco/public_html/londonbbmpinswapco/wp-content/plugins/buddypress/bp-themes/bp-default/activity/activity-loop.php on line 37

    I tried

    Avatar of dude
    dude
    Member

    @pinhit

    help I’m stuck lol

    Avatar of pcwriter
    pcwriter
    Participant

    @pcwriter

    @pinhit

    You really are struggling with this one, aren’t you? One of the important things to look out for is being sure your “if” statements are properly nested.

    To mimic the functionality of the site you linked to above, open activity/activity-loop.php and paste the first part of the conditional (the if, message & else) immediately AFTER the following line:

    Close the conditional (the endif part) immediately BEFORE the following line:

    This will display your not-logged-in message to visitors everywhere the activity stream is displayed: in the main stream, as well as in profiles and groups.

    Avatar of dude
    dude
    Member

    @pinhit

    thanks dude, your’e a star !

    gonna go get my hands dirty ;)

    Avatar of dude
    dude
    Member

    @pinhit

    didn’t quite mimic what the other sites stream is showing but what the heck

    would have been good to show each avatar but restrict the viewing of each update post.

    heres the end result on my site: http://www.londonbbmpinswap.co.uk

    Avatar of pcwriter
    pcwriter
    Participant

    @pcwriter

    @pinhit

    Dirty hands are fun :-)

    Didn’t you already set member profiles to show only to logged-in users? The whole profile section (including the header) is being hidden whereas only the profile activity streams should be hidden. Check members/single/home.php for the code you added earlier, and comment it out or remove it temporarily to see if the display looks better.

    Avatar of dude
    dude
    Member

    @pinhit

    yes I did set members profiles to show only to logged i users.

    I will try see if it makes a difference.

    I also made a wrapper in: members-loop.php to restrict the viewing of the members directory page to save fiddling around with each post relating to each member. In an ideal world what I’m trying to achieve with the activity stream (i.e. only exclude activity updates) is exactly what I was aiming for with the members directory page.

    If push comes to shove I will probably leave things as they are (totally locked down) as my site is being abused by disgruntled ex-users of my facebook page at present who have been banned and coming through to my domain with revenge attacks lol, (very childish I know)

    ** update ** ok I tried it and no change to activity stream I’m afraid but no worries for reasons as mentioned above

    Avatar of pcwriter
    pcwriter
    Participant

    @pcwriter

    @pinhit
    Glad it finally worked out for ya! :-)

    Avatar of dude
    dude
    Member

    @pinhit

    well I’d like to say this matter is finally put to bed but with respect I’d like to keep this thread open for now
    in case someone else has another work around if nobody minds ;)

    It would be ideal if there was another way of showing the avatars in the activity stream and replacing the updates with the login notice as originally planned but many thanks for your input so far guys !

    Avatar of dude
    dude
    Member

    @pinhit

    I’m bumping this because there must be a way to mimic this sites activity page : http://swapbbm.com/
    the method above totally hides the whole of the activity..I don’t want to settle for this because there has been a decline in sign-ups to my site lately partly due to not being able to see anything going on inside.

    they must know something we don’t on this other site, it’s a wordpress/buddypress combo as well !

    Avatar of pandaboy
    pandaboy
    Member

    @pandaboy

    hi london pings,

    i see that you managed to get it done on your website? mind sharing how you managed to get the avatar displayed but not the “profile” and the “update” posted to show warning to non-registered users? i would like to do the same with my buddypress site too (dont worry it has nothing to do with bbm so not a rival site =)). THanks in advance.

Viewing 16 replies - 1 through 16 (of 16 total)

The topic ‘Restrict site activity post viewing..’ is closed to new replies.