jessenco
Forum Replies Created
-
Forum: Plugins
In reply to: Hiding sensitive content to youngster from public reading.OK HERE IT IS!
WORKING GREAT IN WORDPRESS 2.0.2
NOT TEST IN OTHER VERSION.Save in your plugin folder the following code in a file named “HIDETHIS.PHP“.
Activate as usual in the Admin panel.
That’s it !
Usage : <!–hidethis–> <!–/hidethis–>Whenever you want to censure just a part of text anywhere in a post to people not logged (or registered) on your blog
just put the sensitive section of text wiithin these tags <!–hidethis–> <!–/hidethis–>.This will replace all the text within these tags by a nice warning message to people saying the this portion of text is censured, they need to login to see the uncensured post.
AGAIN, THIS WILL ONLY HIDE THE TEXT WITHIN THE TAGS not all the post.
EXAMPLE : Bla bla bla <!–hidethis–> hide this text because it is too hot <!–/hidethis–> bla bla bla.
When used like above example, people not logged will see:
Bla bla bla …contend censured. Please login!… bla bla bla.
People logged will see: Bla bla bla hide this text because it is too hot bla bla bla.Cool isn’t it ?
You can customize the HTML warning message to display as you want;
– maybe to display an image intead of a textual message.
– adding a link to your login page
– etc.It is a modification of the HIDETHIS plugin made by Mark Edwards found in WordPress codex.
Modify by myself and GaMerZ to suit my need.Please give credit to Mark Edwards.
Here is the script:
<?php
/*
Plugin Name: HideThis
Plugin URI: https://www.edwards.org/tags/Wordpress
Description: Hides parts of posts from readers who are not logged in. Begin hidden content with <!--hidethis--> and end hidden content with <!--/hidethis-->
Version: 1.0.1
Author: Mark Edwards
Author URI: https://www.edwards.orgCopyright ? 2006 - Mark Edwards
Drop it in your plugins dir and activate. Then wrap the text to be hidden with <!--hidethis--> and <!--/hidethis-->
Example of post with hidden content:
This is a test post I wrote to see if this plugin works.
<!--hidethis-->
this text will be hidden if a reader isn't logged in
<!--/hidethis-->
And so this is the end of the post.*/
add_filter('the_content', 'hide_some_content');
function hide_some_content($content) {
global $current_user, $user_ID;
if (($current_user->id == 0) && ($user_ID == 0)){
$hide_msg = "<table width="243" border="0" cellpadding="0" cellspacing="0">
<tr><td width="306" align="center" valign="middle" nowrap bgcolor="#FF0000"><strong> ...content censured! Please login...</strong></td></tr></table>";
$b = strpos($content, '<!--hidethis-->');
$e = strpos($content, '<!--/hidethis-->');
$pre = substr($content,0,$b);
$suf .= substr($content,$e,strlen($content));
if($b === false) {
return $pre.$suf;
}
return $pre.$hide_msg.$suf;
} else {
return $content;
}
}
?>Forum: Your WordPress
In reply to: Finally did my own theme.As jimatwork said, it does not view correctly in IE. The design is cool and once this minor problem corrected, this will a be very nice job.
In my opinion, I prefer the right column menu disposition. It always seem more ergonomic to me and since you asked and I cannot mind my own business…that is my review. ;-)))) Good job again!