View,share ,embed microsoft office files online

Jotted by brajesh on May 27, 2009

As a developer,I have been using openoffice for documentation purposes.Last day ,one of my client sent me a docx file,and I was not able to open it in open office.I tried google docs, bit it too does not support docx format.
after a couple minutes of googling,I found a wonderful site.I thought,I would share it with you all.The site is thinkfree.com.
ThinkFree:well as the name says, It is an awesome website with all the feature,you are looking from the Microsoft office.Further,It allows,sharing doc,embedding doc in pages,and viewing docs online.
thinkfree.com

Try yourself here http://thinkfree.com/

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


Checking Programatically whether inside the wordpress post loop or not

Jotted by brajesh on May 24, 2009

Well,that sound easy ,Yes it is.While building my last plugin “wp-colored-post-titile”,I was in the dilemma to check ,whether inside the post loop or not.I looked through google,but could not find anything meaningful,not on wordpress codex too[Now It is as I added it on conditional tag page].So I started exploring the code and looking through query.php,I found this very useful function ,specially for plugin developers.

To check whether you are inside the loop or not ,you can use this function
in_the_loop()

<?php
if(in_the_loop()) /** if the curretn code is called from inside the loop */
 //do something meaningful.
?>

Now let me show you how I used it.I had to set colors for the post title.As you may be knowing ,wordpress provides the filter “the_title” for this purpose.My problem was,wordpress applies this filter to not only the title of post inside the loop ,but also to the title of post in navigation links,sidebar links(yes,I mean page titles).
So,I was in need of someway to make sure ,I apply the color to titles only when ,”the_title” filter is called from inside the loop.
My best friend “Google” ,could not help me in my problem ,so I started looking through the code .After a few minutes of search,I found the function inside the query.php
here is the example how I used it

<?php
/****code for my plugin goes here ***//
 
//apply the filter for post title
add_filter("the_title","wcpt_color_the_title");//call wcpt_color_the_title at the_title hook
 /**more codes goes here ****/
 
/**method to color the post title */
function wcpt_color_the_title($title)
{
 
global $post;
   $custom_field="_wcpt_title_color";
     $color_hex=get_post_meta($post->ID,$custom_field,true); /** get the color associated with current post title */
if(empty($color_hex)) /**if color hex is empty ..just return the title */
       return $title;
/** we are ,that means the color hex is not empty */
if(in_the_loop())	 /**so ,if we are inside the loop,let us modify the color of the post */
return "<span style='color:".$color_hex."'>$title</span>";
else                           /*** for all other conditions return the title */
return $title;
}
 
?>

Now , you may see ,how much useful this function was for me.May be it can save some time for you too.
btw,Now it is available on WordPress codex, and you may have a glance here
http://codex.wordpress.org/Conditional_Tags#Inside_The_Loop

[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