TLF-Text in Flash CS5 bug

I’ve discovered a nasty bug in the Flash CS5 new Text Layout Framework (TLF-Text).
When you type certain characters in a TLF-Text text field, you can get a strange error at compile-time:

Error 1104: Invalid xml name

Since XML is not used in the project we were working on, it didn’t make any sense…

If you use a TLF-Text text field in the Flash IDE, and you type certain characters (in our case “=”) the error starts to appear.
Not sure if this is always the case, but in our case, it triggered the error.

The only workaround I can provide at this time, is to switch the TLF-Text back to Classic-Text.
This off course means loosing the TLF-functionality, but it does stop the error from occurring.

No Comments

Page redirect after node submit

I wanted to redirect to another page after node submit.
Setting $form['#redirect'] didn’t result in such behaviour.

It’s not a good idea to use the standard form submit handler to redirect to another page since drupal calls a number of hooks when saving a node.

What does work, is setting the $form_state['redirect'] on the submit buttons submit handler.
$form['buttons']['submit']['#submit'][] = ‘my_module_example_form_submit’

Thx to Brian Vuyk for pointing this out.

No Comments

Localized terms and views

When you use localized terms (terms have the same tid for all languages, but can be translated in the translate interface)
views has problems translating you terms.

This problem can be resolved by adding the following hook to you custom module

/**
* implementation of hook_views_pre_render
*/
function mymodule_views_pre_render($view) {
if ($view->name == ‘view_name’) {
foreach($view->result as $term) {
$term->term_data_name = tt(’taxonomy:term:’.$term->tid.’:name’, $term->term_data_name);
}
}
}

,

No Comments

Sanitize strings

Ever wanted to sanitize strings as pathauto does?

Why not let pathauto do it for you?

if (module_exists(’pathauto’)) {
// add the pathauto.inc file
require_once(drupal_get_path(’module’, ‘pathauto’) . ‘/pathauto.inc’);
$sane_string = pathauto_cleanstring(’èàé ï%’);
}

2 Comments

IE no-wrap problem with slashes!

It seems IE can’t handle long URL’s in small HTML elements. So after a little bit of research I found a simple solution. This may not be the most breaking news but I never heard of it before so…

This is the solution:

/* IE Word wrapper */
word-wrap: break-word;

Hopefully this cal help you.

, , , ,

No Comments

PHP 6 features

What will PHP6 bring? This article has a little summary of what the future of PHP holds.

No Comments

Custom sql queries in Views

I came across this when i was looking for a way to use my own sqly queries in combination with views.
Sometimes you can’t always get the things you want by using views (or you’re too lazy to fiddle around with arguments, relationships, etc.)

The idea is simple :

1) test your own custom query in phpmyadmin for example.

2) create a view and save it. You don’t have to set any filters since the SQL will be overwritten.

2) if you haven’t created your own module yet, create one now and place the following code in it.  replace MYMODULE by the name of your own module and VIEW_NAME by the name of the view you’ve just created. Then, change the sql query you see here by your own.

function MYMODULE _views_pre_execute(&$view) {

//drupal_set_message(’—->>>’.$view->name);
if($view->name==”VIEW_NAME”) {

$view->build_info['query']=”SELECT vidnode.nid as nid, vidnode.title as title
FROM node vidnode WHERE vidnode.type=’ptl_remotevideo’
AND vidnode.status <> 0
AND vidnode.nid NOT IN (
SELECT DISTINCT media.field_media_video_ref_nid as video_nid
FROM content_field_media_video_ref media
)”;

}

}

That’s it. I used a node view and it gave me what i wanted. I didn’t have time to check out other settings but i guess it shouldn’t be too hard.

, ,

1 Comment

Upgrade ImageMagick to the latest version

A lot of people are looking for an updated installation of ImageMagick instead of those pesky yum packages on Redhat or CentOS. To upgrade to the last version, use these commands :

# uninstall old ImageMagick
yum remove ImageMagick

# get new ImageMagick sources
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz

# untar
tar -zxvf ImageMagick*.tar.gz
cd ImageMagick*

# configure and make
./configure
make

# install
make install

# test ImageMagick (shouldn’t report an error)
convert logo: logo.gif

# fix problem with rmagick not finding ImageMagick libraries
echo /usr/local/lib >> /etc/ld.so.conf.d/ImageMagick.conf
ldconfig

# update rmagick
gem install rmagick

I found this at https://support.railsmachine.com/index.php?pg=kb.page&id=133

No Comments

How to put a hyperlink on your building

Have you ever wondered how to link your building to a webpage?

article_hyperlink

With 2D barcodes you can.

A 2D barcode or Matrix code is a two-dimensional way of representing information.
It has more data representation capability then a (1-dimensional) barcode.

What is cool about a 2D barcode is that it can be read by every mobile device that has a camera and the reader software. So no special hardware required to scan a 2D barcode

You can store some formatted information on a 2D barcode. This information is in the form of an URI.

Most 2D barcode readers will send the URI encoded in the 2D barcode to the platform specific implementation.
That is why some URI’s will not been interpreted by one phone but will be by another phone.

These are some informartion you can encode in a 2D barcode:

  • Link to a website.
    http:// is required, otherwise it will not know it is a website
    example : http://www.calibrate.be
  • Email address
    example : mailto:newmedia@calibrate.be
  • Telephone numbers
    example :  tel:+3238719962
  • Contact Information based on the “MECARDâ€�
    MECARD:N:Hermans,Joris;ADR: Veldkant 31, 2550 Kontich, Belgium;TEL: +32 3 871 99 62;EMAIL:joris@calibrate.be;;
  • SMS hava some few possibilities : sms or smsto
    sms:number:subject or smsto:number:subject
  • Geographic information
    example : geo:40.71872,-73.98905,100

The QR Code is a type of 2D barcode that you can use for free. You will find also a lot of mobile reader software for this type of 2D barcode (for example zxing).
So putting a hyperlink to the digital world on your building is easy.

qrcode

building with a qrcode

If you want to play with it already you can always use a QR-Code generator like this.
And if you want to add dynamic behavior easily to it, you can always take a look at touchatag.

, , ,

No Comments