Drupal

The quickest way should be to add a new block with PHP input format. In that block, call drupal_get_form() and output the result of that. You could do the same using a custom module.

<?php
 
global $user;
$type = 'nodetype';
$node = array('uid' => $user->uid, 'name' => $user->name, 'type' => $type);
print drupal_get_form($type . '_node_form', $node);
 
?>

This took me a little bit of poking around to figure out, so here's a quick tip in case others are attempting to do the same thing.

For some CCK select options, you want it to both be required and to also not default on the first answer because a user might click through without changing the default without meaning to. There is the Default value options you can play with, but the easiest way I've found is in your Allowed values list you can simply enter this as your first choice:

|-Please Choose-

This will give you the -Please Choose- as a default, but if the user doesn't switch it, an error will come up. The reason for this is it's expecting you to have your answer in a format such as 1|Option 1, with the "machine" or "key" name first, followed by a pipe, and then the name of the option a user will see. If you don't give it a machine name it simply isn't valid.

I found the lack of documentation also confusing (and time-consuming). You need to return an array like this:

$array["value"] = "label";

For instance:

<?php
$result = db_query(db_rewrite_sql('SELECT nid,title from {node} WHERE type="page"'));
while ($item = db_fetch_object($result)) {
   $items[$item->nid] = $item->title;
}
return $items;
?>

imagegallery.jpg

Step 1: Copy "thumbnailviewer2.js" into js folder inside theme

Setp 2: Add code below inside template.php for that theme

drupal_add_js(drupal_get_path('theme', 'tapestry') . '/js/thumbnailviewer2.js', 'theme');

themeimage.jpg

To theme cck imagefield with imagecache, make sure imagecache is working. Replace 'featuredsmall' with the imagecache name. Copy the imagefield name and adjust code below.

color.jpg

There are few ways to select color in input form field. Drupal have it's own color picker build in. The draw back with this that it not really user friendly and too technical. Other solution is to use javascrip pop-up menu, but it will not work in all browser.

Here it is :

(node.tpl.php)

To create customize shorter teaser, use this snippet

<?php print $teaser = substr($node->content['body']['#value'], 0, 220) ?>

the "220" is number of character before it cut the teaser.

Adsense limit 3 ads per page. If i insert adsense ads in node.tpl.php, it well repeat the ads 3 times. Because of the node load first before the bottom block, my adsense in bottom block no showing. To solve this, add this snippet inside node.tpl.php. It nice also to separate teaser and full page theme and only insert this snippet inside teaser section only

<?php
if ($id == 1 && $is_front) {
print "...banner here...";
}
?>