Autor stefan
Datum 05.07.2007 16:41
Beiträge: Naja versuch es doch mal damit

<?php

     global $opnConfig;

     $var_datas = array();
     $var_datas['opnConfig'] =array();

     $var_datas['opnConfig']['dbhost'] = 'localhost';
     $var_datas['opnConfig']['dbdriver'] = 'mysql';
     $var_datas['opnConfig']['dbcharset'] = '';
     $var_datas['opnConfig']['dbdialect'] = '';

     $var_datas['opnConfig']['dbuname'] = 'dbuname';
     $var_datas['opnConfig']['dbpass'] = 'dbpass';
     $var_datas['opnConfig']['dbname'] = 'dbname';

     $var_datas['opnConfig']['tableprefix'] = $opnConfig['tableprefix'];

     dbconnect($var_datas['opnConfig'], false, true);

     $sql = 'SELECT thumb_path, desc FROM pictures ORDER BY rand()';;
     $result = &$var_datas['opnConfig']['database']->SelectLimit ($sql,1);
     if ($result !== false) {
          while (! $result->EOF) {
               $thumb_path = $result->fields['thumb_path'];
               $desc = $result->fields['desc'];

               echo '<div align="center"><img src="http://www.domain.de/verzeichnis/fotos/'.$thumb_path.'" width="70%" alt="'.$desc.'"></div>';
               $result->MoveNext();
          }
          $result->close();
     }

?>


Diese Seite drucken
Diese Seite schließen

Dieser Artikel kommt von: OpenPHPNuke - das Open Source CMS

http://www.openphpnuke.info/