WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin HidePost] Don't PROTECT LINKS in specific posts/pages (21 posts)

  1. lalng001
    Member
    Posted 5 years ago #

    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.

  2. MichaelH
    Member
    Posted 5 years ago #

    Am I missing something--just don't put [hidepost] and [/hidepost] in those post/pages.

  3. lalng001
    Member
    Posted 5 years ago #

    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.

  4. MichaelH
    Member
    Posted 5 years ago #

    Please provide a link to download that plugin.

  5. lalng001
    Member
    Posted 5 years ago #

    ok ok.

    Here is the link of the plugin

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

    Thanks for the support MichaelH

  6. MichaelH
    Member
    Posted 5 years ago #

    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.

  7. lalng001
    Member
    Posted 5 years ago #

    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.

  8. MichaelH
    Member
    Posted 5 years ago #

    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.

  9. lalng001
    Member
    Posted 5 years ago #

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

  10. MichaelH
    Member
    Posted 5 years ago #

    Nice.

    Good Luck.

    Will mark this resolved.

  11. lalng001
    Member
    Posted 5 years ago #

    ok ok thanks

  12. lalng001
    Member
    Posted 5 years ago #

    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.

  13. MichaelH
    Member
    Posted 5 years ago #

    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...

  14. lalng001
    Member
    Posted 5 years ago #

    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);
    	}
    }
  15. yogieaw
    Member
    Posted 5 years ago #

    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

  16. lalng001
    Member
    Posted 5 years ago #

    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.

  17. Funnnny
    Member
    Posted 5 years ago #

    Oh, sorry for the late reponse.
    If you want to protect a link in your post, try to use [hidepost] instead.
    I'll add the option to disable hidepost in 1 post, in the future :)

  18. lalng001
    Member
    Posted 5 years ago #

    Ok Ok thanks thanks. I'll just wait for the option of you want to do in the near future ^_^. Thanks...

  19. sharris203
    Member
    Posted 4 years ago #

    I'm looking forward to the update. I need links hidden from guests in every post (downloads), but would like to show them on some pages if I need to.

  20. xtool
    Member
    Posted 4 years ago #

    I also in need of this option for all my protected links from visitors but leaving only certain post or page viewable or downloadable. Thank you in advance.

  21. xtool
    Member
    Posted 4 years ago #

    Ops. Just got it working. My apology.
    1. Place a CHECK in all options EXCEPT "Protect Link".
    2. Edit any Post or Page by inserting tag

    [hidepost=0]YourLink[/hidepost]

    3. Test it by logging out and view post as Visitor.

Topic Closed

This topic has been closed to new replies.

About this Topic