Visualizzazione dei risultati da 1 a 8 su 8
  1. #1

    [PHP] problema con uno script (enthusiastic 3)

    Salve a tutti,
    sto provando da ormai ben tre giorni ad installare uno script per la gestione di fanlistings (banali liste di utenti fan di qualcosa :P) ma senza un grande risultato.

    Script in questione: http://scripts.indisguise.org/ (Enthusiastic 3)

    L'ho scaricato, messo sul mio server nel percorso: public_html/psn/enth3, ho settato tutti i parametri nel file config.php che si trova nella cartella public_html/psn (è quindi un file esterno alla cartella enth3), per l'appunto, ed ho accertato che comunque non ci sono problemi nei valori dati per la configurazione. Si richiedevano infatti i seguenti parametri:

    ****************
    These are the variables for your listing collective.
    $db_server - database server, usually localhost
    $db_user - username for your database
    $db_password - password for your database
    $db_database - actual database name
    *****************

    e fin qui non dovrebbero esserci intoppi.
    Sicché, dopo aver acceduto al file install.php (che si trova in public_html/psn/enth3) si è verificato il seguente -inspiegabile, almeno per me- problema:

    *****************
    Error executing query: Table 'xxxx_fanlistings.settings' doesn't exist; Query is: SELECT `value` FROM `settings` WHERE `setting` = "installation_path"
    *****************

    (ove ovviamente le "xxxx" del percorso sono di censura del nome del mio server :P ).
    La table "settings" è quella che TEORICAMENTE dovrebbe essere generata (così come le altre indicate nel config.php, e così come è sempre accaduto ogni volta che installavo versioni precedenti di questo script in php) dallo script stesso. Ma sembra che in tal caso non sia accaduto, considerando che non riesce a trovarla. Ho provato a cancellare e a ricreare il database sul mio server, ma non ha sortito nessun risultato apprezzabile -.-
    Ho letto anche i commenti che ci sono proprio nella pagina http://scripts.indisguise.org/ (che è quella da cui ho scaricato il "full zip" aggiornato rispetto alle ultime versioni. Ben inteso comunque che io non dovevo aggiornare rispetto a nessuna versione precedente, dato che le precedenti versioni, appunto, le avevo cancellate dal mio server molto tempo fa a causa di un episodio di hackeraggio... Quindi diciamo che quanto meno non ho avuto i milioni di problemi, relativi all'update, che hanno avuto invece altri utenti...) ma sarà un po' colpa dell'inglese e un po' colpa del fatto che di php me ne intendo abbastanza relativamente... che non ho assolutamente capito -semmai sia poi stato spiegato- come risolvere questo problema.

    E insomma: qualcuno sa darmi una mano per capire cosa cappero non quadra? Sono disperata e sfinita....
    Grazie in anticipo!
    I'm going under (going under)
    Drowning in you (drowning in you)
    I'm falling forever (falling forever)
    I've got to break through
    I'm going under

    { GOING UNDER - Evanescence }

  2. #2
    Semplicemente ti dice che la tabella in questione (dove lui cerca di eseguire la query di seguito riportata) non esiste. Sicuro non la debba creare tu?

  3. #3
    Sicurissima, perché questo script è stato creato appositamente per chi non è esperto, e aiutarlo a gestire quindi le fanlistings... Non saprei assolutamente, del resto, come creare tabelle all'interno del database, né tanto meno quanti campi assegnargli, ecc...
    I'm going under (going under)
    Drowning in you (drowning in you)
    I'm falling forever (falling forever)
    I've got to break through
    I'm going under

    { GOING UNDER - Evanescence }

  4. #4
    Io andrei a vedere in mySql a cosa corrisponde la tabella fanlistings.settings

  5. #5
    Banalmente: non esiste O_ò Ci avevo già visto, e non l'ha proprio per niente creata.
    I'm going under (going under)
    Drowning in you (drowning in you)
    I'm falling forever (falling forever)
    I've got to break through
    I'm going under

    { GOING UNDER - Evanescence }

  6. #6
    Prova a guardare in install.php la riga che crea la tabella, magari facendo una ricerchina veloce...

  7. #7
    Dunque, la riga è questa:

    // create settings table
    $query = "CREATE TABLE `$db_settings` (" .
    '`setting` varchar(255) NOT NULL default \'\',' .
    '`title` varchar(255) NOT NULL default \'\',' .
    '`value` text NOT NULL,' .
    '`help` text NOT NULL,' .
    'PRIMARY KEY (`setting`)' .
    ') TYPE=MyISAM';
    $success = mysql_query( $query ) or die( '<p class="error">Error ' .
    'executing query: ' . mysql_error() . '; ' . $query . '</p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
    $query . '</p>';
    almeno principalmente, presumo. La parte successiva è questa:

    // populate settings table, templates first
    $query = "INSERT INTO `$db_settings` VALUES ('affiliates_template', " .
    "'Collective affiliates template', '<a href=\"enth3-url\"><img " .
    "src=\"enth3-image\" width=\"enth3-width\" height=\"enth3-height\" " .
    "border=\"0\" alt=\" enth3-title\" /></a> ', 'Template for showing " .
    "collective affiliates.')";
    $success = mysql_query( $query ) or die( '<p class="error">Error ' .
    'executing query: ' . mysql_error() . '; ' . $query . '</p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
    $query . '</p>';
    $query = "INSERT INTO `$db_settings` VALUES ( " .
    "'affiliates_template_footer', 'Affiliates template footer', '</p>', " .
    "'Text that is inserted directly after the collective affiliates are " .
    "shown.')";
    $success = mysql_query( $query ) or die( '<p class="error">Error ' .
    'executing query: ' . mysql_error() . '; ' . $query . '</p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
    $query . '</p>';
    $query = "INSERT INTO `$db_settings` VALUES ( " .
    "'affiliates_template_header', 'Affiliates template header', " .
    "'<p class=\"center\">', 'Text inserted directly before collective " .
    "affiliates are shown.')";
    $success = mysql_query( $query ) or die( '<p class="error">Error ' .
    'executing query: ' . mysql_error() . '; ' . $query . '</p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
    $query . '</p>';
    $query = "INSERT INTO `$db_settings` VALUES ('joined_template', " .
    "'Joined fanlistings template', '<a href=\"enth3-url\"><img " .
    "src=\"enth3-image\" width=\"enth3-width\" height=\"enth3-height\" " .
    "border=\"0\" alt=\" enth3-subject: enth3-desc\" /></a> ', " .
    "'Template for showing joined fanlistings.')";
    $success = mysql_query( $query ) or die( '<p class="error">Error ' .
    'executing query: ' . mysql_error() . '; ' . $query . '</p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
    $query . '</p>';
    $query = "INSERT INTO `$db_settings` VALUES ('joined_template_footer', " .
    "'Joined template footer', '</p>', 'Text that is inserted directly " .
    "after the joined listings are shown.')";
    $success = mysql_query( $query ) or die( '<p class="error">Error ' .
    'executing query: ' . mysql_error() . '; ' . $query . '</p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
    $query . '</p>';
    $query = "INSERT INTO `$db_settings` VALUES ('joined_template_header', " .
    "'Joined template header', '<p class=\"center\">', " .
    "'Text inserted directly before joined listings are shown.')";
    $success = mysql_query( $query ) or die( '<p class="error">Error ' .
    'executing query: ' . mysql_error() . '; ' . $query . '</p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
    $query . '</p>';
    $query = "INSERT INTO `$db_settings` VALUES ('owned_template', " .
    "'Owned fanlistings template', '<p class=\"center\"><a " .
    "href=\"enth3-url\"><img src=\"enth3-image\" width=\"enth3-width\" " .
    "height=\"enth3-height\" border=\"0\" alt=\" enth3-title\" " .
    "/></a>
    \r\nenth3-title: enth3-subject
    \r\n<a " .
    "href=\"enth3-url\">enth3-url</a>

    \r\nenth3-desc</p>', " .
    "'Template for showing owned fanlistings.')";
    $success = mysql_query( $query ) or die( '<p class="error">Error ' .
    'executing query: ' . mysql_error() . '; ' . $query . '</p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
    $query . '</p>';
    $query = "INSERT INTO `$db_settings` VALUES ('owned_template_footer', " .
    "'Owned template footer', '</p>', 'owned listings are shown.')";
    $success = mysql_query( $query ) or die( '<p class="error">Error ' .
    'executing query: ' . mysql_error() . '; ' . $query . '</p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
    $query . '</p>';
    $query = "INSERT INTO `$db_settings` VALUES ('owned_template_header', " .
    "'Owned template header', '<p class=\"center\">', 'Text inserted " .
    "directly before owned listings are shown.')";
    $success = mysql_query( $query ) or die( '<p class="error">Error ' .
    'executing query: ' . mysql_error() . '; ' . $query . '</p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' . mysql_error() . ' ' .
    $query . '</p>';

    foreach( $_POST as $field => $value ) {
    if( $field != 'install' && $field != 'passwordv' &&
    $field != 'login_password' ) {
    $title = '';
    $help = '';
    switch( $field ) {
    case 'affiliates_dir' :
    $title = 'Collective Affiliates Directory';
    $help = 'Directory where your collective affiliates images ' .
    '(if any) are stored.';
    break;
    case 'collective_title' :
    $title = 'Collective Title';
    $help = 'Your collective title.';
    break;
    case 'collective_url' :
    $title = 'Collective URL';
    $help = 'Web address of your collective.';
    break;
    case 'date_format' :
    $title = 'Date format';
    $help = 'Date format (same as PHP variables).';
    break;
    case 'installation_path' :
    $title = 'Installation Path (Absolute)';
    $help = 'Installation path (absolute path) for this ' .
    'installation of Enthusiast 3.';
    break;
    case 'joined_images_dir' :
    $title = 'Joined images directory';
    $help = 'Directory where your joined images will be stored. ' .
    'This should be an absolute path, and a trailing slash is ' .
    'important.';
    break;
    case 'link_target' :
    $title = 'Link targets';
    $help = 'Your link target (_blank, _top, _self, etc.)';
    break;
    case 'owned_images_dir';
    $title = 'Owned images directory';
    $help = 'Directory where your owned listing images will be ' .
    'stored. This should be an absolute path, and a trailing ' .
    'slash is important.';
    break;
    case 'owner_email' :
    $title = 'Your email';
    $help = 'Your email address for outgoing emails.';
    break;
    case 'owner_name' :
    $title = 'Your name';
    $help = 'Your name for outgoing emails.';
    break;
    case 'password' :
    $title = 'Password';
    $help = 'The password used to log into this installation of ' .
    'Enthusiast 3.';
    break;
    case 'per_page' :
    $title = 'Number of items per page';
    $help = 'Number of items shown per page on any given view.';
    break;
    case 'root_path_absolute' :
    $title = 'Root absolute path';
    $help = 'Absolute path of your root directory (i.e., ' .
    '/home/username/public_html/)';
    break;
    case 'root_path_web' :
    $title = 'Root web address';
    $help = 'Web address of your root directory ' .
    '(i.e.,http://yourdomain.com)';
    break;
    case 'log_errors' :
    $title = 'Log errors?';
    $help = 'Turn error logging on or off.';
    break;
    case 'mail_settings' :
    $title = 'Mail interface setting';
    $help = 'Which mail interface to use (or PHP\\\'s native ' .
    'mail() function)';
    break;
    case 'sendmail_path' :
    $title = 'Sendmail path';
    $help = 'The location of the sendmail program on the filesystem. ';
    break;
    case 'sendmail_args' :
    $title = 'Additional sendmail arguments';
    $help = 'Additional parameters to pass to the sendmail.';
    break;
    case 'smtp_host' :
    $title = 'SMTP host';
    $help = 'The SMTP server to connect to.';
    break;
    case 'smtp_port' :
    $title = 'SMTP port';
    $help = 'The port to connect to on the SMTP server.';
    break;
    case 'smtp_auth' :
    $title = 'Use SMTP authentication?';
    $help = 'Whether or not to use SMTP authentication.';
    break;
    case 'smtp_username' :
    $title = 'SMTP username';
    $help = 'The username to use for SMTP authentication.';
    break;
    case 'smtp_password' :
    $title = 'SMTP password';
    $help = 'The password to use for SMTP authentication.';
    break;
    default :
    break;
    }

    $query = "INSERT INTO `$db_settings` VALUES ('$field', " .
    "'$title', '$value', '$help')";
    if( $field == 'password' ) {
    $query = "INSERT INTO `$db_settings` VALUES ('$field', " .
    "'$title', MD5( '$value' ), '$help')";
    }
    if( $field != 'passwordv' ) {
    $success = mysql_query( $query ) or die( '<p class="error">' .
    'Error executing query: ' . mysql_error() . '; ' . $query .
    '
    </p>' );
    if( !$success )
    echo '<p class="error">Query unsuccessful: ' .
    mysql_error() . ' ' . $query . '</p>';
    }
    }
    }
    ?>
    Ahm... perdonate la lunghezza della quote, ma non sapendone troppo di php non so manco se il resto potrebbe interessare... O_ò
    Comunque: secondo voi c'è qualche porzione di codice errata...?
    I'm going under (going under)
    Drowning in you (drowning in you)
    I'm falling forever (falling forever)
    I've got to break through
    I'm going under

    { GOING UNDER - Evanescence }

  8. #8
    Credo di aver compreso una cosa, ma non saprei comunque correggere l'errore.
    Ad ogni modo: ho provato a creare la tabella SETTING da sola (attribuendo un po' a casaccio i valori, leggicchiando quindi i dati che forniva il file install.php). Ovviamente, all'atto dell'installazione, mi ha dato comunque un errore dicendomi che la tabella setting non poteva essere creata perché GIA' esisteva. Tuttavia, andando a guardare nel mio database, ho scoperto che le altre tabelle restanti erano invece state create!
    Alché ho pensato: ma forse allora se ora ricancello la tabella setting e gliela lascio creare nuovamente a lui si smuove qualcosa. Forse ho trovato una strada perversa per la soluzione!
    ...
    Ovviamente no. Eliminate la tabella setting, il file install.php mi dà nuovamente lo stesso errore: "la tabella fanlistings.setting non esiste"
    Però la mia domanda è: non è che per caso c'è qualche errore nella compilazione della SOLA parte di codice che riguarda setting, e più in particolare rispetto a una qualche istruzione condizionale? Per quel che ne so ad esempio di JAVA, può accadere che se l'istruzione principale non viene eseguita, magari quelle successive sì ( :berto: ).
    :master: vabè è solo un'ipotesi...
    Qualche idea?
    I'm going under (going under)
    Drowning in you (drowning in you)
    I'm falling forever (falling forever)
    I've got to break through
    I'm going under

    { GOING UNDER - Evanescence }

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.