Posts

Showing posts from March, 2012

Creating nodes programmatically in Drupal (including cck and location fields)

Creating a new node in drupal is trivial, but when the node includes custom cck fields, then a few things can trip you up. To save time and energy, here’s a quick guide and some tips to make your drupal life easier. Creating a basic node: global $user; //get current logged in user $new_node = new stdClass(); $new_node->type = 'YOUR_NODE_TYPE_HERE'; $new_node->uid = $user->uid; //you can specify some other userID here if you want $new_node->name = $user->name; $new_node->title = $YOUR_NODE_TITLE; $new_node->body = $YOUR_NODE_BODY; $new_node->status = 1; // published node_save($new_node); The function node_save() does a few things behind the scene. It checks if the nid property is empty to determine if this is a new insert or an update, then calls the appropriate functions so that you would not have duplicates. Put simply, if you want to do an update, populate the nid, and leave it out otherwise. Creatnig a node with CCK fields involves ...

How to Reinstall Windows XP Without Having to Reactivate With Microsoft

To tell you the truth, I have never understood what the big deal is with product activation. The fact is that software piracy is rampant, and Microsoft is the target for a large percentage of the piracy due to their dominance in the market. They have a right to try to stop or at least control that privacy, and the product activation seems to be a fair way of ensuring that only legitimate software owners get to benefit from using it. That said, I know many users abhor the process. It may be because they have had problems activating and have had to call the toll-free number and wait to talk to a Microsoft support agent who then read them some 278-character long activation code. (OK, that’s slight exaggeration.) Or maybe they just feel that it is some sort of invasion of privacy or that Microsoft is acting as “Big Brother” and monitoring their actions. No matter the reason, there are plenty of users who would rather never go through the product activation process again. Unf...

Check Out For Sonar Tools

http://docs.codehaus.org/display/SONAR/Install+Sonar#InstallSonar-Requirements it is a great one......

GET 50 Rs off for your Booking

Hello Friends, How If u can get a 50 rs off for your any ticket booked. ? It's wonderful as I can feel... so http://www.travelyaari.com/ go there book your ticket use coupon code 07944820000 or 08044820000 and get 50 Rs off. Have a great Journey. ..............
Implementing a note service (resource) Create a noteresource module that will contain our service implementation. The info file could look something like this: name = Note Resource description = Sample resource implementation package = Notes example core = 6.x php = 5.2 To get a really simple example I'll create an api for storing notes. In a real world scenario notes would probably be stored as nodes, but to keep things simple we'll create our own table for storing notes. // noteresource.install /** * Implements hook_install(). */ function noteresource_install () { drupal_install_schema ( 'noteresource' ); } /** * Implements hook_uninstall(). */ function noteresource_uninstall () { drupal_install_schema ( 'noteresource' ); } /** * Implements hook_schema(). */ function noteresource_schema () { return array( 'note' => array( '...