Dove sbaglio?

Posts: 187
Iscritto il: 14 Dic 07

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!

__________________

Posts: 1911
Iscritto il: 01 Gen 07
Admin di Drupal ItaliaSviluppatore DrupalDrupal Monkey. Mangio moduli e API a colazioneTraduttore

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

Mancano le parentesi (ad occhio)

__________________

Ciao
    Mavimo
_________________
Io mio sito su Drupal, CFD e OpenFOAM (e se vi chiedete cosa c'entrano l'uno con l'altro.. bhè, non so nemmeno io la risposta Sticking out tongue )


Posts: 187
Iscritto il: 14 Dic 07

<?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!!

__________________

Posts: 18
Iscritto il: 12 Mar 08

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

__________________

Siiii....quanto amo le curve di apprendimento!


Posts: 187
Iscritto il: 14 Dic 07

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

__________________

Condividi contenuti