From 7cd9b13e195f03ca651d8f91bd33060e90fa7b5b Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 24 Jun 2014 15:23:03 +0000 Subject: [PATCH] changed the taskbar to display a user icon --- codepot/src/codepot/views/taskbar.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/codepot/src/codepot/views/taskbar.php b/codepot/src/codepot/views/taskbar.php index ee9b8928..42fdd446 100644 --- a/codepot/src/codepot/views/taskbar.php +++ b/codepot/src/codepot/views/taskbar.php @@ -10,6 +10,23 @@ function show_taskbar ($con, $login) { $title = (isset($login['email']) && $login['email'] != '')? ('title=' . htmlspecialchars($login['email'])): ''; + + // attempt to load the user icon regardless of its upload state. + // if it has not been uploaded, it won't be found. + // check a file system may be faster than checking the database. + $icon_src = ''; + $icon_path = CODEPOT_USERICON_DIR . '/' . $login['id'] . '.png'; + $icon_image = file_get_contents($icon_path); + if ($icon_image) + { + $icon_src = sprintf ( + '', + mime_content_type($icon_path), + base64_encode($icon_image) + ); + } + print $icon_src; + print anchor ('user/home', htmlspecialchars($login['id']), $title); $hex = $con->converter->AsciiToHex (current_url());