ti posto il file mod_partner.php del mio sito
<?php
//Partner Sites Extended
//Copyright 2004 DesignVeteran.com & Kerry Wilson
// @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
//Original Partner Links Module Info://
// $Id: mod_partner.php,v 1.0 15/02/2004 pdg Exp $
/**
* Partner Links Module
* @Copyright (C) 2004 Globo Digital
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.0 $
**/
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
include ("administrator/components/com_partner/config.partner.php");
/**
* Parameters
**/
$orientation = @$params->orientation ? $params->orientation : 'vertical';
$query = "SELECT * FROM #__partner WHERE published='1'";
$database->setQuery($query);
$rows = $database->loadObjectList();
$partners = "";
if ($random != '1'){
foreach($rows as $row) {
if($orientation=="vertical") {
$partners .= "<table width='100%'>";
$partners .= "<tr>";
$partners .= "<td align='center'><a href='index2.php?option=com_partner&link=".$row->link."&id=".$row->id."' target='_blank'><img src='".$row->image."' border='0' alt='".$row->alt."'></a></td>";
$partners .= "</tr>";
$partners .= "<tr>";
$partners .= "<td align='center'>".$row->description."</td>";
$partners .= "<tr>";
$partners .= "</table>";
}else{
$partners .= "<table width='100%'>";
$partners .= "<tr><td align='center'><a href='index2.php?option=com_partner&link=".$row->link."&id=".$row->id."' target='_blank'><img src='".$row->image."' border='0' alt='".$row->alt."'></a></td></tr>";
$partners .= "<tr>";
$partners .= "<td align='center'>".$row->description."</td>";
$partners .= "<tr>";
$partners .= "</table>";
}
}
}else{
$query2 = "SELECT `id` FROM #__partner WHERE published='1'";
$database->setQuery($query2);
$idrows = $database->loadResultArray();
//Makes array of ids
$tempvar=0;
for ($i=0;$idrows[$i];$i++){
{$idrows1[$tempvar]=$idrows[$i];$tempvar++;}
}
//Picks a random partner from the array
srand ((double) microtime() * 10000000);
$rand_keys = array_rand ($idrows1, 2);
$pic=$idrows1[$rand_keys[0]];
//Queries for that partner record details
$queryid = "SELECT * FROM #__partner WHERE published='1' AND id=\"$pic\"";
$database->setQuery($queryid);
$rand = $database->loadObjectList();
foreach($rand as $row) {
$partners .= "<table width='100%'>";
$partners .= "<tr>";
$partners .= "<td align='center'><a href='index2.php?option=com_partner&link=".$row->link."&id=".$row->id."' target='_blank'><img src='".$row->image."' border='0' alt='".$row->alt."'></a></td>";
$partners .= "</tr>";
$partners .= "<tr>";
$partners .= "<td align='center'>".$row->description."</td>";
$partners .= "<tr>";
$partners .= "</table>";}
}
echo $partners;
?>