irakli's blog

Using Node References on a Multilingual Website

CCK Node Reference is an excellent module that allows creation of complex relationships between content types in Drupal. Combine that with Views2 feature called Relationships and you have one of the most sophisticated information architecture design tools any CMS has ever seen. At least - if you stick to one language. When you are working on a multilingual website, though, things get complicated. In this blog post we will discuss how to properly configure node references on a multilingual Drupal website.

Fascination with Portlets Gone Wrong - Orange.com

I must admit, I've always been skeptical about portlets (or whatever else you happen to be calling the same notion in your technology). I've never seen a website where I found them useful. I do not use, or ever intend to use, iGoogle, because I never go to their homepage - my browser allows me to search from the toolbar. As a matter of fact, the only two cases where widgets make any sense, that I know of, are OS-X Dashboard and Facebook. I have not bothered to customize even those, much, to be honest, though.

To my great delight, most website owners quickly figured that the "usability" myth of morphing their websites into a pile of "widgets" was nothing more than a mirage. They quickly kicked the know-it-all-can-sell-any-bullshit "consultants" that suggested it out of the door - where they belong.

Unfortunately, it seems like Orange of France Telecom "did not get the memo". Somebody over there managed to "portletize" the homepage (!) of the corporate website. Now, it's one thing to let users customize their own profile pages, but to turn corporate homepage into a Lego™ toy is just a whole new level of a case of an arrested development.

:big sigh:

How to Delete All Tables in a MySQL Database

If you are working on a system with somewhat large number of tables, you probably have wanted to delete a number of tables matching a pattern (dropping all tables is a specific case of this one). You can do that, by creating a very simple stored procedure:

mysql> delimiter $$
create procedure drop_tables_like(pattern varchar(255))
begin

SELECT @drop_sql:=concat('DROP TABLE IF EXISTS ', group_concat(table_name)) drop_statement
FROM information_schema.tables
WHERE table_schema=database() and table_name like pattern;

IF (@drop_sql IS NOT NULL) THEN
  PREPARE stmt from @drop_sql;
  EXECUTE stmt;
  DROP PREPARE stmt;
END IF;

end$$
delimiter ;

then you can use this procedure to mass-delete tables like:

mysql> call drop_tables_like ('ika%');

Solr, in Drupal, Suddenly Stopped Working!

Ok, so you can swear Solr was working just fine on your Drupal website and suddenly it does not! You made sure nobody messed with your install and you do not believe in goblins. What to do?

Keep your cool. Help is on its way and let us explain what happened.

Apache Solr module uses Drupal's drupal_http_request() function. This is a very useful function that has numerous benefits over PHP curl library for the retrieval of information via HTTP. Simplicity, reliability and speed are just a few to name.

However, it has one serious shortcoming. Somebody thought it was a good idea to check if the Drupal installation can make HTTP calls at all, by fetching self-generated page. If that request fails (because you had .htaccess on for a brief moment there, the request just timed out randomly or evil in-laws casted Voodoo spell on you) - Drupal blocks the function by setting a variable 'drupal_http_request_fails' in the database and then it's all downwards from there.

So, if your Solr installation suddenly stops working for no good reason, or your FeedAPI is not bringing feed items, anymore, try clearing the flag by either issuing: variable_set(drupal_http_request_fails, false); in Drupal, or running the following command in mysql:

mysql> update variable set drupal_http_request_fails='b:0;';

CSS Background Transparency

The Right Way is obviously CSS 3.0: rgba(R,G,B,ALPHA), but since only Safari supports CSS 3.0 currently (to the best of my knowledge, but you bet IE does not) the "right way" is out of question.

Moving on.

You can, also, try using the combined CSS properties:

filter:alpha(opacity=50);-moz-opacity:.5;opacity:.5;

and think to yourself: "OK, I used three properties for one thing, so the cross-browser demons should be happy, right? What can possibly go wrong?"

Well, demons are demons because they are evil and more goes wrong than possibly could. Namely, all child elements of the div, the background of which you just made transparent, will also become transparent. Even if you have no children divs: all your text, within the div, will be transparent and I can bet that was not something you wanted!

What to do? What to do? You rush to Google and find all kinds of MMFW-CSS (make-me-feel-worse, CSS) tricks that do not help. Like the one suggesting the inside elements should not really be children of the initial div, but be overlapped using, nothing less than, an absolute positioning. Yeah, like that really helps: adding the pain of absolute positioning to the already existing list of pains with your page's CSS!

But do not despair! There's a way to the light!

With no further delay, here is the workin'-kickin' solution, tested in most browsers:

The Best VPS Hosting - SliceHost

OK, it's official: I am in love with a hosting company. I never thought I would ever say something like this. I have tried many hosting companies over the years, some horrible, some overpriced, some barely decent. Never have I ever felt so strong (at least positively) about any of them.

SliceHost is an absolute perfection of a hosting company for personal, small and mid-size businesses. I can not think about a single thing that I would not love about them: from incredibly affordable plans, to stability, performance, reliability, quality, instant activation, Drupal-based control panel, even the Campfire-based support line, where you can get answers to your questions 24/7 and right away from highly knowledgeable experts and share experience with other customers.

If I was to build a perfect affordable hosting company myself, and I could implement it exactly the way I wanted, I still would not be able to do it better... frankly, I probably would not even be able to do it as well.

Wonderful job, guys! Seriously!

Keep up the good work!

P.S. So far I have been helping some friends with their SliceHost servers and enjoying their accounts. I will be moving my blog to SliceHost as soon as I find some time to migrate all the stuff I have accumulated on the current server.

Install PHP 5.2 on CentOS 5.2 Using Yum

Yum is a standard installation utility for CentOS 5.2. One of the reasons I favor CentOS over other Linux distros is actually because it comes with yum. It is that good!

Unfortunately, CentOS 5.2 does not generally include the latest versions of libraries, because it follows conservative path of the RedHat Enterprise. Which is not that bad of an idea, for a server OS... until you need that latest version of something and you are stuck... or: not necessarily.

If you a are a Drupal developer, there's a very good reason why you need the latest version of PHP: 5.2. The reason is called FileField module. This module is required by another absolutely essential module ImageField making it a matter of life-or-death (just kidding) to have PHP 5.2 on your server. But the latest CentOS release (ironically also 5.2) only comes with PHP 5.1.6.

What to do?

Web 2.0 in the Army

I found it very interesting to listen to this Web 2.0 Summit presentation by Jeffrey A. Sorenson and see how Web 2.0 is perceived by Army. It's a common stereotype that government is always behind as far as new and cool goes, but apparently Army is well aware of Web 2.0, is fully embracing it and that, my friends, is very exciting to hear, indeed!

Enjoy:

OpenID on Google and MSN Live!

Fantastic news for OpenID:

"This is a historic week for OpenID. Google and Microsoft announced the release of code to support OpenID 2.0 across their most important properties. On Monday, Microsoft, announced OpenID 2.0 support for their 460 million users on the LiveID platform. On Wednesday Google said it will be supporting OpenID 2.0 for any user that has a Google account. Both of these deployments are great news for the OpenID community and the Internet at large. It can be safely said that within the coming months, every single user on the Internet will have an OpenID"

via: openid.net

Please Join A Good Cause

If you care about the future of the Internet we kindly ask you to join a good cause.

Syndicate content