Drupal

Drupal with 1and1 Hosting

You will need to make some changes to the .htaccess file to get Drupal working with http://www.1and1.com. You will also need SSH access to make the changes.

After extracting your Drupal files, modify the .httacces file and add the following line to the top. Note** You can do this at the root of your shared directory.

AddType x-mapp-php5 .php

To get "clean-urls" working, uncomment the ReWrite.

RewriteBase /

Views - PHP Code for Profile Data

If you have a custom field in your user(s) profile and you're trying to pull that value into a view... here's the ticket.

If your profile field is called: "profile_custom_value"

1) For that view, add a new value under "Arguments"
2) Select "Provide default argument"
3) Under "Default argument type: ", select "PHP Code" and use this syntax.
Don't use the brackets - as noted.

global $user;
$profile =  profile_load_profile($user);
return $user->profile_custom_value;

Custom Block - Login

<?php global $user; ?>
<?php if ($user->uid) : ?>
Welcome: <?php print l($user->name,'user/'.$user->uid); ?> |<?php print l("logout","logout"); ?>
<?php else : ?>
Please Login/Register: <?php print l("Login/Register","user/login"); ?>
<?php endif; ?>

Drupal Upgrade - Command Line

This little command will update your drupal code

tar -xzvpf ./drupal-x.x.tar.gz --strip-
components 1

Connect to Drupal with JAVA

Installation Steps
For this to work, you'll need to download and include a few *.jar files for ApacheXmlRpc.

From http://www.apache.org/dyn/closer.cgi/ws/xmlrpc/ download the appropriate "apache-xmlrpc-current-bin.*" file.
Extract the files to a location that can be used to import them for NetBeans in you project.
Add them to your projects Libraries.
To use it, you will need to know the sites Service Key, Service Domain, and the Service URL. Below is a sample of how you use the class

        service = new DrupalXmlRpcService(
                "dev.mysite.com",