[support] blank page output
bharani kumar
bharanikumariyerphp at gmail.com
Sun Jul 20 14:11:59 UTC 2008
this is code
output is blank page
<?php
function sample_menu(){
$content[] = array(
'title' => t('Taxonomy'),
'path' => 'sample',
'callback' => 'display',
'access' => user_access('authenticated user')
);
return $content;
}
function display(){
$vid = 3;
$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 = 'page'
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);
$result = db_query($sql, $vid);
echo "This is result".$result."<br>";
$last = '';
echo $last."<br>";
while ($data = db_fetch_object($result)) { echo "hi this data".$data;
$month = format_date($data->created, 'custom', 'm/Y'); // e.g., 3/2007
echo $month;
if ($last == $data->name) {
$output .= '<li>' . l($data->title, "node/$data->nid") . " ($month)</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") . " ($month)</li>";
}
}
$output .= '</ul>';
return $output;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20080720/7854539b/attachment.htm
More information about the support
mailing list