Hi folks,
currently I`m trying some things with phptemplates, flexinode and php-snipptes. During my experiments I was wondering if it would be possible to include a custom flexinode-field into a php-snippet. For example if that works it would be possible to put a snippet into a flexinode-n.tpl.php file and to leave a flexinode-field for a variable that can be changed each time a new flexinode is created. That can be useful when the snippet needs a taxonomy-id number which changes for each new node.
I`m tryting to do that with the following snippet, but since I`m not a php-programmer I can`t figure out how to put it inside the code:
unset ($output);
$listlength="999";
$charlength="0";
$taxo_id = */ place for the custom flexinodefield */ ;
$content_type = 'flexinode-4';
$result1 = pager_query("SELECT n.title, n.nid, n.teaser, n.uid, n.created, u.name FROM {node} n INNER JOIN {users} u ON n.uid = u.uid INNER JOIN frightening_term_node ON n.nid = frightening_term_node.nid WHERE n.type = '$content_type' AND frightening_term_node.tid = $taxo_id AND n.status = 1 ORDER BY n.created DESC", $listlength);
while ($node = db_fetch_object($result1)) {
$output .= '<span class=capitalchenverdana>' . l($node->title, "node/$node->nid") . "</span><br>" . substr(strip_tags($node->teaser), 0, $charlength) ;
}
print $output;
I`ve already tried just to put in $node->flexinode_n (where n is the number of the field) into the code, but it just returns an error. I`m sure it has just something to do with the writing, but a PHP-noob like me would spend days for figuring that out. :P Maybe someone of you can help me out? That would be great!