By Nitin on April 23, 2011
I use the upgraded awesome plugin Jetpack by WordPress.com to show the ‘Top Posts’ is the sidebar. I recently noticed that the links for these post were broken, even though I wasn’t doing anything wrong at all. I queried the plugin for top 5 posts using:
$top_posts = stats_get_csv('postviews', 'days=-1&limit=6&summarize');
echo '<ul class="most-viewed">';
foreach ( $top_posts as $p ) {
if($p['post_id'])
echo '<li><a href="'. $p['post_permalink'] .'" title="'.
$p['post_title']. '">'. $p['post_title'] .'</a> - <strong>'. $p['views'] . '</strong> views</li>';
}
echo '</ul>';
But somehow, the value at post_permalink key was wrong. Instead of pulling out my hair, I downloaded the Jetpack plugin’s source code, opened the file stats.php and copied a few lines and now the following works awesomely well.
if ( function_exists('stats_get_csv') && $top_posts = stats_get_csv('postviews', 'days=-1&limit=6&summarize')) {
echo '<ul class="most-viewed">';
foreach ( $top_posts as $p ) {
if($p['post_id'] && get_post($p['post_id']))
echo '<li><a href="' . get_permalink( $post['post_id'] ) . '">' .
get_the_title( $post['post_id'] ) . '</a>', number_format_i18n( $post['views'] ) </li>';
}
echo '</ul>';
}
I hope this helps people looking for a quick fix to this problem.
Posted in Wordpress | Tagged tutorial, Wordpress
By Nitin on April 23, 2011
After four months of relatively slow development of Facebook-style Micropublisher (FBSMP), I am happy to tag the branch with 6.x-1.1 release. It might be the last release for this branch, as I would now be upgrading FBSMP to support the latest 6.x-3.x branch of Facebook-style Statuses.
A lot of cool features are coming up with this release especially in the beloved link plugin,
- link plugin: allow users to share links to audio sharing sites such as soundcloud, 8tracks.
- Repost the attachments along with status (similar to re-share and re-tweet functionality), supported by link and photo plugin.
- link plugin: inline editing of title and description, cool JS.
- link plugin: edit the title and description field of the attachment.
- Support for processing GET parameters in the URL.
- link plugin now allows to share the URL using the flink GET parameter. More…
The complete list of features and bug fixes can be found in the release notes.
I hope you enjoy creating amazing sites using the new features and share them here for the world to know how cool this module is
Posted in Drupal | Tagged Drupal, fbsmp, module
By Nitin on February 6, 2011
Do you feel passionate about any open source technology? Or you want to explore one during your summer vacations? On the top of it, if you get a mentor to guide you all along and a stipend of 5000 USD, would you be interested? Yeah! Keep reading then.

GSoC 2011
Google announced its consecutive 7th year for Summer of Code program on January 24, 2011. Google Summer of Code program encourages students from all over the world to engage in open source project development of their choice for 3 months.
Look out for the details of the program here: http://socghop.appspot.com/ and the timeline: http://www.google-melange.com/document/show/gsoc_program/google/gsoc2011/timeline
Keep reading this post
Posted in Drupal, Nitin's Blog | Tagged Drupal, gsoc
By Nitin on December 26, 2010
Posted in Nitin's Blog
By Nitin on December 25, 2010
After months of hard work and support from Isaac and Thomas, I am proud to announce the first stable release of Facebook-style Micropublisher (FBSMP). FBSMP allows user to share content such as links, videos, photos and documents along with their Facebook-style Statuses. It allows you to create a social networking site similar to Twitter, Facebook, Google Buzz and others out-of-the-box. On the top, it integrates with a lot of other Drupal modules (as Activity, Trigger, Rules, Heartbeat, ImageCache, EmVideo, UserPoints, and more) which lets you do a lot more things with your website.
What’s in the box
As of today, FBSMP supports the following features:
- Attaches content using AHAH which keeps everything smooth.
- Publishes links, photos, videos, documents (ppt, doc, pptx, odt, etc) out of the box.
- Extensible to publish any kind of content.
- Integration with Activity 2, Rules, Heartbeat, Triggers/Actions, Input Filters, Views, ImageCache, Token, Application Toolbar(Appbar), Emvideo, Userpoints (through Rules), SlideShare.net API and more.
- Extensive developer API (including hooks) and theming methods.
It is difficult for me to elaborate on all the plugins (a plugin allows to publish one kind of content, for example Link plugin allows you to share your favorite links, Photo plugin allows you to share images on your site.), so you will have to explore them yourself. You can look at the documentation here: http://drupal.org/node/876500
How to get involved
Enjoy it with your holidays, wish you all a Merry Christmas and a great year ahead.
Note: Feature and Support requests should be made through the Facebook-style Micropublisher Forum. I may not be able to answer them here.
Posted in Drupal, Projects | Tagged Drupal, facebook, fbsmp, module
By Nitin on November 22, 2010
I worked on the module Facebook-style Micropublisher (FBSMP) for Drupal, this summer as part of the Google Summer of Code program mentored by Isaac Sukin. This module lets users publish content (links, images, videos and documents) in a stream, along with their Facebook-style Statuses (like on Facebook, or Twitter). When I say that I worked on it as part of GSoC, it would be only partly true. I started working on it around March 2010, when I was contacted by Thomas to create a Drupal module for his site which would imitate the link share feature from Facebook, Google Buzz. I wrote the small module Facebook-style Links, which worked quite well but it was then this occurred to me, “why not create a module which can publish any content, which is extensible to publish any kind of content like images, links, videos, documents, audio, etc”.
Today, I am happy to say that Drupal now has a complete Micropublisher which can be used to create any kind of microblogging platform such as Facebook, Google Buzz, Twitter, etc. I will be posting the first release of the module soon, but before here is the small list of features and a few screenshots. Keep reading this post
Posted in Drupal, Projects | Tagged Drupal, facebook, fbsmp, module