php in page node does not display
just-work - September 9, 2008 - 16:41
| Project: | node privacy byrole |
| Version: | 5.x-1.4 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
users with view permission will see the html/text content of a page node, but not any php content. If the node is entirely php then the access denied message is displayed. Below is a content on the page. the code displayed fine prior to setting up the module.
<?php
$vid = 2;
$sql = db_rewrite_sql("
SELECT n.nid, d.tid, d.name, n.title, n.created
FROM {term_data} d
INNER JOIN {term_node} t on t.tid = d.tid
Left JOIN {node} n on t.nid = n.nid
WHERE d.vid = %d
AND n.type = 'committee'
ORDER BY d.name ASC, n.created DESC",
'n', 'nid');
//Eliminate the DISTINCT that db_rewrite_sql() inserted
$sql = str_replace('DISTINCT(n.nid)', 'n.nid', $sql);
//Do the query, inserting our vocabulary ID.
$result = db_query($sql, $vid);
$last = '';
while ($data = db_fetch_object($result)) {
$month = format_date($data->created, 'custom', 'm/Y'); //e.g., 3/2007
if ($last == $data->name) {
$output .= '<li>' . l($data->title, "node/$data->nid") . " </li>";
}
else {
if ($last) {
$output .= '</ul>';
}
$last = $data->name;
$output .= '<h3>' . check_plain($data->name) . '</h3>';
$output .= '<ul>';
$output .= '<li>' . l($data->title, "node/$data->nid") . " </li>";
}
}
$output .= '</ul>';
return $output;
?>
#1
I haven't tried the code yet, but I do run NPBR with nodes using the PHP filter without problem on 5.x. Sounds like a permissions configuration issue to me, but again, that's without trying anything yet.
#2
I ended up uninstalling it and using content access module...which worked....if I find time to troubleshoot I'll see if I can report back on this...