<?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; Tutorial</title>
	<atom:link href="http://www.sanjeevshrestha.com.np/category/tutorial/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>Know about Joomla Extensions</title>
		<link>http://www.sanjeevshrestha.com.np/2010/02/know-about-joomla-extensions/</link>
		<comments>http://www.sanjeevshrestha.com.np/2010/02/know-about-joomla-extensions/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 18:37:41 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[types of extensions]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/?p=367</guid>
		<description><![CDATA[Out of the box, Joomla! does a great job of managing the content needed to make your Web site sing. But for many people, the true power of Joomla! lies in the application framework that makes it possible for developers all around the world to create powerful add-ons that are called Extensions. An Extension is [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_185" class="wp-caption alignleft" style="width: 210px"><a href="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/04/joomla-ogo.png"><img class="size-full wp-image-185" title="joomla-logo.png" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2009/04/joomla-ogo.png" alt="Joomla Logo" width="200" height="137" /></a><p class="wp-caption-text">Joomla Logo</p></div>
<p>Out of the box, Joomla! does a great job of managing the content needed to make your Web site sing. But for many people, the true power of Joomla! lies in the application framework that makes it possible for developers all around the world to create powerful add-ons that are called Extensions. An Extension is used to add capabilities to Joomla! that do not exist in the base core code. Here are just some examples of the hundreds of available Extensions:<span id="more-367"></span></p>
<p>* Dynamic form builders<br />
* Business or organisational directories<br />
* Document management<br />
* Image and multimedia galleries<br />
* E-commerce and shopping cart engines<br />
* Forums and chat software<br />
* Calendars<br />
* E-mail newsletters<br />
* Data collection and reporting tools<br />
* Banner advertising systems<br />
* Paid subscription services<br />
* and many, many, more</p>
<p>You can find more examples over at our ever growing Joomla! Extensions Directory. Prepare to be amazed at the amount of exciting work produced by our active developer community!</p>
<p>A useful guide to the Extension site can be found at:</p>
<p>http://extensions.joomla.org/content/view/15/63/</p>
<h2>Types of Extensions</h2>
<p>There are five types of extensions:</p>
<p>* Components<br />
* Modules<br />
* Templates<br />
* Plugins<br />
* Languages</p>
<p>You can read more about the specifics of these using the links in the Article Index &#8211; a Table of Contents (yet another useful feature of Joomla!) &#8211; at the top right or by clicking on the Next link below.</p>
<h2>Component</h2>
<p>A Component is the largest and most complex of the Extension types. Components are like mini-applications that render the main body of the page. An analogy that might make the relationship easier to understand would be that Joomla! is a book and all the Components are chapters in the book. The core Article Component (com_content), for example, is the mini-application that handles all core Article rendering just as the core registration Component (com_user) is the mini-application that handles User registration.</p>
<p>Many of Joomla!&#8217;s core features are provided by the use of default Components such as:</p>
<p>* Contacts<br />
* Front Page<br />
* News Feeds<br />
* Banners<br />
* Mass Mail<br />
* Polls</p>
<p>A Component will manage data, set displays, provide functions, and in general can perform any operation that does not fall under the general functions of the core code.</p>
<p>Components work hand in hand with Modules and Plugins to provide a rich variety of content display and functionality aside from the standard Article and content display. They make it possible to completely transform Joomla! and greatly expand its capabilities.</p>
<h2>Module</h2>
<p>A more lightweight and flexible Extension used for page rendering is a Module. Modules are used for small bits of the page that are generally less complex and able to be seen across different Components. To continue in our book analogy, a Module can be looked at as a footnote or header block, or perhaps an image/caption block that can be rendered on a particular page. Obviously you can have a footnote on any page but not all pages will have them. Footnotes also might appear regardless of which chapter you are reading. Simlarly Modules can be rendered regardless of which Component you have loaded.</p>
<p>Modules are like little mini-applets that can be placed anywhere on your site. They work in conjunction with Components in some cases and in others are complete stand alone snippets of code used to display some data from the database such as Articles (Newsflash) Modules are usually used to output data but they can also be interactive form items to input data for example the Login Module or Polls.</p>
<p>Modules can be assigned to Module positions which are defined in your Template and in the back-end using the Module Manager and editing the Module Position settings. For example, &#8220;left&#8221; and &#8220;right&#8221; are common for a 3 column layout.<br />
Displaying Modules</p>
<p>Each Module is assigned to a Module position on your site. If you wish it to display in two different locations you must copy the Module and assign the copy to display at the new location. You can also set which Menu Items (and thus pages) a Module will display on, you can select all Menu Items or you can pick and choose by holding down the control key and selecting multiple locations one by one in the Modules [Edit] screen</p>
<p>Note: Your Main Menu is a Module! When you create a new Menu in the Menu Manager you are actually copying the Main Menu Module (mod_mainmenu) code and giving it the name of your new Menu. When you copy a Module you do not copy all of its parameters, you simply allow Joomla! to use the same code with two separate settings.<br />
Newsflash Example</p>
<p>Newsflash is a Module which will display Articles from your site in an assignable Module position. It can be used and configured to display one Category, all Categories, or to randomly choose Articles to highlight to Users. It will display as much of an Article as you set, and will show a Read more&#8230; link to take the User to the full Article.</p>
<p>The Newsflash Component is particularly useful for things like Site News or to show the latest Article added to your Web site.</p>
<h2>Plugin</h2>
<p>One of the more advanced Extensions for Joomla! is the Plugin. In previous versions of Joomla! Plugins were known as Mambots. Aside from changing their name their functionality has been expanded. A Plugin is a section of code that runs when a pre-defined event happens within Joomla!. Editors are Plugins, for example, that execute when the Joomla! event onGetEditorArea occurs. Using a Plugin allows a developer to change the way their code behaves depending upon which Plugins are installed to react to an event.</p>
<h2>Language</h2>
<p>New to Joomla! 1.5 and perhaps the most basic and critical Extension is a Language. Joomla! is released with multiple Installation Languages but the base Site and Administrator are packaged in just the one Language en-GB &#8211; being English with GB spelling for example. To include all the translations currently available would bloat the core package and make it unmanageable for uploading purposes. The Language files enable all the User interfaces both Front-end and Back-end to be presented in the local preferred language. Note these packs do not have any impact on the actual content such as Articles.</p>
<p>More information on languages is available from the</p>
<p>http://community.joomla.org/translations.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2010/02/know-about-joomla-extensions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why is my .htaccess not working in VPS?</title>
		<link>http://www.sanjeevshrestha.com.np/2010/01/why-is-my-htaccess-not-working-in-vps/</link>
		<comments>http://www.sanjeevshrestha.com.np/2010/01/why-is-my-htaccess-not-working-in-vps/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 08:04:55 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[.htaccess not working]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[VPS server]]></category>
		<category><![CDATA[Webmin]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2010/01/why-is-my-htaccess-not-working-in/</guid>
		<description><![CDATA[If you have a VPS or Linux server running Apache the good old fashioned way without fancy control panels, you’ll quickly have to learn some Apache tweaks.
One of the main issues we commonly run into is a non-working .htaccess file.  Apache doesn’t come with .htaccess support automatically turned on.  You’ll have to turn it on [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a VPS or Linux server running Apache the good old fashioned way without fancy control panels, you’ll quickly have to learn some Apache tweaks.</p>
<p>One of the main issues we commonly run into is a non-working .htaccess file.  Apache doesn’t come with .htaccess support automatically turned on.  You’ll have to turn it on in order for .htaccess files to have an effect.  Here’s what you do:</p>
<p>There are two ways,</p>
<ol>
<li>Edit your httpd.conf manually using a text editor like vim, nano, vi, joe whatever you like.</li>
<li>Edit your httpd.conf through Webmin</li>
</ol>
<p><span id="more-358"></span>Since the Webmin version is more graphical, we’ll show you how to do it through Webmin.  If you’re using a text editor, just skip to the portion with the AllowOveride command.</p>
<p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val=" " /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--></p>
<ol>
<li>Login to your Webmin</li>
<li>Servers&gt;Apache Webserver</li>
<li>Go to the &#8220;Global Configuration&#8221; tab</li>
<li>Click on &#8220;Edit Config Files&#8221;<img style="max-width: 800px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2010/01/config-scrshot1.png" alt="" width="500" height="200" /></li>
<li>Search for AllowOverride and .htaccess and remove the # sign in front or type “AllowOverride All”. or Search for AllowOverride None and replace with AllowOverride All<br />
<img style="max-width: 800px;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2010/01/edit-config.png" alt="" width="500" height="292" /><span style="font-size: 11pt;">This should fix it permanently and allow your .htaccess files to override pretty much and directive needed.</p>
<p></span></li>
</ol>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=b80eb9ac-0745-8e70-8602-dab8f2f14922" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2010/01/why-is-my-htaccess-not-working-in-vps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>Eclipse error &#8211; Cannot connect to keystore</title>
		<link>http://www.sanjeevshrestha.com.np/2009/11/eclipse-error-cannot-connect-to-keystore/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/11/eclipse-error-cannot-connect-to-keystore/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 11:39:26 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[cannot connect to key store]]></category>
		<category><![CDATA[eclipse error]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/11/eclipse-error-cannot-connect-to-keystore/</guid>
		<description><![CDATA[I have recently started working on android SDK and it is the future I say. Android is here to stay for long.&#160; I use eclipse for development and android sdk fits just fine with ADT plugin for Eclipse. But some of us must have faced a error that says &#8220;Cannot connect to keystore&#8221; while installing [...]]]></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/11/eclipse_logo_ganymede.jpg" />I have recently started working on android SDK and it is the future I say. Android is here to stay for long.&nbsp; I use eclipse for development and android sdk fits just fine with ADT plugin for Eclipse. But some of us must have faced a error that says <i><b>&#8220;Cannot connect to keystore&#8221;</b></i> while installing the android sdk with eclipse&#8217;s <b>install new software</b> feature. The google android page also says this will occur if you are using linux. <span id="more-278"></span>And yes I do use linux &#8211; ubuntu 9.04. The android page says to install the latest Java VM and it should work fine, yes that is true but your sun-java is the latest and you don&#8217;t have updates. This might be quite a problem. No worries. hit the following command in your terminal:</p>
<blockquote><p>sudo apt-get install openjdk-6-jre sun-java6-jdk<br />sudo update-java-alternatives -s java-6-sun</p></blockquote>
<p><b>Note: update with the latest java version</b><br />This should work with other flavor of linux too. Try with appropriate package manager.</p>
<p>Now try installing the android sdk again. It should work. Happy androiding..</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=54aaaf6d-57b3-8f01-a39a-c2ac075b3667" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/11/eclipse-error-cannot-connect-to-keystore/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>Using Mootools 1.2 in Joomla1.5.x</title>
		<link>http://www.sanjeevshrestha.com.np/2009/07/using-mootools-12-in-joomla15x/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/07/using-mootools-12-in-joomla15x/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 03:46:04 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools 1.2]]></category>
		<category><![CDATA[Using mootools 1.2.x with joomla]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/07/using-mootools-12-in-joomla15x/</guid>
		<description><![CDATA[Yes! Joomla 1.5.x comes with mootools 1.1.x and it is a pity when you cannot use best of the latest mootools widgets with joomla 1.5.x.  To make the matter worse, you will rarely find forums and blogs that discusses about mootools 1.1. In this case you will definitely want to use mootools 1.2.x with Joomla [...]]]></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/06/mootools-new-logo.jpg" alt="" />Yes! <strong>Joomla 1.5.x</strong> comes with <strong>mootools 1.1.x</strong> and it is a pity when you cannot use best of the latest mootools widgets with joomla 1.5.x.  To make the matter worse, you will rarely find forums and blogs that discusses about mootools 1.1. In this case you will definitely want to use mootools 1.2.x with Joomla in the frontend. So in this small tutorial, we will talk about how to use mootools1.2.x with Joomla 1.5.x. Remember the admin panel of Joomla will still use mootools 1.1.x.</p>
<p>I have written a post about how to use <a href="http://www.sanjeevshrestha.com.np/2009/05/using-jquery-with-joomla/">jQuery with Joomla</a> earlier. This tutorial is just a slight modification of the codes from the earlier post.<br />
<span id="more-253"></span>To use <strong>mootools 1.2.x</strong> with <strong>Joomla 1.5.x</strong>, follow the following steps.</p>
<ol>
<li>Download the mootools core from the mootools <a href="http://mootools.net/core">core builder site</a></li>
<li>Also Download the additional plugins you will use with your installation from <a href="http://mootools.net/more">more builder</a>. I recommend downloading both compressed and uncompressed files from the mootools builder. We may need uncompressed files in debuggin mode.</li>
<li>Copy these files in a folder that can be accessed by Joomla. I recommend media-&gt;system-&gt;js folder of joomla installation. The choice is yours! <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
</ol>
<p>I copied four <strong>files mootools-1.2.3-core.js</strong>, <strong>mootools-1.2.3-core-compressed.js</strong>, <strong>mootools-1.2.3.1-more.js</strong> and <strong>mootools-1.2.3.1-more-compressed.js</strong> to <strong>media-&gt;system-&gt;js</strong> folder. Now locate and open a file named <strong>behavior.php</strong> which is inside <strong>libraries-&gt;joomla-&gt;html-&gt;html</strong> folder. Now find a method named <strong>mootools($debug=null) </strong>and modify it as below.</p>
<blockquote><p>function mootools($debug = null)<br />
{<br />
static $loaded;<br />
$mainframe=&amp;JFactory::getApplication();<br />
// Only load once<br />
if ($loaded) {<br />
return;<br />
}</p>
<p>// If no debugging value is set, use the configuration setting<br />
if ($debug === null) {<br />
$config = &amp;JFactory::getConfig();<br />
$debug = $config-&gt;getValue(&#8216;config.debug&#8217;);<br />
}</p>
<p>$konkcheck = isset($_SERVER['HTTP_USER_AGENT']) ? strpos(strtolower($_SERVER['HTTP_USER_AGENT']), &#8220;konqueror&#8221;) : null;</p>
<p>if($mainframe-&gt;isSite())<br />
{<br />
if ($debug || $konkcheck)<br />
{<br />
JHTML::script(&#8216;mootools-1.2.3-core.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
JHTML::script(&#8216;mootools-1.2.3.1-more.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
}<br />
else<br />
{<br />
JHTML::script(&#8216;mootools-1.2.3-core-compressed.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
JHTML::script(&#8216;mootools-1.2.3.1-more-compressed.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
}<br />
$loaded = true;<br />
return;</p>
<p>}<br />
else<br />
{</p>
<p>if ($debug || $konkcheck)<br />
{<br />
JHTML::script(&#8216;mootools-uncompressed.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
}<br />
else<br />
{<br />
JHTML::script(&#8216;mootools.js&#8217;, &#8216;media/system/js/&#8217;, false);<br />
}<br />
$loaded = true;<br />
return;<br />
}<br />
}</p></blockquote>
<p>This modified mootools behavior checks if the site is accessed from frontend or is it admin. if it is frontend it loads the mootools 1.2.x depending upon the debug mode. It will load uncompressed files in debug mode. This will load both core and more files in frontend. The admin still uses mootools 1.1.x as it heavily depends on it.</p>
<p>This is all! It worked for me. Let me know if it did or not for you. Happy reading!</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=80c86ad4-b30e-8266-8f30-316fefe92af5" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/07/using-mootools-12-in-joomla15x/feed/</wfw:commentRss>
		<slash:comments>8</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>Ajaxifying Joomla Links with Mootools</title>
		<link>http://www.sanjeevshrestha.com.np/2009/06/ajaxifying-joomla-links-with-mootools/</link>
		<comments>http://www.sanjeevshrestha.com.np/2009/06/ajaxifying-joomla-links-with-mootools/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 18:21:21 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Ajaxifying joomla]]></category>
		<category><![CDATA[Implementing ajax in joomla]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2009/06/ajaxifying-joomla-links-with-mootools/</guid>
		<description><![CDATA[
Have you ever wanted to automatically ajaxify joomla links? This is to say if you ever wished that all the links would open with ajax request in your main component area! If yes, then read on! This small tutorial will teach you how to automatically implement ajax requests in every link on a joomla page.
To [...]]]></description>
			<content:encoded><![CDATA[<div align="left"><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/06/mootools-new-logo.jpg" /></div>
<p>Have you ever wanted to automatically ajaxify joomla links? This is to say if you ever wished that all the links would open with ajax request in your main component area! If yes, then read on! This small tutorial will teach you how to automatically implement ajax requests in every link on a joomla page.</p>
<p>To implement Ajax request in every link in a joomla page you need to modify index.php of joomla template. <span id="more-227"></span></p>
<p>Add the code below in index.php</p>
<blockquote><p>&lt;script&gt;<br/><!--<br/>window.addEvent(&#8216;domready&#8217;,function(){<br/>ajaxify();<br/>});<br/><br/>function ajaxify()<br/>{<br/>&nbsp;&nbsp;&nbsp; $$(&#8216;a&#8217;).addEvent(&#8216;click&#8217;,function(e){<br/><br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var e=new Event(e);<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e.stop();<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $(&#8216;ajaxstage&#8217;).setHTML(&#8216;Loading&#8230;&#8217;);<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; req=new Ajax(this.href+&#8217;&amp;tmpl=component&#8217;,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; update:&#8217;ajaxstage&#8217;,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; method:&#8217;get&#8217;,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; onComplete:ajaxify<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; req.request();<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; }<br/>&#8211;><br/>&lt;/script&gt;
</p></blockquote>
<p>This code will implement ajax in every link it finds in a page. The function is recursive, in the sense it will call itself to ajaxify the newly added links by ajax request. Wait, you need to wrap the component in a div to make this work. Find a code similar to </p>
<blockquote><p>
&lt;jdoc:include type=&#8221;component&#8221; /&gt;
</p></blockquote>
<p>and replace it with</p>
<blockquote><p>&lt;div id=&#8221;ajaxstage&#8221;&gt;<br />
&lt;jdoc:include type=&#8221;component&#8221;><br />
&lt;/jdoc:include&gt;&lt;/div&gt;
</p></blockquote>
<p>This div is the stage where the content that is fetched with ajax is updated with. Yes it is this simple. But make sure you have mootools included in your template. If not add the code below to add mootools support in your template.</p>
<blockquote><p>
&lt;?php JHTML::_(&#8216;behavior.mootools&#8217;); ?&gt;
</p></blockquote>
<p>Yes, this concludes the tutorial. Isn&#8217;t it a nifty hack to implement ajax in a joomla page.<br />
Keep coming back for more tips and tricks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2009/06/ajaxifying-joomla-links-with-mootools/feed/</wfw:commentRss>
		<slash:comments>4</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 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>
