Tag Archives: extension

How to get the File Extension from a String in PHP Programming 22 JUL 2013

green php elephants - elephpantsThere are plenty of methods of getting the file extension from a file name in PHP, but if you’re looking for a pretty quick and dirty way of achieving this without any hardcore validation, then it becomes a trivial matter of returning the bit of string after the last occurring . (fullstop) in the full file name string.

And given that PHP provides us with the handy strrchr function that finds the last occurrence of a character in a string, we can quickly whip up a file extension returning function that looks no more complex than this:

function get_file_name_extension($filenamestring) {
	return substr(strrchr($filenamestring,'.'),1);
}

Simple.

Useful Firefox Extensions: MeasureIt CodeUnit 26 NOV 2012

In addition to the big two extensions that almost all developers who work in Firefox have installed (i.e. Firebug and Web Developer), another very useful Firefox extension which I like having tacked on is MeasureIt, a screen ruler measuring system developed by Kevin Freitas.

While technically the awesome Web Developer extension also comes packing a measuring ruler (Miscellaneous -> Show Ruler), I prefer MeasureIt’s simple, focused implementation, whereby you simply click on the ruler icon in the status bar, measure your target area by means of a standard mouse drag selection, view the dimensions of the selected area (in pixels) right next to the highlighted block, and then click on the ruler icon once more to close the whole thing down.

Simple, targeted and very easy to use.

You can manipulate your selection in terms of size and placement, making it an ideal way to get a feel for how much space you have available, or what is the best sized image suited for an area. In short, MeasureIt is really good at… well measuring stuff.

Well worth checking out if you are a web developer who enjoys working in Firefox.

Related Link: https://addons.mozilla.org/en-US/firefox/addon/measureit/

Joomla! Extensions: Phoca Gallery CodeUnit 19 SEP 2011

Phoca Gallery is a fantastic image gallery for the popular Joomla! CMS, created by the Phoca group.

It requires a minimum of Joomla! 1.5.10 and PHP 4.4.1 with GD library to run and comes standard with everything you need from a photo gallery piece of software. It integrates very nicely with Joomla! and is extended by a variety of plugins, components, modules and themes in order to make it even more useful and integrate better into your site.

Featuring the ability to upload multiple images via either its Java or Flash uploader, Phoca Gallery is certainly a great way for sprucing up your site with some more images for your visitors!

Related Link: http://www.phoca.cz/phocagallery

Blog from Your Browser: Scribefire CodeUnit 03 FEB 2011

Enjoy uploading your blog but want to do it a little faster without resorting to the clunky standard web interface? Enter Scribefire, a brilliant browser add-on that makes for quick and simple posting directly to your blog!

From their blurb:

ScribeFire is a full-featured blog editor that integrates with your browser and lets you easily post to all of your blogs.

You can post to blogs from WordPress, Blogger, TypePad, Windows Live Spaces, Tumblr, Posterous, Xanga, LiveJournal, or any other blog that supports the MetaWeblog or MovableType APIs.

You can edit and update existing posts. You can schedule posts for the future (if your blog allows that). You can delete posts. You can save drafts. You can tag and categorize.

ScribeFire Next has an interface so simple that even a caveman could use it. Anything you’re working on is saved if you close the editor and restored when you come back. It really is the easiest way to update your blog.

Nifty.

Related Link: http://www.scribefire.com/

Web Page Image Capture with Pearl Crescent Page Saver CodeUnit 12 SEP 2010

I was working on my portfolio site the other day and needed something that would take full page screenshots of the current website loaded in my browser.

Enter Pearl Crescent Page Saver, an extension (or plugin if you will) for Firefox that comes in both a paid for Pro and a free Basic version.

It allows you to capture images of web pages, including Flash content, that can be saved in either PNG or JPEG format. You can select to capture the entire page, or just the visible portion.

It has another of settings that allows you to fine tune the capture process, including settings for image file name and scale. It run on the latest Firefox (3.5 onwards) and has been tested on Windows XP, Mac OS X and Linux x86.

I myself ran in on my Ubuntu Lucid Lynx installation, and after the usual easy Mozilla extension installation process, I was rewarded with a revised right-click context menu that now included two extra menu options, namely Save Image of Visible Portion and Save Image of Entire Page.

And that is precisely how easy it is to use this fantastic extension!

Screenshot of the Funakoshi Karate International South Africa website

Related Link: http://pearlcrescent.com/products/pagesaver/

Ubuntu Lucid Lynx: Terminal Quick Launch by Right-clicking! CodeUnit 27 JUN 2010

If you want an even quicker way of launching a terminal command line window outside of navigating to the Applications menu, selecting Accessories and then clicking on Terminal, then the excellent little Nautilus extension named nautilus-open-terminal is most definitely for you!
To install, simply run:

sudo aptitude install nautilus-open-terminal

The extension will then download and install itself. Once done, you may need to either restart Nautilus or log out and back in again, but once you’re back, you will notice that right clicking on any folder will bring up a newly extended context menu, with the proud little command “Open in Terminal” blinking back at you from close to the bottom of the menu!

Clicking it will then launch a fresh terminal with the path set to that of the folder you clicked on, making it a snap to open a terminal and immediately work within the folder you wanted to!

Nifty.

Ubuntu Lucid Lynx: Simple Resize of Images by Right-Clicking on It! CodeUnit 26 JUN 2010

Seeing as we are all using Ubuntu/Gnome’s powerful Nautilus file manager, a particularly quick and easy way to resize or rotate images by simply right-clicking on them comes courtesy of the extremely handy little Nautilus-image-converter extension.

Installing this extension and then restarting nautilus (or simply logging out and then back in again), reveals two new right-context menu options available when clicking on an image file’s icon, namely “Rotate Images…” and “Resize Images…”. Selecting either one of these options brings up a dialog which then allows you to simply either rotate the selected images or resize them to the dimensions of your choice – without having to fire up an external application like GIMP for example!

To grab the helpful little extension, simply run the following from your terminal:

sudo aptitude install nautilus-image-converter

Simple as that! :)

AutoComplete Country Selection using jQuery CodeUnit 12 MAR 2010

Marc-Antoine Ross has knocked together a great little jQuery plugin, or extension if you will, which gives you a nice autocomplete country selector textbox (with little flags).

So in order for someone to provide you with their nationality, all they now need to do is start typing in a little form textbox provided and after two letters or so, they can simply select from the available drop down list the country which they wish to list.

The extension uses Jorn Zaefferer’s Autocomplete jQuery plugin, FamFamFam’s flag icon set and Aral Balkan’s ISO country data source in case you were wondering.

Related Link: http://www.devtaxi.com/tools/accountry/

Download a Full Facebook Photo Album in Firefox CodeUnit 11 MAR 2010

Yet another cool little Firefox extension, add-on from LazyRussian, Arthur Sabintsev. FacePAD, Facebook Photo Album Downloader is a brilliant little addition to your Firefox arsenal in that it allows you to download all the photos and images from either a Facebook friend, event or group’s photo album en masse, i.e. all in one fell swoop.

Gone are the days of opening an album, clicking on a photo and downloading each and every image one by one! (Needless to say, you should already be seeing the enormous time saver implications here)

Install FacePAD as you would any normal Firefox add-on/extension and once installed, set the language preference under Options on the Firefox Add-ons page. Now all that is left is to browse to Facebook, find an album you wish to download, right-click and select “Download with FacePAD”.

If your default download path in Firefox is set, you’ll get a javascript prompt to confirm and after clicking yes, all the photos contained in the set will be added to Firefox’s normal download manager and start downloading.

Couldn’t be any simpler! :)

Download Link: https://addons.mozilla.org/en-US/firefox/addon/8442

Related Link: http://lazyrussian.com/my-projects/facepad-facebook-photo-album-downloader-2/