I had written this code a few years ago for use on a website although not the icon sprite I’m including… I needed to use it recently so I’ve decided to upload it here too..
I know it’s not the most elegant solution, but it works well over all browsers and fallbacks (no CSS) gracefully as a list, finally if there isn’t an actual icon available for your social networking site, then it will default to the ‘share this’ icon.
While using ldir within a different project, I found a couple of bugs releated to how it retrieves its own URL/URI so I figured out a better way of retrieving this information and updated ldir available to everyone else.
I have decided to deprecate the $GET parameter when using the function as it should now detect $_GET variables automatically and utilise them although this maybe still be a little buggy but the ultimate aim is for it to figure out the $_GET variables itself.
In the time it took me to write a post for version 1.8.0 I improved some of the $_GET parameter code so I incemented the version number to 1.8.1 and you can grab the latest version of ldir on its page as always
I’ve stared using the very powerful yet minimalistic text editor Sublime Text 2, one of the great features is the ability to customise it to your personal needs.
Some of the code I write I license under the GPL v3 but because the code is only a small function, I don’t want to include the full GPL in the source so I use the minimal header. To ease my life and make it quicker to include this minimal header in my code I have written a small snippet for Sublime to insert the minimal GPL.
and press tab to comete the code. This will then move the cursor to the program and description part where you pop the name and a brief description. You’ll probably want to change the copyright name to your own in the snippet.
To install the snippet just download it, open Sublime click Preferences > Browse Packages and put it in the user folder in there, then restart Sublime.
Sublime SMARTY Support
It took me a while to find the forum post so I’m reposting the info here, sublime actually supports smarty semi-natively but its not turned on, so here’s how to turn it back on…
Open file “Packages\HTML\HTML.tmLanguage”, if you search for string “<!–” you will notice that (currently) there is two references to “Smarty language” commented. Un-comment these.