WP Nic Edit html comments issues with normal user comment

Jotted by brajesh on January 6, 2009

Happy new year to all of you.I wish you and your family a very prosperous and happy new year.

As I had mentioned,I was planning to release another updated version of WP NicEdit,but it has been delayed because of some issues.My apologies for that.

When you use Wp NicEdit,It makes the comment area a rich text editor.

Now the issue is ,when a user is not logged in or has no capability(as in wp terms) to write html,It will not save the comment as rich comment.Reason,wordpress removes all the formatting using the kses filter.

My current experiment has not been successful in removing the kses filter for wordpress and because of time lack ,I could not do more experiments.If you know a way,In which we can remove the kses filter for comment,or allow html comments(so wordpress does not strips the tags),Please let me know.All the help is appreciated.Also,I will give you a credit link in my next release post of wp NicEdit.So pleasemIf you have any idea about allowing HTMl in comments,please let me know.

Thanks

Brajesh

[blinklist] [Bloglines] [del.icio.us] [Digg] [dzone] [Facebook] [Ma.gnolia] [Mister Wong] [Reddit] [Sphere] [Sphinn] [StumbleUpon] [Technorati] [Email]


Wordpress Mu Plugins Installation, sitewide Plugins vs. per blog plugin

Jotted by brajesh on January 5, 2009

If you are either new to wpmu development/use or probably switched from wordpress,you might have faced this dilemma.

In standard wodpress,there is only one plugin directory inside wp-content named “plugins”.

If you have installed wpmu or got a chance to work with it,when you will navigate to wp-content folder,you will find two directories named “mu-plugins” and “plugins” as shown in the image below

Plugin Directories in wordpress Mu

Plugin Directories in wordpress Mu

Let us take a look at the differences:-

In wordpress there is one blog only,while in case of wordpress mu the same installation can have hundreds or thousands (evenĀ  bigger if you see wordpress.com) of blog hosted on it.

So,wordpress Mu provides two sorts of plugins,one is the plugins which are globally available(my be you can tell them site wide plugin).

To install a plugin which are automatically enabled for all blogs on a wordpress Multiuser installation,you just need to put it in mu-plugins folder.

If you put a plugin in “mu-plugins” folder,It is automatically activated,thereĀ  is no need to manually activating the plugin as in case of standard wordpress plugin.

Now there are times ,when you want your user to use some plugin,but they may use or may not use it.So to give the flexibility to your users, you just need to put it in “plugins” folder.

This plugin will be available to all the blog owners(blog admins) on your website and them may enable or disable it on their will from their dashboard.

So,the two plugins directory are required because of the nature of the wordpress Mu sites/blogs.

I hope,It will help someone looking for the differences between site wide plugin and per blog plugin.

I encourage you to leave a reply,if you have any suggestion,any questions,I will reply promptly.

[blinklist] [Bloglines] [del.icio.us] [Digg] [dzone] [Facebook] [Ma.gnolia] [Mister Wong] [Reddit] [Sphere] [Sphinn] [StumbleUpon] [Technorati] [Email]


Showing List of recently Created blogs on wordpress Mu

Jotted by brajesh on

Working on one of my client’s project recently,I found myself looking for some code to show list of recently created blogs on a wordpress Mu website.

After googling for around 15 minutes,I could not find anything to help me.
Finally,I decided to write the code myself.

The code is pretty straight forward,you may include it directly in your theme or use as a plugin.
Here goes the snippets of code dissected.

<?php
/*Fetch an array of $number_blogs most recently created blogs
**@number_blogs :The number of most recently created blogs you want to show.
*/
function get_recent_blogs($number_blogs=5)
{
  global $wpdb;
  $blog_table=$wpdb->blogs;
/*fetch blog_id,domain,path from wp_blogs table ,where the blog is not spam,deleted or archived order by the date and time of registration */
  $query="select blog_id,domain,path from $blog_table where public='1' and archived='0' and spam='0' and deleted='0' order by registered desc limit 0,$number_blogs";
 
  $recent_blogs=$wpdb->get_results($wpdb->prepare($query));
 
return $recent_blogs;
 
 }
?>

It returns an array of objects having the fields blog_id,domain,path. So now,if you are like me, you may be interested in showing a bulleted list(or simply a list of these all the blogs recently created ),you may do following

<ul class="recent-blogs">
<?php $recent_blogs=get_recent_blogs(5);
	foreach($recent_blogs as $recent_blog):
		$blog_url="";
		if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes' )
			$blog_url="http://".$recent_blog->domain.$recent_blog->path;
		else
		$blog_url="http://".$recent_blog->domain.$recent_blog->path;
	$blog_name=get_blog_option($recent_blog->blog_id,"blogname");
	?>
<li>
<h3><a href="<?php echo $blog_url;?>"><?php _e( $blog_name)?> </a></h3>
<span><?php echo $blog_name?></span>
</li>
<?php endforeach;?>
</ul>

That’s It.we are done.Well ,to make it more easy,I have created another function show_recent_blogs which has a prototype like following

<?php
function show_recent_blogs($number_blogs=5,$description=true)
?>

It will output similar to the above code,but if you call it like

<ul class="recent-blogs">
<?php
/*here first argument is the number of blogs you want to show */
 
show_recent_blogs(5,false);
?>
</ul>

It will not show the description.
You may download the whole file as a plugin here and Can drop it in your wp-content/mu-plugins folder or include in your themes functions.php.
Here is a screen shot from my test blog
recent-blog-list

Well,you may have a look at my template where I experimented this on the site http://clients.wpmudemo.com/motionsblogg
Have a look at the bottom of the right sidebar.

And here is the Plugin for download.List recently Created blogs (109)

[blinklist] [Bloglines] [del.icio.us] [Digg] [dzone] [Facebook] [Ma.gnolia] [Mister Wong] [Reddit] [Sphere] [Sphinn] [StumbleUpon] [Technorati] [Email]



Get Adobe Flash playerPlugin by wpburn.com wordpress themes