Web

Country flags icon pack

I'm working on a project where I needed to display country flags for a type of content according to the country it was reffering to.

So I needed an icon pack. The best one I came across was this one:
http://365icon.com/icon-styles/ethnic/classic2/

Has the icons by ISO code and different sizes for all your needs.

Big thanks to the authors.

Split array in smaller arrays

PHP iconTo divide an array and split it into smaller sub-arrays by size, you can use the PHP function array_chunk():

$sections = array_chunk(array('k', 'l', 'm', 'n', 'o'), 2);

TinyMCE wysiwyg and TinyBrowser file upload plugin

I'm working on an osCommerce project. I can't believe people use something like osCommerce. Installing modules means manually editing various files... Nasty. Don't like it a bit.

I had to add TinyMCE to the textarea for pages and product descriptions and needed the capability to add images and resize them, plus uploading various files.

If you're looking for the same thing, I recommend using Tinybrowser plugin. There are a few other options available, but I liked this one best.

Unzip and copy the folder in the plugins folder of your tinymce installation. Than include tiny_mce/plugins/tinybrowser/tb_tinymce.js.php along with the main tinymce js file.

Edit the config_tinybrowser.php file so that the upload directories are valid (usually /images/uploads/)

Now, you only need to edit the init js code and add tinybrowser to the list of plugins and buttons:

file_browser_callback : 'tinyBrowser',
plugins: 'tinyBrowser,advimage',

Now, everything is set-up and ready to go.

If you want to link to files, click the link Icon and you will see a smal icon in the pop-up window that you can click and upload files.

modavastyl.ro - relaunched on Drupal

I've just relaunched www.modavastyl.ro on Drupal. Fairly simple website, the owners wanted to have the ability to add news, pages and products easily. Also SEO features that are great in Drupal.

Jaluzele verticale ModavaStyl preview

.ninja

Got this from a friend, Marian:

.ninja { color: black; visibility: hidden; }

 

Drupal - print an "Add as a friend" link

If you are usign the user relationship module in Drupal and want to print an "Add as a friend" link somewhere in the theme, views, etc and you want to preserve the AJAX goodness this is how you do it.

[syntaxhighlighter] <?php print l(t('Add as a friend'),'relationship/'.$friend->uid.'/request/1',array('html'=> true, 'query'=> drupal_get_destination(), 'attributes'=> array('class'=>'user_relationships_popup_link'))); ?>[/syntaxhighlighter]

 

The AJAX magic is done by the class "user_relationships_popup_link'.

You should make some checks to see if the user is already a friend or if the user is logged in to see the "add friend" link. And check to see if you're not looking at your own profile, so you don't add the link for you to become your own friend.

To check if you already have a relantionship with an user use this:

if ($relationships = user_relationships_load(array('between' => array($user->uid, $friend->uid),'approved' => 0))) {
        print '<div class="user-flags">'.t('You have a pending friend request with this user').'</div>';
}

if ($relationships = user_relationships_load(array('between' => array($user->uid, $friend->uid),'approved' => 1))) {
            print '<div class="user-flags">'.t('This is a friend').'</div>';
}

$friend->uid is the UID of the user you are trying to add as a friend.

Finished Typo3 project - Waterstillar.com

I've finished working on a Typo3 project. It's online at www.waterstillar.com. I'll post more about this when I'm done working on the portfolio page.

A quick summary. It's built on Typo3 4.2.6, has 2 main templates, frontpage and a 2 column one. Most content is text and images, but also has two custom built modules. One is for the Library section, displays term definitions order by letters and the other is a gallery plugin with a jQuery 3D carousel.

The company owning the site, based in Denmark, sells Waterstillar products that help you clean the water you drink. Here's what the product does:

“A simple and effective solar distillation solution, primarily for domestic use. Can be placed on (or in) a roof and the drinking water will flow directly into the kitchen. A solar collector with a WaterStillar® unit integrated. 1 m2 will give app 20-25 litres pr day”.

Read more on Waterstillar website.

Waterstillar.com website

 

Opera 10

Opera launched version 10 of their browsers. I like this one. Runs well, looks well and doesn't slow down like Firefox which has become almost impossible to use.

The only thing making me start Firefox now it's Firebug.

Safari and Opera perform much better. Hope DragonFly matures and becomes as easy to use as Firebug.

Canale TV romanesti online

Alta adresa unde se pot vedea posturi tv online: http://www.televiziuni-online.110mb.com

Seven sins of usability

Here is a list of seven usability mistakes:

  1. Inconsistent and confusing site navigation
  2. Difficult to scan content
  3. Misidentified and unidentified links
  4. Too much industry jargon
  5. Hidden or absent contact information
  6. Not allowing user browser control
  7. Content that looks like advertising

You can read more on NetImperator