<?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>Sudhir Tiwari</title>
	<atom:link href="http://www.sudhirtiwari.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sudhirtiwari.com</link>
	<description>HelpDesk For PHP Developers</description>
	<lastBuildDate>Mon, 30 Apr 2012 18:17:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Sort products by Facebook Likes in Magento</title>
		<link>http://www.sudhirtiwari.com/2012/04/sort-products-by-facebook-likes-in-magento/</link>
		<comments>http://www.sudhirtiwari.com/2012/04/sort-products-by-facebook-likes-in-magento/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 18:17:40 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/?p=232</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2012/04/sort-products-by-facebook-likes-in-magento/">Sort products by Facebook Likes in Magento</a></p><p>In each online shopping store, user interface is quite crucial. If you can build an easy to use shopping cart with minimal efforts for user to know what he wants and how he can do it, you are in very good shape to attract more and more customers. To achieve this most of the stores [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2012/04/sort-products-by-facebook-likes-in-magento/">Sort products by Facebook Likes in Magento</a></p><p>In each online shopping store, user interface is quite crucial. If you can build an easy to use shopping cart with minimal efforts for user to know what he wants and how he can do it, you are in very good shape to attract more and more customers. To achieve this most of the stores provide category wise browse of products and sorting by different criteria like Sort by Price, Sort by Manufacturer, Sort by Newest/Oldest first, etc. This does make sense as it lessens the total efforts of the users to find what they are looking for.</p>
<p>These days, many of the stores provide Facebook like button on their stores so that users can like their products and it will promote the product on social media. It’s very useful as you are getting promotion of the products from your users directly. As there was a demand from one client to give an option of Sort products by their Facebook likes, I decided to create an extension for that.</p>
<p>I have created a script which fetches the total likes of the products and stores in the database and admin can select option in admin panel to give product ability of sorting by Facebook likes. The telly of Facebook likes can be updated on regular interval, either daily or hourly and based upon that sorting will work on front-side. It can give option of Most liked this month, Most liked this week, Most liked in last 2 days, Most liked today, etc.</p>
<p>If you want to get it for your magento store then you can contact me on sudhirtiwari@tricoreitsolutions.com or use contact us page of this website.</p>
<div class="wp-caption alignnone" style="width: 320px"><a href="http://www.tricoreitsolutions.com/sort-products-by-facebook-likes-in-magento"><img alt="Sort products by Facebook Likes in Magento" src="http://www.tricoreitsolutions.com/wp-content/uploads/2012/03/sort_by_facebook_likes_magento.png" title="Sort products by Facebook Likes in Magento" width="310" height="209" /></a><p class="wp-caption-text">Sort products by Facebook Likes in Magento</p></div>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2012/04/sort-products-by-facebook-likes-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Attaching image to post from external url wordpress</title>
		<link>http://www.sudhirtiwari.com/2012/01/attaching-image-to-post-from-external-url-wordpress/</link>
		<comments>http://www.sudhirtiwari.com/2012/01/attaching-image-to-post-from-external-url-wordpress/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 10:47:29 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[attache image to post from external url]]></category>
		<category><![CDATA[Image attachement]]></category>
		<category><![CDATA[media_sideload_image]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/?p=227</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2012/01/attaching-image-to-post-from-external-url-wordpress/">Attaching image to post from external url wordpress</a></p><p>Its very simple to attach image from any external url to post by code.
Here is the simple code that will attach image to your post.
set_time_limit(300);
require_once(ABSPATH . 'wp-admin/includes/file.php');
require_once(ABSPATH . 'wp-admin/includes/media.php');
require_once(ABSPATH . 'wp-admin/includes/image.php');
$upload = media_sideload_image('IMAGE_URL', "POST_ID", "IMAGE_DESC");
die ( $upload );

  
</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2012/01/attaching-image-to-post-from-external-url-wordpress/">Attaching image to post from external url wordpress</a></p><p>Its very simple to attach image from any external url to post by code.<br />
Here is the simple code that will attach image to your post.</p>
<pre class="brush:php">set_time_limit(300);
require_once(ABSPATH . 'wp-admin/includes/file.php');
require_once(ABSPATH . 'wp-admin/includes/media.php');
require_once(ABSPATH . 'wp-admin/includes/image.php');
$upload = media_sideload_image('IMAGE_URL', "POST_ID", "IMAGE_DESC");
die ( $upload );
</pre>
<p> <img src='http://www.sudhirtiwari.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2012/01/attaching-image-to-post-from-external-url-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>e-Shop Recurring Payment Plugin</title>
		<link>http://www.sudhirtiwari.com/2011/12/e-shop-recurring-payment-plugin/</link>
		<comments>http://www.sudhirtiwari.com/2011/12/e-shop-recurring-payment-plugin/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 20:26:41 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress News]]></category>
		<category><![CDATA[eshop]]></category>
		<category><![CDATA[eshop paypal pro]]></category>
		<category><![CDATA[eshop recurring]]></category>
		<category><![CDATA[eshop recurring payments wordpress]]></category>
		<category><![CDATA[paypal pro esho plugin]]></category>
		<category><![CDATA[recurring eshop wordpress]]></category>
		<category><![CDATA[recurring payment]]></category>
		<category><![CDATA[recurring payment eshop]]></category>
		<category><![CDATA[recurring payments eshop]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/?p=217</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2011/12/e-shop-recurring-payment-plugin/">e-Shop Recurring Payment Plugin</a></p><p>Hii Friends/Webmasters,
I have seen few question over web &#8220;Can eShop handle Recurring Billing through PayPal?&#8221;. Yes ofcourse it can handle here is the solution in face of plugin  
As i am big fan of bloging sites, i have read lots of things regarding eshop. I have seen developers/webmasters love the eshop plugin.
Here i again [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2011/12/e-shop-recurring-payment-plugin/">e-Shop Recurring Payment Plugin</a></p><p>Hii Friends/Webmasters,</p>
<p>I have seen few question over web &#8220;Can eShop handle Recurring Billing through PayPal?&#8221;. Yes ofcourse it can handle here is the solution in face of plugin <img src='http://www.sudhirtiwari.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>As i am big fan of bloging sites, i have read lots of things regarding eshop. I have seen developers/webmasters love the eshop plugin.</p>
<p>Here i again with one new solution for your shopping site that you require <img src='http://www.sudhirtiwari.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Guess&#8230; Hmmm&#8230; Yeah Its &#8220;e-Shop Recurring Payment&#8221;.</p>
<p>I have completed the first version of e-Shop Recurring payment.</p>
<p>First of all i would like to describe your what is &#8220;Recurring Payment&#8221;.</p>
<p>Recurring payments are an option that allows your customers to make Visa card payments to you automatically at regular intervals. They can be used in a variety of situations, from monthly subscriptions and leasing arrangements to paying electricity and telephone bills.</p>
<p>Recurring payments mean that customers do not have to worry about remembering to make their payment each time it is due, while you provide better service, receive your payments regularly and save valuable time.</p>
<p>How it works with e-Shop ?<br />
You just need to download the &#8220;e-Shop Recurring Payment&#8221; Plugin from the site. Install it using installation wizard of wordpress.. That&#8217;s It.</p>
<p>Version Support.<br />
It support latest stable version of e-Shop (3.2)</p>
<p>so if any one is in need for this feature let me know i will do it. You can reach me at sudhirtiwari@tricoreitsolutions.com or fill the contact us form with<br />
subject of &#8220;Paypal Pro API Plugin for eShop&#8221; and your suggations on message part.</p>
<p>You can see the below screencasts that i will provide you for admin settings and user-end setting.<br />
<strong>Admin Side User Interface:</strong></p>
<div id="attachment_634" class="wp-caption alignnone" style="width: 310px"><a href="http://www.tricoreitsolutions.com/wp-content/uploads/2011/12/eshop-recurring-payment-plugin-install.png"><img src="http://www.tricoreitsolutions.com/wp-content/uploads/2011/12/eshop-recurring-payment-plugin-install-300x168.png" alt="e-Shop Recurring Payment Plugin" title="e-Shop Recurring Payment Plugin" width="300" height="168" class="size-medium wp-image-634" /></a><p class="wp-caption-text">e-Shop Recurring Payment Plugin</p></div>
<p><strong>Front Side User Interface:</strong></p>
<div id="attachment_635" class="wp-caption alignnone" style="width: 310px"><a href="http://www.tricoreitsolutions.com/wp-content/uploads/2011/12/eshop-recurring-payment-frontend.png"><img src="http://www.tricoreitsolutions.com/wp-content/uploads/2011/12/eshop-recurring-payment-frontend-300x168.png" alt="eshop recurring payment plugin wordpress" title="eshop recurring payment plugin wordpress" width="300" height="168" class="size-medium wp-image-635" /></a><p class="wp-caption-text">eshop recurring payment plugin wordpress</p></div>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2011/12/e-shop-recurring-payment-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CakePHP Online Now With User History Traker</title>
		<link>http://www.sudhirtiwari.com/2011/09/cakephp-online-now-with-user-history-traker/</link>
		<comments>http://www.sudhirtiwari.com/2011/09/cakephp-online-now-with-user-history-traker/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 05:31:16 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Cake PHP Online Now]]></category>
		<category><![CDATA[Cake PHP User's Log]]></category>
		<category><![CDATA[Croogo Online Users Block]]></category>
		<category><![CDATA[Online Users Croogo]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/?p=212</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2011/09/cakephp-online-now-with-user-history-traker/">CakePHP Online Now With User History Traker</a></p><p>Its very simple to have a online block on your webpage in CakePHP.
Here I am going to explain you Step By Step Tutorial for this. I have just developed it so want to share with Everyone because i have done research on google from long hours.

Step 1 :Hit The Controller first.
/app/app_controller.php
Create a function in your [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2011/09/cakephp-online-now-with-user-history-traker/">CakePHP Online Now With User History Traker</a></p><p>Its very simple to have a online block on your webpage in CakePHP.<br />
Here I am going to explain you Step By Step Tutorial for this. I have just developed it so want to share with Everyone because i have done research on google from long hours.</p>
<p><a href="http://tricoreitsolutions.com"><img alt="TriCore IT Solutions" src="http://www.tricoreitsolutions.com/wp-content/uploads/2011/07/onlinenow-322x198.png" title="Online Now" class="alignnone" width="322" height="198" /></a><br />
Step 1 :Hit The Controller first.<br />
/app/app_controller.php<br />
Create a function in your app_controller. You can create it anywhere in the controller.</p>
<pre class="brush:php">function recordActivity()
	{
		if($this-&gt;Auth-&gt;user('id'))
		{
			$this-&gt;Activity-&gt;query("DELETE FROM activities  WHERE user_id = '".$this-&gt;Auth-&gt;user('id')."'");
			$this-&gt;data['Activity']['user_ip'] = $_SERVER['REMOTE_ADDR'];
			$this-&gt;data['Activity']['user_id'] = $this-&gt;Auth-&gt;user('id');
			$this-&gt;data['Activity']['user_browser'] = $_SERVER['HTTP_USER_AGENT'];
			$this-&gt;data['Activity']['user_accessed'] = date("Y-m-d H:i:s");
			$this-&gt;Activity-&gt;save($this-&gt;data);
			unset($this-&gt;data['Activity']);
		}
	}</pre>
<p>Here you can see that i have used &#8220;Activity&#8221; model that&#8217;s having User&#8217;s IP Address , User&#8217;s Logged in ID<br />
The browser from which user has requested the webpage and Last Accessed Date&gt;</p>
<p>The below line is used to unset the Activity model because we have declared our function in application controller not<br />
in &#8220;Activity&#8221; Controller. If we Declare it in &#8220;Activity&#8221; Controller then it will be auto reset.</p>
<pre class="brush:php">unset($this-&gt;data['Activity']);</pre>
<p>Step 2 : Now call your defined function into same &#8220;app_controller&#8221; inside public function beforeFilter()</p>
<pre class="brush:php">public function beforeFilter() {
		$this-&gt;recordActivity();
}</pre>
<p>Step 3 : Create a table in your database name as &#8220;activities&#8221; it will track logs of users and by using this tabel we will display the &#8220;Online Users&#8221;.</p>
<pre class="brush:sql">CREATE TABLE `activities` (
  `activity_id` int(11) NOT NULL auto_increment,
  `user_browser` varchar(255) NOT NULL,
  `user_ip` varchar(15) NOT NULL,
  `user_id` varchar(15) NOT NULL,
  `user_accessed` datetime NOT NULL,
  PRIMARY KEY  (`activity_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1856 ;</pre>
<p>Step 4 : We are done with tracking logs of users data you can check them into your database.<br />
Now lets suppose you want to show the logged in users on home page of in side block of your website then just find them out from &#8220;Activity&#8221; and &#8220;User&#8221; Models..</p>
<pre class="brush:php">$online_cond = array(
								'limit' =&gt; 10,
								'conditions' =&gt; array(' activities.user_accessed  &gt;= DATE_SUB( CURRENT_DATE() , INTERVAL 10 MINUTE) ' ),
								'order' =&gt; array(' activities.user_accessed DESC ' ),
								'group' =&gt; ' User.id ',
								'joins' =&gt; array(
       								array(
           								'table' =&gt; 'activities',
           								'alias' =&gt; 'activities',
           								'type' =&gt; 'LEFT',
           								'conditions'=&gt; array(' activities.user_id  = User.id ')
									)
								)
							);
		$OnlineUser_Array = $this-&gt;User-&gt;find('all' , $online_cond);
		//print_r($OnlineUser_Array);exit;
		$this-&gt;set('OnlineUser_Array', $OnlineUser_Array);</pre>
<p>Step 5 : You must delete log of user who is going to logged out from the system. It will delete his logged history.<br />
This Step is necessary for only those who are not looking to keep track of logged user.<br />
The developers who are only looking for &#8220;Online User&#8221; Functionality can put below code to reduce database weight.</p>
<pre class="brush:php">public function logout() {
        $this-&gt;Session-&gt;setFlash(__('Log out successful.', true), 'default', array('class' =&gt; 'success'));
		$this-&gt;Activity-&gt;query("DELETE FROM activities  WHERE user_id = '".$this-&gt;Auth-&gt;user('id')."'");
        $this-&gt;redirect($this-&gt;Auth-&gt;logout());
    }</pre>
<p>You Have done it <img src='http://www.sudhirtiwari.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Check Your page and Enjoy the time you saved &#8230;</p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2011/09/cakephp-online-now-with-user-history-traker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paypal Pro API Plugin for eShop</title>
		<link>http://www.sudhirtiwari.com/2011/04/paypal-pro-api-plugin-for-eshop/</link>
		<comments>http://www.sudhirtiwari.com/2011/04/paypal-pro-api-plugin-for-eshop/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 14:57:47 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress News]]></category>
		<category><![CDATA[eshop]]></category>
		<category><![CDATA[eshop and paypal pro]]></category>
		<category><![CDATA[eshop enhancement with paypal pro]]></category>
		<category><![CDATA[eshop paypal pro]]></category>
		<category><![CDATA[patch eshop]]></category>
		<category><![CDATA[patch paypal pro]]></category>
		<category><![CDATA[PayPal Pro]]></category>
		<category><![CDATA[paypal pro api]]></category>
		<category><![CDATA[paypal pro api intergration]]></category>
		<category><![CDATA[PayPal Pro eShop]]></category>
		<category><![CDATA[paypal pro with esho]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress eshop]]></category>
		<category><![CDATA[wordpress eshop paypal pro patch]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/?p=203</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2011/04/paypal-pro-api-plugin-for-eshop/">Paypal Pro API Plugin for eShop</a></p><p>I have got lots of request for integration of eshop with paypal pro API..
Clients are asking for same solution but their wording are different&#8230;.
###1
I would like someone to modify the php for eshop&#8217;s paypal gateway so that customers do not leave my site when checking out.
###2
I need a Paypal Pro merchant gateway plugin for eShop. [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2011/04/paypal-pro-api-plugin-for-eshop/">Paypal Pro API Plugin for eShop</a></p><p>I have got lots of request for integration of eshop with paypal pro API..</p>
<p>Clients are asking for same solution but their wording are different&#8230;.<br />
###1<br />
I would like someone to modify the php for eshop&#8217;s paypal gateway so that customers do not leave my site when checking out.</p>
<p>###2<br />
I need a Paypal Pro merchant gateway plugin for eShop. eShop currently offers a standard paypal gateway but does not have settings/option for the Paypal API direct pay. I am aware other shopping carts offer this (like wp ecommerce) but I like the eShop interface and functions.</p>
<p>I would very much like it written as a plugin for eShop.</p>
<p>WordPress version: 3.0.4<br />
eShop version: 6.0.2</p>
<p>etc&#8230;.</p>
<p>Finally, I desire to add this feature to eShop wordpress plugin..<br />
You can see the demo at my given demo url.<br />
Demo URL : http://www.techphpexpert.com/projects/eshop/</p>
<p>It was great to customize this plugin as its great achievement and everyone is in need of this&#8230;..</p>
<p>Currenltly i have customized &#8220;eShop&#8221; plugin for developers it might be easy to integrate my customization but may be not so easy for webmaster to do this job.</p>
<p>so if any one is in need for this feature let me know i will do it. You can reach me at sudhirsoft01@gmail.com or fill the contact us form with<br />
subject of &#8220;Paypal Pro API Plugin for eShop&#8221; and your suggations on message part.</p>
<p>You can see the below screencasts that i will provide you for admin settings and user-end setting.<br />
<strong>Admin Side User Interface:</strong></p>
<p><a href="http://www.sudhirtiwari.com/wp-content/uploads/2011/04/admin-setting-eshop.png"><img class="alignnone size-medium wp-image-205" title="admin-setting-eshop" src="http://www.sudhirtiwari.com/wp-content/uploads/2011/04/admin-setting-eshop-300x168.png" alt="" width="300" height="168" /></a></p>
<p><strong>Front Side Paypal Pro checkout option:</strong><br />
<a href="http://www.sudhirtiwari.com/wp-content/uploads/2011/04/front-checkout-page.png"><img class="alignnone size-medium wp-image-206" title="front-checkout-page" src="http://www.sudhirtiwari.com/wp-content/uploads/2011/04/front-checkout-page-300x168.png" alt="" width="300" height="168" /></a></p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2011/04/paypal-pro-api-plugin-for-eshop/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Custom error pages with htaccess</title>
		<link>http://www.sudhirtiwari.com/2011/03/custom-error-pages-with-htaccess/</link>
		<comments>http://www.sudhirtiwari.com/2011/03/custom-error-pages-with-htaccess/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 20:20:23 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript and htaccess tutorials]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/?p=199</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2011/03/custom-error-pages-with-htaccess/">Custom error pages with htaccess</a></p><p>A tutorial to enable custom error pages with an htaccess file. Note htaccess files only work on a linux server
To create an htaccess file open notepad or any plain text editor and save the file as .htaccess, if using notepad make sure the file type is set to all files or you will create a [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2011/03/custom-error-pages-with-htaccess/">Custom error pages with htaccess</a></p><p>A tutorial to enable custom error pages with an htaccess file. Note htaccess files only work on a linux server</p>
<p>To create an htaccess file open notepad or any plain text editor and save the file as .htaccess, if using notepad make sure the file type is set to all files or you will create a txt file.</p>
<p>There are five types of error pages that your server has to offer which are:</p>
<p>400 &#8211; Bad request</p>
<p>401 &#8211; Authorization Required</p>
<p>403 &#8211; Forbidden directory</p>
<p>404 &#8211; Page not found</p>
<p>500 &#8211; Internal Server Error</p>
<p>if you don&#8217;t have the right page like say a 404 page then the server issues you the error and informs you it could not find an error document. Making your own custom error page is very easy with htaccess on an htaccess file enter the command ErrorDocument then the error number then a forward slash then the path to the error page which tells the page where to go like this:</p>
<p>ErrorDocument 404 /errors/404.php</p>
<p>The final file will look like this:</p>
<pre class="brush:plain">ErrorDocument 400 /400.html

ErrorDocument 401 /401.html

ErrorDocument 403 /403.html

ErrorDocument 404 /404.html

ErrorDocument 500 /500.html</pre>
<p>Save the htaccess file in the root of the server then if their is an error the custom error page is served.<br />
Credit : phphelptutorials.com</p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2011/03/custom-error-pages-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Multisite</title>
		<link>http://www.sudhirtiwari.com/2011/02/wordpress-multisite/</link>
		<comments>http://www.sudhirtiwari.com/2011/02/wordpress-multisite/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 06:06:05 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Changing File Permissions]]></category>
		<category><![CDATA[Configuring Wildcard Subdomains for multi site under Plesk Control Panel]]></category>
		<category><![CDATA[Create A Network]]></category>
		<category><![CDATA[Debugging a WordPress Network]]></category>
		<category><![CDATA[Editing wp-config.php]]></category>
		<category><![CDATA[Giving WordPress Its Own Directory]]></category>
		<category><![CDATA[Glossary]]></category>
		<category><![CDATA[Migrating Multiple Blogs into WordPress 3.0 Multisite]]></category>
		<category><![CDATA[Multilingual Codex]]></category>
		<category><![CDATA[Network Admin]]></category>
		<category><![CDATA[Super Admin Menu]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/?p=193</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2011/02/wordpress-multisite/">WordPress Multisite</a></p><p>Create A Network
In WordPress 3.0, you now have the ability to create a network of sites (Multisite). This Article is instructions for creating a network. It is very similar to creating your own personal version of wordpress.com.
NOTE: If you are currently running a version of WordPress MU, you do not need to complete these steps. [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2011/02/wordpress-multisite/">WordPress Multisite</a></p><h2 class="pagetitle">Create A Network</h2>
<p><!-- start content -->In <a title="Version 3.0" href="/Version_3.0">WordPress 3.0</a>, you now have the ability to create a <a title="Glossary" href="/Glossary#Network">network</a> of sites (Multisite). This Article is instructions for creating a network. It is very similar to creating your own personal version of wordpress.com.</p>
<div style="clear: both; background-color: #ffffff; border: 1px solid #c6d9e9; color: #000000; padding: 7px; margin: 0.5em auto; vertical-align: middle;"><strong>NOTE:</strong> If you are currently running a version of <a title="WPMU" href="/WPMU">WordPress MU</a>, you <strong>do not</strong> need to complete these steps. your network is already enabled. Once you upgrade to the 3.x branch, you will be prompted to update your .htaccess rules for MultiSite.</div>
<p><script type="text/javascript">// <![CDATA[
   if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); }
// ]]&gt;</script><a id="Before_You_Begin" name="Before_You_Begin"></a></p>
<h2><span class="mw-headline"> Before You Begin </span></h2>
<p><a id="Admin_Requirements" name="Admin_Requirements"></a></p>
<h3><span class="mw-headline"> Admin Requirements </span></h3>
<p>If you want to run a network of blogs you should at least have a basic understanding of UNIX/Linux administration. A basic knowledge of WordPress development, PHP, HTML and CSS is recommended as well.</p>
<p>Setting up and running a multi-site installation is more complex than a single-site install. Reading this page should help you to decide if you really need a multi-site install, and what might be involved with creating one. If the instructions on this page make no sense to you, be sure to test things on a development site first, rather than your live site.</p>
<p><a id="Server_Requirements" name="Server_Requirements"></a></p>
<h3><span class="mw-headline"> Server Requirements </span></h3>
<p>Since this feature requires extra server setup and more technical ability, please check with your webhost and ask if they support the use of this feature. It is not recommended to try this on shared hosting.</p>
<p>You are given the choice between sub-domains or sub-directories in <a href="#Step_4:_Installing_a_Network">Step 4: Installing a Network</a>. This means each additional site in your network will be created as a new virtual subdomain or subdirectory.</p>
<dl>
<dd>
<ul>
<li> <strong>Sub-domains</strong> &#8212; like <code>site1.example.com</code> and <code>site2.example.com</code></li>
<li> <strong>Sub-directories</strong> &#8212; like <code>example.com/site1</code> and <code>example.com/site2</code></li>
</ul>
</dd>
</dl>
<p>It is also possible later, through use of a plugin such as <a class="external text" title="http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/" href="http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/">WordPress MU Domain Mapping</a>, to map individual sites to independent domain names.</p>
<dl>
<dt> Sub-directory sites </dt>
<dd> It works with the use of <strong>the <a title="Glossary" href="/Glossary#mod_rewrite">mod_rewrite</a> feature on the server</strong> having the ability to read the <code>.htaccess</code> file, which will create the link structure. </dd>
<dd> If you are using pretty permalinks in your blog already, then subdirectory sites will work as well. </dd>
<dt> Sub-domain sites </dt>
<dd> It works using <strong>wildcard subdomains</strong>. You must have this enabled in Apache, and you must also add a wildcard subdomain to your DNS records. (See <a href="#Step_2:_Setting_Wildcard_Subdomains">Step 2</a> how to set up.) </dd>
<dd> Some hosts have already set up the wildcard on the server side, which means all you need to add is the DNS record. </dd>
<dd> Some shared webhosts may not support this, so you may need to check your webhost before enabling this feature. </dd>
</dl>
<p><a id="WordPress_Settings_Requirements" name="WordPress_Settings_Requirements"></a></p>
<h3><span class="mw-headline"> WordPress Settings Requirements </span></h3>
<ul>
<li> <a title="Giving WordPress Its Own Directory" href="/Giving_WordPress_Its_Own_Directory">Giving WordPress its own directory</a> will not work in WordPress 3.0 with multisite enabled. It interferes with the member blog lookup.</li>
<li> You <strong>cannot create a network</strong> in the following cases:
<ul>
<li> &#8220;WordPress address (URL)&#8221; is different from &#8220;Site address (URL)&#8221;.</li>
<li> &#8220;WordPress address (URL)&#8221; uses a port number other than &#8216;:80&#8242;, &#8216;:443&#8242;.</li>
</ul>
</li>
<li> You <em>cannot choose <strong>Sub-domain</strong> Install</em> in the following cases:
<ul>
<li> WordPress install is in a directory (not in document root).</li>
<li> &#8220;WordPress address (URL)&#8221; is <code>localhost</code>.</li>
<li> &#8220;WordPress address (URL)&#8221; is IP address such as <var>127.0.0.1</var>.</li>
</ul>
</li>
<li> You <em>cannot choose <strong>Sub-directory</strong> Install</em> in the following cases:
<ul>
<li> If your existing WordPress installation has been set up for more than a month, due to issues with existing permalinks. (This problem will be fixed in a future version. See <a href="#Switching_between_subdomains_and_subfolders">Switching between subdomains and subfolders</a> for more information.)</li>
</ul>
</li>
</ul>
<p>(See <code><a class="external text" title="http://core.trac.wordpress.org/browser/tags/3.1/wp-admin/network.php" href="http://core.trac.wordpress.org/browser/tags/3.1/wp-admin/network.php">wp-admin/network.php</a></code> for more detail)</p>
<p><a id="Step_1:_Backup_Your_WordPress" name="Step_1:_Backup_Your_WordPress"></a></p>
<h2><span class="mw-headline"> Step 1: Backup Your WordPress </span></h2>
<p>Your WordPress will be updated when creating a Network. Please <a title="WordPress Backups" href="/WordPress_Backups">backup your database and files</a>.</p>
<p><a id="Step_2:_Setting_Wildcard_Subdomains" name="Step_2:_Setting_Wildcard_Subdomains"></a></p>
<h2><span class="mw-headline"> Step 2: Setting Wildcard Subdomains </span></h2>
<p>(If this is a Sub-directories Install, <a href="#Step_3:_Allow_Multisite">skip this step</a>.)</p>
<p><strong>Sub-domain sites</strong> work with the use of wildcard subdomains. This is a two-step process:</p>
<ol>
<li> Apache must be configured to accept wildcards.
<ol>
<li> Open up the <code>httpd.conf</code> file or the include file containing the VHOST entry for your web account.</li>
<li> Add this line:
<pre>ServerAlias *.example.com</pre>
</li>
</ol>
</li>
<li> In the DNS records on your server, add a wildcard subdomain that points to the main installation. It should look like:
<pre>A *.example.com</pre>
</li>
</ol>
<p>External links:</p>
<ul>
<li> <a class="extiw" title="wikipedia:Wildcard DNS record" href="http://en.wikipedia.org/wiki/Wildcard_DNS_record">Wildcard DNS record</a> (Wikipedia)</li>
<li> <a class="external text" title="http://httpd.apache.org/docs/2.0/en/vhosts/" href="http://httpd.apache.org/docs/2.0/en/vhosts/">Apache Virtual Host</a> (Apache HTTP Server documentation)</li>
</ul>
<p><a id="Specific_Configurations" name="Specific_Configurations"></a></p>
<h3><span class="mw-headline">Specific Configurations</span></h3>
<p>Due to the fact that every host is configured differently, the following &#8216;per site&#8217; directions are not exhaustive.  In all cases, if you cannot determine how to set up wildcard subdomains, <em>contact your webhost</em> for directions.</p>
<p><strong>CPanel</strong></p>
<p>Make a sub-domain named &#8220;*&#8221; (wildcard) at your CPanel (*.example.com). Make sure to point this at the same folder location where your wp-config.php file is located.</p>
<p><strong>Plesk</strong></p>
<p>There are several steps that differ when setting up the server for wildcard subdomains on a server using Plesk Panel compared to a server using cPanel (or no control panel).  This article <a title="Configuring Wildcard Subdomains for multi site under Plesk Control Panel" href="/Configuring_Wildcard_Subdomains_for_multi_site_under_Plesk_Control_Panel">Configuring Wildcard Subdomains for multi site under Plesk Control Panel?</a> details all the steps involved.</p>
<p><strong>DirectAdmin panel</strong></p>
<p>Click &#8220;User Panel&#8221; -&gt; DNS Management -&gt; add the following three entries using the three columns:</p>
<pre>* A xxx.xx.xx.xxx</pre>
<p>(Replace &#8220;xxx.xx.xx.xxx&#8221; with your website IP.)  Click &#8220;Admin Panel&#8221; (If you have no &#8220;admin panel&#8221; ask your host to do this.) -&gt; Custom Httpd -&gt; yourdomain.com -&gt; In the text input area, just paste and &#8220;save&#8221; precisely the following:</p>
<pre>ServerAlias *.|DOMAIN|</pre>
<p>(If you ever need to un-do a custom Httpd: return here, delete text from input area, save.)</p>
<ul>
<li> DirectAdmin.com: <a class="external text" title="http://help.directadmin.com/item.php?id=127" href="http://help.directadmin.com/item.php?id=127">Apache Wildcard Documentation</a>&#8230; DirectAdmin.com forum: <a class="external text" title="http://www.directadmin.com/forum/showthread.php?p=195033" href="http://www.directadmin.com/forum/showthread.php?p=195033">WordPress wildcard subdomains</a>.</li>
</ul>
<p><a id="Step_3:_Allow_Multisite" name="Step_3:_Allow_Multisite"></a></p>
<h2><span class="mw-headline"> Step 3: Allow Multisite </span></h2>
<p>To enable the Network menu item, you must first define multisite in the <a title="Editing wp-config.php" href="/Editing_wp-config.php"><code>wp-config.php</code></a> file.</p>
<p>Open up <code>wp-config.php</code> and add this line <strong>above</strong> where it says <code>/* That's all, stop editing! Happy blogging. */</code>:</p>
<pre>define('WP_ALLOW_MULTISITE', true);
</pre>
<p><a id="Step_4:_Installing_a_Network" name="Step_4:_Installing_a_Network"></a></p>
<h2><span class="mw-headline"> Step 4: Installing a Network </span></h2>
<p>This will enable the Network menu item to appear in the Tools menu.  Visit <a class="mw-redirect" title="Super Admin Menu" href="/Super_Admin_Menu">Administration</a> &gt; <a class="mw-redirect" title="Super Admin Menu" href="/Super_Admin_Menu#Tools">Tools</a> &gt; <a title="Tools Network SubPanel" href="/Tools_Network_SubPanel">Network</a> to see the screen where you will configure certain aspects of our network.</p>
<div class="thumb tright">
<div class="thumbinner" style="width: 182px;">
<p><a class="image" title="Tools Network SubPanel" href="http://codex.wordpress.org/images/thumb/7/7c/tools-network.png/180px-tools-network.png"><img class="thumbimage" src="http://codex.wordpress.org/images/thumb/7/7c/tools-network.png/180px-tools-network.png" border="0" alt="" width="180" height="113" /></a></p>
<div class="thumbcaption">
<div class="magnify"><a class="internal" title="Enlarge" href="http://codex.wordpress.org/images/thumb/7/7c/tools-network.png/180px-tools-network.png"><img src="http://codex.wordpress.org/skins/common/images/magnify-clip.png" alt="" width="15" height="11" /></a></div>
<p>Tools Network SubPanel</p>
</div>
</div>
</div>
<dl>
<dt> Addresses of Sites in your Network </dt>
<dd>You are given the choice between sub-domains or sub-directories (if none of <a href="#WordPress_Settings_Requirements">the above</a> applies). This means each additional site in your network will be created as a new virtual subdomain or subdirectory. you have to pick one or the other, and <strong>you cannot change this unless you reconfigure your install</strong>. See also <a href="#Before_You_Begin">Before You Begin</a>.</p>
<ul>
<li> <strong>Sub-domains</strong> &#8212; like <code>site1.example.com</code> and <code>site2.example.com</code></li>
<li> <strong>Sub-directories</strong> &#8212; like <code>example.com/site1</code> and <code>example.com/site2</code></li>
</ul>
</dd>
</dl>
<dl>
<dt> Network Details </dt>
<dd> There are filled in automatically.
<dl>
<dt> Server Address </dt>
<dd> The Internet address of your network will be <code>example.com</code>. </dd>
<dt> Network Title </dt>
<dd> What would you like to call your network? </dd>
<dt> Admin E-mail Address </dt>
<dd> Your email address. </dd>
</dl>
</dd>
</dl>
<p>Double-check they are correct and click the <strong>Install</strong> button.</p>
<p>You may receive a warning about wildcard subdomains. Check <a href="#Step_2:_Setting_Wildcard_Subdomains">Setting Wildcard Subdomains</a>.</p>
<div class="screen" style="padding: 10px; border: 1px solid #dadada; background-color: #f0f0f0;">
<p><strong>Warning! Wildcard DNS may not be configured correctly!</strong></p>
<p>The installer attempted to contact a random hostname (<code>13cc09.example.com</code>) on your domain.</p>
<p>To use a subdomain configuration, you must have a wildcard entry in your DNS. This usually means adding a <code>*</code> hostname record pointing at your web server in your DNS configuration tool.</p>
<p>You can still use your site but any subdomain you create may not be accessible. If you know your DNS is correct, ignore this message.</p>
</div>
<p><a id="Step_5:_Enabling_the_Network" name="Step_5:_Enabling_the_Network"></a></p>
<h2><span class="mw-headline"> Step 5: Enabling the Network </span></h2>
<p>The rest of the steps are ones you must complete in order to finish.</p>
<div class="thumb tright">
<div class="thumbinner" style="width: 182px;">
<p><a class="image" title="Tools Network Created" href="/File:tools-network-created.png"><img class="thumbimage" src="http://codex.wordpress.org/images/thumb/5/5c/tools-network-created.png/180px-tools-network-created.png" border="0" alt="" width="180" height="149" /></a></p>
<div class="thumbcaption">
<div class="magnify"><a class="internal" title="Enlarge" href="/File:tools-network-created.png"><img src="http://codex.wordpress.org/skins/common/images/magnify-clip.png" alt="" width="15" height="11" /></a></div>
<p>Tools Network Created</p>
</div>
</div>
</div>
<dl>
<dt>0. First, back up your existing <code>wp-config.php</code> and <code>.htaccess</code> files. </dt>
</dl>
<dl>
<dt>1. Create a <code>blogs.dir</code> directory under <code>/wp-content/</code> </dt>
<dd> This directory is used to stored uploaded media for your additional sites and must be <a title="Changing File Permissions" href="/Changing_File_Permissions">writable</a> by the web server. They should be CHOWNed and CHMODed the same as your <code>wp-content</code> directory. </dd>
</dl>
<dl>
<dt>2. Add the extra lines your WordPress installation generates into your <a title="Editing wp-config.php" href="/Editing_wp-config.php"><code>wp-config.php</code> file</a>. </dt>
<dd> These lines are dynamically generated for you based on your configuration. </dd>
<dd> Edit the <code>wp-config.php</code> file while you are logged in to your sites admin panel. </dd>
<dd> Paste the generated lines immediately <strong>above</strong> <code>/* That's all, stop editing! Happy blogging. */</code>. </dd>
</dl>
<dl>
<dt>3. Add the generated mod_rewrite rules to your <code>.htaccess</code> file, replacing other WordPress rules. </dt>
<dd> (If there isn&#8217;t one, then create it.) </dd>
<dd> These lines are dynamically generated for you based on your configuration. </dd>
</dl>
<dl>
<dt>4. Log in again. </dt>
<dd> Once the above steps are completed and the new wp-config.php &amp; .htaccess files are saved, your network is enabled and configured. You will have to log in again. click &#8220;Log In&#8221; to refresh your Adminstration Panel. If you have problems logging back in, please clear your browser&#8217;s cache and cookies. </dd>
</dl>
<p><a id="Step_6:_Network_Admin_Settings" name="Step_6:_Network_Admin_Settings"></a></p>
<h2><span class="mw-headline"> Step 6: Network Admin Settings </span></h2>
<p>In 3.0, you had a new menu for <strong>Super Admin</strong>, but as of 3.1 you have an entire sub-section for  <strong><a title="Network Admin" href="/Network_Admin">Network Admin</a></strong>.  The link can be found on the upper-right of all admin screens, by your name.</p>
<p>Go the <a class="new" title="Network Admin Settings SubPanel (page does not exist)" href="/index.php?title=Network_Admin_Settings_SubPanel&amp;action=edit&amp;redlink=1">Settings</a> panel to configure network options, and the Sites panel to manage your sites.</p>
<p><a id="Things_You_Need_To_Know" name="Things_You_Need_To_Know"></a></p>
<h2><span class="mw-headline"> Things You Need To Know </span></h2>
<p>Here are some additional things you might need to know about advanced administration of the blog network.</p>
<p><a id="User_Access" name="User_Access"></a></p>
<h3><span class="mw-headline">User Access</span></h3>
<p>By design, all users who are added to your network will have <em>subscriber</em> access to <strong>all sites</strong> on your network.</p>
<p>Also, site admins cannot install new themes or plugins.  Only the Network Admin (aka Super Admin) has that ability.</p>
<p><a id="Permalinks" name="Permalinks"></a></p>
<h3><span class="mw-headline">Permalinks</span></h3>
<p>While permalinks will continue to work, the main blog (i.e. the first one created) will have an extra entry of <code>blog</code>, making your URLs appear like <code>domain.com/blog/YYYY/MM/POSTNAME</code>.</p>
<p>This is by design, in order to prevent collisions with SubFolder installs. Currently there is no easy way to change it, as doing so prevents WordPress from auto-detecting collisions between your main site and any subsites. This will be addressed, and customizable, in a future version of WordPress.</p>
<p>Also note that the <code>blog</code> prefix is not used for static pages which will be accessible directly under the base address, e.g. <code>domain.com/PAGENAME</code>. If you try to create a static page in the first blog with the name of another existing blog, the page&#8217;s permalink will get a suffix (e.g. <code>domain.com/PAGENAME-2</code>). If you create a new blog with the slug of an existing static page, the static page will not be reachable anymore. To prevent this, you can add the names of your static pages to the blacklist so that no blog with this name can be created.</p>
<p><a id="WordPress_Plugins" name="WordPress_Plugins"></a></p>
<h3><span class="mw-headline">WordPress Plugins</span></h3>
<dl>
<dd>WordPress Plugins now have additional flexibility, depending upon their implementation across the network. </dd>
</dl>
<ul>
<li> <strong>Site Specific Plugins:</strong> WordPress Plugins to be activated or deactivated by an individual blog owner are stored in the <tt>plugins</tt> directory. You need to enable the Plugins page for individual site administrators from Network &gt; Options.</li>
<li> <strong>Network Plugins:</strong> WordPress Plugins stored in the <tt>plugins</tt> directory can be activated across the network by the super admin.</li>
<li> <strong>Must-Use Plugins:</strong> Plugins to be used by all sites on the entire network may also be installed in the <tt>mu-plugins</tt> directory as single files, or a file to include a subfolder. Any files within a folder will not be read. These files are not activated or deactivated; if they exist, they are used.</li>
</ul>
<p><a id="Categories_and_Tags" name="Categories_and_Tags"></a></p>
<h3><span class="mw-headline">Categories and Tags</span></h3>
<dl>
<dd>Global terms are disabled in WordPress 3.0 by default. You can use the <a class="external text" title="http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/" href="http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/">Sitewide Tags WordPress Plugin</a> or other similar Plugins to incorporate global tags on the portal/front page of the site or on specific pages or blogs within the network to increase navigation based upon micro-categorized content. </dd>
</dl>
<p><a id="Switching_between_subdomains_and_subfolders" name="Switching_between_subdomains_and_subfolders"></a></p>
<h3><span class="mw-headline">Switching between subdomains and subfolders</span></h3>
<p>If you have had WordPress installed for longer than a month and are attempting to activate the network, you will be told to use <strong>Sub-domain</strong> sites.  This is in order to ensure you don&#8217;t have conflicts between pages (i.e. example.com/pagename ) and sites (i.e. example.com/sitename ).  If you are confident you will not have this issue, then you can change this after you finish the initial setup.</p>
<p>In your <code>wp-config.php</code> file, you&#8217;ll want to change the define call for SUBDOMAIN_INSTALL:</p>
<dl>
<dt>Use SubDomains </dt>
<dd>
<pre>define( 'SUBDOMAIN_INSTALL', true );</pre>
</dd>
<dt>Use SubFolders </dt>
<dd>
<pre>define( 'SUBDOMAIN_INSTALL', false );</pre>
</dd>
</dl>
<p>You&#8217;ll also have to change your <code>.htaccess</code> to the new setup. Be aware, you may have issues if you attempt this after being on one setup or the other for any length of time, so proceed with caution.</p>
<p><a id=".htaccess_and_Mod_Rewrite" name=".htaccess_and_Mod_Rewrite"></a></p>
<h3><span class="mw-headline">.htaccess and Mod Rewrite</span></h3>
<p>Unlike Single Site WordPress, which can work with &#8220;ugly&#8221; <a title="Using Permalinks" href="/Using_Permalinks">Permalinks</a> and thus does not need Mod Rewrite, MultiSite <em>requires</em> its use to format URLs for your subsites. This necessitates the use of an .htaccess file, the format of which will be slightly different if you&#8217;re using SubFolders or SubDomains.  The examples below are the standard .htaccess entries for WordPress SubFolders and SubDomains, when WordPress is installed in the root folder of your website.  If you have WordPress in it&#8217;s own folder, you will need to change the value for <tt>RewriteBase</tt> appropriately.</p>
<p>As a reminder, these are <strong>EXAMPLES</strong> and work in most, but not all, installs.</p>
<p><strong>SubFolder Example</strong></p>
<pre># BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress
</pre>
<p><strong>SubDomain Example</strong></p>
<pre># BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
# END WordPress
</pre>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2011/02/wordpress-multisite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Account/Registration Fields</title>
		<link>http://www.sudhirtiwari.com/2011/02/custom-accountregistration-fields/</link>
		<comments>http://www.sudhirtiwari.com/2011/02/custom-accountregistration-fields/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 05:53:54 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[add custom field]]></category>
		<category><![CDATA[Add New Registration Field to Magento Signup page]]></category>
		<category><![CDATA[add registration field]]></category>
		<category><![CDATA[custom registration]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[magento account]]></category>
		<category><![CDATA[magento development]]></category>
		<category><![CDATA[magento registration]]></category>
		<category><![CDATA[Make custom registration page for magento]]></category>
		<category><![CDATA[signup]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/?p=180</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2011/02/custom-accountregistration-fields/">Custom Account/Registration Fields</a></p><p>Our goal was to add a few fields to the standard Magento Registration form (Magento 1.4x, using the default template structure), enabling us to capture information such as Occupation, and Education.
Magento provides a simple user account signup page. However, some online stores might want to collect relevant customer information for more targeted and personal interactions [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2011/02/custom-accountregistration-fields/">Custom Account/Registration Fields</a></p><p>Our goal was to add a few fields to the standard Magento Registration form (Magento 1.4x, using the default template structure), enabling us to capture information such as Occupation, and Education.</p>
<p>Magento provides a simple user account signup page. However, some online stores might want to collect relevant customer information for more targeted and personal interactions with their customers. Some examples of details that could be collected include occupation, education etc&#8230;</p>
<p>Adding your custom fields on the signup form is not difficult, but it is not trivial either, since one cannot use the Magento backend for the task. As an example of how it can be done, I will demonstrate the addition of a new custom field to the signup form asking new users to enter their occupation and education.<br />
Okay, Let me follow step by step. Please do not miss any single step otherwise it won&#8217;t work&#8230;<br />
<strong>Step 1 :</strong></p>
<p>Open File :</p>
<p>app\design\frontend\base\default\template\customer\form\register.phtml</p>
<p>1. Find below code</p>
<pre class="brush:php">&lt;div&gt;
&lt;label for="email_address"&gt;&lt;?php echo $this-&gt;__('Email Address') ?&gt; &lt;span
class="required"&gt;*&lt;/span&gt;&lt;/label&gt;&lt;br/&gt;
&lt;input type="text" name="email" id="email_address" value="&lt;?php echo $this-
&gt;htmlEscape($this-&gt;getFormData()-&gt;getEmail()) ?&gt;" title="&lt;?php echo $this-&gt;__('Email
Address') ?&gt;" /&gt;
&lt;/div&gt;</pre>
<p>Replace Code</p>
<pre class="brush:php">&lt;div&gt;
&lt;label for="email_address"&gt;&lt;?php echo $this-&gt;__('Email Address') ?&gt; &lt;span
class="required"&gt;*&lt;/span&gt;&lt;/label&gt;&lt;br/&gt;

&lt;input type="text" name="email" id="email_address" value="&lt;?php echo $this-
&gt;htmlEscape($this-&gt;getFormData()-&gt;getEmail()) ?&gt;" title="&lt;?php echo $this-&gt;__('Email Address')
?&gt;" /&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;label for="occupation"&gt;&lt;?php echo $this-&gt;__('Occupation') ?&gt;&lt;/label&gt;&lt;br/&gt;

&lt;input type="text" name="occupation" id="occupation" value="&lt;?php echo
$this-&gt;htmlEscape($this-&gt;getFormData()-&gt;getOccupation()) ?&gt;" title="&lt;?php echo $this-
&gt;__('Occupation') ?&gt;" /&gt;

&lt;/div&gt;

&lt;div&gt;

&lt;label for="education"&gt;&lt;?php echo $this-&gt;__('Education') ?&gt;&lt;/label&gt;&lt;br/&gt;

&lt;input type="text" name="education" id="education" value="&lt;?php echo $this-
&gt;htmlEscape($this-&gt;getFormData()-&gt;getEducation()) ?&gt;" title="&lt;?php echo $this-&gt;__('Education')
?&gt;" /&gt;

&lt;/div&gt;</pre>
<p><strong>step 2:</strong></p>
<p>Open file :</p>
<p>app\design\frontend\base\default\template\customer\form\edit.phtml</p>
<p>1. Find Below Code</p>
<pre class="brush:applescript">&lt;li&gt;
&lt;div&gt;
&lt;label for="email"&gt;&lt;?php echo $this-&gt;__('Email Address') ?&gt; &lt;span
class="required"&gt;*&lt;/span&gt;&lt;/label&gt;&lt;br /&gt;
&lt;input type="text" name="email" id="email" value="&lt;?php echo $this-
&gt;htmlEscape($this-&gt;getCustomer()-&gt;getEmail()) ?&gt;" title="&lt;?php echo $this-&gt;__('Email
Address') ?&gt;" /&gt;
&lt;/div&gt;
&lt;/li&gt;</pre>
<p>Replace Code</p>
<pre class="brush:php">&lt;li&gt;
&lt;div&gt;
&lt;label for="email"&gt;&lt;?php echo $this-&gt;__('Email Address') ?&gt; &lt;span
class="required"&gt;*&lt;/span&gt;&lt;/label&gt;&lt;br /&gt;
&lt;input type="text" name="email" id="email" value="&lt;?php echo $this-
&gt;htmlEscape($this-&gt;getCustomer()-&gt;getEmail()) ?&gt;" title="&lt;?php echo $this-&gt;__('Email
Address') ?&gt;" /&gt;
&lt;/div&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;div&gt;
&lt;label for="occupation"&gt;&lt;?php echo $this-&gt;__('Occupation') ?&gt; &lt;/label&gt;&lt;br/&gt;
&lt;input type="text" name="occupation" id="occupation" value="&lt;?php echo
$this-&gt;htmlEscape($this-&gt;getCustomer()-&gt;getOccupation()) ?&gt;" title="&lt;?php echo $this-
&gt;__('Occupation') ?&gt;" /&gt;
&lt;/div&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;div&gt;
&lt;label for="education"&gt;&lt;?php echo $this-&gt;__('Education') ?&gt; &lt;/label&gt;&lt;br/&gt;
&lt;input type="text" name="education" id="education" value="&lt;?php echo
$this-&gt;htmlEscape($this-&gt;getCustomer()-&gt;getEducation()) ?&gt;" title="&lt;?php echo $this-
&gt;__('Education') ?&gt;" /&gt;
&lt;/div&gt;

&lt;/li&gt;
</pre>
<p><strong>Step 3:</strong></p>
<p>Open file :</p>
<p>app\code\core\Mage\Customer\Model\Entity\Setup.php</p>
<p>1. Find below code inside getDefaultEntities() function</p>
<p>Replace Code :</p>
<p><strong> </strong></p>
<pre class="brush:php"><strong><strong>'email' =&gt; array(
'type'
=&gt; 'static',
'label'
=&gt; 'Email',
'class'
=&gt; 'validate-email',
'sort_order' =&gt; 6,
),
'occupation' =&gt; array(
'label'
=&gt; 'Occupation',
'required' =&gt; false,
'sort_order' =&gt; 7,
),
'education' =&gt; array(
'label'
=&gt; 'Education',
'required' =&gt; false,
'sort_order' =&gt; 8,
),

</strong></strong></pre>
<p><strong>Note: (if you need field with validation then ‘requirted’ =&gt; true)</strong></p>
<p>Hey do not feel tired or boring  you are going right way. You are now only Two steps to get it done.<br />
<strong><br />
Step 4 :</strong></p>
<p>Open file :</p>
<p>app\code\core\Mage\Customer\etc\config.xml</p>
<p>1. Find below Code :</p>
<p>&lt;global&gt;<br />
&lt;fieldsets&gt;<br />
&lt;customer_account&gt;</p>
<p>Then In &lt;customer_account&gt;, you will find below line</p>
<p>&lt;email&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/email&gt;</p>
<p>After that line insert 2 more rows like below :</p>
<p>&lt;occupation&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/occupation&gt;<br />
&lt;education&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/education&gt;</p>
<p><strong>Step 5:</strong></p>
<p><strong>(Most important) </strong>Please follow below instruction :</p>
<p>1. Open file app\design\frontend\base\default\template\customer\form\register.phtml</p>
<p>2. Add Below code at top of the file,</p>
<pre class="brush:php">&lt;?php
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$AttrCode = occupation;
$settings = array (
'position' =&gt; 1,
'is_required'=&gt; 0
);
$setup-&gt;addAttribute('1', $AttrCode, $settings); ?&gt;</pre>
<p>Now Save file Clear Cache from admin panel Refresh create account page</p>
<p>For Example, (http://websitename/ index.php/customer/account/create/)</p>
<p>Once Refreshed, then</p>
<p>Go to the customer_entity_varchar table in DB, your field is there&#8230;</p>
<p>Again Open file, app\design\frontend\base\default\template\customer\form\register.phtml</p>
<p>Now Replace Top code,</p>
<pre class="brush:php">&lt;?php
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$AttrCode = education;
$settings = array (
'position' =&gt; 1,
'is_required'=&gt; 0
);
$setup-&gt;addAttribute('1', $AttrCode, $settings); ?&gt;</pre>
<p>Or Else put</p>
<pre class="brush:php">$AttrCode = education;</pre>
<p>Now Save file Clear Cache from admin panel Refresh create account page</p>
<p>For Example, (http://websitename/ index.php/customer/account/create/)</p>
<p>Once Refreshed then,</p>
<p>Again go to file, app\design\frontend\base\default\template\customer\form\register.phtml</p>
<p>And Comment Top Code or remove top code&#8230;.</p>
<p>$AttrCode = education;</p>
<p>Now create your account and login with your information&#8230;</p>
<p>Check my account page and get smile&#8230;.:)</p>
<p>That’s it&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p>Feel Free to ask if you are having any doubt in this.<br />
credit goes to Magento developer : Vipul Prajapati</p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2011/02/custom-accountregistration-fields/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>WordPress Hack &#8211; How to Insert Ads in the Middle of Your Content!</title>
		<link>http://www.sudhirtiwari.com/2011/02/wordpress-hack-how-to-insert-ads-in-the-middle-of-your-content/</link>
		<comments>http://www.sudhirtiwari.com/2011/02/wordpress-hack-how-to-insert-ads-in-the-middle-of-your-content/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 07:38:33 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[insert ads]]></category>
		<category><![CDATA[middle of your content]]></category>
		<category><![CDATA[middle of your post]]></category>
		<category><![CDATA[wordpress hack]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/?p=177</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2011/02/wordpress-hack-how-to-insert-ads-in-the-middle-of-your-content/">WordPress Hack &#8211; How to Insert Ads in the Middle of Your Content!</a></p><p>With this hack you will be able to add adsense block (or somethings else) in the midde of your post after 2 paragraphs.
As a hard hack my suggestion is make a template backup before apply this tricks.

Open your “single.php” file (in your template folder)
Search
&#60;?php the_content(); ?&#62;


Replace with:
&#60;?php
  $content = apply_filters('the_content', $post-&#62;post_content);  //get the [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2011/02/wordpress-hack-how-to-insert-ads-in-the-middle-of-your-content/">WordPress Hack &#8211; How to Insert Ads in the Middle of Your Content!</a></p><p>With this hack you will be able to add adsense block (or somethings else) in the midde of your post after 2 paragraphs.</p>
<p>As a hard hack my suggestion is make a template backup before apply this tricks.</p>
<ul>
<li>Open your “<em>single.php</em>” file (in your template folder)</li>
<li>Search<br />
&lt;?php the_content(); ?&gt;<img src="file:///C:/Users/regius/AppData/Local/Temp/moz-screenshot-1.png" alt="" /></li>
</ul>
<ul>
<li>Replace with:
<pre class="brush:php">&lt;?php
  $content = apply_filters('the_content', $post-&gt;post_content);  //get the post content store in $content
  $save = explode("&lt;/p&gt;", $content);  //Separate the content into &lt;p&gt; blocks
  $tcount=0; //this is count for number of &lt;p&gt; blocks
  $adon=0;  //this is a variable so you don't show ads more than once.
  foreach($save as $item) {
    echo $item;  //print the &lt;p&gt; block
    echo "&lt;/p&gt;";
    if(preg_match('/&lt;p&gt; /',$item)==0 &amp;&amp; $tcount&gt;=1 &amp;&amp; $adon==0) {
                                $adon=1;
?&gt;
Replace this with Your adsense code!!!
&lt;?php
    }
 if(preg_match('/&lt;p&gt; /',$item)==0 &amp;&amp; $tcount&gt;=4 &amp;&amp; $adon==1) {
                                $adon=2;
?&gt;
Replace this with Your adsense code if you want additional adsense blocks for super long blog posts or leave it empty if you don't want one.
&lt;?php
   }
   $tcount++;
 }
?&gt;
</pre>
<p>credit goes to : zedomax.biz</li>
<div>
<div id="highlighter_402484">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</ul>
<ul>
<div>
<div id="highlighter_511866">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code><br />
</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</ul>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2011/02/wordpress-hack-how-to-insert-ads-in-the-middle-of-your-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to display post count from a category</title>
		<link>http://www.sudhirtiwari.com/2011/02/how-to-display-post-count-from-a-category/</link>
		<comments>http://www.sudhirtiwari.com/2011/02/how-to-display-post-count-from-a-category/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 07:31:35 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[post count]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/?p=174</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2011/02/how-to-display-post-count-from-a-category/">How to display post count from a category</a></p><p>I am just recording my work right now. I found this to work really well.

function wt_get_category_count($input = '') {
global $wpdb;
if($input == '')
{
$category = get_the_category();
return $category[0]-&#62;category_count;
}
elseif(is_numeric($input))
{
$SQL = "SELECT $wpdb-&#62;term_taxonomy.count FROM $wpdb-&#62;terms, $wpdb-&#62;term_taxonomy WHERE $wpdb-&#62;terms.term_id=$wpdb-&#62;term_taxonomy.term_id AND $wpdb-&#62;term_taxonomy.term_id=$input";
return $wpdb-&#62;get_var($SQL);
}
else
{
$SQL = "SELECT $wpdb-&#62;term_taxonomy.count FROM $wpdb-&#62;terms, $wpdb-&#62;term_taxonomy WHERE $wpdb-&#62;terms.term_id=$wpdb-&#62;term_taxonomy.term_id AND $wpdb-&#62;terms.slug='$input'";
return $wpdb-&#62;get_var($SQL);
}
}

Place above in your function.php file.
And then add below [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2011/02/how-to-display-post-count-from-a-category/">How to display post count from a category</a></p><p>I am just recording my work right now. I found this to work really well.</p>
<p><code></p>
<pre class="brush:php">function wt_get_category_count($input = '') {
global $wpdb;
if($input == '')
{
$category = get_the_category();
return $category[0]-&gt;category_count;
}
elseif(is_numeric($input))
{
$SQL = "SELECT $wpdb-&gt;term_taxonomy.count FROM $wpdb-&gt;terms, $wpdb-&gt;term_taxonomy WHERE $wpdb-&gt;terms.term_id=$wpdb-&gt;term_taxonomy.term_id AND $wpdb-&gt;term_taxonomy.term_id=$input";
return $wpdb-&gt;get_var($SQL);
}
else
{
$SQL = "SELECT $wpdb-&gt;term_taxonomy.count FROM $wpdb-&gt;terms, $wpdb-&gt;term_taxonomy WHERE $wpdb-&gt;terms.term_id=$wpdb-&gt;term_taxonomy.term_id AND $wpdb-&gt;terms.slug='$input'";
return $wpdb-&gt;get_var($SQL);
}
}</pre>
<p></code></p>
<p>Place above in your function.php file.</p>
<p>And then add below inside the regular php begin and end to any location you want the count to be displayed.<br />
<code>echo wt_get_category_count(categoryid);</code></p>
<p>Thanks to WPCode.net</p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2011/02/how-to-display-post-count-from-a-category/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

