WPtouch in french – Update 1.9.8.1

February 14th, 2010 Guillaume No comments

The translation for the WPtouch 1.9.8.1 update is available ! You can download the language file.

It stays some sentences not managed to be translated… By exemple, the “Search…” wich appears when you click on the “Search” button in the WPtouch menu. To solve this, you have just to modify the file wp-content/plugins/wptouch/themes/default/header.php and replace the line

<input type="text" value="Search..."
onfocus="if (this.value == "Search...")
{this.value = ''}" name="s" id="s" />

by

<input type="text" value="<?php _e('Search...', "wptouch"); ?>"
onfocus="if (this.value == "<?php _e('Search...', "wptouch"); ?>")
{this.value = ''}" name="s" id="s" />

If you see something else not properly translated in WPtouch, thanks to alert me !

Finaly, if you manage your website with more than one language, then I suggest that you modify the file wp-content/plugins/wptouch/themes/core/core-functions.php to update the SQL request below in the bnc_get_ordered_cat_list() function :

$sql = "select * from " . $table_prefix .
          "term_taxonomy inner join " . $table_prefix .
          "terms on " . $table_prefix .
          "term_taxonomy.term_id = " . $table_prefix .
          "terms.term_id where taxonomy =
          'category' order by count desc";

replaced by

$sql = "SELECT " . $table_prefix . "terms.term_id, count,
           CASE WHEN INSTR( name, '@' ) >0 THEN
           TRIM( LEFT( name, INSTR( name, '@' ) -1 ) ) ELSE
           TRIM( name ) END AS name FROM " . $table_prefix .
           "icl_translations INNER JOIN " . $table_prefix .
           "term_taxonomy ON " . $table_prefix .
           "term_taxonomy.term_taxonomy_id = " . $table_prefix .
           "icl_translations.element_id INNER JOIN " .
           $table_prefix . "terms ON " . $table_prefix .
           "term_taxonomy.term_id = " . $table_prefix .
           "terms.term_id WHERE element_type = 'category'
           AND taxonomy = 'category' AND
           language_code = '" . get_bloginfo('short_language') .
           "' ORDER BY count DESC";

Then your WPtouch “Category” will display only the categories for the current language…

Categories: Wordpress Tags:

Chromium as a fake Safari on iPhone

November 24th, 2009 Guillaume No comments

To test iPhone WebApp on Linux we don’t have Safari…
We can use Safari for Windows with Wine, or Safari in a Windows virtual machine with VMWare Server or VirtualBox…
But we can also simply use a browser with the same core engine than Safari ie Webkit : Epiphany ou Chromium. Then we have just to change the user-agent to forge a fake Safari on iPhone. If you search on Google, you’ll find very exotic solution : someone uses hexadecimal editor to modify the Chromium binary files… like using an atomic bomb against a fly) : the solution is much easier, you have just to pass through the –user-agent parameter to chromium like this :

chromium-browser --user-agent="Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_2 like Mac OS X; fr-fr) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7D11 Safari/528.16"

Categories: iPhone Tags:

Ubuntu 9.10 Alternate AMD

November 16th, 2009 Guillaume No comments

Install of this version is not always as easy as it should… This time I’ve tried ton install Ubuntu 9.10 on my main computer. I used the “Ubuntu 9.10 Alternate AMD64″ CD because this PC is running 2 SATA hard drives configured in Raid 1… and only the alternate version is able to install it in Raid “out of the box”. But, during the installation process, system complains about mounting the standard CD release… like if the Alternate CD was not a full version… but the CD is mounted so the CD player stays closed… A quick search on the internet and I see that I’m not the only one with this problem. Fortunately, install from 9.10 DVD version seems to solve this bug… I’ll try it as soon as possible but maybe it’s time to ask if Ubuntu should not break the rule and postpone the launch of a new version if problems still exist… like Debian way… but not excessively ;-)

PS 11/18/2009 : I confirm, with the DVD install works like a charm !

Categories: OS Tags: ,

WPtouch in french – Update 1.9.5

November 14th, 2009 Guillaume No comments

The translation for the WPtouch 1.9.5 update is available ! You can download the language file.

Categories: Wordpress Tags: ,

Ubuntu 9.10 on Sony Vaio SZ3XP

November 9th, 2009 Guillaume No comments

Last weekend I had problem with the installation on netbook… This time I’ve tried to install it on a classical Sony laptop : a good and still working Vaio SZ3XP…

It was working without problem for 6 months under Jaunty in 32 bits… and the install from scratch to 9.10 has been really easy ! Like for the previous one, it needs tweak configuration to achieve the proper use of the Ricoh r5u870 webcam and integrated fingerprint reader from Upek is not working at all. (It should indeed… If Sony would, Upek provides Linux drivers but this particular model integrates a modified firmware for Sony. It adds some crypto and only windows drivers from Sony know how to decrypt the stream. Maybe someone could break this to make it fonctionnal on Linux. Interoperability is a rule that Sony seems to ignore)

In short : Ubuntu 9.10 works wonderfully… I’m pretty excited to be able to say the same thing for the Wind netbook !

Categories: OS Tags: ,

Ubuntu 9.10 Netbook Remix and MSI Wind U100

November 2nd, 2009 Guillaume 3 comments

Ubuntu 9.10 Netbook Remix

You’d better have to wait ! I’ve upgraded the netbook of my son this weekend and the result is not as good as it should…

Screen is flashing… USB peripherals are not working and the webcam is dead too…

Back to Jaunty 9.04 : it works fine…

More info

Categories: OS Tags: ,

How to secure your WordPress blog ?

October 31st, 2009 Guillaume No comments

A little tip to secure your WordPress blog (you can use it with another CMS indeed) : just put a .htaccess into you admin folder : for WordPress it’s in wp-admin

Example .htaccess

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "Access Control"
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
# whitelist home IP address
allow from my.ip.at.home
# whitelist work IP address
allow from my.ip.at.work
</LIMIT>

And of course, you change this file with your own IP addresses…

Categories: Wordpress Tags: ,

How to create a debian package from sources ?

October 31st, 2009 Guillaume No comments

Sometimes it happens we want to create his own .deb package from the sources repository (e.g. when you like to use the last up-to-date version and the binary package doesn’t exist…)

It’s very easy if you follow the rules in the good order :-)

  1. Download sources files of your software (for this example it could be drupal6 even if the binary package exists now…)
    1. drupal6_6.14-1.orig.tar.gz
    2. drupal6_6.14-1.diff.gz
    3. drupal6_6.14-1.dsc
  2. Un-compress drupal6_6.14.orig.tar.gz
  3. Un-compress drupal6_6.14.diff.gz
  4. You’ll probably need some tools if it’s your first building package process :
    1. sudo apt-get install dpatch
    2. sudo apt-get install fakeroot
  5. Run : patch -p1 < xxx.diff
  6. Move the debian directory created in previous step into the folder created in step 2 (the one which contents the sources from *.orig.tar.gz, for this example it’s drupal-6.14) : mv debian drupal-6.14
  7. Go into the sources directory : cd drupal-6.14
  8. You’ll probably make debian/rules script executable… Run : chmod +x debian/rules
  9. Then run : dpkg-buildpackage -rfakeroot -uc -b
  10. That’s all ! You just have to install your new freshly compiled package. So, for our example it will be :
    1. cd ..
    2. sudo dpkg -i drupal6-6.14_all.deb

You know the way now…

Categories: OS Tags: ,

World of Goo

October 31st, 2009 Guillaume No comments

World of Goo

Programming is fun and exciting but from time to time a game is good to relax ! So, I give you a free advice : play with the brilliant “World Of Goo” … For 13 euros 50 (20 dollars) you will play hours to solve enigma of this “puzzle game”. Honestly, it’s worth it ! It’s original even if “puzzle game” is a classical. What you have here is a game where interest and fun are more important than to “kill them all” boring concept… Levels are not so easy and require agility and brain efforts ;-) You will be quickly addict ! Moreover, developers have choosen to not protect this game against the copy (no DRM, no protection at all) : and even more, by buying one licence, you can download the Windows, Mac and Linux version (32 and 64 bits) !! Try it, and if you like it, support them by buying this cooooool game !

Categories: Games Tags: ,

WPML, multi language and search engine

October 31st, 2009 Guillaume No comments

If you are using WordPress and the WPML plugin to manage your web site in multi language, you have surely noticed that when a visitor uses the search engine, WordPress displays the result list of the default language and not of the language currently used by the visitor…

To upgrade this feature, I’ve done a little patch… It’s a quick and dirty one but it works (you can easily optimise this by using a function to overload the default behavior of WordPress instead of directly modifying the standard WordPress files (and loosing your modification during the next upgrade…)

Update the file wp-includes/general-template.php for the function get_bloginfo like this :

case 'short_language':
  $output = get_locale();
  $short_language = explode("_", $output);
  $output = $short_language[0];
break;

And the on your theme (e.g. iNove in wp-content/themes/inove/templates/header.php file) :

You just have to modify the form like this :

<form action="<?php bloginfo('home'); ?>/<?php bloginfo('short_language'); ?>/"
      method="get">

Have fun with WordPress and WPML !

ps : you can also modify the links to your title/home to avoid switching language when a user click on the logo

<h1 id="title">
  <a href="<?php bloginfo('url'); ?>/<?php bloginfo('short_language'); ?>/">
    <?php bloginfo('name'); ?>
  </a>
</h1>

and for the breadcrumbs…

<a title="<?php _e('Home', 'inove'); ?>"
   href="<?php echo get_settings('home'); ?>/<?php bloginfo('short_language'); ?>/">
  <?php _e('Home', 'inove'); ?>
</a>

By the way, the idea comes from this thread…

Categories: Wordpress Tags: ,