Random Snippet of Code and Life

Archive for October, 2007


29
Oct

How to build a node in Drupal programmatically

<?php
$newnode = new stdClass();
$newnode->title = ‘Welcome’;
$newnode->body = ‘This is the welcome page for your site. Replace this text with whichever content you\’d like to use for your welcome page.’;
global $user;
$newnode->uid = $user->uid;
$newnode->type = ‘page’;
$newnode->status = 1;
$newnode->promote = 0;
node_save($newnode);
?>
From http://mediumexposure.com
Technorati Tags: Drupal node, Drupal, Programming

Popularity: 9% [?]

Popularity: 9% [?]


04
Oct

Free Burma!

Popularity: 8% [?]

Popularity: 8% [?]


03
Oct

Xinclude: Template match not found

Enable the option –xinclude for the parser.

Popularity: 9% [?]

Popularity: 9% [?]

Random Snippet of Code and Life is is proudly powered by Wordpress
Navigation Theme by GPS Gazette