diff options
Diffstat (limited to 'frontends/php/include/items.inc.php')
| -rw-r--r-- | frontends/php/include/items.inc.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php index 49b7dd16..fc07cca6 100644 --- a/frontends/php/include/items.inc.php +++ b/frontends/php/include/items.inc.php @@ -1091,19 +1091,19 @@ COpt::profiling_stop('prepare table'); { if($db_item["value_type"] == ITEM_VALUE_TYPE_LOG) { - $row=DBfetch(DBselect("select max(id) as max from history_log where itemid=".$db_item["itemid"])); - - if($row && !is_null($row['max'])) + $row=DBfetch(DBselect("select value from history_log where itemid=".$db_item["itemid"]." order by id desc", 1)); + if($row) { - $row2=DBfetch(DBselect("select value from history_log where id=".$row["max"])); - $lastvalue=nbsp(htmlspecialchars(substr($row2["value"],0,20))); - if(strlen($db_item["lastvalue"]) > 20) - $lastvalue .= " ..."; + $lastvalue=/*nbsp(htmlspecialchars(*/$row["value"]/*))*/; + if(utf8_strlen($lastvalue) > 20) + $lastvalue = utf8_strtop($lastvalue,20)." ..."; + $lastvalue = nbsp(htmlspecialchars($lastvalue)); } else { $lastvalue="-"; } + } else if(isset($db_item["lastvalue"])) { |
