By Daniel_Hatcher on
Now i have a code like so...
function tutorial_nodeapi(&$node, $op, $teaser, $page) {
switch ($op) {
case 'load':
return db_fetch_array(db_query('SELECT parent, weight FROM {tutorial} WHERE vid = %d', $node->vid));
break;
case 'view':
if (!$teaser) {
if (isset($node->parent)) {
$path = tutorial_location($node);
// Construct the breadcrumb:
$node->breadcrumb = array(); // Overwrite the trail with a tutorial trail.
foreach ($path as $level) {
$node->breadcrumb[] = array('path' => 'node/'. $level->nid, 'title' => $level->title);
}
$node->breadcrumb[] = array('path' => 'node/'. $node->nid);
$node->content['tutorial_navigation'] = array(
'#value' => theme('tutorial_navigation', $node),
'#weight' => 100,
);
if ($page) {
menu_set_location($node->breadcrumb);
}
}
}
break;
case 'update':
if (isset($node->parent)) {
if ($node->revision) {
db_query("INSERT INTO {tutorial} (nid, vid, parent, weight) VALUES (%d, %d, %d, %d)", $node->nid, $node->vid, $node->parent, $node->weight);
}
else {
db_query("UPDATE {tutorial} SET parent = %d, weight = %d WHERE vid = %d", $node->parent, $node->weight, $node->vid);
}
}
break;
case 'delete revision':
db_query('DELETE FROM {tutorial} WHERE vid = %d', $node->vid);
break;
case 'delete':
db_query('DELETE FROM {tutorial} WHERE nid = %d', $node->nid);
break;
case 'fields':
return array('nid', 'uid', 'type', 'title', 'teaser', 'body', 'revisions', 'status', 'promote', 'moderate', 'sticky', 'created', 'changed', 'format');
}
}The question i have has more to do with this part.
case 'fields':
return array('nid', 'uid', 'type', 'title', 'teaser', 'body', 'revisions', 'status', 'promote', 'moderate', 'sticky', 'created', 'changed', 'format');Now i know it returns the array but was the array called and how do i use it to design the node page i want. Rather than the default.
Comments
Nobody?
Nobody?
...
The 'fields' op has been dropped in Drupal 4.7 already.
See http://api.dupal.org.
So is there no way to edit
So is there no way to edit the node style then?
Oh, the URL api.dupal.org
Oh, the URL api.dupal.org does not work.
...
Sorry, I meant http://api.drupal.org . The 'r' slipped.
You didn't explain the reason for this discussion. What are you trying to achieve? Whose is the code above? And what's wrong?
I want to edit the style of
I want to edit the style of the node, because i use a type of BBCode like [code] and what i want is the edit the node style so it automatically replaces the BBCode with php highlight_string() rather than have to use the PHP coding to do it on each file.