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; }
Hi, You should probably remove the display() function declaration and move its body outside it. So, you will have something like function sample_menu(){ ..... } $vid = 3; .... return $output; What's the point of sample_menu() ? -- # Vasileios Lourdas, # Informatics Engineer, Thessaloniki (Greece) # http://www.lourdas.name
Here sample_menu is the function, This sample_menu for navigation.. On Sun, Jul 20, 2008 at 7:46 PM, Vasileios Lourdas <drupal@lourdas.name> wrote:
Hi,
You should probably remove the display() function declaration and move its body outside it. So, you will have something like
function sample_menu(){ ..... }
$vid = 3; .... return $output;
What's the point of sample_menu() ? -- # Vasileios Lourdas, # Informatics Engineer, Thessaloniki (Greece) # http://www.lourdas.name -- [ Drupal support list | http://lists.drupal.org/ ]
what i try here is.. without using view module, display taxonomy +fruits -apple -orange +vegitable -ladies finger -onion chk the attached document,, On Sun, Jul 20, 2008 at 9:11 PM, bharani kumar < bharanikumariyerphp@gmail.com> wrote:
Here
sample_menu is the function,
This sample_menu for navigation..
On Sun, Jul 20, 2008 at 7:46 PM, Vasileios Lourdas <drupal@lourdas.name> wrote:
Hi,
You should probably remove the display() function declaration and move its body outside it. So, you will have something like
function sample_menu(){ ..... }
$vid = 3; .... return $output;
What's the point of sample_menu() ? -- # Vasileios Lourdas, # Informatics Engineer, Thessaloniki (Greece) # http://www.lourdas.name -- [ Drupal support list | http://lists.drupal.org/ ]
participants (2)
-
bharani kumar -
Vasileios Lourdas