Dove sbaglio?

5 contenuti / 0 new
Ultimo contenuto
Dove sbaglio?

ragazzi guardate sto codice:

<?php
function cover_page() {
   
// Image Attributes
   
$attr = array('width' => '140',    'height' => '140');
   
// Table Attributes
   
$attributes = array('width' => '100%');
   
$rows[] = array;
   
$result = db_query('SELECT * FROM {cover} ORDER BY filename');
    while (
$info = db_fetch_object($result))
    {
       
$link = $info->url;
       
$picture = theme('image', $info->filename, ' ', ' ', $attributes, FALSE);
       
$picture = l($picture, $link, array('title' => t('View Banner.')), NULL, NULL, FALSE, TRUE);
       
$rows[] = array($picture, $info->photo, $info->description);
    }
    
$header = array(t('Cover'), t('Photo'), t('Description'));
   
$output  = theme('table', $header, $rows, $attributes);
      return
$output;
}
 
?>

errore:

Fatal error: Cannot unset string offsets in C:\xampp\htdocs\dp7\drupal-5.7\includes\form.inc on line 319

dove sbaglio? mi sfugge!

<?php
  $rows
[] = array();
?>

Mancano le parentesi (ad occhio)

Ciao
Marco
--
My blog
Working at @agavee

<?php
/*
*  cover_page
*/
function cover_page() {
   
// Image Attributes
   
$attr = array('width' => '140',    'height' => '140');
   
// Table Attributes
   
$attributes = array('width' => '100%');
   
$rows[] = array();
   
$result = db_query('SELECT * FROM {cover} ORDER BY filename');
    while (
$info = db_fetch_object($result))
    {
       
$link = $info->url;
       
$picture = theme('image', $info->filename, ' ', ' ', $attributes, FALSE);
       
$picture = l($picture, $link, array('title' => t('View Banner.')), NULL, NULL, FALSE, TRUE);
       
$rows[] = array($picture, $info->photo, $info->description);
    }
   
$header = array(t('Cover'), t('Photo'), t('Description'));
   
$output  = theme('table', $header, $rows, $attributes);
      return
$output;
}
 
?>

mavimo niente da fare sempre lo stesso errore!!

"on line 319".....se indichi già ci si avvicina di più

risolto, il problema è ceh io richiamavo la drupal_get_form con callback, invece dovevo richiamre la funzione direttamente!! grazie a tutti!!