Joomla.it Forum

Joomla! 1.5.x (versione con supporto terminato) => Joomla! 1.5 => : electra 01 Oct 2008, 10:52:29

: aggiornare un codice di Joonla1.0 per Joomla 1.5
: electra 01 Oct 2008, 10:52:29
Ciao a tutti,
ho un problema particolare. Avrei bisogno di utilizzare una porzione di codice fatta per Joomla 1.0 in Joomla 1.5 ma non so come correggere quelle parti che non vanno bene nella nuova versione. Spero che qualcuno mi possa aiutare e che la sezione in cui sto scrivendo il mio topik sia giusta...
Il codice è il seguente:

create view1.php
$view = "<?php \r\n".
        "// view1.php\r\n".
        "// Syntax: view1.php?id=<id>\r\n".
        "// Fred van der Schaar\r\n".
        "\$id = \$_GET['id'];\r\n".
        "// Automate\r\n".
        "define( '_VALID_MOS', 1 );\r\n".
        "require_once( '../../configuration.php' );\r\n".
        "if(\$id) {\r\n".
        "\t// connect to database, using parameters from Joomla site\r\n".
        "\t@MYSQL_CONNECT(\$mosConfig_host,\$mosConfig_user,\$mosConfig_password);\r\n".
        "\t@mysql_select_db(\$mosConfig_db);\r\n".
        "\t// run the query\r\n".
        "\t\$query = \"select image, type from jos_image where id=\$id\";\r\n".
        "\t\$result = @MYSQL_QUERY(\$query);\r\n".
        "\t// we found a record, display it\r\n".
        "\tif (\$result) {\r\n".
        "\t\t\$data = @MYSQL_RESULT(\$result,0,\"image\");\r\n".
        "\t\t\$type = @MYSQL_RESULT(\$result,0,\"type\");\r\n".
        "\t\tHeader( \"Content-type: image/\$type\");\r\n".
        "\t\tprint  \$data;\r\n".
        "\t};\r\n".
        "};\r\n".
        "?>";
$file = $mosConfig_absolute_path."/components/com_facileforms/view1.php";
if ( !file_exists($file)){
   $handle = fopen ($file, 'w'); // Let's open for write
   fputs($handle, $view);
   fclose($handle);


Grazie mille.