WordPress.org

Support

Support » Plugins and Hacks » [Plugin HidePost] Don’t PROTECT LINKS in specific posts/pages

[Plugin HidePost] Don’t PROTECT LINKS in specific posts/pages

  • Is there anyway to turn off the Hide Post plugin in an specific page or post? I don’t want some of my post to hide links from guests. Thank you.

Viewing 15 replies - 1 through 15 (of 20 total)
  • Am I missing something–just don’t put [hidepost] and [/hidepost] in those post/pages.

    hmm. actually i only use the hide post plugin for it’s ability to hide url to non-members and i didn’t put any [hidepost] [/hidepost] in any pages or posts. It automatically work in the whole blog. Now my problem is that i want some pages and posts to be free from this hide url ability.

    Please provide a link to download that plugin.

    ok ok.

    Here is the link of the plugin

    http://wordpress.org/extend/plugins/hidepost/

    Thanks for the support MichaelH

    Sorry, I have not been able to figure out what the “Protect Link (Only logged in member can see link on your post)” feature is meant to do.

    Ok, let me explain. Basically the [Hidepost] plugin, has 2 functions.

    1. It Hide certain content in a post or page if i put it inside the [hidepost][/hidepost] tag.
    2. It only has a option that it will automatically search all the posts and pages in the blog for urls and hide it from guest.

    And i’m using the 2nd function of the plugin. But what i want is to have the control to stop the 2nd feature in any particular posts or pages of my blog.

    Okay thanks for the explanation. Here’s a change you could make to the hidepost.php script to do that:

    change (starting at line 97 in version 2.3.6):

    function hidepost_filter_post($content) {
        global $m_id, $hidepost_hide_link, $hidepost_hide_content;
    	hidepost_replace_pattern();
    	//Protect the link
    	if ($hidepost_hide_link == 1) {
    	$m_id = -1;//Magic ^.^
    	$content = preg_replace('#\<a(.*?)\>(.*?)\</a\>#sie','hidepost_replace_link($content)',$content);
    	}
    	//Protect content

    to

    function hidepost_filter_post($content) {
        global $post, $m_id, $hidepost_hide_link, $hidepost_hide_content;
    	hidepost_replace_pattern();
    	//Protect the link
    	if ($hidepost_hide_link == 1) {
    	if ($post->ID != 224 && $post->ID !=73) {
    	$m_id = -1;//Magic ^.^
    	$content = preg_replace('#\<a(.*?)\>(.*?)\</a\>#sie','hidepost_replace_link($content)',$content);
    	}
    	}
    	//Protect content

    This line ($post->ID != 224 && $post->ID !=73) is excluding post IDs 224 and 73 from being LINK PROTECTED.

    Please note, changes to that script will be ‘lost’ when you upgrade that plugin in the future.

    ahh ok ok ^_^. Thanks so much Michael ^^. Anyways hows my web’s design now?

    Nice.

    Good Luck.

    Will mark this resolved.

    ok ok thanks

    Hello michael,

    It seems that it has no effects. I already did what you said then log out to see if it works but it still doesn’t work.

    Okay will unresolve this.

    You are using the correct ID’s of the posts/pages you don’t want link protected?

    I did actually test that it worked…

    Well i put the correct ID. But i’m using custom permalinks %categort/%posts, that’s the structure of my permalinks.

    This is the code i change, it’s really like your example.

    function hidepost_filter_post($content) {
        global $post, $m_id, $hidepost_hide_link, $hidepost_hide_content;
    	hidepost_replace_pattern();
    	//Protect the link
    	if ($hidepost_hide_link == 1) {
    if ($post->ID != 1223 && $post->ID != 691) {
    	$m_id = -1;//Magic ^.^
    	$content = preg_replace('#\<a(.*?)\>(.*?)\</a\>#sie','hidepost_replace_link($content)',$content);
    	}
    }

    There is, however an alternate answer to your problem.

    You could disable the “Protect Link” and of course you’ll need to put the tag [hidepost][/hidepost] to your post/page that you wanna protect manually.

    Hope it helps,

    Yogie Ardiwinata

    Yes that’s true but it will be so much work because my blog is more about downloading. Michael’s code will really do the trick but my problem is i can’t get it functional.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Plugin HidePost] Don’t PROTECT LINKS in specific posts/pages’ is closed to new replies.