Commit | Line | Data |
---|---|---|
e586807d | 1 | <?php |
b42b2bf9 H |
2 | function smarty_function_get_image_link($params,&$smarty) { |
3 | global $db; | |
4 | $id = $params['id']; | |
5 | $img = SYSTEM_ROOT."/images/nodes/".substr($id,0,1)."/".substr($id,1,1)."/$id.gif"; | |
e586807d | 6 | |
b42b2bf9 | 7 | if (file_exists($img)) { |
e586807d H |
8 | echo "/images/nodes/".substr($id,0,1)."/".substr($id,1,1)."/$id.gif"; |
9 | } | |
b42b2bf9 H |
10 | else { |
11 | $set = $db->query("select user_id from users where user_id = $id"); | |
12 | if ($set->getNumRows() > 0) $imglink = "/images/nodes///.gif"; | |
13 | else $imglink = "/images/nodes/1/0/101.gif"; | |
14 | echo $imglink; | |
15 | } | |
16 | } | |
17 | ?> |