<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sanjeev Shrestha &#187; PHP</title>
	<atom:link href="http://www.sanjeevshrestha.com.np/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sanjeevshrestha.com.np</link>
	<description>Blogging on Joomla Development /Codeigniter/JQuery/Mootools/Wordpress - All Related to Web</description>
	<lastBuildDate>Sun, 09 May 2010 08:15:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating Color Element in Joomla for custom parameter type</title>
		<link>http://www.sanjeevshrestha.com.np/2010/01/creating-color-element-in-joomla-for-custom-parameter-type/</link>
		<comments>http://www.sanjeevshrestha.com.np/2010/01/creating-color-element-in-joomla-for-custom-parameter-type/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 15:14:58 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[color element]]></category>
		<category><![CDATA[color element for joomla]]></category>
		<category><![CDATA[color picker for joomla]]></category>
		<category><![CDATA[custom parameters]]></category>
		<category><![CDATA[Joomla element]]></category>
		<category><![CDATA[moorainbow]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2010/01/creating-color-element-in-joomla-for-custom-parameter-type/</guid>
		<description><![CDATA[Elements are of utmost importance in Joomla development. Elements allows you to create custom parameter type that you can use in your metadata files. Metadata files are xml files that are used to provide configuration parameters to your component, module, plugin or even views. Metadata files for your views are used configure menu links that [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/04/joomla-ogo.png" alt="" />Elements are of utmost importance in Joomla development. Elements allows you to create custom parameter type that you can use in your metadata files. Metadata files are xml files that are used to provide configuration parameters to your component, module, plugin or even views. Metadata files for your views are used configure menu links that that will use that view.</p>
<p>In this short tutorial, I will tell about creating elements and using it differently on different places. Elements are special files that generally adds value to parameters. For this tutorial, I will create a color element that  can be used in different components, modules, plugins where color selection is done through a color picker. I will use <a href="http://moorainbow.woolly-sheep.net" target="_blank">moorainbow</a> as web color picker. <!-- more --><span id="more-351"></span><br />
Also note, I am creating this element for my <a href="http://www.gobingoo.com" target="_blank">adsensebingo module</a>. Hence this code has been tested and used.</p>
<h1>Creating Color Element File</h1>
<p>Element file are generally single php file that has element class that extends JElement base class. The class overrides fetchElement method  of JElement Base class to provide color picker.<br />
Let us create a folder that will hold all files necessary for color element.  Let us call this folder &#8220;element&#8221;. Download the latest moorainbow library and place it in a subfolder directly below the elements folder. Now create a color.php file . This file is the element file and has a class JElementColor that extends JElement base class.<br />
Now override fetchElement method of JElement base class.  The important part of element is the fetchElement method. This method actually returns data that can be used by parameters.</p>
<p>A little explanation about fetchElement is necessary. method fetchElement requires 4 arguments namely<br />
$name &#8211; is the unique name of the parameter, from the <strong>name</strong> argument.<br />
$value &#8211; is the current value of the parameter.<br />
$node &#8211; is a <em>JSimpleXMLElement</em> object representing the <em>&lt;param&gt;</em> element.<br />
$control_name &#8211; is the parameter type from the <strong>type</strong> argument (eg. &#8216;category&#8217; or &#8216;color&#8217;).</p>
<p>The fetchElement method for Color element is as below</p>
<pre class="brush:php">function fetchElement($name, $value, &amp;$node, $control_name)
{
        ob_start();
        $img=JUri::root()."modules/mod_adsensebingo/elements/moorainbow/images/rainbow.png";
        $imgx=JUri::root()."modules/mod_adsensebingo/elements/moorainbow/images/";
        static $embedded;
                if(!$embedded)
        {
            $css2=JUri::root()."modules/mod_adsensebingo/elements/moorainbow/css/mooRainbow.css";
            $jspath=JUri::root()."modules/mod_adsensebingo/elements/moorainbow/js/mooRainbow.js";
             ?&gt;
&lt;link
    href="&lt;?php echo $css2;?&gt;" type="text/css" rel="stylesheet" /&gt;
&lt;script src="&lt;?php echo $jspath;?&gt;"&gt;&lt;/script&gt;

            &lt;?php
            $embedded=true;

        ?&gt;
&lt;script&gt;

            window.addEvent('domready',function(){
//Get sibling function from http://www.sanjeevshrestha.com.np
                Element.extend({
                    getSiblings: function() {
                        return this.getParent().getChildren().remove(this);
                    }
                });
            $('.rainbowbtn').each(function(item){

         item.color=new MooRainbow(item.id, {
                    startColor: [58, 142, 246],
                    wheel: true,
                    id:item.id+'x',
                    onChange: function(color) {

                    item.getSiblings()[0].value = color.hex;
                    },
                    onComplete: function(color) {

                    item.getSiblings()[0].value = color.hex;
                    },

                    imgPath: '&lt;?php echo $imgx;?&gt;'

                });

                });
            });
            &lt;/script&gt;
            &lt;?php
        }
            ?&gt;
            &lt;label&gt;
&lt;input
    name="&lt;?php echo $control_name;?////&gt;[&lt;?php echo $name;?&gt;]" type="text"
    class="inputbox" id="&lt;?php echo  $control_name.$name ?&gt;"
    value="&lt;?php echo $value;?&gt;" size="10" /&gt;
&lt;img
    src="&lt;?php echo $img;? /&gt;" id="img&lt;?php echo $name; ?&gt;" alt="[r]"
    class="rainbowbtn" width="16" height="16" /&gt;&lt;/label&gt;
        &lt;?php

        $content=ob_get_contents();

        ob_end_clean();
        return $content;

    }</pre>
<p>That is it.</p>
<h1>Using it in Module Parameters.</h1>
<p>Now let us use this in module parameter. Parameters are generally written in<br />
element block. For these params block to render our color element we need to specify path to our elements folder in this params element node as below</p>
<pre class="brush:xml">&lt;params addpath="[path]/elements"&gt; &lt;/param&gt;
--- list of &lt;param&gt; elements ---
&lt;/params&gt;</pre>
<p>In our case this is written as</p>
<pre class="brush:xml">&lt;params addpath="/modules/mod_adsensebingo/elements"&gt; &lt;/param&gt;
&lt;param name="foreground" type="color" default="#CC0000" label="Foreground Color" description="Select foreground color for your google ad" &gt; &lt;/param&gt;
-- other &lt;param&gt; elements
&lt;/params&gt;</pre>
<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2010/01/shot.jpg" alt="" />Now this block is aware of new elment type and knows where to find the element rendering code. The parameter section of module setting page now correctly shows a color picker.<br />
You can create any kind of elments, from a simple integer list to a complex color element or elements that shows records from your component. The usage is limitless.</p>
<p>That is all for color element. More to come on element tutorials till then happy reading.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=6b5df7d5-8092-87e7-9ea2-5ad121049b12" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2010/01/creating-color-element-in-joomla-for-custom-parameter-type/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Paypal Donation Module for Joomla</title>
		<link>http://www.sanjeevshrestha.com.np/2009/12/paypal-donation-module-for-joomla/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/12/paypal-donation-module-for-joomla/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 15:20:00 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[MyUpdates]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[collect donation]]></category>
		<category><![CDATA[joomlaguru.com.np]]></category>
		<category><![CDATA[OSDonate]]></category>
		<category><![CDATA[Paypal Donation Module]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/12/paypal-donation-module-for-joomla/</guid>
		<description><![CDATA[A small donation can make a big difference to opensource developers who devote few hours a day to help a community of users. I also develop extensions for Joomla and release it for others to use. Joomlaguru.com.np is one of my site that is devoted to help Joomla users. Small or Big, donations matter to [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: left; margin-top: 10px; margin-bottom: 10px; margin-right: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/12/osdonate-logo.png" alt="" />A small donation can make a big difference to opensource developers who devote few hours a day to help a community of users. I also develop extensions for <a href="http://www.joomla.org" target="_blank">Joomla</a> and release it for others to use. <a href="http://www.joomlaguru.com.np" target="_blank">Joomlaguru.com.np</a> is one of my site that is devoted to help Joomla users. Small or Big, donations matter to opensource projects and developers.</p>
<p>Recently I created a donation module for joomla that collects donations on Joomla sites. This module uses <a href="http://www.paypal.com" target="_blank">Paypal</a> to collect donations and is simple to setup and you can get it up and running within a minute. This module is free to use and is released under <strong>GNU/GPL. </strong> You can see live demo of the module at <a href="http://www.joomlaguru.com.np" target="_blank">www.joomlaguru.com.np</a>. <span id="more-334"></span></p>
<h2>Features</h2>
<p>Version 1.0 has following features. You can view the parameters for this module. This module has rich set of configuration options as explained below.<br />
<img style="max-width: 800px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/12/osdonate-parameters-21.png" alt="" /></p>
<p><strong>Select Server </strong>- This has two options and lets user to select between live and sandbox environment on paypal.</p>
<p><strong>Paypal Merchant  Email/ID </strong>- Paypal Email. You can also enter paypal merchant ID instead of paypal email. This increases security without exposing your email address.</p>
<p><strong>Donate To Text </strong>- Configure text that is displayed on invoice and paypal donation collecting form.</p>
<p><strong>Fixed Donation</strong> &#8211; You can choose to accept fixed donations or Donation through input box or a drop down box. If you select fixed donations, please enter donation amount in next field too. If you select &#8220;Show amount in select box&#8221; user is presented a drop down box with different denominations. These denominations can be configured from a file that is under<strong> modules-&gt;mod_osdonate-&gt;data-&gt;amounts.dat</strong></p>
<p><strong>Fixed Amount Donation</strong> &#8211; Fixed donation amount. This is used only when fixed_donation is active.</p>
<p><strong>Your locale currency </strong>- Select currency in which you want to accept donation. Be advised this currency should be active in your paypal. If not this may cause error. You can add currencies in your paypal account. Please refer to paypal help on more about this.</p>
<p><strong>Your Country locale </strong>- Select your country. This should be from your paypal account.</p>
<p><strong>Thank you page</strong> &#8211; Select article that will be displayed when user makes a successful payment through paypal donation form.</p>
<p><strong>Cancel Page</strong> &#8211; Select article that will be displayed when user cancels the payment.</p>
<p><strong>Donation Intro Text </strong>- Text that will be displayed before paypal donate button. Be expressive and a little funny to your viewers. <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Donation Post Text</strong> &#8211; Text that will appear after the donation button.</p>
<p>This is all you need to collect donations from your joomla site.</p>
<p>You can view more details about this module <a href="http://www.joomlaguru.com.np/documentation/modules/osdonate" target="_blank">here</a>. Also you can download the module <a href="http://www.joomlaguru.com.np/freebies/modules/13-modosdonate.html" target="_blank">here</a>.</p>
<p>If you like this module consider contributing at <a href="http://www.joomlaguru.com.np" target="_blank">Joomlaguru.com.np</a>. Your small contribution can make a difference.</p>
<form id="donateplusform" action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" id="cmd" name="cmd" value="_donations">
			<p class="donate_amount"><label for="amount">Donation Amount:</label><br /><input type="text" name="amount" id="amount" value="10" /> <small>(Currency: USD)</small></p>
			<p class="recognition_wall"><label><input type="checkbox" id="recognize" name="recognize" value="1" /> Put my Donation on the Recognition Wall</label></p>
			<div id="wallinfo">
			<p class="show_onwall" id="wallops"><label for="show_onwall">Show on Wall:</label><br /><select name="item_number">
				<option value="0:">Do not show any information</option>
				<option value="1:">Donation Amount, User Details &amp; Comments</option>
				<option value="2:">User Details &amp; Comments Only</option>
			</select></p>
			<p class="donor_name"><label for="donor_name">Name:</label><br /><input type="text" name="on0" id="donor_name" /></p>
			<p class="donor_email"><label for="donor_email">Email:</label><br /><input type="text" name="os0" id="donor_email" /></p>
			<p class="donor_url"><label for="donor_url">Website:</label><br /><input type="text" name="on1" id="donor_url" /></p>
			<p  class="donor_comment"><label for="donor_comment">Comments:</label><br /><textarea name="os1" id="donor_comment" rows="4" cols="45" style="width:90%"></textarea><br /><span id="charinfo">Write your comment within 199 characters.</span> </p></div>
<input type="hidden" name="notify_url" value="http://www.sanjeevshrestha.com.np/wp-content/plugins/donate-plus/paypal.php">
<input type="hidden" name="item_name" value="Contribution to sanjeevshrestha.com.np">
<input type="hidden" name="business" value="onemc.freelance@gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="return" value="http://www.sanjeevshrestha.com.np?thankyou=true">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
<p class="submit"><input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></p>
</form>
<p>Happy reading!! <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong> </strong></p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=6ccbd368-4fa7-858a-ae2e-e5df1d92067e" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/12/paypal-donation-module-for-joomla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JQuery Plugin for Joomla</title>
		<link>http://www.sanjeevshrestha.com.np/2009/12/jquery-plugin-for-joomla/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/12/jquery-plugin-for-joomla/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 03:08:43 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[MyUpdates]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[jquery plugin]]></category>
		<category><![CDATA[jQuery plugin for Joomla]]></category>
		<category><![CDATA[jquery with mootools]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[using jquery with joomla]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/12/jquery-plugin-for-joomla/</guid>
		<description><![CDATA[I recently released jQuery plugin for Joomla on joomlaguru.com.np. This is a simple plugin that allows user to use jQuery in Joomla and is based on my tutorial here. This plugin works in two modes and allows user a flexibility to replace or use jquery in conjunction with mootools.  This plugin is released under GNU/GPL [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/12/os-jquery-logo1.jpg" alt="" />I recently released <a href="http://www.joomlaguru.com.np/freebies/plugins/12-plgosjquery.html" target="_blank">jQuery plugin</a> for Joomla on <a href="http://www.joomlaguru.com.np" target="_blank">joomlaguru.com.np</a>. This is a simple plugin that allows user to use jQuery in Joomla and is based on my tutorial <a href="http://www.sanjeevshrestha.com.np/2009/05/using-jquery-with-joomla/" target="_blank">here</a>. This plugin works in two modes and allows user a flexibility to replace or use jquery in conjunction with mootools.  This plugin is released under GNU/GPL and is free as in free beer!</p>
<h2>Features</h2>
<p><strong>1. Two modes</strong></p>
<p>User can select to replace mootools with jQuery completely or use jQuery in conjunction with mootools. Using jQuery with mootools introduces noConflict features of jQuery and replaces &#8216;$&#8217; operator with jquery. This allows other libraries to use &#8216;$&#8217; operator without conflict.<span id="more-328"></span></p>
<p><!-- more --></p>
<p><strong>2. Where to use selection</strong></p>
<p>Use can select where to use jQuery. User can choose to use jQuery in frontend and/ or in administrator.</p>
<p><strong>3. Allows other application to check if jquery is loaded.</strong></p>
<p>This plugin also introduces a variable in application session that allows others to check if jquery is loaded or not. The illustration of use is as below\</p>
<blockquote>
<pre>    $app =&amp; JFactory::getApplication();

        //Check to see if jquery is already included
        if( $app-&gt;get('jquery') === true ) {

            //Code here

        }
    else
    {

    //Code here

    }</pre>
</blockquote>
<p>Here is the screenshot of plugin parameters</p>
<p><img style="max-width: 800px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/12/jquery-plugin-screenshot1.jpg" alt="" /></p>
<h2>License</h2>
<p>The module is released under GNU/GPL license and hence users are allowed distribute and modify the module without warranty what so ever. The developer does not bear any liability for the extension.</p>
<h2>Download</h2>
<p>Download the latest release from the download section of <a href="http://www.joomlaguru.com.np/freebies/plugins.html" target="_blank">joomlaguru.com.np</a> or you can <span class="download_link">click <a href="http://www.joomlaguru.com.np/freebies/plugins/12-plgosjquery.html" target="_blank">here</a></span> to download the plugin.</p>
<p>Send in your comments and feedbacks on the plugin. Hope you will like the plugin. Happy reading.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=371381cb-c8f5-848d-8f17-abbab3b451ee" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/12/jquery-plugin-for-joomla/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Analytics Plugin for Joomla</title>
		<link>http://www.sanjeevshrestha.com.np/2009/12/analytics-plugin-for-joomla/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/12/analytics-plugin-for-joomla/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 20:04:24 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[MyUpdates]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[analytics plugin for Joomla]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[google analytics for joomla]]></category>
		<category><![CDATA[joomlaguru.com.np]]></category>
		<category><![CDATA[osanalytics]]></category>
		<category><![CDATA[osanalytics ver 1.0 plugin for joomla]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/12/analytics-plugin-for-joomla/</guid>
		<description><![CDATA[I have created a google analytics plugin for Joomla. This plugin is simple and inserts google analytics code into joomla pages. This plugin is released under GNU/GPL license. The plugin is free and available from www.joomlaguru.com.np
Features
Website ID &#8211; Website ID from Google Analytics. These website ID are unique to each website profile.index.php?option=com_content
Domain &#8211; Enter domain [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: left; margin-top: 10px; margin-bottom: 10px; margin-right: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/12/osanalytics.jpg" alt="" />I have created a google analytics plugin for Joomla. This plugin is simple and inserts google analytics code into joomla pages. This plugin is released under GNU/GPL license. The plugin is free and available from <a href="http://www.joomlaguru.com.np" target="_blank">www.joomlaguru.com.np</a><span id="more-317"></span></p>
<h2>Features</h2>
<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/12/osanalytics-scrshot.jpg" alt="" />Website ID &#8211; Website ID from Google Analytics. These website ID are unique to each website profile.index.php?option=com_content</p>
<p>Domain &#8211; Enter domain without<strong> http://www</strong> e.g. <strong>joomlaguru.com.np</strong></p>
<p>Track &#8211; Select tracker type. User can select from tracker type. There are 3 types of tracker available.</p>
<ol>
<li><strong>Single Domain Tracker</strong><br />
Tracker Tracks single domain only.</li>
<li><strong>One Domain With Multiple Subdomains</strong><br />
Tracker tracks multiple subdomains under single domain</li>
<li><strong>Multiple Top Level Domains</strong><br />
Tracker tracks multiple top level domains.</li>
</ol>
<p>Download the <a href="http://www.joomlaguru.com.np/freebies/plugins/9-plgosanalytics.html" target="_blank">plugin from the joomlaguru.com.np download page.</a></p>
<p>If you find this plugin useful please consider contributing. Your contribution can make a difference<br />
<form id="donateplusform" action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" id="cmd" name="cmd" value="_donations">
			<p class="donate_amount"><label for="amount">Donation Amount:</label><br /><input type="text" name="amount" id="amount" value="10" /> <small>(Currency: USD)</small></p>
			<p class="recognition_wall"><label><input type="checkbox" id="recognize" name="recognize" value="1" /> Put my Donation on the Recognition Wall</label></p>
			<div id="wallinfo">
			<p class="show_onwall" id="wallops"><label for="show_onwall">Show on Wall:</label><br /><select name="item_number">
				<option value="0:">Do not show any information</option>
				<option value="1:">Donation Amount, User Details &amp; Comments</option>
				<option value="2:">User Details &amp; Comments Only</option>
			</select></p>
			<p class="donor_name"><label for="donor_name">Name:</label><br /><input type="text" name="on0" id="donor_name" /></p>
			<p class="donor_email"><label for="donor_email">Email:</label><br /><input type="text" name="os0" id="donor_email" /></p>
			<p class="donor_url"><label for="donor_url">Website:</label><br /><input type="text" name="on1" id="donor_url" /></p>
			<p  class="donor_comment"><label for="donor_comment">Comments:</label><br /><textarea name="os1" id="donor_comment" rows="4" cols="45" style="width:90%"></textarea><br /><span id="charinfo">Write your comment within 199 characters.</span> </p></div>
<input type="hidden" name="notify_url" value="http://www.sanjeevshrestha.com.np/wp-content/plugins/donate-plus/paypal.php">
<input type="hidden" name="item_name" value="Contribution to sanjeevshrestha.com.np">
<input type="hidden" name="business" value="onemc.freelance@gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="return" value="http://www.sanjeevshrestha.com.np?thankyou=true">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
<p class="submit"><input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></p>
</form></p>
<p>Hope you like this plugin. Happy reading!!</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=9a40f3b1-8e74-8bad-b29c-54098532a198" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/12/analytics-plugin-for-joomla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla1.6 Alpha 2 Released</title>
		<link>http://www.sanjeevshrestha.com.np/2009/10/joomla1-6-alpha-2-released/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/10/joomla1-6-alpha-2-released/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 05:50:43 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[MyUpdates]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[alpha 1.6]]></category>
		<category><![CDATA[new release]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/10/joomla1-6-alpha-2-released/</guid>
		<description><![CDATA[Good news and Congratulations to every Joomligans &#8211; The most awaited Joomla 1.6 is in its alpha 2. I personally believe this will be better joomla than ever. Better navigation, better organization of contents and better extension development environment and many more. The most important thing in this joomla for me is ACL management, still [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/04/joomla-ogo.png" />Good news and Congratulations to every Joomligans &#8211; The most awaited Joomla 1.6 is in its alpha 2. I personally believe this will be better joomla than ever. Better navigation, better organization of contents and better extension development environment and many more. The most important thing in this joomla for me is ACL management, still in its infancy but welcome abroad. <br /><span id="more-275"></span>The content management has gone slimmer with no sections and hierarchical categories. I always wondered why do we need sections if we had multi level categories and I think Joomla developers heard my prayers. <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> &nbsp; I see a update sub menu in extensions management, and I think this is a great feature to auto update the core and inspiration to component developers like me. I have personally developed an auto updating component and I will release it in public domain for testing. </p>
<p>The media manager is cool with multiple upload and that too with ajax but I could not get it running. Another inspiration for me <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>This is an opportunity and challenge for component developers like me to upgrade and update. I am getting my hands dirty on the new arrived code, better get yours too.</p>
<p>Download the latest release of joomla from here<br /><a target="_blank" href="http://joomlacode.org/gf/project/joomla/frs/?action=FrsReleaseBrowse&amp;frs_package_id=3585">http://joomlacode.org/gf/project/joomla/frs/?action=FrsReleaseBrowse&amp;frs_package_id=3585</a></p>
<p>Happy coding with joomla. <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=83c8de88-94d4-8064-a437-0d256b1d613f" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/10/joomla1-6-alpha-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating Past and Future dates in PHP</title>
		<link>http://www.sanjeevshrestha.com.np/2009/08/calculating-past-and-future-dates-in-php/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/08/calculating-past-and-future-dates-in-php/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 09:09:56 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[calculate date in past and future]]></category>
		<category><![CDATA[php date and time]]></category>
		<category><![CDATA[strtotime]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/?p=266</guid>
		<description><![CDATA[Have you wondered, if there was an easy way to find past and future dates in PHP? I had to work on something similar and to tell the truth I did not know that we had easy way around. Yes, I used to create my own library for this, silly me   .the strtotime [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/05/phplogo.jpg" />Have you wondered, if there was an easy way to find past and future dates in PHP? I had to work on something similar and to tell the truth I did not know that we had easy way around. Yes, I used to create my own library for this, silly me <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  .<br /><span id="more-266"></span>the strtotime function of php is very powerful but underutilised function. The strtotime function does not just convert strings to timestamp values but it can perform other functions with the help of its internal language. In this post we will learn about calculating past and future dates with the help of strtotime function.</p>
<p>The strtotime function not only converts the string to timestamp value but can also calculate future and past dates. Lets us see some examples</p>
<pre class="brush:php">

echo date("d-m-y", strtotime("- 7 days"));
</pre>
<p>This will print the date 7 days ago from current date. simple, isn&#8217;t it? yes we can pass offset values into strtotime. The offset values can be any integer followed by <b>days</b>, <b>weeks</b>, <b>months</b> and <b>years</b>. There are other predefined values like <b>now</b>, <b>today</b>, <b>tomorrow</b>, <b>yesterday</b>, <b>first saturday</b>, <b>last saturday</b>, <b>this saturday</b>, <b>next saturday</b>&nbsp; and so on. </p>
<p>some more examples to make the concept more clear:</p>
<pre class="brush:php">
echo date("d-m-y", strtotime("- 7 days"));
echo date("d-m-y", strtotime("+1 weeks"));
echo date("d-m-y", strtotime("- 1 months"));
echo date("d-m-y", strtotime("+ 2 years"));
echo date("d-m-y", strtotime("now"));
echo date("d-m-y", strtotime("yesterday"));
echo date("d-m-y", strtotime("last sunday"));
echo date("d-m-y", strtotime("this monday"));
echo date("d-m-y", strtotime("+2 weeks saturday"));
</pre>
<p>and in a case where you want to find 10 days from today you can simply use <br />echo date(&#8220;d-m-Y&#8221;, strtotime(&#8220;+10 days&#8221;));</p>
<p>And yes this is that simple. Don&#8217;t do it the hard way <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=1549e3b8-b741-8cad-b41d-14b597952b63" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/08/calculating-past-and-future-dates-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirecting a subdomain to script with .htaccess</title>
		<link>http://www.sanjeevshrestha.com.np/2009/07/redirecting-a-subdomain-to-script-with-htaccess/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/07/redirecting-a-subdomain-to-script-with-htaccess/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 05:50:30 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[redirecting]]></category>
		<category><![CDATA[subdomain]]></category>
		<category><![CDATA[subdomain to script]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/07/redirecting-a-subdomain-to-script-with-htaccess/</guid>
		<description><![CDATA[I recently had to work with .htaccess to redirect user to their homepage based on subdomain. The requirement was simple and is seen here and there and ofcourse everywhere now a days in different social networks. The requirement was redirecting http://username.domain.tld to http://domain.tld/user.php?u=username. This is just an example (Not similar to url I used). So [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/07/apache-logo2.png" align="right" />I recently had to work with<b> .htaccess</b> to redirect user to their homepage based on subdomain. The requirement was simple and is seen here and there and ofcourse everywhere now a days in different social networks. The requirement was redirecting <b>http://username.domain.tld</b> to <b>http://domain.tld/user.php?u=username</b>. This is just an example (Not similar to url I used). So how do we accomplish this with .htaccess. With .htaccess it is easy to redirect a subdomain to a script. See the .htaccess code below and I will explain how to do it.<span id="more-240"></span></p>
<p>
<blockquote>Options +FollowSymLinks<br />RewriteEngine On<br />RewriteCond %{HTTP_HOST} ([^\.]+).domain.(.*)<br />RewriteCond %{HTTP_HOST} !^exclude.domain.(.*)<br />RewriteCond %{HTTP_HOST} !^www.domain.(.*)<br />RewriteRule ^(.*)$ user.php?u=%1 [L,NC]</p></blockquote>
<p>(Use [R=301,NC] if you want to redirect the page instead of rewriting)<br />Whenever you use <b>mod_rewrite</b> (the part of apache that does the magic), you need to include these 2 lines before any ReWrite rules.<br /><b>Options +FollowSymLinks<br />RewriteEngine On</b></p>
<p><b>+FollowSymLinks</b> must be enabled for any rules to work (Security requirements)</p>
<p>The third line<b> RewriteCond %{HTTP_HOST} ([^\.]+).domain.(.*)</b> matches the host name (remember <b>%{HTTP_HOST}</b> is an environment variable.) and finds the subdomain (excluding any dot (.) in middle). The fourth and fifth line excludes the domain listed. This is necessary so that you don&#8217;t confuse the script to use unwanted subdomain. for e.g. in category.domain.tld the fourth line will exclude this domain. If we don&#8217;t exclude this domain it will rewrite to script with category as username.&nbsp; (pretty neat <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ). Also add as many subdomains you wish to use that are not users. The fifth line does the same. It excludes www.domain.tld to be redirected.</p>
<p>The sixth line does the magic. it rewrites to correct script with subdomain as parameter. (<b>%1</b> stores the subdomain).</p>
<p>That is all. It worked for me. let me know if it did for you! Happy .htaccess(ing)!<font face="sans-serif"></font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/07/redirecting-a-subdomain-to-script-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Multithreading in PHP</title>
		<link>http://www.sanjeevshrestha.com.np/2009/05/multithreading-in-php/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/05/multithreading-in-php/#comments</comments>
		<pubDate>Tue, 12 May 2009 07:25:14 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Multithreading]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/?p=220</guid>
		<description><![CDATA[I hear different people saying different things about multi-threading in PHP. Some say it cannot be done, no way and others say yes, it can be done. But I say, it cannot be done purely but we can implement pseudo multithreading. That is we can fake multi threading in PHP. 
So how do we do [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: left; margin-top: 10px; margin-bottom: 10px; margin-right: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/05/phplogo.jpg" />I hear different people saying different things about multi-threading in PHP. Some say it cannot be done, no way and others say yes, it can be done. But I say, it cannot be done purely but we can implement pseudo multithreading. That is we can fake multi threading in PHP. </p>
<p>So how do we do it? This can be implemented with the help of 2 kinds of files. 1) the main file and other 2) the thread file. There can be any number of thread file. The main file calls the thread files and it looks like it is multi-threaded.<span id="more-220"></span></p>
<p>Let us look at a code fragment below. </p>
<blockquote><p>&nbsp;<br />$url = $_GET['url'];<br />$scripts = array(<br />&nbsp;&nbsp; &#8220;script1.php&#8221;,<br />&nbsp;&nbsp;&nbsp; &#8220;script2.php&#8221;,<br />&nbsp;&nbsp;&nbsp; &#8220;script3.php&#8221;,<br />&nbsp;&nbsp;&nbsp; &#8220;script4.php&#8221;,<br />&nbsp;&nbsp;&nbsp; &#8220;script5.php&#8221;,<br />&nbsp;&nbsp;&nbsp; &#8220;script6.php&#8221;);<br />&nbsp;<br /># Set off parallel contacts to each of the scripts<br />&nbsp;<br />for ($p=0; $p<count($scripts); $p++)="" {=""><br />&nbsp;&nbsp;&nbsp; $fh[$p] = popen(&#8220;/usr/bin/php &#8220;.<br />&nbsp;&nbsp;&nbsp; &#8220;/home/yoursite/public_html/&#8221; . $scripts[$p] .&#8221; &#8221; .<br />&nbsp;&nbsp;&nbsp; $url,&#8221;r&#8221;);<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;<br />/*<br />*&nbsp;&nbsp;&nbsp; Do your processing here. The above statements will return the control to this block<br />*<br />*&nbsp;&nbsp;&nbsp; Still Processing other works<br />*<br />*&nbsp;&nbsp;&nbsp; Enough Processing. Now Gather the results<br />*/<br />&nbsp;<br />for ($p=0; $p<count($scripts); $p++)="" {=""><br />&nbsp;&nbsp;&nbsp; $st = fgets($fh[$p]);<br />&nbsp;&nbsp;&nbsp; $rs .=&nbsp; $scripts[$p] . &#8221; : &#8221; . $st .&#8221;<br />&#8220;;<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;<br />print $rs;<br />?&gt;<br /></count($scripts);></count($scripts);></p></blockquote>
<p>What the above does is fire off the 6 scripts in parallel, passing $url to each script as a command line parameter. It executes each script by executing the <acronym title="Hypertext Preprocessor">php</acronym> binary itself, so the processes themselves live outside of apache. The instant the scripts are fired, they work in the background whilst control is passed back to <acronym title="Hypertext Preprocessor">PHP</acronym> to continue.&nbsp; After we&#8217;ve done other intensive processing (whatever code you insert above) we can finally get all the scripts return values. For this example, here is the code for one of the scripts that is called &#8211; note how it reads the url we passed from the command line.</p>
<blockquote><p>$url = $argv[1];<br />print &#8220;this is the returned value&#8221;;<br />&nbsp;?&gt;</p></blockquote>
<p>The above method is best used on very intensive tasks that typically take a long time. This method can increase the performance upto 50% (My personal experience and tests).</p>
<p>That is all. In this way we can multithread a PHP script. To be more specifi pseudo multi thread.&nbsp; <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>This is the simplest of all. I will write a tutorial on how to multithread php scripts using CURL. Till then Happy reading! <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=007ecf43-2307-88f6-ace5-2d8bf95d7a09" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/05/multithreading-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using jQuery with Joomla!</title>
		<link>http://www.sanjeevshrestha.com.np/2009/05/using-jquery-with-joomla/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/05/using-jquery-with-joomla/#comments</comments>
		<pubDate>Fri, 08 May 2009 09:49:50 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[jquery conflict]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/?p=203</guid>
		<description><![CDATA[Joomla ! (till Ver 1.5.10)&#160; by default supports mootools 1.11. The core is still not updated to use mootools 1.2x version. 
Now back to the topic. jQuery and Mootools are known to produce conflicts when used together. jQuery is more reliable and robust than mootools (It is my personal view)&#160; but it is however not [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/05/jquery-on-white.gif" />Joomla ! (till Ver 1.5.10)&nbsp; by default supports mootools 1.11. The core is still not updated to use mootools 1.2x version. </p>
<p>Now back to the topic. jQuery and Mootools are known to produce conflicts when used together. jQuery is more reliable and robust than mootools (It is my personal view)&nbsp; but it is however not provided with core joomla installation. So how to use jQuery with Mootools without any conflicts.&nbsp; <br /><span id="more-203"></span></p>
<p>To use jQuery with joomla, 
<ul>
<li>Download the latest jQuery release or any releast the best fit your requirements, </li>
<li>Save it to an accessible folder (e.g. /media/system/js/)</li>
<li>Now include the library from within your view. i.e. include the jquery library in layout file (normally default.php) of your view. </li>
</ul>
<blockquote><p>
<div class="codecontent">$document = &amp;JFactory::getDocument();<br />$document-&gt;addScript(JPATH_SITE.&#8217;/media/system/js/jquery.js&#8217; );<br />$document-&gt;<span class="method-title">addScriptDeclaration</span> ( &#8216;jQuery.noConflict();&#8217; );</div>
</blockquote>
<p>You can use jQuery with <b>jQuery.noConflict()</b> method called right after you include the jQuery library as shown above. </p>
<p>This will allow you to use the jQuery without conflicts. But what if you want to replace all the mootools library with jQuery and don&#8217;t want to use mootools at all. But remember the Joomla Administrator section uses mootools heavily so you cannot eliminate mootools from administration panel. So how to use jQuery in frontend. Here is the trick.</p>
<p>Open a file named <b>behavior.php</b>. This is under <b>libraries-&gt;joomla-&gt;html-&gt;html</b>. Now find a method named <b>mootools($debug = null)</b>. Create another function named jQuery(debug=null) and paste the code as below in the body of the function.<br />
<blockquote>function jQuery($debug = null)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; static $loaded;</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; global $mainframe;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Only load once<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ($loaded) {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // If no debugging value is set, use the configuration setting<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ($debug === null) {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $config = &amp;JFactory::getConfig();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $debug = $config-&gt;getValue(&#8216;config.debug&#8217;);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $konkcheck = strpos (strtolower($_SERVER['HTTP_USER_AGENT']), &#8220;konqueror&#8221;);</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ($debug || $konkcheck) {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JHTML::script(&#8216;jquery.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if($mainframe-&gt;isSite()) {</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JHTML::script(&#8216;jquery.min.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JHTML::script(&#8216;mootools.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $loaded = true;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br />&nbsp;&nbsp;&nbsp; }</p></blockquote>
<p>Now you can use jQuery in the frontend but the admin still uses the mootools. With this method you will not face any conflicts and use jQuery without mootools.</p>
<p>The jquery.min.js is the minified version of jQuery library whereas the jquery.js is uncompressed version. Remember to put these both files under <b>media-&gt;system-&gt;js</b> folder.</p>
<p>To use jQuery in your codes just call <b>JHTML::_(&#8216;behavior.jQuery&#8217;)</b> to import jquery into your page. isn&#8217;t it cool to use jquery with joomla. I dreamt of it for long.</p>
<p>Send me comments and suggestions on this post. Happy reading</p>
<p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=b7b0e418-7211-8bc8-a24e-0359a8d8d492" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/05/using-jquery-with-joomla/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Using Google Chart API in your website</title>
		<link>http://www.sanjeevshrestha.com.np/2009/05/using-google-chart-api-in-your-website/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/05/using-google-chart-api-in-your-website/#comments</comments>
		<pubDate>Wed, 06 May 2009 08:44:42 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Api]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Chart API]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Chart API]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/?p=199</guid>
		<description><![CDATA[Charts are useful and more informative way of representing data in a website. There are many commercial and opensource components and libraries available to implement charts in a website. Most of them are flash based and very attractive. There may be cases where you don&#8217;t want or can&#8217;t use flash based charts. So what are [...]]]></description>
			<content:encoded><![CDATA[<p><img style="max-width: 800px; float: left; margin-top: 10px; margin-bottom: 10px; margin-right: 10px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/05/googl.png" />Charts are useful and more informative way of representing data in a website. There are many commercial and opensource components and libraries available to implement charts in a website. Most of them are flash based and very attractive. There may be cases where you don&#8217;t want or can&#8217;t use flash based charts. So what are the alternatives? Write your own library using <b>gd</b> or any other image manipulation library or Use <b>Google Chart API</b>. Yes, google chart api is here to rescue you from all the tedious coding you will do to create your own library. <span id="more-199"></span></p>
<p>Google Chart API is simple and easy to implement and produces nifty chart in your website with the data you supplied to the API. The API generates a PNG-format image in response to a url. The API generates different kinds of Charts like bar, line, pie, 3D pie and that too in different color and sizes. isn&#8217;t that cool?</p>
<p>As already mentioned the google chart API is simple and easy to implement. (Read more about the chart API at <a href="http://code.google.com/apis/chart/">http://code.google.com/apis/chart/</a>) You just need to form a url in following format and send it to google. <br />
<blockquote>
<p><code>http://chart.apis.google.com/chart?
<parameter 1=""> </param>&amp;
<parameter 2=""> </param></parameter></parameter></code><code>&amp;
<parameter n=""> </param></parameter></code></p>
<p><code>e.g. </code><code>http://chart.apis.google.com/chart?chs=350x150&amp;chd=t:70,30&amp;cht=p3&amp;chl=</code><code>Joomla|Drupal</code></p>
</blockquote>
<p><code>Yes generating chart is that simple. Just copy the above example and see for yourself. Now let me explain the chart parameters.</code></p>
<blockquote><p><code>http://chart.apis.google.com/chart?</code> is the Chart API&#8217;s location.<br /><code>&amp;</code> separates parameters.<br /><code>chs=350x150</code> is the chart&#8217;s size in pixels.<br /><code>chd=t:70,30</code> is the chart&#8217;s data.<br /><code>cht=p3</code> is the chart&#8217;s type.<br /><code>chl=Joomla|Drupal</code> is the chart&#8217;s label. </p></blockquote>
<p>You must at least provide chs, chd, cht parameters to the API. Now let us discuss some variations of&nbsp; parameters</p>
<p>To know more about the Google Chart API, refer to google code at <a href="http://code.google.com/apis/chart/">http://code.google.com/apis/chart/</a>. The API docs provides all the information on how to use the Chart API in your website. </p>
<p>Happy Reading!</p>
<p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=17f3ca85-7bf3-8022-8a59-037c9b304784" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/05/using-google-chart-api-in-your-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
