diff --git a/scripts/stats.php b/scripts/stats.php
index 2eeea57..78f0988 100644
--- a/scripts/stats.php
+++ b/scripts/stats.php
@@ -151,7 +151,7 @@ function setModalText(iter, title, text, authorlink) {
fetchArray(SQLITE3_ASSOC)){
$count = $results['COUNT(*)'];
$maxconf = round((float)round($results['MAX(Confidence)'],2) * 100 ) . '%';
@@ -164,13 +164,15 @@ while($results=$result3->fetchArray(SQLITE3_ASSOC)){
$comname = preg_replace('/\'/', '', $comname);
$linkname = preg_replace('/_/', '+', $dbsciname);
$filename = "/By_Date/".$date."/".$comname."/".$results['File_Name'];
+ $engname = get_com_en_name($results['Sci_Name']);
+ $engname_url = str_replace("'", '', str_replace(' ', '_', $engname));
echo str_pad("
$species
@@ -180,11 +182,8 @@ while($results=$result3->fetchArray(SQLITE3_ASSOC)){
ob_flush();
flush();
- $config = get_config();
if (! empty($config["FLICKR_API_KEY"])) {
- $engname = get_com_en_name($results['Sci_Name']);
-
$flickrjson = json_decode(file_get_contents("https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=".$config["FLICKR_API_KEY"]."&text=\"".str_replace(' ', '%20', $engname)."\"&license=2%2C3%2C4%2C5%2C6%2C9&sort=relevance&per_page=15&format=json&nojsoncallback=1"), true)["photos"]["photo"];
foreach ($flickrjson as $val) {
diff --git a/scripts/todays_detections.php b/scripts/todays_detections.php
index d62290d..c819e4b 100644
--- a/scripts/todays_detections.php
+++ b/scripts/todays_detections.php
@@ -195,6 +195,8 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {
$filename = "/By_Date/".date('Y-m-d')."/".$comname."/".$todaytable['File_Name'];
$filename_formatted = $todaytable['Date']."/".$comname."/".$todaytable['File_Name'];
$sciname = preg_replace('/ /', '_', $todaytable['Sci_Name']);
+ $engname = get_com_en_name($todaytable['Sci_Name']);
+ $engname_url = str_replace("'", '', str_replace(' ', '_', $engname));
if (!empty($config["FLICKR_API_KEY"]) && (isset($_GET['display_limit']) || isset($_GET['hard_limit']) || $_GET['kiosk'] == true) ) {
if ($flickr === null) {
@@ -230,7 +232,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {
- 
+ 
Confidence:
@@ -246,7 +248,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {