<?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>Sat, 27 Aug 2011 17:18:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Naming Conventions in Nooku &#8211; I</title>
		<link>http://www.sanjeevshrestha.com.np/2011/08/naming-conventions-in-nooku/</link>
		<comments>http://www.sanjeevshrestha.com.np/2011/08/naming-conventions-in-nooku/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 10:39:00 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Nooku]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Conventions]]></category>
		<category><![CDATA[nooku]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2011/08/naming-conventions-in-nooku/</guid>
		<description><![CDATA[With Great power comes great responsibility, yes! it fits aptly with Nooku Framework. To leverage the power of Nooku, it requires you to follow some conventions for naming your classes, files, folders, tables and fields too. Let us explore more about these naming conventions in detail. We will divide this post in four sections and [...]]]></description>
			<content:encoded><![CDATA[<p>With Great power comes great responsibility, yes! it fits aptly with Nooku Framework. To leverage the power of Nooku, it requires you to follow some conventions for naming your classes, files, folders, tables and fields too. Let us explore more about these naming conventions in detail. We will divide this post in four sections and we will also see how we can easily adapt ourselves to these naming conventions.</p>
<p><span style="font-size: medium;"><strong>Classes Naming Convention</strong></span></p>
<p>It depends on what you are naming, it varies if you are naming a component or module or a plugin. If the class is a part of Component, the general syntax is Com&lt;YourComponentName&gt;&lt;M/V/C&gt;&lt;FileName&gt;. <span id="more-410"></span></p>
<p>For Example: Let us consider, we have a component named CoolBanner. If we want to define a Banner Controller the class name should be <strong>ComCoolbannerControllerBanner</strong>. And if we want to define a model class, the class name should look like <strong>ComCoolbannerModelBanner</strong>.</p>
<p>But there are other things to consider when naming your class. But to understand better, we can say the naming of the class depends on the folder structure of your component and filename that will contain your class. You will generally store all your controllers in <strong>controllers</strong> folder of your component, all models in <strong>models</strong> folder, filters in <strong>Filters</strong> folder and like wise views in your <strong>views</strong> folder. (Views classname are exception to above syntax)</p>
<p>Lets us review how this folder structure and class naming map to each other. As per above example, we should store</p>
<blockquote><p>ComCoolbannerControllerBanner in /component/com_coolbanner/controllers/banner.php<br />
ComCoolbannerModelBanner in /component/com_coolbanner/models/banner.php<br />
ComCoolbannerModelBanners in /component/com_coolbanner/models/banners.php<br />
ComCoolbannerFilterBannerid in /components/com_coolbanner/filters/bannerid.php</p>
</blockquote>
<p>Also if you have some extra level deep folders like /components/com<em>coolbanner/databases/ we should write the classname that reflects this level too. So for example, let us assume we have 3 folders in /components/com</em>coolbanner/databases/ folder namely tables , behaviors and rowsets and also have categories.php, hits.php and categories.php in these folders in order. The class name should reflect these folder structure.</p>
<blockquote><p>ComCoolbannerDatabaseTableCategories should go in /components/com_coolbanner/databases/tables/categories.php<br />
ComCoolbannerDatabaseBehaviorHits Should go in /components/com_coolbanner/databases/behaviors/hits.php<br />
ComCoolbannerDatabaseRowsetCategories Should go in /components/com_coolbanner/databases/rowsets/hits.php</p>
</blockquote>
<p>Views are exception to this naming convention. A View&#8217;s filename uses the document type that is being used to render the view. The class <strong>ComCoolBannerViewBannersHtml</strong> will render HTML document type for the banners view and should be stored in the file <strong>/components/com<em>coolbanner/views/banners/html.php</strong>. You can even add your own document type format at will. For example if you want a view to be rendered as json, you can create a view class <strong>ComCoolbannerViewBannersJson</strong> and store it in <strong>/components/com</em>coolbanner/views/banners/json.php</strong></p>
<p>Likewise you can name your classname depending on the folder structure.</p>
<p>You can even follow the above naming convention to name your modules and plugins as well. The only deviation from above syntax is the prefix used to start class name. Modules start with Mod, Plugins start with Plg and Components Start Com. See below</p>
<blockquote><p>ModCoolbannerDefault will be stored in /modules/mod_coolbanner/default.php<br />
ModCoolbannerView will be stored in /modules/mod_coolbanner/view.php<br />
PlgSystemCoolbanner will be stored in /plugins/system/coolbanner.php<br />
PlgSystemCoolbannerDefault will be stored in /plugins/system/coolbanner/default.php</p>
</blockquote>
<p>And likewise.</p>
<p>We will continue the next part of this series in my next post. We will discuss about table and field naming convention in nooku. I hope this was useful for people starting with nooku. Best of luck. <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2011/08/naming-conventions-in-nooku/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I am set to write tutorials, tips and tweaks for Nooku</title>
		<link>http://www.sanjeevshrestha.com.np/2011/08/i-am-set-to-write-tutorials-tips-and-tweaks-for-nooku/</link>
		<comments>http://www.sanjeevshrestha.com.np/2011/08/i-am-set-to-write-tutorials-tips-and-tweaks-for-nooku/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 08:54:00 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[MyUpdates]]></category>
		<category><![CDATA[Nooku]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[nooku]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2011/08/i-am-set-to-write-tutorials-tips-and-tweaks-for-nooku/</guid>
		<description><![CDATA[I have been working with Nooku Framework  for sometime and there are many things to share with like minded people. With less accessible and updated documentation and few tutorials, Nooku can be daunting at first sight. And with so many things here and there, you can feel like bullets swooshing over your head. Ranging From [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float: right;" src="http://www.sanjeevshrestha.com.np/wp-content/uploads/2010/09/logo-nooku-framework-200-navy.png" alt="Nooku Tutorials" width="200" height="84" />I have been working with Nooku Framework  for sometime and there are many things to share with like minded people. With less accessible and updated documentation and few tutorials, Nooku can be daunting at first sight. And with so many things here and there, you can feel like bullets swooshing over your head. Ranging From following conventions to Design patterns,  you have so many things to learn. And with so less resources, you will probably be sleeping with nightmares:). But take my word, Nooku is worth learning.<span id="more-401"></span></p>
<p>I will try to write my findings, tutorials and tweaks on Nooku in coming days. These are basically my writeup and is not affilated with Nooku or Joomla itself and If there are any errata, the blame is on me <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . You can even send me suggestion on topics for Blog and I will try to explain explain within my knowledge.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2011/08/i-am-set-to-write-tutorials-tips-and-tweaks-for-nooku/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Uploading Files through SSH</title>
		<link>http://www.sanjeevshrestha.com.np/2010/08/uploading-files-through-ssh/</link>
		<comments>http://www.sanjeevshrestha.com.np/2010/08/uploading-files-through-ssh/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 06:04:54 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[quick uploading files]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.sanjeevshrestha.com.np/2010/08/uploading-files-through-ssh/</guid>
		<description><![CDATA[You have large file to upload to your server and hate FTP clients that takes numerous days and nights to upload, Try SSH to upload files. SSH is comparatively faster than FTP (My Personal Opinion). If you are running Linux or FreeBSD Operating System on your local computer and have access to server shell, use [...]]]></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/2010/08/ssh-logo1.jpg" />You have large file to upload to your server and hate FTP clients that takes numerous days and nights to upload, Try SSH to upload files. SSH is comparatively faster than FTP (My Personal Opinion).</p>
<p>If you are running Linux or FreeBSD Operating System on your local computer and have access to server shell, use &#8216;scp&#8217; command to copy files and directories to the server. <span id="more-386"></span></p>
<p>To copy files<br />
<blockquote># scp your_filename login@yourserver.com:path</p></blockquote>
<p>To copy entire folder/directories<br />
<blockquote># scp -r your_directoryname login@yourserver.com:path</p></blockquote>
<p>If you are using windows OS, you can use pscp available from Putty Download Page <a href="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/download.html">here</a></p>
<p>Cheers! <img src='http://www.sanjeevshrestha.com.np/wp-includes/images/smilies/icon_smile.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=0d424eae-2c39-87b4-aa03-03335ed5a68a" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sanjeevshrestha.com.np/2010/08/uploading-files-through-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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 [...]]]></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>4</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>5</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>1</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 function of [...]]]></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>1</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[javascript]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[Tutorial]]></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>10</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>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: www.sanjeevshrestha.com.np @ 2012-05-19 15:23:07 -->
