By default - and this is right so - no teasers are generated for nodes with input-type php. But in some cases it is necessary - particularly with regard to the userinterface - to have teasers for all types of your content. And if you know what you do - you can generate also teasers for php-nodes. Here is our solution:
Teasers are generated in the node.module's function node_teaser. The original code is:
if (isset($format)) {
filters = filter_list_format($format);
if (isset($filters['filter/1']) && strpos($body, '<?' !== false ) {
return $body;
}
}
Change this to the following:
if (isset($format)) {
filters = filter_list_format($format);
if (isset($filters['filter/1']) && strpos($body, '<?' !== false ) {
$delimeter = strpos($body, '<!--phpbreak-->');
if ( $delimeter > 0 ) {
return substr($body, 0, $delimeter);
} else {
return $body;
}
}
}
Add in function node_view the following to strip out this new tag (after strip out the normal <!--break-->):
node->body = str_replace('<!--phpbreak-->', '', $node->body);
Now you have a new tag <!--break--> to generate teasers for php-nodes. But: you must know what you do! Don't use this tag inside your php-code!
And remeber:
Drupal 4.6 stores the teasers in the database and not on the fly - if you change code - you must update also your nodes!