Hey, I found this module on the net with no .xml and it didn't run with one... I figured it wasn't made for Mambo 4.5.1+. Well I thought this really would be a useful module so I started working on it. This is what I have so far:
Code:
<?
# Don't allow direct acces to the file
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
# Make sure you have access to core functions
global $database;
# Database Query
$query = "SELECT filesize, downloads FROM #_downloads";
$database->setQuery($query);
# Set up the counters
while($rows = $database->loadObjectList())
{
$rownum = 0;
$rownum++;
$dlsize = $row[$rownum]->filesize;
$dldowns = $row[$rownum]->downloads;
# Filecounter
$gcounter++;
# Trafficcounter
$dltransfer = $dlsize * $dldowns;
$gtransfer = $gtransfer + $dltransfer;
# Downloadscounter
$gdowns = $gdowns + $dldowns;
# Filebasesizecounter
$gsize = $gsize + $dlsize;
}
# Print the information onto the screen.
$gsize = number_format($gsize / 1048576,2,",",".");
$gtransfer = number_format($gtransfer / 1048576,2,",",".");
$content .= "<table border=0 cellspacing=0 cellpadding=1 width=100%>";
$content .= "<tr><td><strong>Files</strong></td><td align=right>$gcounter</td><tr>";
$content .= "<tr><td><strong>Downloads</strong></td><td align=right>$gdowns</td><tr>";
$content .= "<tr><td><strong>Size</strong></td><td align=right>$gsize MB</td><tr>";
$content .= "<tr><td><strong>Traffic</strong></td><td align=right>$gtransfer MB</td><tr>";
$content .= "</table>";
?> I've came a long way from when I started on the mod, but since I don't really know PHP and just using my novice skills of C++ and other PHP source code to try and figure it out I ran into a problem somewhere in between accessing the DB and getting the turning the info into transfer how many files etc. Does anyone here know what I did wrong and help me?