Info
- 6 posts
- 5 voices
- Started 2 years ago by aiitee
- Latest reply from aiitee
- This topic is not resolved
Link Cloaking
-
- Posted 2 years ago #
heyy
there's a way to hide links to unregistered users????
thanks!!
-
- Posted 2 years ago #
What links specifically?
-
- Posted 2 years ago #
<?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: http://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'); ?> -
- Posted 2 years ago #
I also asked about this future, to hide all links for users that are not logged in.
I have a download section, and I’d love to hide the links for visitors, making it visible for logged in users only.
-
- Posted 2 years ago #
You could wrap your links in code like this:
http://bbpress.org/forums/topic/check-if-a-user-is-logged-in#post-19953 -
- Posted 2 years ago #
hey kawauso, thanks for that code i will try it!
i was thinking to cloak almost all links inside a post or thread.
mostly links to download sites like megaupload or rapidshare, etc. but also links to anything inside a post.
the code from kawauso is exactly what i'm talking about.
cya and thanks!
-
You must log in to post.