Archive for the ‘Tools’ Category

MAMP 2.1.1 Character Set Issues

Thursday, August 2nd, 2012 by Bernard Robbins

For those that use the latest MAMP 2.1.1 to develop your Joomla products, you may have noticed strange characters in your text output from the database. Like the strange diamond question mark U+FFFD �.  This is caused by inadvertently using different character sets when communicating between PHP and MySQL. I’m using MAMP 2.1.1, which now uses PHP 5.4.4 and MySQL 5.5.25, with Joomla 2.5.6.

Here is the solution I came up with.

Set PHP 5.4.4 php.ini to utf8.

/Applications/MAMP/bin/php/php5.4.4/conf/php.ini
default_charset = "UTF-8"

Let’s see what MySQL reports:

Bernard:~ Bernard$ /Applications/MAMP/Library/bin/mysqladmin variables|grep latin1
| character_set_client          | latin1
| character_set_connection      | latin1
| character_set_database        | latin1
| character_set_results         | latin1
| character_set_server          | latin1
| collation_connection          | latin1_swedish_ci
| collation_database            | latin1_swedish_ci
| collation_server              | latin1_swedish_ci
Bernard:~ Bernard$

Let’s force all connections to MySQL to be utf8.

Bernard:~ Bernard$ cat /Applications/MAMP/conf/my.cnf
[mysql]
 default-character-set=utf8
[client]
 default-character-set=utf8
[mysqld]
 skip-character-set-client-handshake
 character-set-server=utf8
 collation-server=utf8_general_ci
 init-connect='SET NAMES utf8'
 Bernard:~ Bernard$

Restart MAMP 2.1.1.

Let’s see what MySQL reports:

Bernard:~ Bernard$ /Applications/MAMP/Library/bin/mysqladmin variables|grep utf8
| character_set_client           | utf8
| character_set_connection       | utf8
| character_set_database         | utf8
| character_set_results          | utf8
| character_set_server           | utf8
| character_set_system           | utf8
| collation_connection           | utf8_general_ci
| collation_database             | utf8_general_ci
| collation_server               | utf8_general_ci
| init_connect                   | SET NAMES utf8
Bernard:~ Bernard$

Looks real good so far.

setUTF() automatically runs in JDatabaseMySQLi :

mysqli_query($this->connection, "SET NAMES 'utf8'");

So, MySQL and JDatabaseMySQLi are set for utf8 but a dump of the connection shows something different.

In my component (Joomla is configured to use MySQLi):

$db = JFactory::getDbo();
var_dump(mysqli_get_charset($db->getConnection())->charset);
string(6) "latin1"

Um, WTH? What went wrong? PHP 5.4.4, MySQL 5.5.25, and Joomla! 2.5.6 are all set for utf8 not latin1. At this point I have no idea. But, after hours of head scratching, the fix is very simple.

In Joomla! edit the JDatabaseMySQLi file located at:

/Applications/MAMP/htdocs/Joomla_2.5.X/libraries/joomla/database/database/mysqli.php

Add this to line 456 within setUTF() :

mysqli_set_charset($this->connection,'utf8');

Now run our dump again we get:

$db = JFactory::getDbo();
var_dump(mysqli_get_charset($db->getConnection())->charset);
string(4) "utf8"

Final thoughts. This is obviously not a long term solution. As soon as you upgrade to Joomla! 2.5.7, it will overwrite your changes to the library. Hopefully this issue will correct itself in the future.

Happy Coding.

Upcoming Joomla! mobile app

Thursday, September 29th, 2011 by rafa


Update: jomMobile has now been released and you can find more information at http://jommobile.com/

Code name Vimba is an upcoming free app for the iPhone and Android. We recently got the pleasure of testing the app as well as partnering with the developer of the application. Just think now you have the ability to manage your site on the go with a sexy and slick interface. No need to worry about rushing back to the office to make an update. Now you can with the convenience of your phone.

Read the rest of this entry »

Our new plugin makes CSS3 in IE (and any other browser) easy!

Monday, May 2nd, 2011 by jshroyer

css3 example samplesWhat is this?

Anyone who has tried to add CSS3 to their site knows how difficult and time consuming it is to figure out the correct code for the correct browsers. Also, how do I make it work with IE? Wonder no more! With the Automated CSS3 Generator Plugin all you need to do is enter the values for the CSS3 you need and it does the rest. It also only outputs the CSS for the browser you are using so you won’t need 4 lines of CSS to do a simple rounded corner anymore. Read the rest of this entry »

How to work with IE9

Thursday, March 31st, 2011 by jshroyer

By now, I’m sure everyone has choked back a tear or two at the final release of Internet Explorer 9. We immediately started getting support requests asking why their websites look broken in this new ‘revolutionary’ browser (hard to say that with a straight face.) Yes, we are again submerged into Microsoft hell, needing to find fixes for yet another browser. We have done a lot of legwork figuring out the best way to handle supporting this IE9 so we wanted to share the information we have learned to make developing (a little) easier.

Read the rest of this entry »

Utilizing Envelope Distort for Typographical Effects

Wednesday, July 21st, 2010 by John

I’d like to share a method for creating unique typographical effects on the outside of the letters using Adobe Illustrator. See what I mean in the example below. Then read on and find out how to do it yourself!

Read the rest of this entry »

WordPress MU Quick Links

Monday, April 13th, 2009 by rafa

Today I made a small module for one of our clients. This module looks something like this:

WordPress MU Quick Links
I added a few IF statements. It will only show the “View Your Blog” and “Manage Your Blog” links if the user has a blog. Additionally, the “Start a Blog” only shows up if the user doesn’t own a blog.

Read the rest of this entry »

Customizing your Joomla! 1.5 quick links

Sunday, March 22nd, 2009 by Steven

Joomla! 1.5 Quick Links

Here’s a question I’ve heard a lot: “How can you work faster within the Joomla! 1.5 backend?”

The answer is, use your quick icon or Cpanel. All you have to do is edit the main core file to achieve this. It’s a simple process – just follow the steps below on how to get the ‘corePHP’ WordPress button your quick links.

Read the rest of this entry »

.htaccess Security

Saturday, February 28th, 2009 by rafa

htaccess jungle

Here is most of our .htaccess file. This is what I like to call the forefront of our site. It works just like a firewall. We have been using our .htaccess for a few months now and we love the results. I know it can occasionally be hard to find the right command to do the job, so I’d like to show you all of the lines, not just the ones that are security related. If you are not using Joomla! you will have to strip about ten lines from this.
Read the rest of this entry »

Hidden gem in Developers Toolbar

Friday, July 7th, 2006 by jshroyer

I found this little gem while surfing for some new CSS information. Did you know that if you press Control + Alt + F (Mac: Apple + Alt + F), a more advanced CSS viewer will show up as a pop-up in Firefox’s Web Developer Extension from Chris Pederick? I still love it and will always use Xyle Scope for most of my CSS information digging, but this is a major tool for finding elements quickly.

Kudos to Content with Style for the tip!