<?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>Bonafide Technology</title>
	<atom:link href="http://www.bonafidetech.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bonafidetech.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Sat, 12 May 2012 06:52:25 +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>Auto resize iframe</title>
		<link>http://www.bonafidetech.com/2012/05/auto-resize-iframe/</link>
		<comments>http://www.bonafidetech.com/2012/05/auto-resize-iframe/#comments</comments>
		<pubDate>Tue, 01 May 2012 07:01:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.bonafidetech.com/?p=61</guid>
		<description><![CDATA[Example code for auto resize an iframe: &#60;script src=&#8221;http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js&#8221;&#62;&#60;/script&#62; &#60;script&#62; $(document).ready(function(){ $(&#8216;iframe&#8217;).load(function() { this.style.height = this.contentWindow.document.body.offsetHeight + &#8216;px&#8217;; }); }); &#60;/script&#62;]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bonafidetech.com/wp-content/uploads/noimage.jpg"><img src="http://www.bonafidetech.com/wp-content/uploads/noimage-150x150.jpg" alt="" title="noimage" width="150" height="150" class="alignnone size-thumbnail wp-image-112" /></a></p>
<p>Example code for auto resize an iframe:</p>
<div style="padding: 10px; background: #dddddd none repeat scroll 0% 0%;">&lt;script src=&#8221;http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script&gt;<br />
$(document).ready(function(){<br />
$(&#8216;iframe&#8217;).load(function() {<br />
this.style.height = this.contentWindow.document.body.offsetHeight + &#8216;px&#8217;;<br />
});<br />
});<br />
&lt;/script&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bonafidetech.com/2012/05/auto-resize-iframe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Add to Bookmark&#8221; Script</title>
		<link>http://www.bonafidetech.com/2012/05/add-to-bookmark-script/</link>
		<comments>http://www.bonafidetech.com/2012/05/add-to-bookmark-script/#comments</comments>
		<pubDate>Tue, 01 May 2012 07:01:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.bonafidetech.com/?p=58</guid>
		<description><![CDATA[For add bookmark script on your page, just place following function anywhere on your page: &#60;script type=&#8221;text/javascript&#8221;&#62; function addBookmark(title,url){ /** * Check if its FFX */ if (window.sidebar) window.sidebar.addPanel(title, url, &#8220;&#8221;); else if(window.opera &#38;&#38; window.print){ /** * Think its opera */ var elem = document.createElement(&#8216;a&#8217;); elem.setAttribute(&#8216;href&#8217;,url); elem.setAttribute(&#8216;title&#8217;, title); elem.setAttribute(&#8216;rel&#8217;,'sidebar&#8217;); elem.click(); &#8230;]]></description>
			<content:encoded><![CDATA[<p>For add bookmark script on your page, just place following function anywhere on your page:</p>
<div style="padding:10px; background:#DDDDDD;">
&lt;<em>script type</em>=&#8221;text/javascript&#8221;&gt;<br />
function addBookmark(title,url){<br />
/**<br />
* Check if its FFX<br />
*/<br />
if (window.sidebar)<br />
window.sidebar.addPanel(title, url, &#8220;&#8221;);<br />
else if(window.opera &amp;&amp; window.print){<br />
/**<br />
* Think its opera<br />
*/<br />
var elem = document.createElement(&#8216;a&#8217;);<br />
elem.setAttribute(&#8216;href&#8217;,url);<br />
elem.setAttribute(&#8216;title&#8217;,</p>
<div id=":uc">title);<br />
elem.setAttribute(&#8216;rel&#8217;,'sidebar&#8217;);<br />
elem.click();<br />
}<br />
/**<br />
* Fallback for IE<br />
*/<br />
else if(document.all)<br />
window.external.AddFavorite(url, title);<br />
}</div>
<div>&lt;/script&gt;</div>
</div>
<div>After placing that code, Now use this code where to show &#8220;Add to Bookmark&#8221; link:</div>
<div>&lt;a href=&#8221;javascript:addBookmark(&#8216;Bookmark Title&#8217;, &#8216;Bookmark Url&#8217;)&#8221;&gt;Add To Bookmark&lt;/a&gt;</div>
<div>Thats it..</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bonafidetech.com/2012/05/add-to-bookmark-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use Twentyten theme as custom theme!</title>
		<link>http://www.bonafidetech.com/2012/05/how-to-use-twentyten-theme-as-custom-theme/</link>
		<comments>http://www.bonafidetech.com/2012/05/how-to-use-twentyten-theme-as-custom-theme/#comments</comments>
		<pubDate>Tue, 01 May 2012 07:00:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bonafidetech.com/?p=56</guid>
		<description><![CDATA[Twenty-Ten, a default theme for wordpress, is really a simple and good theme. It mostly happens that you need to make changes in default Twentyten theme LIKE Change the width of the sidebar, change the menu text spacing etc. When that kind of changes are required, what most of developers &#8230;]]></description>
			<content:encoded><![CDATA[<p><strong>Twenty-Ten</strong>, a default theme for wordpress, is really a simple and good theme. It mostly happens that you need to make changes in default Twentyten theme LIKE Change the width of the sidebar, change the menu text spacing etc. When that kind of changes are required, what most of developers do they make all changes in default Twentyten theme. That is not the correct way.<br />
When changes are required, Don’t Use Twentyten Theme. The reason why i am preferring not to use Twentyten theme is <em>&#8220;every time you update WordPress all the default theme files get overwritten erasing all your keenly crafted edits&#8221;.</em></p>
<p><strong>Solution for this is:</strong><br />
1. Make a copy of the Twenty Ten theme :- Making a copy is so simple. Just make one another copy of Twentyten theme and rename this copied theme with the name you want to give. FTP path for themes folder is /wp-content/themes/ .</p>
<p>2. Update style.css :- open the style.css(/wp-content/themes/twentyten/style.css) file in a text editor. At the top of the file you will see the following header:</p>
<div style="padding:0px 20px;">Theme Name: Twenty Ten<br />
Theme URI: http://wordpress.org/<br />
Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable — make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the “Asides” and “Gallery” categories, and has an optional one-column page template that removes the sidebar.<br />
Author: the WordPress team<br />
Version: 1.2<br />
License: GNU General Public License<br />
License URI: license.txt<br />
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu<br />
*/</div>
<p>All you need to change is the theme name FROM:<br />
Theme Name: Twenty Ten<br />
to<br />
Theme Name: &lt;Name you want to give to your theme&gt;</p>
<p>Done. Now when you log into your dashboard and click on “Appearance” you will see your new theme. Just click on activate to use it. Now you can tweak the theme to your hearts content and not have your work erased every time there is a WordPress update.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonafidetech.com/2012/05/how-to-use-twentyten-theme-as-custom-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop textarea elements from being resizable in Mozila 4.0</title>
		<link>http://www.bonafidetech.com/2012/05/stop-textarea-elements-from-being-resizable-in-mozila-4-0/</link>
		<comments>http://www.bonafidetech.com/2012/05/stop-textarea-elements-from-being-resizable-in-mozila-4-0/#comments</comments>
		<pubDate>Tue, 01 May 2012 06:59:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.bonafidetech.com/?p=54</guid>
		<description><![CDATA[In mozila 4.0, i noticed that each textarea becomes resizable. No doubt, its really a nice feature. But some times we need to avoid it. Its very easy to stop resizable feature from textareas. Just place following code in your css file: textarea {resize:none}]]></description>
			<content:encoded><![CDATA[<p>In mozila 4.0, i noticed that each textarea becomes resizable. No doubt, its really a nice feature. But some times we need to avoid it. Its very easy to stop resizable feature from textareas. Just place following code in your css file:</p>
<p>textarea {resize:none}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonafidetech.com/2012/05/stop-textarea-elements-from-being-resizable-in-mozila-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wp_nav_menu First and Last Classes</title>
		<link>http://www.bonafidetech.com/2012/05/wp_nav_menu-first-and-last-classes/</link>
		<comments>http://www.bonafidetech.com/2012/05/wp_nav_menu-first-and-last-classes/#comments</comments>
		<pubDate>Tue, 01 May 2012 06:59:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bonafidetech.com/?p=52</guid>
		<description><![CDATA[wp_nav_menu allows you to show navigation in the front-end. This simple function picks the menu defined in the wp-admin dashboard and displays it as the list. You can define menu separator using “link_before, link_after” or “before, after” params. But the common problem with this function is that sometimes we need &#8230;]]></description>
			<content:encoded><![CDATA[<p><strong style="font-size: 19.5px; line-height: 29.25px;">wp_nav_menu</strong> allows you to show navigation in the front-end. This simple function picks the menu defined in the wp-admin dashboard and displays it as the list. You can define menu separator using “link_before, link_after” or “before, after” params. But the common problem with this function is that sometimes we need to add a class to first or last menu link.</p>
<p>Like in the example below -</p>
<p>Home | PHP | WordPress | CSS <span style="color: #ff0000;"><strong>|</strong></span></p>
<p>Of course you do not want the trailing “<span style="color: #ff0000;"><strong>|</strong><span style="color: #000000;">“. Now let’s see how do we achieve this. Open the functions.php file the same file where you have registered this menu and paste the following function. </span></span></p>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family: monospace;"><span style="color: #000000; font-weight: bold;">function</span> nav_menu_first_last<span style="color: #009900;">(</span> <span style="color: #000088;">$items</span> <span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
 <span style="color: #000088;">$pos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strrpos</span><span style="color: #009900;">(</span><span style="color: #000088;">$items</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'class="menu-item'</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$items</span><span style="color: #339933;">=</span><span style="color: #990000;">substr_replace</span><span style="color: #009900;">(</span><span style="color: #000088;">$items</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'menu-item-last '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">7</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$pos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">(</span><span style="color: #000088;">$items</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'class="menu-item'</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$items</span><span style="color: #339933;">=</span><span style="color: #990000;">substr_replace</span><span style="color: #009900;">(</span><span style="color: #000088;">$items</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'menu-item-first '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">7</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$items</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span>
add_filter<span style="color: #009900;">(</span> <span style="color: #0000ff;">'wp_nav_menu_items'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'nav_menu_first_last'</span> <span style="color: #009900;">)</span><span style="color: #339933;">;</span></pre>
</div>
</div>
<p>&nbsp;</p>
<p>The above function adds a filter to the navigation such that the first navigation gets a class <strong><em>menu-item-first</em></strong> and the last menu item gets the class <strong><em>menu-item-last </em></strong>assigned. Now all you have to do is to include the necessary CSS style to make it invisible. To do so, simply add the following style information into your CSS stylesheet file, usually <strong>styles.css</strong></p>
<div class="wp_syntax">
<div class="code">
<pre class="css" style="font-family: monospace;"><span style="color: #6666ff;">.menu-item-last</span> <span style="color: #00aa00;">{</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00aa00;">:</span> <span style="color: #993333;">none</span><span style="color: #00aa00;">;</span>
<span style="color: #00aa00;">}</span></pre>
</div>
</div>
<p style="font-size: 19.5px; line-height: 29.25px;"><br style="font-size: 19.5px; line-height: 29.25px;" /></p>
<div id="_mcePaste" class="mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 133px; width: 1px; height: 1px;">
<p style="font-size: 19.5px; line-height: 29.25px;">The above function adds a filter to the navigation such that the first navigation gets a class <strong style="font-size: 19.5px; line-height: 29.25px;"><em style="font-size: 19.5px; line-height: 29.25px;">menu-item-first</em></strong> and the last menu item gets the class <strong style="font-size: 19.5px; line-height: 29.25px;"><em style="font-size: 19.5px; line-height: 29.25px;">menu-item-last </em></strong>assigned. Now all you have to do is to include the necessary CSS style to make it invisible. To do so, simply add the following style information into your CSS stylesheet file, usually <strong style="font-size: 19.5px; line-height: 29.25px;">styles.css</strong></p>
<div class="wp_syntax" style="font-size: 19.5px; line-height: 29.25px;">
<div class="code" style="font-size: 19.5px; line-height: 29.25px;">
<pre class="css" style="font-family: monospace;"><span style="color: #6666ff;">.menu-item-last</span> <span style="color: #00aa00;">{</span><br style="font-size: 17.55px; line-height: 26.325px;" /><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00aa00;">:</span> <span style="color: #993333;">none</span><span style="color: #00aa00;">;</span><br style="font-size: 17.55px; line-height: 26.325px;" /><span style="color: #00aa00;">}</span></pre>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bonafidetech.com/2012/05/wp_nav_menu-first-and-last-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Rid of Vertical Scrollbar from FB iframed pages</title>
		<link>http://www.bonafidetech.com/2012/05/getting-rid-of-vertical-scrollbar-from-fb-iframed-pages/</link>
		<comments>http://www.bonafidetech.com/2012/05/getting-rid-of-vertical-scrollbar-from-fb-iframed-pages/#comments</comments>
		<pubDate>Tue, 01 May 2012 06:59:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.bonafidetech.com/?p=50</guid>
		<description><![CDATA[When working with FB iframed pages, Sometime the height of content area, you are going to show on FB pag, can need more than 800 pixels. But default height for Facebook&#8217;s iFramed pages is 800 pixels. This causes a vertical scrollbar on FB page. To get rid of this type &#8230;]]></description>
			<content:encoded><![CDATA[<p>When working with FB iframed pages, Sometime the height of content area, you are going to show on FB pag, can need more than 800 pixels. But default height for Facebook&#8217;s iFramed pages is <strong>800 pixels</strong>. This causes a vertical scrollbar on FB page.</p>
<p><span style="text-decoration: underline;"><strong><em>To get rid of this type of scrollbar:</em></strong></span></p>
<p><strong>-&gt; </strong><strong>Change your &#8220;IFrame Size&#8221; to &#8220;Auto-resize&#8221;</strong><br />
On <a title="http://www.facebook.com/developers/" href="http://www.facebook.com/developers/" target="_blank">your application developer page</a>, in the &#8220;Edit settings&#8221; section of your app, in the &#8220;Facebook Integration&#8221; section, make sure that &#8220;IFrame Size&#8221; is set to &#8220;Auto-resize&#8221;, NOT &#8220;Show scrollbars.&#8221;</p>
<p><a href="http://www.bonafidetech.com/wp-content/uploads/iframe.png"><img src="http://www.bonafidetech.com/wp-content/uploads/iframe.png" alt="" title="iframe" width="487" height="101" class="alignnone size-full wp-image-47" /></a><br />
&nbsp;</p>
<p><strong>-&gt;</strong><strong> Add the JavaScript to your iFramed page</strong><br />
First, <strong>load Facebook&#8217;s Javascript SDK</strong> by adding the following code just before the &lt;/body&gt; tag of your index page:</p>
<p><code>&lt;div id="fb-root"&gt;&lt;/div&gt;<br />
&lt;script src="<a onmousedown="UntrustedLink.bootstrap($(this), &quot;c0738&quot;, event, bagof({}));" rel="nofollow" href="http://connect.facebook.net/en_US/all.js" target="_blank">http://connect.facebook.net/en_US/all.js</a>"&gt;&lt;/script&gt;<br />
&lt;script&gt;<br />
FB.init({<br />
appId  : 'YOUR-APP-ID-HERE',<br />
status : true, // check login status<br />
cookie : true, // enable cookies to allow the server to access the session<br />
xfbml  : true  // parse XFBML<br />
});<br />
&lt;/script&gt;</code></p>
<p><strong>MAKE SURE</strong> you change &#8220;YOUR-APP-ID-HERE&#8221; to your application ID!</p>
<p>&nbsp;</p>
<p><strong>-&gt;</strong><strong> </strong>Once you’ve loaded the Javascript SDK, you can use <strong>FB.Canvas.setSize()</strong> to get rid of those scrollbars. Put the following code before the &lt;/head&gt; tag on your index page:</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
window.fbAsyncInit = function() {<br />
FB.Canvas.setSize();<br />
}<br />
// Do things that will sometimes call sizeChangeCallback()<br />
function sizeChangeCallback() {<br />
FB.Canvas.setSize();<br />
}<br />
&lt;/script&gt;</code></p>
<p>This tells Facebook to resize your iFrame once the page has loaded and again whenever the size of your content changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonafidetech.com/2012/05/getting-rid-of-vertical-scrollbar-from-fb-iframed-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove hashtag from URL when using prettyPhoto!</title>
		<link>http://www.bonafidetech.com/2012/05/remove-hashtag-from-url-when-using-prettyphoto/</link>
		<comments>http://www.bonafidetech.com/2012/05/remove-hashtag-from-url-when-using-prettyphoto/#comments</comments>
		<pubDate>Tue, 01 May 2012 06:58:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Css]]></category>

		<guid isPermaLink="false">http://www.bonafidetech.com/?p=48</guid>
		<description><![CDATA[PrettyPhoto, a jQuery lightbox clone, supports image galleries, Flash content, video (including YouTube and vimeo) and embedding external websites using iframes. No doubt, it is really a very simple and flexible plugin which is compatible with all major browsers including IE6. But if one will see it adds a hashtag &#8230;]]></description>
			<content:encoded><![CDATA[<p>PrettyPhoto, a jQuery lightbox clone, supports image galleries, Flash content, video (including YouTube and vimeo) and embedding external websites using iframes. No doubt, it is really a very simple and flexible plugin which is compatible with all major browsers including IE6.<br />
But if one will see it adds a hashtag like &#8216;!prettyPhoto&#8217; in url when clicking on an image with prettyPhoto rel attribute. Sometimes we don&#8217;t want to add this hashtag in url. How to stop prettyPhoto for add this hashtag in url. Its very easy. Just follow these two steps:</p>
<p>1. Find in &#8220;jquery.prettyPhoto.js&#8221; :<br />
   function setHashtag(){<br />
     if(typeof theRel == &#8216;undefined&#8217;) return; // theRel is set on normal calls, it&#8217;s impossible to deeplink using the API<br />
     location.hash = &#8216;!&#8217; + theRel + &#8216;/&#8217;+rel_index+&#8217;/'; //JST Code<br />
   };</p>
<p>   And replace it with:<br />
   function setHashtag(){<br />
     if(typeof theRel == &#8216;undefined&#8217;) return; // theRel is set on normal calls, it&#8217;s impossible to deeplink using the API<br />
     //location.hash = &#8216;!&#8217; + theRel + &#8216;/&#8217;+rel_index+&#8217;/'; //JST Code<br />
   };</p>
<p>2. Find<br />
   function clearHashtag(){<br />
     // Clear the hashtag only if it was set by prettyPhoto<br />
     url = location.href;<br />
     hashtag = (url.indexOf(&#8216;#!prettyPhoto&#8217;)) ? true : false;<br />
     if(hashtag) location.hash = &#8220;!prettyPhoto&#8221;; //JST Code<br />
   }</p>
<p>   And replace it with:<br />
   function clearHashtag(){<br />
     // Clear the hashtag only if it was set by prettyPhoto<br />
     url = location.href;<br />
     hashtag = (url.indexOf(&#8216;#!prettyPhoto&#8217;)) ? true : false;<br />
     //if(hashtag) location.hash = &#8220;!prettyPhoto&#8221;; //JST Code<br />
   }</p>
<p>and thats all.. <a href=http://atlantic-drugs.net/products/viagra.htm>viagra</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonafidetech.com/2012/05/remove-hashtag-from-url-when-using-prettyphoto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove Parent Categories from URL</title>
		<link>http://www.bonafidetech.com/2012/05/remove-parent-categories-from-url/</link>
		<comments>http://www.bonafidetech.com/2012/05/remove-parent-categories-from-url/#comments</comments>
		<pubDate>Tue, 01 May 2012 06:57:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bonafidetech.com/?p=46</guid>
		<description><![CDATA[How to remove the parent category from the url with WordPress 3.1? One way is, Just paste the below one code in your functions.php : add_action( &#8216;init&#8217;, &#8216;build_taxonomies&#8217;, 0 ); function build_taxonomies() { register_taxonomy( &#8216;category&#8217;, &#8216;post&#8217;, array( &#8216;hierarchical&#8217; => true, &#8216;update_count_callback&#8217; => &#8216;_update_post_term_count&#8217;, &#8216;query_var&#8217; => &#8216;category_name&#8217;, &#8216;rewrite&#8217; => did_action( &#8216;init&#8217; &#8230;]]></description>
			<content:encoded><![CDATA[<p>How to remove the parent category from the url with WordPress 3.1? </p>
<p>One way is, Just paste the below one code in your functions.php :</p>
<p>add_action( &#8216;init&#8217;, &#8216;build_taxonomies&#8217;, 0 );<br />
function build_taxonomies() {</p>
<p>  register_taxonomy( &#8216;category&#8217;, &#8216;post&#8217;, array(<br />
		&#8216;hierarchical&#8217; => true,<br />
	 	&#8216;update_count_callback&#8217; => &#8216;_update_post_term_count&#8217;,<br />
		&#8216;query_var&#8217; => &#8216;category_name&#8217;,<br />
		&#8216;rewrite&#8217; => did_action( &#8216;init&#8217; ) ? array(<br />
					&#8216;hierarchical&#8217; => false,<br />
					&#8216;slug&#8217; => get_option(&#8216;category_base&#8217;) ? get_option(&#8216;category_base&#8217;) : &#8216;category&#8217;,<br />
					&#8216;with_front&#8217; => false) : false,<br />
		&#8216;public&#8217; => true,<br />
		&#8216;show_ui&#8217; => true,<br />
		&#8216;_builtin&#8217; => true,<br />
	) );</p>
<p>}</p>
<p>This will rediect </p>
<p>http://www.mysite.com/category/parent-1/parent-2/child/</p>
<p>to</p>
<p>http://www.mysite.com/category/child/</p>
<p>But if one wants to remove &#8220;category&#8221; base as well from url, then there is a plugin named &#8220;<a href="http://wordpress.org/extend/plugins/no-category-parents/">No Category Parents</a>&#8221; which hadn’t got any coverage on the web yet. This plugin will completely remove “Category Base” from your WordPress permalinks.  It automatically redirects and rewrites all urls to the new url. It changes your “/category/name/” to  ”/name/”.</p>
<p>Thats it. <img src='http://www.bonafidetech.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonafidetech.com/2012/05/remove-parent-categories-from-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Track the user who deauthorizes your FB app</title>
		<link>http://www.bonafidetech.com/2012/05/track-the-user-who-deauthorizes-your-fb-app/</link>
		<comments>http://www.bonafidetech.com/2012/05/track-the-user-who-deauthorizes-your-fb-app/#comments</comments>
		<pubDate>Tue, 01 May 2012 06:56:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FB Api]]></category>

		<guid isPermaLink="false">http://www.bonafidetech.com/?p=44</guid>
		<description><![CDATA[Sometimes we may need to track which users of our facebook application are removing the application from their application setting. For this: - Go to your current app setting page. One way to list your all apps is visit https://www.facebook.com/developers/apps.php - Now in the application setting in the advanced tab, &#8230;]]></description>
			<content:encoded><![CDATA[<p><strong>Sometimes we may need to track which users of our facebook application are removing the application from their application setting. For this:</strong><br />
- Go to your current app setting page. One way to list your all apps is visit https://www.facebook.com/developers/apps.php<br />
- Now in the application setting in the <strong>advanced</strong> tab, you’ll see a parameter named <strong>Deauthorize Callback</strong> in the authentication area. (Settings=&gt;Advanced=&gt;Deauthorize Callback). Here set the url which you want to call when a user removes your app.<br />
- Like you set the url: www.yourdomain.com/remove_app.php , means you are going to track the user id on remove_app.php. So write following code in your rempve_app.php file:</p>
<div style="padding: 10px; background: #f0f0f0;">&lt;?phpfunction parse_signed_request($signed_request, $secret) {<br />
list($encoded_sig, $payload) = explode(&#8216;.&#8217;, $signed_request, 2);</p>
<p>// decode the data<br />
$sig = base64_url_decode($encoded_sig);<br />
$data = json_decode(base64_url_decode($payload), true);</p>
<p>if (strtoupper($data['algorithm']) !== &#8216;HMAC-SHA256&#8242;) {<br />
error_log(&#8216;Unknown algorithm. Expected HMAC-SHA256&#8242;);<br />
return null;<br />
}</p>
<p>// check sig<br />
$expected_sig = hash_hmac(&#8216;sha256&#8242;, $payload, $secret, $raw = true);<br />
if ($sig !== $expected_sig) {<br />
error_log(&#8216;Bad Signed JSON signature!&#8217;);<br />
return null;<br />
}</p>
<p>return $data;<br />
}</p>
<p>function base64_url_decode($input) {<br />
return base64_decode(strtr($input, &#8216;-_&#8217;, &#8216;+/&#8217;));<br />
}</p>
<p>function write_to_file($user_fb_id) {<br />
$myFile = &#8220;deauthorize.txt&#8221;;<br />
$fh = fopen($myFile, &#8216;w&#8217;);<br />
fwrite($fh, $user_fb_id);<br />
fclose($fh);<br />
}</p>
<p>$result = parse_signed_request($_REQUEST['signed_request'], APP_SECRET_ID);<br />
$user_fb_id = $result["user_id"];<br />
write_to_file($user_fb_id);<br />
?&gt;</p>
</div>
<p>This whole process will happen in backend and you can’t see it on front end. So what i am doing is i am calling a function named “write_to_file()” with a perameter “$user_fb_id” which is the actual id of user. This function will put the user id in your defined file named “deauthorize.txt”. For call the above function, just made two changes before run it:<br />
- place a file on server with name: “deauthorize.txt”<br />
- CHANGE APP_SECRET_ID with your app’s secret ID.</p>
<p>Thats it..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonafidetech.com/2012/05/track-the-user-who-deauthorizes-your-fb-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto Login to wordpress</title>
		<link>http://www.bonafidetech.com/2012/05/auto-login-to-wordpress/</link>
		<comments>http://www.bonafidetech.com/2012/05/auto-login-to-wordpress/#comments</comments>
		<pubDate>Tue, 01 May 2012 06:55:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bonafidetech.com/?p=42</guid>
		<description><![CDATA[Sometimes, in wordpress, what we need is to make a user auto log in. Solution for this is very simple. Just put the following code in your functions.php :- function auto_log_me_in($user_login) { $user = get_userdatabylogin($user_login); $user_id = $user->ID; wp_set_current_user($user_id, $user_login); wp_set_auth_cookie($user_id); do_action(&#8216;wp_login&#8217;, $user_login); } Now call auto_log_me_in($user_login); where you want &#8230;]]></description>
			<content:encoded><![CDATA[<p>Sometimes, in wordpress, what we need is to make a user auto log in. Solution for this is very simple. Just put the following code in your functions.php :-</p>
<div style="padding:10px; background: #f0f0f0;;">
function auto_log_me_in($user_login) {<br />
	$user = get_userdatabylogin($user_login);<br />
	$user_id = $user->ID;<br />
	wp_set_current_user($user_id, $user_login);<br />
	wp_set_auth_cookie($user_id);<br />
	do_action(&#8216;wp_login&#8217;, $user_login);<br />
}
</div>
<p>Now call<br />
auto_log_me_in($user_login);<br />
where you want to make a user auto log in. Here &#8220;$user_login&#8221; is the user name to whom one want to make log in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonafidetech.com/2012/05/auto-login-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

