Skip to:
Content
Pages
Categories
Search
Top
Bottom

Disable Activity Stream Links


  • Zabelator
    Participant

    @zabelator

    Hello, I am running buddypress on WordPress 4.3.1 running X – Child Theme: Renew theme. I have a site that uses Activity Streams and Groups components only.

    For my groups home pages, I have created a custom Front Page with a welcome message and the activity from the group.

    I dont use the member directory or any BP user profiles. I would like to keep the text from the activity on the page, but I dont want it to be a Link to their profile.

    For example: ” MannyMember joined the group GroupOne 6 days, 23 hours ago ”

    MannyMember and GroupOne are both links. I would like to remove the link for the member and group if possible, but more importantly just the Member.

    I was hoping I could use a filter to modify the output of bp_activity_action(); but cannot figure it out. Any help is greatly appreciated.

    Thanks.

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

  • William
    Participant

    @william_oneb

    Hi @zabelator

    Try adding this to “style.css” in your active theme

    #buddypress .acomment-meta a, #buddypress .activity-header a, #buddypress .comment-meta a {
        text-decoration: none;
        pointer-events: none;
        cursor: default;
    }

    Zabelator
    Participant

    @zabelator

    Thanks for the suggestion, @william_oneb. I have added that to my CSS. It has worked for Firefox and Chrome, but with Internet Explorer it is still a clickable link, just with the default cursor and no hover actions.

    This is a good start, but I would like to disable it across the board.


    William
    Participant

    @william_oneb

    @zabelator in that case, you’ll have to use jQuery and probably not CSS.

    Open “head.php” and add the following code.

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    	<script type="text/javascript">
    $(document).ready(function(){
    $("#buddypress .acomment-meta a, #buddypress .activity-header a, #buddypress .comment-meta a" ).click(function(oneb){
        oneb.preventDefault();
    });
    
    });
    </script>

    It should now work across the board. Note, this will be disabled even when the user is logged in so you might want to use php to load this script on home page only. Let me know if works.


    Zabelator
    Participant

    @zabelator

    I think you are correct, @william_oneb. I am going to have to use some jQuery. I found something similar to this, but I added a bit to remove the link title, so it does not show as a tool tip. The jQuery I have is a little different but it does the job.

    $(document).ready(function ()
    {
    	$(".activity-header > p > a").prop('title', '');
    	$(".activity-header > p > a").attr("disabled", "disabled").on("click", function() {
        return false;
    });
    });

    The only issue I have is that IE still shows the URL in the lower left when you hover over it, but from what I have read, that is browser functionality that we cannot control. This may be the best I can do without hacking the main BP Core file.

    Thanks for the help.


    William
    Participant

    @william_oneb

    I’m not sure of the solution to the issue in IE but I guess that’s probably the furthest you can go without hacking the core files.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disable Activity Stream Links’ is closed to new replies.
Skip to toolbar