Currently Browsing: hacks

Disallow to load your page in iframe

You may use next code to make problems for somebody, who is loading your page in iFrame:

if((self.parent && !(self.parent===self)) && (self.parent.frames.length != 0)){
self.parent.location=document.location;
}

How to rebuild all thumbnails in VirtueMart at once

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:

  1. Go to Joomla Administrator Panel
  2. Go to VirtueMart Configuration
  3. Check the box: Enable Dynamic Thumbnail Resizing.
  4. Set your: Thumbnail Image Width and Height
  5. Delete images in resized folder.
  6. Run next query in DB:
    update jos_vm_product set product_thumb_image = product_full_image

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!

Ofcourse your server has to have GD+ library installed and working. Most servers have it.

How to add class “last” to last menu item (li) in Joomla 1.5 (mod_mainmenu)

Create new file default.php and place it in /[your_template]/html/mod_mainmenu/, add next content to it: (more…)

Replace standart Joomla MooTools with yours on front-end

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 (more…)

How to set products per page limit in VirtueMart

Ofcourse you may change that setting in Joomla Configuration » List Length. But also it can be done in another custom way. (more…)

Conditional comments for Internet Explorer

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. (more…)

IE Error: cannot open the internet site, operation aborted

It’s error arises then JavaScript trying to add elements in existing DOM-structure. (more…)