<?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>Fragov Blog &#187; hacks</title>
	<atom:link href="http://fragov.com/blog/category/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://fragov.com/blog</link>
	<description>About my life, programming, freelancing</description>
	<lastBuildDate>Wed, 14 Dec 2011 20:36:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Disallow to load your page in iframe</title>
		<link>http://fragov.com/blog/2011/12/14/disallow-to-load-your-page-in-iframe/</link>
		<comments>http://fragov.com/blog/2011/12/14/disallow-to-load-your-page-in-iframe/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 20:35:38 +0000</pubDate>
		<dc:creator>fragov</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://fragov.com/blog/?p=128</guid>
		<description><![CDATA[You may use next code to make problems for somebody, who is loading your page in iFrame: if((self.parent &#38;&#38; !(self.parent===self)) &#38;&#38; (self.parent.frames.length != 0)){ self.parent.location=document.location; }]]></description>
			<content:encoded><![CDATA[<p>You may use next code to make problems for somebody, who is loading your page in iFrame:</p>
<pre name="code" class="javascript">if((self.parent &amp;&amp; !(self.parent===self)) &amp;&amp; (self.parent.frames.length != 0)){
self.parent.location=document.location;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://fragov.com/blog/2011/12/14/disallow-to-load-your-page-in-iframe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to rebuild all thumbnails in VirtueMart at once</title>
		<link>http://fragov.com/blog/2011/10/14/how-to-rebuild-all-thumbnails-in-virtuemart-at-once/</link>
		<comments>http://fragov.com/blog/2011/10/14/how-to-rebuild-all-thumbnails-in-virtuemart-at-once/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 15:27:46 +0000</pubDate>
		<dc:creator>fragov</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[VirtueMart]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[rebuild]]></category>
		<category><![CDATA[thumbnails]]></category>
		<category><![CDATA[virtuemart]]></category>

		<guid isPermaLink="false">http://fragov.com/blog/?p=87</guid>
		<description><![CDATA[As you possibly already know, it is not enough to set Dynamic Thumbnail Resizing in VirtueMart Admin Panel to ON. You also have to make several steps, to redo all thumbnails for your VirtueMart products: Go to Joomla Administrator Panel Go to VirtueMart Configuration Check the box: Enable Dynamic Thumbnail Resizing. Set your: Thumbnail Image [...]]]></description>
			<content:encoded><![CDATA[<p>As you possibly already know, it is not enough to set Dynamic Thumbnail Resizing in VirtueMart Admin Panel to ON. You also have to make several steps, to redo all thumbnails for your VirtueMart products:</p>
<ol>
<li>Go to Joomla Administrator Panel</li>
<li>Go to VirtueMart Configuration</li>
<li>Check the box: Enable Dynamic Thumbnail Resizing.</li>
<li>Set your: Thumbnail Image Width and Height</li>
<li>Delete images in resized folder.</li>
<li>Run next query in DB:
<pre class="sql" name="code">update jos_vm_product set product_thumb_image = product_full_image</pre>
</li>
</ol>
<p>Worked like a charm with gd library working (Dynamic Thumbnail Resizing). When setting the thumb image to full image, this will clear out all the old thumbs originally created when adding a new product. Clearing out the resized folder will delete all GD (dynamically) created thumbs. Now when gd goes to make new thumbs in resized, it will us the thumbnail set in product_thumb_image, which via sql you have set to be the full image. So it will create nice, clear, resized images!</p>
<p>Ofcourse your server has to have GD+ library installed and working. Most servers have it.</p>
]]></content:encoded>
			<wfw:commentRss>http://fragov.com/blog/2011/10/14/how-to-rebuild-all-thumbnails-in-virtuemart-at-once/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to add class &#8220;last&#8221; to last menu item (li) in Joomla 1.5 (mod_mainmenu)</title>
		<link>http://fragov.com/blog/2010/03/14/how-to-add-class-last-to-last-menu-item-li-in-joomla-1-5-mod_mainmenu/</link>
		<comments>http://fragov.com/blog/2010/03/14/how-to-add-class-last-to-last-menu-item-li-in-joomla-1-5-mod_mainmenu/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 18:15:24 +0000</pubDate>
		<dc:creator>fragov</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[fixes]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://fragov.com/blog/?p=71</guid>
		<description><![CDATA[Create new file default.php and place it in /[your_template]/html/mod_mainmenu/, add next content to it: &#60;?php // no direct access defined('_JEXEC') or die('Restricted access'); if ( ! defined('modMainMenuXMLCallbackDefined') ) { //class to add class "last" to last li function addLastClass($result) { $result = preg_replace("/(.*)&#60;\/li&#62;&#60;li class=\"item(\d*)\"&#62;(.*)&#60;\/li&#62;&#60;\/ul&#62;(.*).*/is", '$1&#60;/li&#62;&#60;li&#62;$3&#60;/li&#62;&#60;/ul&#62;$4', $result); return $result; } function modMainMenuXMLCallback(&#38;$node, $args) { $user    = [...]]]></description>
			<content:encoded><![CDATA[<p>Create new file default.php and place it in /[your_template]/html/mod_mainmenu/, add next content to it:<span id="more-71"></span></p>
<pre class="php" name="code">
&lt;?php

// no direct access
defined('_JEXEC') or die('Restricted access');

if ( ! defined('modMainMenuXMLCallbackDefined') )
{

//class to add class "last" to last li
function addLastClass($result) {
$result = preg_replace("/(.*)&lt;\/li&gt;&lt;li class=\"item(\d*)\"&gt;(.*)&lt;\/li&gt;&lt;\/ul&gt;(.*).*/is", '$1&lt;/li&gt;&lt;li&gt;$3&lt;/li&gt;&lt;/ul&gt;$4', $result);

return $result;
}

function modMainMenuXMLCallback(&amp;$node, $args)
{
$user    = &amp;JFactory::getUser();
$menu    = &amp;JSite::getMenu();
$active    = $menu-&gt;getActive();
$path    = isset($active) ? array_reverse($active-&gt;tree) : null;

if (($args['end']) &amp;&amp; ($node-&gt;attributes('level') &gt;= $args['end']))
{
$children = $node-&gt;children();
foreach ($node-&gt;children() as $child)
{
if ($child-&gt;name() == 'ul') {
$node-&gt;removeChild($child);
}
}
}

if ($node-&gt;name() == 'ul') {
foreach ($node-&gt;children() as $child)
{
if ($child-&gt;attributes('access') &gt; $user-&gt;get('aid', 0)) {
$node-&gt;removeChild($child);
}
}
}

if (($node-&gt;name() == 'li') &amp;&amp; isset($node-&gt;ul)) {
$node-&gt;addAttribute('class', 'parent');
}

if (isset($path) &amp;&amp; (in_array($node-&gt;attributes('id'), $path) || in_array($node-&gt;attributes('rel'), $path)))
{
if ($node-&gt;attributes('class')) {
$node-&gt;addAttribute('class', $node-&gt;attributes('class').' active');
} else {
$node-&gt;addAttribute('class', 'active');
}
}
else
{
if (isset($args['children']) &amp;&amp; !$args['children'])
{
$children = $node-&gt;children();
foreach ($node-&gt;children() as $child)
{
if ($child-&gt;name() == 'ul') {
$node-&gt;removeChild($child);
}
}
}
}

if (($node-&gt;name() == 'li') &amp;&amp; ($id = $node-&gt;attributes('id'))) {
if ($node-&gt;attributes('class')) {
$node-&gt;addAttribute('class', $node-&gt;attributes('class').' item'.$id);
} else {
$node-&gt;addAttribute('class', 'item'.$id);
}
}

if (isset($path) &amp;&amp; $node-&gt;attributes('id') == $path[0]) {
$node-&gt;addAttribute('id', 'current');
} else {
$node-&gt;removeAttribute('id');
}
$node-&gt;removeAttribute('rel');
$node-&gt;removeAttribute('level');
$node-&gt;removeAttribute('access');
}
define('modMainMenuXMLCallbackDefined', true);
}
//get menu code
ob_start();

modMainMenuHelper::render($params, 'modMainMenuXMLCallback');

//add class "last" to last li
$menu_html = ob_get_contents();
ob_end_clean();

echo addLastClass($menu_html);</pre>
]]></content:encoded>
			<wfw:commentRss>http://fragov.com/blog/2010/03/14/how-to-add-class-last-to-last-menu-item-li-in-joomla-1-5-mod_mainmenu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Replace standart Joomla MooTools with yours on front-end</title>
		<link>http://fragov.com/blog/2009/10/21/replace-standart-joomla-mootools-with-yours-on-front-end/</link>
		<comments>http://fragov.com/blog/2009/10/21/replace-standart-joomla-mootools-with-yours-on-front-end/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 14:34:30 +0000</pubDate>
		<dc:creator>fragov</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://fragov.com/blog/?p=64</guid>
		<description><![CDATA[To keep upwards compatibility for your Joomla Core the following example shows a solution, by clearing the Header Buffer from the scripts Joomla is adding by itself. This is a template based modification, which does work with extensions loading their own Scripts or Stylesheets into the Header Buffer. And by that also transparent and not [...]]]></description>
			<content:encoded><![CDATA[<p>To keep upwards compatibility for your Joomla Core the following example shows a solution, by clearing the Header Buffer from the scripts Joomla is adding by itself. This is a template based modification, which does work with extensions loading their own Scripts or Stylesheets into the Header Buffer. And by that also transparent and not affected by any version upgrade to your Joomla Core<span id="more-64"></span>:</p>
<pre class="php" name="code">
&lt;!-- Load MooTools by the template, and at the top before any other scripts --&gt;
&lt;?php
/* --- This removes any Joomla default Scripts from the Header Buffer --- */
$header = $this-&gt;getHeadData();                   // Get the current HEAD buffer
$header['scripts'] = array();                     // Clear all current 'scripts' entries
$this-&gt;setHeadData($header);                      // Update the HEAD buffer
/* --- We add the MooTools Framework manually, see below --- */
?&gt;

&lt;head&gt;
&lt;!-- Load MooTools at first --&gt;
&lt;script type="text/javascript" src="templates/&lt;?php echo $this-&gt;template ?&gt;/js/mootools/mootools-1.2.1-core.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="templates/&lt;?php echo $this-&gt;template ?&gt;/js/mootools/mootools-1.2-more.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="templates/&lt;?php echo $this-&gt;template ?&gt;/js/mootools/mootools-1.2-compat.js"&gt;&lt;/script&gt;

&lt;!-- Now all other scripts from extensions --&gt;
&lt;jdoc:include type="head" /&gt;

&lt;/head&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://fragov.com/blog/2009/10/21/replace-standart-joomla-mootools-with-yours-on-front-end/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to set products per page limit in VirtueMart</title>
		<link>http://fragov.com/blog/2009/07/17/how-to-set-products-per-page-limit-in-virtuemart/</link>
		<comments>http://fragov.com/blog/2009/07/17/how-to-set-products-per-page-limit-in-virtuemart/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 20:55:16 +0000</pubDate>
		<dc:creator>fragov</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[virtuemart]]></category>

		<guid isPermaLink="false">http://fragov.com/blog/?p=58</guid>
		<description><![CDATA[Ofcourse you may change that setting in Joomla Configuration » List Length. But also it can be done in another custom way. To change products per page limit in VirtueMart you should open for edit file: components/com_virtuemart/virtuemart.php Edit: $limit = intval( $mainframe-&#62;getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); And change $mosConfig_list_limit to any number of products [...]]]></description>
			<content:encoded><![CDATA[<p>Ofcourse you may change that setting in Joomla Configuration » List Length. But also it can be done in another custom way.<span id="more-58"></span><br />
To change products per page limit in VirtueMart you should open for edit file: components/com_virtuemart/virtuemart.php<br />
Edit:</p>
<pre class="php" name="code">$limit = intval( $mainframe-&gt;getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) );</pre>
<p>And change $mosConfig_list_limit to any number of products per page.</p>
]]></content:encoded>
			<wfw:commentRss>http://fragov.com/blog/2009/07/17/how-to-set-products-per-page-limit-in-virtuemart/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Conditional comments for Internet Explorer</title>
		<link>http://fragov.com/blog/2009/07/17/conditional-comments-for-internet-explorer/</link>
		<comments>http://fragov.com/blog/2009/07/17/conditional-comments-for-internet-explorer/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 01:25:29 +0000</pubDate>
		<dc:creator>fragov</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[fixes]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://fragov.com/blog/?p=55</guid>
		<description><![CDATA[Conditional comments only work in Explorer on Windows, and are thus excellently suited to give special instructions meant only for Explorer on Windows. They are supported from Explorer 5 onwards, and it is even possible to distinguish between 5.0, 5.5 and 6.0. &#60;!--[if IE]&#62; According to the conditional comment this is Internet Explorer&#60;br /&#62; &#60;![endif]--&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Conditional comments only work in Explorer on Windows, and are thus excellently suited to give special instructions meant only for Explorer on Windows. They are supported from Explorer 5 onwards, and it is even possible to distinguish between 5.0, 5.5 and 6.0.<span id="more-55"></span></p>
<pre class="html" name="code">&lt;!--[if IE]&gt;
According to the conditional comment this is Internet Explorer&lt;br /&gt;
&lt;![endif]--&gt;
&lt;!--[if IE 5]&gt;
According to the conditional comment this is Internet Explorer 5&lt;br /&gt;
&lt;![endif]--&gt;
&lt;!--[if IE 5.0]&gt;
According to the conditional comment this is Internet Explorer 5.0&lt;br /&gt;
&lt;![endif]--&gt;
&lt;!--[if IE 5.5]&gt;
According to the conditional comment this is Internet Explorer 5.5&lt;br /&gt;
&lt;![endif]--&gt;
&lt;!--[if IE 6]&gt;
According to the conditional comment this is Internet Explorer 6&lt;br /&gt;
&lt;![endif]--&gt;
&lt;!--[if IE 7]&gt;
According to the conditional comment this is Internet Explorer 7&lt;br /&gt;
&lt;![endif]--&gt;
&lt;!--[if gte IE 5]&gt;
According to the conditional comment this is Internet Explorer 5 and up&lt;br /&gt;
&lt;![endif]--&gt;
&lt;!--[if lt IE 6]&gt;
According to the conditional comment this is Internet Explorer lower than 6&lt;br /&gt;
&lt;![endif]--&gt;
&lt;!--[if lte IE 5.5]&gt;
According to the conditional comment this is Internet Explorer lower or equal to 5.5&lt;br /&gt;
&lt;![endif]--&gt;
&lt;!--[if gt IE 6]&gt;
According to the conditional comment this is Internet Explorer greater than 6&lt;br /&gt;
&lt;![endif]--&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://fragov.com/blog/2009/07/17/conditional-comments-for-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE Error: cannot open the internet site, operation aborted</title>
		<link>http://fragov.com/blog/2009/06/24/ie-error-cannot-open-the-internet-site-operation-aborted/</link>
		<comments>http://fragov.com/blog/2009/06/24/ie-error-cannot-open-the-internet-site-operation-aborted/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 04:08:17 +0000</pubDate>
		<dc:creator>fragov</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://fragov.com/blog/?p=50</guid>
		<description><![CDATA[It&#8217;s error arises then JavaScript trying to add elements in existing DOM-structure. Check this example: &#60;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"&#62; &#60;html&#62; &#60;head&#62; &#60;title&#62;Internet Explorer: Operation Aborted. Sample error.&#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#60;table&#62; &#60;script&#62; document.body.appendChild(document.createElement('div')) &#60;/script&#62; &#60;/table&#62; &#60;/body&#62; &#60;/html&#62; There are two ways to avoid this: Run script in windows.onload function: &#60;!DOCTYPE html PUBLIC "-//W3C//DTD HTML [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s error arises then JavaScript trying to add elements in existing DOM-structure.<span id="more-50"></span><br />
Check this example:</p>
<pre name="code" class="html">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Internet Explorer: Operation Aborted. Sample error.&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table&gt;
&lt;script&gt;
document.body.appendChild(document.createElement('div'))
&lt;/script&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>There are two ways to avoid this:</p>
<ol>
<li>Run script in windows.onload function:
<pre class="html" name="code">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;
 &lt;html&gt;
 &lt;head&gt;
   &lt;title&gt;Internet Explorer: Operation Aborted. Sample solution.&lt;/title&gt;
   &lt;/head&gt;    &lt;body&gt;
   &lt;ul&gt;
      &lt;script&gt;
       window.onload = function(){
        document.body.appendChild(document.createElement('div'))
      }
  &lt;/script&gt;
  &lt;/ul&gt;
 &lt;/body&gt;
 &lt;/html&gt;</pre>
</li>
<li>Or add to javascript tag parameter defer=&#8221;defer&#8221;:
<pre name="code" class="html">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;
&lt;html&gt;
 &lt;head&gt;
  &lt;title&gt;Internet Explorer: Operation Aborted. Sample error.&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;
  &lt;table&gt;
    &lt;script defer="defer"&gt;
     document.body.appendChild(document.createElement('div'))
      &lt;/script&gt;
    &lt;/table&gt;
  &lt;/body&gt;
 &lt;/html&gt;</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://fragov.com/blog/2009/06/24/ie-error-cannot-open-the-internet-site-operation-aborted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
