TBDev Forum
Programming board
Main Page Forum Rules Privacy Policy Members Contact Us
Welcome Guest (Login | Register)
TBDev Forum TBDev.net - Help General Support Stats Update
Page 1 2

Stats Update

2006-10-06 01:30:00
Group: Member
Posts: 119
Topics participated: 58
Topics started: 7
First post: 2006-10-04 07:41:00
Last post: 2008-02-16 09:29:00
$sql = 'SELECT value_u FROM avps WHERE arg="seeders"';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$seeders = 0 + $row[0];

$sql = 'SELECT value_u FROM avps WHERE arg="leechers"';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

$leechers = 0 + $row[0];
if ($leechers == 0)
$ratio = 0;
else
$ratio = round($seeders / $leechers * 100);
$peers = number_format($seeders + $leechers);
$seeders = number_format($seeders);
$leechers = number_format($leechers);


The problem is that the statistic remain at 0

Peers 0
Seeders 0
Leechers 0
Seeder/leecher ratio (%) 0

And the cleanup doesnt work...

I think that the problem is in the avps in the database, but i dont know how fix it...

lastcleantime 0 0000-00-00 00:00:00 0 1141860540
last24 0 0000-00-00 00:00:00 7 1141558217

arg last24 last24record value_s value_i value_u
 
2006-10-06 14:45:00
Group: Member
Posts: 119
Topics participated: 58
Topics started: 7
First post: 2006-10-04 07:41:00
Last post: 2008-02-16 09:29:00
I've set to 0 the lastcleantime, but doesn't update... :(
 
2006-10-26 16:09:00
Group: Member
Posts: 162
Topics participated: 60
Topics started: 21
First post: 2006-07-13 00:35:00
Last post: 2007-07-30 00:38:00
$registered = number_format(get_row_count("users"));
//$unverified = number_format(get_row_count("users", "WHERE status='pending'"));
$torrents = number_format(get_row_count("torrents"));
//$dead = number_format(get_row_count("torrents", "WHERE visible='no'"));
$seeders = get_row_count("peers", "WHERE seeder='yes'");
$leechers = get_row_count("peers", "WHERE seeder='no'");
$result = mysql_query("SELECT SUM(downloaded) AS totaldl, SUM(uploaded) AS totalul FROM users") or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_assoc($result);
$totaldownloaded = mksize($row["totaldl"]);
$totaluploaded = mksize($row["totalul"]);
$seeders = $seeders;
$leechers = $leechers;
$seeders = number_format($seeders);
$leechers = number_format($leechers);
$peers = number_format($leechers + $seeders);
if ($seeders == "0") { $ratio = "0"; }
elseif ($leechers == "0") { $ratio = "0"; }
else {
$ratio = round($seeders / $leechers * 100);
}
 
2006-10-26 18:56:00
Group: Member
Posts: 301
Topics participated: 203
Topics started: 5
First post: 2006-03-05 19:53:00
Last post: 2008-04-15 01:36:00
Get a recent copy of the source and check your cleanup function in include/bittorrent against it. Also check your AVPS table against the sql pattern.

Do NOT simply bypass the stats part of it. If cleanup doesn't work, you will have major db problems shortly.

Bernard

edit, afterthought : Don't forget that someone has to browse the site to activate the cleanup. Simply waiting for it accomplishes nothing.
 
2006-10-26 20:07:00
Group: Member
Posts: 119
Topics participated: 58
Topics started: 7
First post: 2006-10-04 07:41:00
Last post: 2008-02-16 09:29:00
"Fatal error: SQL ERROR [ mysql ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '028 WHERE arg='leechers'' at line 1 [1064]

CALLING PAGE

/to/docleanup.php&

SQL

UPDATE avps SET value_u=1,028 WHERE arg='leechers'
in /usr/local/www/data-dist/to/include/db/dbal.php on line 107"


I have this when i run docleanup.php
 
2006-10-26 20:24:00
Group: Member
Posts: 301
Topics participated: 203
Topics started: 5
First post: 2006-03-05 19:53:00
Last post: 2008-04-15 01:36:00
Then your problems are solved. The table wants an integer for its value. Commas aren't integers. Get rid of it.

Bernard
 
2006-10-26 20:26:00
Group: Member
Posts: 119
Topics participated: 58
Topics started: 7
First post: 2006-10-04 07:41:00
Last post: 2008-02-16 09:29:00
can you explain what i have to do :)

(im italian and i don't understand very well)
 
2006-10-26 20:42:00
Group: Member
Posts: 301
Topics participated: 203
Topics started: 5
First post: 2006-03-05 19:53:00
Last post: 2008-04-15 01:36:00
It tells you the line and script that generates that number. Follow it back and see why it adds the comma. I do not recognize it by name or location and do know what source you are using so I can't help with that.

Expect to have similar problems with the seeders number.

Bernard

edit, additional info : In the base TB source you will find
 
2006-11-30 09:18:00
Group: Member
Posts: 38
Topics participated: 22
Topics started: 12
First post: 2006-11-04 17:19:00
Last post: 2008-06-07 18:15:00
Hmm..the only table I have in avps is lastcleantime.

value_s : nothing
Value_i: 0
value_U: 113342356

i am having the same problems as above but when I run docleanup.php I get that it is done. but still no updated stats.

Might there be a problem if the users arent connectable??
 
2006-11-30 10:22:00
Group: Member
Posts: 2312
Topics participated: 1240
Topics started: 124
First post: 2006-02-25 21:12:00
Last post: 2009-01-03 14:56:00
You have to enable them in index.php, as by default stats are disabled. Search the forum for resolution
 

Similar threads

Topic Posts Last post
UL/DL stats wont update.. 1 2008-06-28 06:37:00
Main Page Stats Do Not Update. 7 2006-10-16 06:57:00
browser stats and user stats next to each other 4 2007-11-20 21:19:00
Update help 2 2008-04-02 16:49:00
Update in: 1 2008-07-16 21:02:00