a391aa07d0107b67bde9505be0c0ff471d2c9520
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / smarty / node_methodz / function.get_image_link.php
1 <?php
2 function smarty_function_get_image_link($params,&$smarty) {
3 global $db;
4 $id = $params['id'];
5 $img = './'.SYSTEM_IMAGES.'/nodes/'.substr($id,0,1)."/".substr($id,1,1)."/$id.gif";
6
7 if (file_exists($img)) {
8 echo SYSTEM_IMAGES.'/nodes/'.substr($id,0,1)."/".substr($id,1,1)."/$id.gif";
9 }
10 else {
11 $set = $db->query("select user_id from users where user_id = $id");
12 if ($set->getNumRows() > 0) {
13 $imglink = SYSTEM_IMAGES.'/nodes///.gif';
14 } else {
15 $imglink = SYSTEM_IMAGES.'/nodes/1/0/101.gif';
16 }
17 echo $imglink;
18 }
19 }
20
21 ?>
This page took 0.301047 seconds and 3 git commands to generate.