Add to favorites / bookmarks


Guys here is a very simple javascript to add a link of bookmark this page(for mozilla) or add to favorite (for IE)

<script language=”JavaScript1.2″ type=”text/javascript”>
function createBookmark() {

var title = document.title;
var url = window.location.href;

if (window.sidebar) { // Mozilla Firefox Bookmark
window.sidebar.addPanel(title, url,””);
} else if( window.external ) { // IE Favorite
window.external.AddFavorite( url, title); }
else if(window.opera && window.print) { // Opera Hotlist
return true; }
}

if (window.external) {
document.write(‘<a href = “javascript:createBookmark()”);”>Add to Favorites</a>’);
} elseĀ  if (window.sidebar) {
document.write(‘<a href = “javascript:createBookmark()”);”>Bookmark Page</a>’);
} else if (window.opera && window.print) {
document.write(‘<a href =”javascript:createBookmark()”);”>Add Bookmark</a>’);
}
</script>

php zip library


Guys,

A few days back I was on a project where, I got some innovative job (for me atleast).

i.e. There was a list of files displayed on a page, and that list is simply displayed by reading the content of a directory and it’s sub directory. Each list item were having a checkbox. Now the challenge for me was to create a zip archive of the selected list items, as same as you have seen for gmail attachments. I searched a lot and finally got a great library for this, yes that is pclzip.

Using pclzip

You can compress and extract zip formatted archives.

PclZip gives you the ability to manipulate zip formatted arhives. You can create an archive, list the content and extract all its content in the file system.

PclZip defines an object class which represent a Zip Archive. This class manages the archive properties and offers access method and actions on the archive.

Trust me its very simple to use and very vast library with a lot of functions. Even most popular CMS like joomla, drupal, nucleus, moodle, wordpress etc. uses the same PCLZIP.

cheers.

VB Form without title bar


Some times you need an application, in which you do not want to add the default windows the blue title bar with min, restore and close buttons, Here is the simplest formula just do set these properties for forms

  • Caption = “”
  • ControlBox = False
  • MinButton = False
  • MaxButton = False

That’s it! enjoy

window.open()


A few days back, I was trying to open a popup window with javascript:window.open() method

And for that my syntex was something like

window.open(‘url to open’,’window name’,’attribute1,attribute2′);

That was working with firefox, but in IE the popup was not be able to open. I tried a lot by googling, by changing the syntex but all in vain.

Than I found somewhere there was a very small mistake in my syntex you would not believe.

the window name I provided was ‘window name’

but its should be without any spaces something like this “window_name

otherwise it will not work in IE.

cheers!