Der Teil aus der ref.php:
PHP-Code:
$refs = db_query ('SELECT u.nickname, COUNT(w.werber) AS total FROM '.$db_prefix.'_werberdaten w LEFT JOIN '.$db_prefix.'_userdaten u ON u.uid=w.werber WHERE w.werber != 0 AND w.zuordnungszeit >= '.$ralleydaten['start'].' AND w.zuordnungszeit <= '.$ralleydaten['ende'].' AND w.gesamt >= '.$ralleydaten['pro'].' GROUP BY w.werber ORDER BY total DESC LIMIT 10');
$count = 1;
while ($row = mysql_fetch_assoc($refs)) {
    $users[$count] = $row['nickname'];
    $ref[$count] = $row['total'];
    $count++;
}

head ('Platzierungen und Preise'); ?>
<div>Dieses Refralley läuft vom <b><?=date('d.m.Y H:i'$ralleydaten['start']);?></b> bis zum <b><?=date('d.m.Y H:i'$ralleydaten['ende']);?></b>.<br />
Für diese Refralley sind <b><?=number_format($ralleydaten['p1']+$ralleydaten['p2']+$ralleydaten['p3']+$ralleydaten['p4']+$ralleydaten['p5']+$ralleydaten['p6']+$ralleydaten['p7']+$ralleydaten['p8']+$ralleydaten['p9']+$ralleydaten['p10'],2,",",".").' '.$waehrung;?></b> ausgelobt und werden wie unten angezeigt auf die Plätze <b>1</b> bis <b><?=$ralleydaten['plaetze'];?></b> verteilt.</div>
<br />
<?
if ($ralleydaten['pro'] == 0) echo '<div align="center"><b>Es werden alle Refs gezählt!</b></div>';
else echo '<div align="center"><b>Es werden nur Refs gezählt ab '.number_format($ralleydaten['pro'],2,',','.').' '.$waehrung.' Refgewinn!</b></div><br />'; ?>
<br />

<br />
<center><object type="application/x-shockwave-flash" 
data="images/myprogress.swf?progress=<?=$swf_prozent;?>&amp;name=<?=$swf_name;?>&amp;status=<?=$swf_status;?>&amp;color=<?=$swf_bar_color;?>&amp;bgcolor=<?=$swf_hintergrund_color;?>&amp;bgcolor2=<?=$swf_rand_color;?>&amp;fcolor=<?=$swf_font_color;?>&amp;"
width="330" height="120">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" 
value="images/myprogress.swf?progress=<?=$swf_prozent;?>&amp;name=<?=$swf_name;?>&amp;status=<?=$swf_status;?>&amp;color=<?=$swf_bar_color;?>&amp;bgcolor=<?=$swf_hintergrund_color;?>&amp;bgcolor2=<?=$swf_rand_color;?>&amp;fcolor=<?=$swf_font_color;?>&amp;" />
<param name="quality" value="high" />
</object></center>
<br />

<table width="100%" cellpadding="1" cellspacing="1" border="0" align="center">
    <tr class="tr_head">
        <td width="50"><b>Rang</b></td>
        <td><b>User</b></td>
        <td width="100"><b>Refs</b></td>
        <td width="150"><b>möglicher Gewinn</b></td>
    </tr>
<?
for($x=1;$x<11;$x++){
    if (!isset($users[$x])) $users[$x] = 'n/a';
    if (!isset($ref[$x])) $ref[$x] = 0;
    $row = ($rp % 2 == 0) ? 0 : 1; ?>
    <tr class="tr_row<?=$row;?>">
        <td align="right"><?=$rp++;?>.&nbsp;</td>
        <td>&nbsp;<?=$users[$x];?></td>
        <td align="right"><?=$ref[$x];?>&nbsp;</td>
        <td align="right"><?=number_format($ralleydaten['p'.$x], 0).' '.$waehrung;?>&nbsp;</td>
    </tr>
<?
} ?>
Hier die SQL Tabelle:
PHP-Code:
-- Tabellenstruktur für Tabelle `vms_ralleydaten`
--

CREATE TABLE IF NOT EXISTS `vms_ralleydaten` (
  `
ralleyvarchar(50NOT NULL default '',
  `
startint(11NOT NULL default '0',
  `
endeint(11NOT NULL default '0',
  `
artvarchar(50NOT NULL default '',
  `
prodouble(10,2NOT NULL default '0.00',
  `
jackpotdouble(10,2NOT NULL default '0.00',
  `
plaetzeint(2NOT NULL default '0',
  `
p1double(10,2NOT NULL default '0.00',
  `
p2double(10,2NOT NULL default '0.00',
  `
p3double(10,2NOT NULL default '0.00',
  `
p4double(10,2NOT NULL default '0.00',
  `
p5double(10,2NOT NULL default '0.00',
  `
p6double(10,2NOT NULL default '0.00',
  `
p7double(10,2NOT NULL default '0.00',
  `
p8double(10,2NOT NULL default '0.00',
  `
p9double(10,2NOT NULL default '0.00',
  `
p10double(10,2NOT NULL default '0.00',
  
PRIMARY KEY  (`ralley`)
ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- 
Daten für Tabelle `vms_ralleydaten`
--

INSERT INTO `vms_ralleydaten` (`ralley`, `start`, `ende`, `art`, `pro`, `jackpot`, `plaetze`, `p1`, `p2`, `p3`, `p4`, `p5`, `p6`, `p7`, `p8`, `p9`, `p10`) VALUES
('refralley'12142584001230383400'statisch'0.000.003150.00500.000.000.000.000.000.000.000.000.00),
(
'aktivralley'11120472001112292000'statisch'6.000.0051000.00750.00500.00250.00100.000.000.000.000.000.00),
(
'klickralley'11045340001230764400'dynamisch'3.000.0021000000.00500.000.000.000.000.000.000.000.000.00); 
Da sind leider auch die anderen Ralleys dabei, sollte ja aber nicht srören. Hoffe ich zumindest...