Hello all,
If you use jump.cgi to a ID and later use jump.cgi to that same ID it will not be hits = hits + 1 (with same IP), no action is taken on hits. I though is this meant to be, because the same IP is used or is this a bug ?
So i followed the code in jump.cgi and watched the data database (mysqlman <--- i can suggest) and figured out that the table Build_Update and Hits_Track is used for keeping track of it and nph-build.cgi will update the counters.
In jump.cgi this code exist:
# Remove old hit tracks.
$db->do ("DELETE FROM Hits_Track WHERE TO_DAYS(NOW()) - TO_DAYS(created) > 2");
# Add this to the hit track table, and if we were able to add, then
# let's update/insert the hit total table.
$sth = $db->prepare ("SELECT 1 FROM Hits_Track WHERE LinkID = $id AND IP = '$ENV{'REMOTE_ADDR'}'");
$sth->execute();
if (! $sth->rows) {
$sth = $db->prepare ("SELECT 1 FROM Build_Update WHERE LinkID = $id");
$sth->execute();
($sth->rows) ?
$db->do ("UPDATE Build_Update SET Hits = Hits + 1 WHERE LinkID = $id") :
$db->do ("INSERT INTO Build_Update (LinkID, Hits, Votes, Rating) VALUES ($id, 1, 0, 0)");
$db->do ("INSERT INTO Hits_Track (LinkID, IP) VALUES ($id, '$ENV{'REMOTE_ADDR'}')");
}
}If you following it logical I came to the conclusion that if a IP is logged in hits_track and the ID is the same it will NOT get to the code:
$db->do ("UPDATE Build_Update SET Hits = Hits + 1 WHERE LinkID = $id") :
So no hits = hits + 1 is done.
Only if you try the same ID again after 2 days it will update again or after you used nph-build.cgi i quess!
Is this a bug or was it meant to be this way (or do i have to learn a lot about logical code ) ?
Well allready thanks.
Regards startpoint.
If you use jump.cgi to a ID and later use jump.cgi to that same ID it will not be hits = hits + 1 (with same IP), no action is taken on hits. I though is this meant to be, because the same IP is used or is this a bug ?
So i followed the code in jump.cgi and watched the data database (mysqlman <--- i can suggest) and figured out that the table Build_Update and Hits_Track is used for keeping track of it and nph-build.cgi will update the counters.
In jump.cgi this code exist:
Code:
# Remove old hit tracks.
$db->do ("DELETE FROM Hits_Track WHERE TO_DAYS(NOW()) - TO_DAYS(created) > 2");
# Add this to the hit track table, and if we were able to add, then
# let's update/insert the hit total table.
$sth = $db->prepare ("SELECT 1 FROM Hits_Track WHERE LinkID = $id AND IP = '$ENV{'REMOTE_ADDR'}'");
$sth->execute();
if (! $sth->rows) {
$sth = $db->prepare ("SELECT 1 FROM Build_Update WHERE LinkID = $id");
$sth->execute();
($sth->rows) ?
$db->do ("UPDATE Build_Update SET Hits = Hits + 1 WHERE LinkID = $id") :
$db->do ("INSERT INTO Build_Update (LinkID, Hits, Votes, Rating) VALUES ($id, 1, 0, 0)");
$db->do ("INSERT INTO Hits_Track (LinkID, IP) VALUES ($id, '$ENV{'REMOTE_ADDR'}')");
}
}
$db->do ("UPDATE Build_Update SET Hits = Hits + 1 WHERE LinkID = $id") :
So no hits = hits + 1 is done.
Only if you try the same ID again after 2 days it will update again or after you used nph-build.cgi i quess!
Is this a bug or was it meant to be this way (or do i have to learn a lot about logical code ) ?
Well allready thanks.
Regards startpoint.