Commit | Line | Data |
---|---|---|
35b74f20 | 1 | <?php |
2 | // Faster alternative for geting user image link | |
3 | // (no db connection) | |
4 | // this is fine for example for viewing "K", much less db requests. | |
5 | ||
6 | function smarty_function_get_image_link_fast($params,&$smarty) { | |
7 | $id = $params['id']; | |
8 | ||
9 | if (!is_numeric($id)) { $id=0;} | |
10 | $img = './'.SYSTEM_IMAGES.'/nodes/'.substr($id,0,1)."/".substr($id,1,1)."/$id.gif"; | |
11 | ||
12 | if (file_exists($img)) { echo "$img"; } | |
13 | else { echo SYSTEM_IMAGES.'/nodes///.gif'; } | |
14 | } | |
15 | ?> |