From 7b6479f4371a86352cebc11a7e5cf89975b12bb0 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 22 Jul 2017 00:13:08 -0700 Subject: [PATCH] Web: add option in gpu_desc() to show shorter version of GPU string --- html/inc/host.inc | 54 ++++++++++++++++++++--------------------- html/inc/util.inc | 2 +- html/user/show_user.php | 3 ++- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/html/inc/host.inc b/html/inc/host.inc index 516a345275..f5f6b4ea98 100644 --- a/html/inc/host.inc +++ b/html/inc/host.inc @@ -245,7 +245,7 @@ function host_nresults($host) { // Given string of the form [BOINC|vers][type|model|count|RAM|driver-vers][vbox|vers], // return a human-readable version of the GPU info // -function gpu_desc($x) { +function gpu_desc($x, $detail=true) { $descs = explode("]", $x); array_pop($descs); $str = ""; @@ -267,35 +267,35 @@ function gpu_desc($x) { $str .= $d[0]; } $str .= " ".$d[1]; - $str .= " (".$d[3].")"; - if (array_key_exists(4, $d)) { - if ($d[4] != "" && $d[4] != 0) { - // if version has no '.', assume it's in 100*maj+min form - // - if (strchr($d[4], '.')) { - $str .= " driver: ".$d[4]; - } else { - $i = (int)$d[4]; - $maj = (int)($i/100); - $min = $i%100; - $str .= sprintf(" driver: %d.%02d", $maj, $min); + if ($detail) { + $str .= " (".$d[3].")"; + if (array_key_exists(4, $d)) { + if ($d[4] != "" && $d[4] != 0) { + // if version has no '.', assume it's in 100*maj+min form + // + if (strchr($d[4], '.')) { + $str .= " driver: ".$d[4]; + } else { + $i = (int)$d[4]; + $maj = (int)($i/100); + $min = $i%100; + $str .= sprintf(" driver: %d.%02d", $maj, $min); + } + } + } + if (array_key_exists(5, $d)) { + if ($d[5] != "" && $d[5] != 0) { + if (strchr($d[5], '.')) { + $str .= " OpenCL: ".$d[5]; + } else { + $i = (int)$d[5]; + $maj = (int)($i/100); + $min = $i%100; + $str .= sprintf(" OpenCL: %d.%d", $maj, $min); + } } } } - if (array_key_exists(5, $d)) { - if ($d[5] != "" && $d[5] != 0) { - if (strchr($d[5], '.')) { - $str .= " OpenCL: ".$d[5]; - } else { - $i = (int)$d[5]; - $maj = (int)($i/100); - $min = $i%100; - $str .= sprintf(" OpenCL: %d.%d", $maj, $min); - } - } - } - - } if (!$str) $str = "---"; return $str; diff --git a/html/inc/util.inc b/html/inc/util.inc index ec5de2e7f3..2e4dea94e4 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -222,7 +222,7 @@ function page_head( $did_page_head = true; $url_base = url_base(); - $rssname = PROJECT . " RSS 2.0"; + $rssname = "RSS 2.0"; $rsslink = $url_base."rss_main.php"; if (!$caching) { diff --git a/html/user/show_user.php b/html/user/show_user.php index 2d1876271b..33fb4b19e1 100644 --- a/html/user/show_user.php +++ b/html/user/show_user.php @@ -102,7 +102,8 @@ if ($format=="xml"){ } community_links($community_links, $logged_in_user); end_table(); - echo ""; + echo ""; + end_table(); page_tail(true); }