GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
Digital_Repository
Browse code
- Tidied up getMaxCount() calls.
master
1 parent
9bcada1
commit
b2357c2d38678be280c0a423350713de5fc03eee
nstanger
authored
on 1 Feb 2007
Patch
Showing
1 changed file
Repositories/statistics/includes/inc.html.cumulative_usage_country.es.php
Ignore Space
Show notes
View
Repositories/statistics/includes/inc.html.cumulative_usage_country.es.php
<h3>Abstract views and full text downloads by source</h3> <p><strong>Note:</strong> The country of origin is determined by looking up the source IP address in the <a href="http://www.maxmind.com/app/geoip_country">GeoLite Country</a> database provided by MaxMind LLC. Due to the ever-changing nature of the Internet, this database can never be 100% complete or accurate, so it is possible that a small number of downloads may be reported as being from the wrong country. Hits from automated indexers and crawlers for Internet search engines are listed separately at the <a href="#bots">bottom of the page</a>.</p> <?php /* NJS 2001-01-31 Refactored code to calculate longest bar and generate table contents into separate functions in inc.fns.cumulative_usage_country. This makes it easier to separate off hits from search engine bots and crawlers. */ $max_width=400; if (! isset($GLOBALS["db_values"]["0"]["country_downloads"])) { print "<table>\n"; print '<tr><td align="left" width="200" style="color:#ff0000;"><b>No statistics available.</b></td></tr>'; print "\n"; } else { // Output table for "real" countries. // Compute the longest bar. // NJS 2006-06-14: You never know, there may be no downloads or // abstracts yet, so make sure it's at least 1 to avoid div/0 errors. $max_count = max( getMaxCount( 'country' ), 1 ); print "<table cellspacing='0' cellpadding='4'>\n"; print "<tr><td colspan='5'><h4 style='margin-top: 0px;'>Downloads by country (derived from IP address of query)</h4></td></tr>\n"; print '<tr><td colspan="5"><span style="font-size:small;">Click on a country name or flag to view details of the eprints that have been downloaded from that country.</span></td></tr>'; print '<tr><th colspan="2" style="background-color:#cccccc;">Country</th> <th style="background-color:#66ddee;">Abstracts</th> <th style="background-color:#4477dd;color:#ffffff;">Full text</th> <th style="background-color:#cccccc;"> </th></tr>'; generateCountryTable( 'country', $max_count, $max_width ); // Output table for search engine bots/crawlers. print '<tr><td colspan="5"><a name="bots"></a>'; print "<h4>Downloads by automated indexers and crawlers</h4></td></tr>\n"; $max_count = max( getMaxCount( 'bot' ), 1 ); print '<tr><td colspan="5"><span style="font-size:small;">Click on a search engine name or icon to view details of the eprints that have been indexed by that engine.</span></td></tr>'; print '<tr><th colspan="2" style="background-color:#cccccc;">Search engine</th> <th style="background-color:#66ddee;">Abstracts</th> <th style="background-color:#4477dd;color:#ffffff;">Full text</th> <th style="background-color:#cccccc;"> </th></tr>'; generateCountryTable( 'bot', $max_count, $max_width ); print "</table>\n"; } // of else ?>
<h3>Abstract views and full text downloads by source</h3> <p><strong>Note:</strong> The country of origin is determined by looking up the source IP address in the <a href="http://www.maxmind.com/app/geoip_country">GeoLite Country</a> database provided by MaxMind LLC. Due to the ever-changing nature of the Internet, this database can never be 100% complete or accurate, so it is possible that a small number of downloads may be reported as being from the wrong country. Hits from automated indexers and crawlers for Internet search engines are listed separately at the <a href="#bots">bottom of the page</a>.</p> <?php /* NJS 2001-01-31 Refactored code to calculate longest bar and generate table contents into separate functions in inc.fns.cumulative_usage_country. This makes it easier to separate off hits from search engine bots and crawlers. */ $max_width=400; if (! isset($GLOBALS["db_values"]["0"]["country_downloads"])) { print "<table>\n"; print '<tr><td align="left" width="200" style="color:#ff0000;"><b>No statistics available.</b></td></tr>'; print "\n"; } else { // Output table for "real" countries. // Compute the longest bar. $max_count = getMaxCount( 'country' ); // NJS 2006-06-14: You never know, there may be no downloads or // abstracts yet... $max_count = max( $max_count, 1 ); print "<table cellspacing='0' cellpadding='4'>\n"; print "<tr><td colspan='5'><h4 style='margin-top: 0px;'>Downloads by country (derived from IP address of query)</h4></td></tr>\n"; print '<tr><td colspan="5"><span style="font-size:small;">Click on a country name or flag to view details of the eprints that have been downloaded from that country.</span></td></tr>'; print '<tr><th colspan="2" style="background-color:#cccccc;">Country</th> <th style="background-color:#66ddee;">Abstracts</th> <th style="background-color:#4477dd;color:#ffffff;">Full text</th> <th style="background-color:#cccccc;"> </th></tr>'; generateCountryTable( 'country', $max_count, $max_width ); // Output table for search engine bots/crawlers. print '<tr><td colspan="5"><a name="bots"></a>'; print "<h4>Downloads by automated indexers and crawlers</h4></td></tr>\n"; $max_count = getMaxCount( 'bot' ); $max_count = max( $max_count, 1 ); print '<tr><td colspan="5"><span style="font-size:small;">Click on a search engine name or icon to view details of the eprints that have been indexed by that engine.</span></td></tr>'; print '<tr><th colspan="2" style="background-color:#cccccc;">Search engine</th> <th style="background-color:#66ddee;">Abstracts</th> <th style="background-color:#4477dd;color:#ffffff;">Full text</th> <th style="background-color:#cccccc;"> </th></tr>'; generateCountryTable( 'bot', $max_count, $max_width ); print "</table>\n"; } // of else ?>
Show line notes below