A little about Vernon...

Hey there everybody, I’m Vernon. I’ve been a full-time freelance web designer since 2002 and can honestly say it’s been a great journey.

If you’re interested, take a look at my services site and let me help you with your project.

You are currently browsing the archives of the Scripts category.

0

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

I got my first look at TinyMCE 3.0 today and I’m highly impressed.  There’s times when certain dialogs didn’t load for me, but overall it’s a great improvement.  This new version is a complete rewrite of the TinmyMCE core.  Keep in mind that this is an Alpha version and there are several known issues with this version, and “we still suggest you get the 2.1.2 version if stability is your major concern.”

From a pure feature point of view, this release might not be very impressive, but if you are interested in JavaScript and do a lot of custom development, this is the release you have been waiting for. One of the main focuses for the new 3.x branch is to produce a more powerful API and also make it output valid XHTML code by default.

Some of the more notable changes are:

  • Rewrote the core and most of the plugins and themes from scratch.
  • Reduced the over all script size by 33% and the number of files/requests by 75% so it loads a lot faster.
  • Added new and improved serialization engine, faster and more powerful.
  • Added new inlinepopups plugin, the dialogs are now skinnable and uses clearlooks2 as default.
  • Added new contextmenu plugin, context menus can now have submenus and plugins can add items on the fly.
  • Added new skin support for the simple and advanced themes you can alter the whole UI using CSS.
  • Added new o2k7 skin for the simple and advanced themes.
  • Added new JSON parser/serializer and JSON-RPC class to the core API.
  • Added new cookie utility class to the core API.
  • Added new Unit testing class to the core API only available in dev mode.
  • Added new Safari plugin, fixes lots compatibility of issues with Safari 3.x.
  • Added new on demand loading of plugins and themes. Enables you to load and init TinyMCE at any time.
  • Added new unit tests in the dev package of TinyMCE. Runs tests on the core API, commands and settings of the editor.
  • Removed all button images and replaced them with CSS sprite images. Reduces the number of requests needed.
  • Removed lots of language files and merged them into the base language files. Reduces the number of requests needed.
  • Removed lots of unnecessary files and merged many of them together to reduce requests and improve loading speed.
  • Fixed so convert_fonts_to_spans are enabled by default. So no more font tags.
  • Fixed so all classes from @import stylesheets gets imported into the editor.

Thats right, its now 33% smaller and loads even quicker than before! The fastest loading editor just got even faster!

Check out the complete changelog.

A new example of the alternative Office2k7 skin can be seen here:
http://tinymce.moxiecode.com/example_sk … ample=true

The Spellchecker and Compressor for TinyMCE 3.0 Alpha has also been updated.

The Alpha version is live on this server and the Wiki example pages. If you wish to try it out yourself, go to the download page.

TinyMCE Forum / TinyMCE 3.0 Alpha 1 Released

Tags: , , ,

0

PHP Email Address Encoder
April 4th, 2007

This small PHP function will give you an easy way to encode any email address using Character Entities. Just supply the function call with an email address and get the encoded version returned. Most any browser will properly read and translate your email without a problem and without any further action on your part.

Just make a nice call to the function whenever you want to show your email. Such as...

PHP:
  1. <a href="mailto:<?php encode_email('you@yourdomain.com'); ?>"><?php encode_email('you@yourdomain.com'); ?></a>

Here's the function code:

PHP:
  1. <?php
  2. function encode_email($email) {
  3.     //transform email to lowercase
  4.     $email = strtolower($email);
  5.     //separate characters of email into an array
  6.     // str_split() only available in PHP 5
  7.     $email = str_split($email);
  8.     //loop through string and encode as necessary
  9.     foreach($email as $ekey => $evalue) {
  10.         switch($evalue) {
  11.             case 'a':
  12.                 $encoded_email .= "&#097;";
  13.                 break;
  14.             case 'b':
  15.                 $encoded_email .= "&#098;";
  16.                 break;
  17.             case 'c':
  18.                 $encoded_email .= "&#099;";
  19.                 break;
  20.             case 'd':
  21.                 $encoded_email .= "&#100;";
  22.                 break;
  23.             case 'e':
  24.                 $encoded_email .= "&#101;";
  25.                 break;
  26.             case 'f':
  27.                 $encoded_email .= "&#102;";
  28.                 break;
  29.             case 'g':
  30.                 $encoded_email .= "&#103;";
  31.                 break;
  32.             case 'h':
  33.                 $encoded_email .= "&#104;";
  34.                 break;
  35.             case 'i':
  36.                 $encoded_email .= "&#105;";
  37.                 break;
  38.             case 'j':
  39.                 $encoded_email .= "&#106;";
  40.                 break;
  41.             case 'k':
  42.                 $encoded_email .= "&#107;";
  43.                 break;
  44.             case 'l':
  45.                 $encoded_email .= "&#108;";
  46.                 break;
  47.             case 'm':
  48.                 $encoded_email .= "&#109;";
  49.                 break;
  50.             case 'n':
  51.                 $encoded_email .= "&#110;";
  52.                 break;
  53.             case 'o':
  54.                 $encoded_email .= "&#111;";
  55.                 break;
  56.             case 'p':
  57.                 $encoded_email .= "&#112;";
  58.                 break;
  59.             case 'q':
  60.                 $encoded_email .= "&#113;";
  61.                 break;
  62.             case 'r':
  63.                 $encoded_email .= "&#114;";
  64.                 break;
  65.             case 's':
  66.                 $encoded_email .= "&#115;";
  67.                 break;
  68.             case 't':
  69.                 $encoded_email .= "&#116;";
  70.                 break;
  71.             case 'u':
  72.                 $encoded_email .= "&#117;";
  73.                 break;
  74.             case 'v':
  75.                 $encoded_email .= "&#118;";
  76.                 break;
  77.             case 'w':
  78.                 $encoded_email .= "&#119;";
  79.                 break;
  80.             case 'x':
  81.                 $encoded_email .= "&#120;";
  82.                 break;
  83.             case 'y':
  84.                 $encoded_email .= "&#121;";
  85.                 break;
  86.             case 'z':
  87.                 $encoded_email .= "&#122;";
  88.                 break;
  89.             case '0':
  90.                 $encoded_email .= "&#048;";
  91.                 break;
  92.             case '1':
  93.                 $encoded_email .= "&#049;";
  94.                 break;
  95.             case '2':
  96.                 $encoded_email .= "&#050;";
  97.                 break;
  98.             case '3':
  99.                 $encoded_email .= "&#051;";
  100.                 break;
  101.             case '4':
  102.                 $encoded_email .= "&#052;";
  103.                 break;
  104.             case '5':
  105.                 $encoded_email .= "&#053;";
  106.                 break;
  107.             case '6':
  108.                 $encoded_email .= "&#054;";
  109.                 break;
  110.             case '7':
  111.                 $encoded_email .= "&#055;";
  112.                 break;
  113.             case '8':
  114.                 $encoded_email .= "&#056;";
  115.                 break;
  116.             case '9':
  117.                 $encoded_email .= "&#057;";
  118.                 break;
  119.             case '&':
  120.                 $encoded_email .= "&#038;";
  121.                 break;
  122.             case ' ':
  123.                 $encoded_email .= "&#032;";
  124.                 break;
  125.             case '_':
  126.                 $encoded_email .= "&#095;";
  127.                 break;
  128.             case '-':
  129.                 $encoded_email .= "&#045;";
  130.                 break;
  131.             case '@':
  132.                 $encoded_email .= "&#064;";
  133.                 break;
  134.             case '.':
  135.                 $encoded_email .= "&#046;";
  136.                 break;
  137.         }
  138.     }
  139.     //echo encoded email
  140.     echo $encoded_email;
  141. }
  142. ?>

0

So I recently ran into an issue while trying to resize a BMP file with PHP. Fortunately, I came across this user created function in the imagecreate() section of the PHP website that made it easy as pie.

All you need to do is take the function there and do something like...

PHP:
  1. $src = ImageCreateFromBMP($_FILES['upload_field']['tmp_name']);
  2. imagejpeg($src, 'test.jpg');

Of course that's a pretty bland and simple example, but you should get the point. If not, post a comment and I'd be glad to update it.

BMP Resize with PHP