Moin,
ich brauche nochmal eure Hilfe. Das o.g. Script ist jetzt ein wenig erweitert und bisher kam ich auch immer zum gewünschten Ergebnis. Nun komm ich aber mal wieder nicht weiter.
Wenn man über einen Link fährt soll ein Bild per Mouseover aufgehen. Im Original siehts so aus:
http://www.winner-team-joiner.de/server/modules/maprank2time/
Wie man sieht gehts. Das ist der entsprechende Code:
<?
include("includes/dbinfo.inc.php");
#################################################################
######## server ip:port für die timelimit berechnung ############
#################################################################
$server_ip="85.14.221.195:27015";
#################################################################
$img_width=320;
$img_height=240;
$img_dir="./images";
$img_bgcolor="#202020";
$img_bordercolor="#eeeeee";
$order=$_GET["order"];
$sort=$_GET["sort"];
if($sort=="DESC") {
$sort="ASC";
} else {
$sort="DESC";
}
if($order=="good") {
$order="(good/total)*100";
} else if($order=="okay") {
$order="(okay/total)*100";
} else if($order=="bad") {
$order="(bad/total)*100";
} else if($order=="tl") {
$order="(good/total)-(bad/total)";
} else if($order==""){
$order="total";
}
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM maprank_data WHERE ip='".$server_ip."'; ";
$result=mysql_query($query);
$row = mysql_fetch_row($result);
$mp_timelimit=$row[1];
$min_votes=$row[2];
$max_time_offset=$row[3];
$min_timelimit=$row[4];
$vote_mode=$row[5];
$query="SELECT * FROM `maprank` ORDER BY ".$order." ".$sort." ";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<BODY BGCOLOR="#000000" TEXT="#eeeeee" LINK="#99CCFF" VLINK="#99CCFF" ALINK="#99CCFF" leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 marginheight=0 marginwidth=0>
<script type="text/javascript" src="includes/wz_tooltip.js"></script>
<b><br>
<?
echo "<center><font size=+2 color='#eeeeee'>Map Bewertungen: <a href='hlsw://".$server_ip."/'>".$server_ip."</a><font size=-2></center></b>
<br>
<center><b><font size=2 color='#a0a0a0'>Bewertungen werden im Spiel abgegeben<font size=0></b></center>
<br>
<center><b><font size=2 color='#a0a0a0'>Maps mit weniger als ".$min_votes." Votes laufen ".$mp_timelimit." min<font size=0></b></center>
<br>";
?>
<div align="center">
<table border="2" cellspacing="2" cellpadding="2" width="100%">
<tr>
<?
echo "<th style='align=center;background-color=#800000'><a href='".$home_site."index.php?order=map_name&sort=".$sort."'><font size=+1>Map Name</font></a></th>
<th style='align=center;background-color=#800000'><a href='".$home_site."index.php?order=good&sort=".$sort."'><font size=+1>Gut</font></a></a></th>
<th style='align=center;background-color=#800000'><a href='".$home_site."index.php?order=okay&sort=".$sort."'><font size=+1>Okay</font></a></th>
<th style='align=center;background-color=#800000'><a href='".$home_site."index.php?order=bad&sort=".$sort."'><font size=+1>Schlecht</font></a></th>
<th style='align=center;background-color=#800000'><a href='".$home_site."index.php?order=total&sort=".$sort."'><font size=+1>Votes</font></a></th>
<th style='align=center;background-color=#800000'><a href='".$home_site."index.php?order=tl&sort=".$sort."'><font size=+1>Timelimit</font></a></th>
</tr>";
$i=0;
while ($i < $num) {
$map_name=mysql_result($result,$i,"map_name");
$state1=mysql_result($result,$i,"good");
$state2=mysql_result($result,$i,"okay");
$state3=mysql_result($result,$i,"bad");
$total=($state1 + $state2 + $state3);
if ($total==0){
$state1p=0;
}else{
$state1p=round($state1 / $total,2)*100;
}
if ($total==0){
$state2p=0;
}else{
$state2p=round($state2 / $total,2)*100;
}
if ($total==0){
$state3p=0;
}else{
$state3p=round($state3 / $total,2)*100;
}
$color="a0a020";
if (($state1p > $state2p) & ($state1p > $state3p)){
$color="208020";
}
if (($state3p >= $state2p) & ($state3p > $state1p)){
$color="802020";
}
if($vote_mode==1) {
$f_factor=($state1p-$state3p);
} else {
$f_factor=((($state1p*3)+($state2p*2)+$state3p) / 3);
}
$timelimit=round($mp_timelimit+(($f_factor/100)*$max_time_offset));
if($timelimit<10) {
$timelimit=$min_timelimit;
}
if($total<$min_votes) {
$timelimit=$mp_timelimit;
}
if (file_exists($img_dir."/".$map_name.".jpg")) {
$image=$map_name;
} else {
$image="noimage";
}
echo "<tr>
<td align='center'><font color='".$color."'>
<a onmouseover=\"Tip('<img src=\'".$img_dir."/../../../../modules/My_eGallery/gallery/cstrike/".$image.".jpg\' width=\'".$img_width."\' height=\'".$img_height."\'><br><table align=\'center\'>".$map_name."</table>',BGCOLOR,'".$img_bgcolor."',BORDERCOLOR,'".$img_bordercolor."',FONTCOLOR,'#eeeeee')\">".$map_name."</a></font></td>
<td align='center'><font color='a0a0a0'>".$state1p."%</font></td>
<td align='center'><font color='a0a0a0'>".$state2p."%</font></td>
<td align='center'><font color='a0a0a0'>".$state3p."%</font></td>
<td align='center'><font color='a0a0a0'>".$total."</font></td>
<td align='center'><font color='a0a0a0'>".$timelimit." min</font></td>
</tr>";
++$i;
}
echo "</table>";
echo "<br><font size=1 color='#a0a0a0'>Plugin Settings:
mp_timelimit ".$mp_timelimit." |
min_votes ".$min_votes." |
max_time_offset ".$max_time_offset." |
min_timelimit ".$min_timelimit." |
vote_mode ".$vote_mode."
<br>";
?>
Wenn ich das jetzt in einen Block einbaue funktionierts nichtmehr.
Oben steht wie üblich:
<?php
if (eregi("block-maprank.php",$_SERVER['PHP_SELF'])) { Header("Location: index.html"); die();
}
Dann habe ich
include("includes/dbinfo.inc.php");
und
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
auskommentiert. Leider funktioniert der Mouseover nun nichtmehr. Kann mir bitte jemand sagen wo ich einen Fehler mache ?