Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide Links

  • @shagalaga

    Member

    Hi,

    is there a plug in to Hide Links(including email etc) from guests and a guestbook for each user profile aaaaand a better Private Messaging Plug in?

    couldn’t find anything in the plug in DB

Viewing 7 replies - 1 through 7 (of 7 total)
  • @shagalaga

    Member

    and a more accurate posting time!

    @chrishajer

    Participant

    What version of bbPress are you using?

    @shagalaga

    Member

    v0.9.0.4

    @chandersbs

    Member

    I also would love to know how to hide links in some sections of my forum for non-registered users.

    I have a download section, and I’d like to keep the links only visible to registered users. Perhaps also put a message only visible to non-registered users that they need to register to see the links, when they’re viewing topics in the download section.

    Any ideas?

    @hanratty

    Member

    why r u hide that

    technically u have to make visibility false to hide link

    @kawauso

    Member

    I think should do it, it’s based off code here: https://bbpress.org/forums/topic/open-links-in-new-window

    Change the values of $forums to the forum IDs of those you wish to restrict (it’ll only work on direct parent forums, not grandparents or categories, I don’t want to include walker code unless people need it).

    Tested on 1.0.2 trunk, so I’m not 100% sure it’ll run on 0.9, sorry.

    <?php
    /*
    Plugin Name: Remove Links (conditional)
    Description: Removes links for non-registered users. Based on <a href="http://ckon.wordpress.com/2007/07/12/bbpress-plugin-bb-tweaks/">bb tweaks</a>.
    Plugin URI: https://bbpress.org/forums/topic/hide-links
    Version: 0.01
    */

    function bb_strip_links( $text ) {
    global $topic;

    $forums = array(
    1,
    2,
    3,
    );

    if ( !in_array( $topic->forum_id, $forums ) )
    return $text;

    if ( !bb_current_user_can( 'write_post' ) )
    $text = preg_replace('|<a (.+?)>(.+?)</a>|i', 'Login or register to download', $text);

    return $text;

    }

    add_filter('post_text', 'bb_strip_links');

    ?>

    @Hanratty: hiding links using CSS visibility will still leave the link URLs in the code, which isn’t too desirable for some

    @kawauso

    Member

    @Shagalaga: Maybe you could use a hidden forum for guestbooks? One topic per user that’s had a comment posted, just use the existing topic functions and a modified post form on the bottom of their profile?

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.