Hejsa, jeg har lidt problemer med at få en tæller til at virke, på http://www.hitter.dk den har virket, og jeg ved ikke om det er en port eller Apache der laver noget ged i den.
Er der nogen som kan hjælpe med at få den til at virke,
evt. gerne mod betaling.
<a href="http://www.hitter.dk/list.php?c=67&s=501"><img src="http://www.hitter.dk/image.php?id=7"></a>
list.php
<?
require_once("conn.php");
require_once("includes.php");
include_once("template/header.php");
//get the category/subcategory info
$q1 = "select * from counter_categories where CategoryID = '$_GET[c]' ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);
$CategoryName = $a1[CategoryName];
$q2 = "select * from counter_subcategories where SubcategoryID = '$_GET[s]' ";
$r2 = mysql_query($q2) or die(mysql_error());
$a2 = mysql_fetch_array($r2);
$SubcategoryName = $a2[SubcategoryName];
//get the rank
$t1 = mktime(0,0,0,date(m),date(d),date(Y));
$t2 = mktime(23,59,59,date(m),date(d),date(Y));
$q3 = "select SiteID, count(ip) as votes from counter_stats where SubcategoryID = '$_GET[s]' and sTime between '$t1' and '$t2' group by SiteID order by votes desc ";
$r3 = mysql_query($q3) or die(mysql_error());
if(mysql_num_rows($r3) == '0')
{
include("template/NoResults.php");
}
else
{
$col = "white";
while($a3 = mysql_fetch_array($r3))
{
if($col == "white")
{
$col = "dddddd";
}
else
{
$col = "white";
}
$i = $i + 1;
if($i == '1')
{
$hits = "100.00";
$votes2 = $a3[votes];
}
else
{
if($votes2 == '0')
{
$votes2 = '1';
}
$hits = number_format(($a3[votes]/$votes2)*100, 2, ".", "");
}
$q4 = "select * from counter_info where SiteID = '$a3[SiteID]' ";
$r4 = mysql_query($q4) or die(mysql_error());
$a4 = mysql_fetch_array($r4);
$rows .= "<tr bgcolor=$col>\\n\\t<td width=50 height=50 align=center valign=middle><font face=arial size=5><b>$i</b></font></td>\\n\\t<td width=600 valign=top class=BlackText><a class=BlueLinks href=\\"$a4[SiteURL]\\" target=_blank>$a4[SiteTitle]</a><br>$a4[SiteDescription]</td>\\n\\t<td class=SmallText width=80 height=50 align=center valign=middle>Hits: $hits%<br><br><a class=BlueLinks href=\\"javascript:StatsWin('details.php?c=$_GET[c]&s=$_GET[s]&id=$a3[SiteID]');\\">details</a></td>\\n</tr>\\n";
}
include_once("template/ListTemplate.php");
}
include_once("template/footer.php");
?>
image.php
<?
Header("Content-type: image/png");
//image dimentions
$width = "150";
$height = "31";
$img = ImageCreate($width,$height);
require("conn.php");
//get the site info
$q1 = "select * from counter_info where SiteID = '$_GET[id]' ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);
$t = time();
//count this visit
$q1 = "insert into counter_stats set
SiteID = '$_GET[id]',
CategoryID = '$a1[CategoryID]',
SubcategoryID = '$a1[SubcategoryID]',
ip = '$_SERVER[REMOTE_ADDR]',
sTime = '$t' ";
mysql_query($q1) or die(mysql_error());
//get the subcategory name
$q2 = "select SubcategoryName from counter_subcategories where SubcategoryID = '$a1[SubcategoryID]' ";
$r2 = mysql_query($q2) or die(mysql_error());
$a2 = mysql_fetch_array($r2);
//get the rank
$t1 = mktime(0,0,0,date(m),date(d),date(Y));
$t2 = mktime(23,59,59,date(m),date(d),date(Y));
$q3 = "select SiteID, count(ip) as votes from counter_stats where SubcategoryID = '$a1[SubcategoryID]' and sTime between '$t1' and '$t2' group by SiteID order by votes desc ";
$r3 = mysql_query($q3) or die(mysql_error());
while($a3 = mysql_fetch_array($r3))
{
$NewArray[] = $a3[SiteID];
}
if(!empty($NewArray))
{
$NewRank = array_flip($NewArray);
$id = $_GET[id];
$MyRank = ($NewRank[$id] +1);
}
$bgColor = ImageColorAllocate($img, 0x2c,0x6D,0xAF); // blue
$BlackText = ImageColorAllocate($img, 0,0,0); // black
$WhiteText = ImageColorAllocate($img, 255,255,255); //left upper corner
imagestring($img, 3, 1, 0, $a2[0], $WhiteText);
imagestring($img, 7, 3, 14, $MyRank, $WhiteText);
imagestring($img, 7, 25, 14, "Top100", $BlackText);
ImagePng($img);
imagecreatefrompng($img);
ImageDestroy($img);
?>