Members: 16,996
Threads: 38,866
Posts: 159,475
Online: 44

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 11.07.2005, 04:39   #1 (permalink)
Baby Mamber
 
Join Date: Jun 2005
Posts: 15
KillerJ59J is on a distinguished road
Default Dwonload Info Module (alittle help please)

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?
KillerJ59J is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 14.07.2005, 21:30   #2 (permalink)
Baby Mamber
 
Join Date: Jun 2005
Posts: 15
KillerJ59J is on a distinguished road
Default Re: Dwonload Info Module (alittle help please)

Hey, Someone please help me. I have found one error in my code, but it is still turning out to be 0 when I print it PLEASE HELP.
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
  $rownum = 0;
  while($rows = $database->loadObjectList())
  {
    $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>";

?>
KillerJ59J is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
First web camera module for mambo 4.5.1 noobnuggets Development Announcements 4 13.11.2005 11:26
module id dmso Module Development 2 26.05.2005 16:57
template Info module problem hilit Mambo 4.5 General Talk 1 31.07.2004 00:49
Author Info module v1.0-Beta Released tonyskyday Development Announcements 0 27.07.2004 05:48
New module - Info PC setup Development Announcements 4 18.06.2004 18:29


All times are GMT +2. The time now is 10:57.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.