Buy at Flipkart

Flipkart.com

Monday, July 4, 2011

Embedding +1 (Google Plus) on MediaWiki sites

Here are the steps that I followed for embedding +1 button on a MediaWiki Site that I administer - called as GeetShabda - which is a place for sharing lyrics for Marathi songs.

See this Page to see it working!

As per the code provided by Google on the Webmasters site - I started exploring options to include it in the MediaWiki site. However, I could not find any ready steps - so I decided to share this with everyone.

1. <!-- Place this tag in your head or just before your close body tag -->
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

2.  <!-- Place this tag where you want the 1 button to render -->
     <g:plusone></g:plusone>


Steps for MediaWiki installations:
(I am a newbie to Mediawiki and hence this might not be the *best way* to achieve this)
  1. Go to LocalSettings.php
    1. Add the following code
 $wgHooks['BeforePageDisplay'][]  = 'MyExtensionJavaScript';
function MyExtensionJavaScript( $out ) 
{
  # -----------------------------------------------
  #  Merge JavaScript into OutputPage
  # -----------------------------------------------
  $script = '<script type="text/javascript" language="javascript" src="https://apis.google.com/js/plusone.js">'
                    . '</script>';
  $out->addScript( $script);
  return true;
}    
 --- This ensures that the step (1) above happens correctly. and the plus one API is loaded and referenced from the HTML head.

              2. Go the the .php file . In my case the site uses the Vector template and hence I edited the Vector.php
                          1. In Vector.php add the below code after

<!-- firstHeading -->
<h1 id="firstHeading" class="firstHeading"><?php $this->html( 'title') ?>
<g:plusone size="medium" href="/"></g:plusone>
</h1>
<!-- /firstHeading -->

And voila - You would have a +1 Button on all your pages.

Update: 14-July: Rendering of code update (as per comment by Tom. Thanks!)

Friday, September 10, 2010

Beautifying Wiki URL(s)

Recently, I started helping my sister for developing geetshabda . The site (project) aims to build the largest repository of information on music in local languages in India and especially Marathi - to begin with.

Due to this, I decided to get my hands dirty into MediaWiki.  Below tips should help you in setting up clean URL(s) for your media-wiki installation on GoDaddy.

    * When testing these instructions, be sure to launch a new browser instance to prevent browser caching from hiding the latest configuration changes.

[edit] .htaccess
Create .htaccess in wiki installation directory (with GoDaddy File Manager or by FTP) with this content:

RewriteEngine On
RewriteRule ^wiki/(.*)$ /index.php?title=$1 [PT,L,QSA]
RewriteRule ^wiki/*$ /index.php [L,QSA]
RewriteRule ^/*$ /index.php [L,QSA]

[edit] LocalSettings.php

Add the following to the end of LocalSettings.php (in Subdomain directory):

# SHORT URLS:
$wgScriptPath = ""; # Path to the actual files
$wgArticlePath = "/wiki/$1"; # Virtual path

It may be necessary to set $wgUsePathInfo to true with this code:

$wgUsePathInfo = true;

Thursday, January 7, 2010

Best Programming Quote Ever.

It should be noted that no ethically-trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to write a DestroyCity procedure, to which Baghdad could be given as a parameter.

-Nathaniel_Borenstein

Posted via web from nishantmodak's posterous

Thursday, December 10, 2009

Marissa Mayer Talk @ Le Web

Today, I am posting a link to a 30 minute interview of Marissa Mayer by Michael Arrington.

It deals with all the topic of real time web, streams, future search and things Google is dabbling on right now.

1. For finding interesting topics, I used to search on google. 
2. Now? I get all those interesting data from twitter.

Google's approach towards solving all the problem including those with newspapers, real time web et all. are well talked about in this video.

Take Aways? 
1. Authoritarian Search . - (twitter, Experts on topic.)
2. Newspaper evolution - More of the approach of Google towards solving that. - Do you see some opportunities here?
3. 'Getting' Wave. - I should try out - my friends' 100 threads discussions onto that. Should be fun.
4. Goggles.

On another note, UStream.tv release the live broadcasting app today. - which is TOTALLY cool.

Posted via email from Emerging Technologies