All Articles by Sangkrit

Register/transfer domain names at http://system.sangkrit.net and mail to system@sangkrit.net to get your web/app made/managed as per the budget allocated.

4508 Articles

Google Apps Status Dashboard

Google Apps Status Dashboard offers you the performance information on Google Services (Apps). It applies to both consumer services and for organisations using Google Apps Services. You can visit Google Apps Status Dashboard anytime to view current running status of App Services. You may switch to its RSS feed.

Remember:

  1. Green Dot means No Issues
  2. Pink Dot means Service outage
  3. Orange Dot means Service disruption

Move Across WordPress Draft, Pending And Publish Post Statuses

Don’t use register_post_status before init. Register Post Status is a function used to create and modify post status based on given parameters. register_post_status() function is located in wp-includes/post.php It accepts following two parameters:

  • $post_status means a string for the post status name
  • $args means an array of arguments

<?php register_post_status( $post_status, $args ); ?>

Example:
(Following example registers “Unread” post status:

function my_custom_post_status(){
register_post_status( ‘unread’, array(
‘label’ => _x( ‘Unread’, ‘post’ ),
‘public’ => true,
‘exclude_from_search’ => false,
‘show_in_admin_all_list’ => true,
‘show_in_admin_status_list’ => true,
‘label_count’ => _n_noop( ‘Unread <span class=”count”>(%s)</span>’, ‘Unread <span class=”count”>(%s)</span>’ ),
) );
}
add_action( ‘init’, ‘my_custom_post_status’ );

Where:

  • label is a descriptive name for the post status marked for translation.
  • public – Set true to show posts of this status in the front end. Defaults to false.
  • exclude_from_search – Set true to exclude posts with this post status in search results. Defaults to false.
  • show_in_admin_all_list – Defines whether to include posts in the edit listing for their post type.
  • show_in_admin_status_list – Shows in the list of statuses with post counts. Example: Published (12)
  • label_count – The text to display on admin screen or you won’t see status count.

Find A Perfect App In Chrome Web Store By Taking A Little Help From Your Google+ Friend Circles

Now Google Chrome Web Store helps you to share all your Google Chrome’s  items in your Google+ Circles. You may do so by finding them in Chrome’s Web Store and clicking +1 (located in store detail page).

And by clicking “From your circles” (located in Chrome Web Store’s category menu) you can review different apps and themes recommended by your friends. Now it is easy to find right app, you would be getting app suggestions from Chrome Web Store on the basis of all that apps +1’d by your friend circle in Google+.

AdSense Toolbar For Google Chrome

AdSense Publisher Toolbar is a Google extension which help you to access AdSense earning reports very quickly. It displays its report on the same page which you are reading.

It gives AdSense Publishers two different ways to access real time information about your account. It shows your AdSense earnings for the last day, present day, last month, present month . It also displays revenue data for top channels created by you in your AdSense account.

With Pop-up account overview you can view the following:

  1. Summary of account earnings (today, yesterday, this month, last month)
  2. Top 5 custom channels (with selectable date range)
  3. Top 5 URL channels (with selectable date range) And
  4. Lifetime revenue

In-site ad overlay provides you following options:

  1. It overlays for both adunit-based and legacy AdSense ads for the logged in user
  2. It overlays for DoubleClick for Publishers (DFP) tags on overlay-enabled domains
  3. Provides instant summary reporting on adunit-based AdSense tag overlays
  4. Provides instant summary reporting on legacy AdSense tags with custom channels

New in 3.x:

  1. A cleaned and light overlay.
  2. Supports for AdExchange Seller publishers.
  3. New panel with Ad Details
  4. Provides URL blocking in the Ad Details panel
  5. Provides creative blocking for ALL Ad Review Center users
  6. Feedback and Reporting on problems related to Ads

After you install AdSense Toolbar Extension it connects with your Google AdSense Account and uses AdSense API in the process of fetching your earnings data.

How To Add Facebook Chat On Firefox Sidebar

1. Open Firefox browser.

2. Move to top navigation menu

3. Select Bookmarks >> New Bookmark

4. Place a new bookmark with following details:

  • Name it “Facebook Chat”
  • Set location at http://www.facebook.com/presence/popout.php
  • Check this “load this bookmark in sidebar”

5. Load Firefox sidebar from View >>Sidebar >> Booksmarks

Show Related Posts In Your WordPress Blog Without Using Any Plugin

Copy and Paste the given code within the loop. It may engage your blog visitors to stay for a longer time:

<?php
//for use in the loop, list 5 post titles related to first tag on current post
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo ‘Related Posts’;
$first_tag = $tags[0]->term_id;
$args=array(
‘tag__in’ => array($first_tag),
‘post__not_in’ => array($post->ID),
‘showposts’=>5,
‘caller_get_posts’=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a></p>
<?php
endwhile;
}
}
?>

This code displays posts related to current post. It is based on tags. You may change the number of posts it displays, just change ‘showposts’=>5 with your number.

Display Popular Posts In Your WordPress Blog’s Sidebar Without Using Any Plugin

You can highlight most popular content of your WordPress site in your sidebar. Copy-Paste the following code in your theme’s sidebar.php file:

<h2>Popular Posts</h2>
<ul>
<?php $result = $wpdb->get_results(“SELECT comment_count,ID,post_title
FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5″);
foreach ($result as $post) {
setup_postdata($post);
$postid = $post->ID;
$title = $post->post_title;
$commentcount = $post->comment_count;
if ($commentcount != 0) { ?>
<li><a href=”<?php echo get_permalink($postid); ?>” title=”<?php echo
$title ?>”>
<?php echo $title ?></a> {<?php echo $commentcount ?>}</li>
<?php } } ?>
</ul>

It displays most popular posts on your site’s sidebar.

For changing the number of posts to display in your sidebar:

Look-up for this line in the above code block: FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5″); and Replace 5 with the number of posts you like to display.

Easiest Way for Displaying both Popular and Unpopular Posts in your Sidebar:

Now easiest way to do this (display popular posts) and many other similar things like displaying both popular and unpopular posts, knowing the number of post hits is to use Most and Least Read Posts Widget Plugin

Download from the link, activate it and start using it by placing its widgets in your sidebar. It gives you two different widgets one shows most read posts and the other shows least read posts and also it counts your post hits both on sidebar and in your dashboard All Posts list.

Add “Pin It” Button To Your Google Chrome’s Bookmark Bar

For installing “Pin It” button in your Chrome:

  1. Visit Pinterest Goodies.
  2. Display your bookmark bar if it is hidden: Visit Wrench Icon (present at the top right corner of chrome) >> Bookmarks >> Check Show Bookmarks Bar
  3. There is a “Pin It” button on that page. Drag it to your bookmark bar.
  4. Now while browsing the web you can pin any image by pressing this “Pin It” button.

Watch this video tutorial:

[iframe][/iframe]

Add ‘Pin It’ Button To Images In Your WordPress Blog

Without using Plugin: Add this code to your theme’s footer.php file before the </body> tag. Get Pinterest’s javascript at Goodies.

<script type=”text/javascript” src=”//assets.pinterest.com/js/pinit.js”></script>

Add this code to your theme’s single.php file wherever you want Pin It button to be visible:

<a href=”http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php echo catch_that_image() ?>&description=<?php the_title(); ?>” class=”pin-it-button” count-layout=”horizontal”><img border=”0″ src=”//assets.pinterest.com/images/PinExt.png” title=”Pin It” /></a>

Add this code in your theme’s functions.php file:

function catch_that_image() {
global $post, $posts;
$first_img = ”;
ob_start();
ob_end_clean();
$output = preg_match_all(‘/<img.+src=[‘”]([^'”]+)[‘”].*>/i’, $post->post_content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
$first_img = “/images/default.jpg”;
}
return $first_img;
}

Or You may use a WordPress plugin and that would be more easy for you. Use this plugin Pinterest Pin It Button For Images. Either search it on WP Plugin search or click the link and upload the folder to the /wp-content/plugins/ directory, Activate from ‘Plugins’ menu and Enjoy.

Hide Post Images Without Removing Thumbnail Image In Category Archive

Given code hides post images but keeps thumbnail image in Category archive and homepage. Add following code block in your theme’s function.php:

function wpi_image_content_filter($content){

if (is_home() || is_front_page() || is_category()){
$content = preg_replace(“/<img[^>]+>/i”, “”, $content);
}

return $content;
}
add_filter(‘the_content’,’wpi_image_content_filter’,11);

Facebook Marketing Team Released Facebook Posters For Your Business

Facebook marketing team has released posters that you can use in your business stores after printing them. Its PDF so you can print them and put it in your office, stores or anywhere you want to encourage your clients, customers and others who visit your business place to join your page on Facebook. Also if you like you may put it in your website linking to your Facebook page but these posters are better for using as printable posters and for websites those old Facebook badges are fine.

Download all posters from here: http://ads.ak.facebook.com/ads/FacebookAds/Facebook_Signs.pdf

How To Grant Privilege To Any MySQL Database User ?

GRANT command is be used for giving privilege to any user for accessing database.

GRANT PRIVILEGES ON DATABASE OBJECTS TO USER@HOST IDENTIFIED BY ‘PASSWORD’;

Example:

For granting privilege to user  admin Use:

GRANT ALL PRIVILEGES ON *.* TO ‘admin@localhost’ IDENTIFIED BY ‘secret’;

For specifying the username and password which is used while staring MySQL is:

mysql –h hostname –u username –p password

When you don’t want users to access any other database tables then replace* (as shown below) with database name of that particular user whom you want to limit access to other database tables:

GRANT ALL PRIVILEGES ON ‘store’.* TO ‘admin@localhost’ IDENTIFIED BY ‘secret’;

Run given command with root permission. In the given command ‘store’ correlates to the name of database to which the privileges are assigned.

Adblock Plus For Annoyance-free Web Surfing

Adblock Plus is good if you need to block  undesirable website elements to appear on web pages while you are surfing the internet. Subscribe a free filter service and add undesirable website elements to the block list with just a single click.

Use sudo apt-get install xul-ext-adblock-plus command to install this app from your Linuc terminal.

Visit Firefox >> Tools >> Add-ons >> Get Add-ons >> Search All Add-ons >> AdBlock Plus to add Addblock extension to your Firefox web web browser.

Visit Adblock Plus Webiste