Drupal 7 - Create a user with custom fields based on Taxonomy terms

Let say we have a travel-website. Each user has fields like :
- My Hometown (single entry)
- Visited cities (multiple entries)
- Cities I want to visit (multiple entries)

And we want to restore user-db from an extern-file. We have to prepare taxonomy terms and assign IDs before starting insert data. After parsing data, we can create each user with following php-code.

$uname = "Alex Miller";
$umail = "alex.miller@example.com";

$hometown_id = 123;
$visited_city1 = 345;
$visited_city2 = 456;

$tovisit_city1 = 678;
$tovisit_city2 = 789;

List of Hobbies and Interests - Text Database

Many developers need lists like "Hobbies & Interests" etc. Here is a new list in as simple text format. New entries are welcome.

3D printing
Air sports
Aircraft Spotting
Amateur astronomy
Amateur geology
Amateur Radio
American football
Animal fancy
Aquarium (Freshwater & Saltwater)
Art collecting
Association football
Australian rules football
Auto audiophilia
Auto racing

Display E-Mail Adresse of anonym visitors in Drupal-comments securely


Visitors post comments and they live sometimes their contact information like email address to get feedback. If you display e-mail spambots will catch them before other visitors. If you dont display, other visitors cannot send feedback. What is the secure anti-spam solution?

Here is what I did:

- email adresse of comment-poster will just partly shown to other anonym visitors (and with a tip to register to see full email)
- email adresse of comment-poster will shown to other registered visitors fully

List of new Internet Jobs (career of new media of digital age)

In last 10 years there are more than 100 new jobs. Here is a list of common IT/www-jobs. It is impossible to find the name/title of most these jobs on books and encyclopedia which is older than 15 years.

Account Manager
Ajax Developer
Applications Analyst
Applications Designer
Applications Programmer
Applications Tester
Chemical Informaticist
Circuit Designer
Computer Operator
Computer Support Service Representative
Computer Systems Analyst
Computer Systems Auditor
Customer/Technical Support Specialist
Data Mapper
Database Analyst/Expert

Backup all MySQL databases automagicly with the PHP admin script

Server administration software like Cpanel, Plesl, Webmin etc have already their backup solutions. But they are runned mostly once a week or max a day because of performance reasons. Let say we just want to backup all of our mysql-databases every 2 hours.

To do this:

  • Create a directory like /backup/mysql
  • Save code below under something like backup_mysql.php
  • Chmod it to 755
  • Run it manually or with cronjobs /root/scripts/backup_mysql.php
// use this if your php.ini does not allow shell etc #!/usr/bin/php -n

Comparison of Mozilla Firefox 4 and Microsoft Internet Explorer 9

I have just installed MSIE 9 and Firefox 4 rc2 on my computer.

User interface on both browsers are similar. Firefox'es home-button moved to right of url bar. Just back-forward buttons are visible. Tabs are on the top. Url-bar are shorter.

Javascript performance on both systems are similar. Some tests with jquery gave Firefox more points. But Firefox still needs more ram than msie.

Both systems support HTML5 and CSS3.

The visual difference between MSIE8 and 9 is more than the one between Firefox3 and 4.

Firefox let resize textareas.

Filezilla and plain-text clear, unsecure password storage

Everyone knows FileZilla FTP-client programm. It is fast, easy to use and offers most used functions for a good ftp-client. And it is open source & free. But there is a big problem: Filezilla stores passwords in a very unsecure way. Filezilla stores passwords of recent servers, passwords of sites in site-manager in plain text.

Files (and path) storing passwords:

Path for Windows XP/2K: “C:\Documents and Settings\USERNAME\Application Data\FileZilla”
Path for Windows 7/Vista: “C:\Users\USERNAME\AppData\Roaming\FileZilla\”
Path for Linux: “/home/USERNAME/.filezilla/”

How to select a secure password for your online logins

What is a good password?

A good paswword is:

- at least 8 char long
- includes letters, CAPS and numbers
- never repeated somewhere else
- cannot be found as a string on a search engines, Google finds 0 result for it
- cannot be found in any dictionary/database exists on the world
- nobody incl. your wife can guess / estimate it
- easy to remember for you

To do this build a long sentence, take the first chars of words, combine with usename-userid and service u logging on, encrpyt it with a formel just you know.

Never do:

Server Benchmark with PHP 5 : ThePlanet, Hosteurope, Hetzner

This is a small benchmark test / performance comparison with PHP 5 between ThePlanet, Hosteurope and Hetzner Servers. Servers are not same, and there are RAM difference but in this test RAM plays no big role, but CPU plays. The server from Hosteurope is a virtual server with min. 2GB ram guarantie. The other two are dedicated root servers. ThePlanet's OS is Redhat enterprise, The other two are using Debian.

Hetzner : Intel® Core™ i7-920 Quad-Core with 8GB Ram
Hosteurope: 8 Cores Intel® Xeon® with min 2GB or more
ThePlanet: 2x DualCore Intel(R) Xeon(TM) CPU 3.40GHz with 2GB

Save / open .ico files (icons) with Adobe Photoshop CS4 64 / 32 Bit

First visit http://www.telegraphics.com.au/sw/#icoformat and download the true version (32 / 64 Bit) for your OS (Mac / Windows / Linux)

Attention: at this time I could not get 64bit Plugin (... .8BI) works on 64Bit Windows7. But when I copied the 32 version of plug in I coult get it run on both 64 bit and 32 bit CS4. Also use "ICOFormat-1.6f9-win" instead of "ICOFormat-1.93b1-win64" below.

Extract files to folder (ICOFormat-1.93b1-win64). There is one .8bi file and gpl license, readme etc.

Syndicate content

CafeWebmaster.com(CW) is a free online community for webdevelopers and beginners. Anybody can share their code, articles, tips, tutorials, code-examples or other webdesign related material on the site. Newbies can submit their questions and reply to existing questions. CW does not guarantee or warrant reliability of code, data and information published on the site. Use the site on your own risk. The site takes no responsibility of direct or indirect loss or any kind of harm to its users. The site also doesn't take responsibility of infected files or source code with any kind of infection or viruses, worms, spywares, malwares, trojan horses. CW reserves the right to edit, move, or delete any of content for any reason.