If you need a London based Drupal developer you can hire me. Check the availability page and contact me on info@aprium.net.
I wanted a cron job to run that would backup my Mysql database each hour. But I also wanted the command to create a new file each time preserving the history.
This is the command I came up with:
mysqldump --opt -u [username] [dbname] > /path/to/backups/database-`date +%Y-%m-%d-%k:%M:%S`.sql
Sometimes you will be executing a form alter and the $form object passed to you does not match what is coming out on the screen. This is most likely that another module is running after your form alter and changing the form.
So the solution is make your module execute after all the other modules have finished. You can do this by changing the system weight. There are 2 ways of doing this, the first is to install the module order module which is in development at the moment but should do the trick.
Its quite common when making a site to need a different size image for the first teaser than the rest of the teasers in the list. This job is made more difficult because when the CCK image field is sent to the template it only gives you the end result in the $output variable and does not give you the images path.
Its does however give you a file id in the raw data which you can use to load the file object and get all the information you need create a new image from a different preset.
I have created another gedit colour scheme inspired by the textmate and xcode syntax colour schemes. Remember to comment here if you like it!
I have been trying out the Opera 10.6 beta for Linux and I have got to say im very impressed. The main difference is the developer tools which if you are used to firebug you will feel very at home with. The tools are called Dragonfly and instead of taking a different direction like Safari and web-kit, they have stuck closely to the firebug system but made it natively part of the browser.
For windows users the Browser is full released but the Linux and OS X version are in beta. Well worth giving a go!
This article is a quick solution if you have a menu item for adding content and you want to make sure the user is logged in before going to the add node page. This solution will also display a register/login link and then redirect them once they have logged in.
1) Firstly make sure you have the php filter module enabled and you are logged in as admin.
2) Next create a new page and set the input format to php.
3) Then paste the following code into the body of the page.
<?php
global $user;
if($user->uid == 0) {
?>
The best way I have found to export nodes is through the views bonus pack. After installing that you will see a bunch of new options in the feed display. Now you can select the style of CSV file.
I did notice that the headers are not set correctly but you can fix this by opening up views-bonus-export-csv.tpl.php and adding
drupal_set_header('Content-Type: text/x-comma-separated-values; charset=UTF-8');
drupal_set_header('Content-Disposition: attachment; filename="data.csv"');
I recently tried the new ubuntu one iphone application. You can sync all your contacts from your iphone to your ubuntu one account and vice versa. Its a very basic application and does not support your files or notes you have stored on the ubuntu one cloud.
Your have to sign up for a separate mobile account on the one web site at https://one.ubuntu.com/phones/ and then enter the username and password it generates for you into the app.
Looking forward to the next version!
I just wanted to shamelessly promote one of the best open source project I have found.
The project is a PHP library that converts HTML into a PDF document. I have used it in two projects now and its performed brilliantly. Before I would use the ezpdf library to create a PDF from code. Its a good library but it so much easier to create your document in HMTL and then convert it.
Just a quick fix I found for an eclipse error.
The error message I got was "Problems occurred while trying to save the state of the workbench." and it appeared when eclipse was closing or periodically saving.
The fix is simply create a directory in your workbench directory. My workbench is in /var/www so I used.
mkdir /var/www/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/
Restart eclipse and no more error messages!
If you need a London based Drupal developer you can hire me. Check the availability page and contact me on info@aprium.net.