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;
}

Full URL, current URL and base URL variables in Joomla 1.5, 1.6 and 1.7

Base URL:

JURI::base();

Current URL:

JURI::current();

Full URL:

JRequest::getURI();

How to add class “last” to last menu item (li) in Joomla 1.7 (mod_menu)

There is an option to add for last <a> tag, but it is not enough for me, as I need also for last <li> tag.
First you should copy file default.php from /modules/mod_menu/ to /templates/your_template_name/html/mod_menu. Next, you should edit this file. (more…)

Empty list of language switcher module in Joomla 1.7

Process of enabling of multi-lingual in Joomla is not too obvious. Main thing, which usually cause empty list of language, so multi-lingual not work at all.

You have not to forget to enable “System – Language Filter” in Joomla Extentions -> Plug-in Manages. Also you should create menu and make “Default” pages for each language. (more…)

MooTools actions on browser window resize

When you need make some action using MooTools on window resize you should use a timer:

window.addEvent('resize', function(){
    $clear(timer);
    var timer = (function(){
        // your actions goes here
    }).delay(50);
});

You may play with timer delay.

Internet Explorer conditional comments

<!--[if IE]>
According to the conditional comment this is IE<br />
<![endif]-->
<!--[if IE 6]>
According to the conditional comment this is IE 6<br />
<![endif]-->
<!--[if IE 7]>
According to the conditional comment this is IE 7<br />
<![endif]-->
<!--[if IE 8]>
According to the conditional comment this is IE 8<br />
<![endif]-->
<!--[if IE 9]>
According to the conditional comment this is IE 9<br />
<![endif]-->
<!--[if gte IE 8]>
According to the conditional comment this is IE 8 or higher<br />
<![endif]-->
<!--[if lt IE 9]>
According to the conditional comment this is IE lower than 9<br />
<![endif]-->
<!--[if lte IE 7]>
According to the conditional comment this is IE lower or equal to 7<br />
<![endif]-->
<!--[if gt IE 6]>
According to the conditional comment this is IE greater than 6<br />
<![endif]-->
<!--[if !IE]> -->
According to the conditional comment this is not IE<br />
<!-- <![endif]-->

lt – less than
gt – greater than
lte – less than or equal to
gte – greater than or equal to

Remove index.php From URLs in ExpressionEngine

First we need to create .htaccess file in ExpressionEngine root directory with next lines:

Options +FollowSymLinks
RewriteEngine on

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

Next in ExpressionEngine administration panel in Admin > General Configuration set Name of your site’s index page empty.

Using ExpressionEngine Image Manipulation in Templates

Since version 2.2, ExpressionEngine has integrated some image manipulation into its file management module. This includes resizing images and creating thumbnails with support for the three major image manipulation protocols: GD, NetPBM, and ImageMagick. This means that when adding images to your site you can set multiple sizes and aspect ratios for creating thumbnails. You also have the option of creating watermarks on the images. (more…)

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 Make A Custom Twitter Feed For Your Website

Inserting JavaScript

To get your Twitter feed to pull from your latest tweet from your Twitter account, you are going to need to insert some JavaScript into the page your feed will rest in.  There are several areas where you can place this code but I, and many others, have found that the best place is to place it at the very end of your code, right before the end </body> tag.

<script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script>
<script src="http://twitter.com/statuses/user_timeline/REPLACE.json?callback=twitterCallback2&count=1" type="text/javascript"></script>

In the code above, swap the word “REPLACE” with your account name. An example would be if your account name was “twitter.com/ChrisKirkman,” you would just place “ChrisKirkman” in there instead of the word “REPLACE.” If you do decide to display multiple tweets, instead of the one that I suggested, then all you will have to do is change where it says “count=1” to whatever number of tweets you would like to display.  Where it links to “blogger.js,” you can have your own file on your server that you link to that has the same information with some minor tweaks, if you like.

Inserting the HTML into your page

<div id="twitter_t"></div>
<div id="twitter_m">
<div id="twitter_container">
<ul id="twitter_update_list"></ul>
</div>
</div>
<div id="twitter_b"></div>

The code above references the CSS that was styled earlier on.  Based off of your layout, all of that code could be thrown into another container (or table) to allow it to work best with the rest of your layout design.

 

 

Page 1 of 3123