get_image_link fix
[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
6 if (!is_numeric($id)) { return 1;}
7 $img = './'.SYSTEM_IMAGES.'/nodes/'.substr($id,0,1)."/".substr($id,1,1)."/$id.gif";
8
9 if (file_exists($img)) {
10 echo SYSTEM_IMAGES.'/nodes/'.substr($id,0,1)."/".substr($id,1,1)."/$id.gif";
11 }
12 else {
13 $set = $db->query("select user_id from users where user_id = $id");
14 if ($set->getNumRows() > 0) {
15 $imglink = SYSTEM_IMAGES.'/nodes///.gif';
16 } else {
17 $imglink = SYSTEM_IMAGES.'/nodes/1/0/101.gif';
18 }
19 echo $imglink;
20 }
21 return 0;
22 }
23
24 ?>
This page took 0.25216 seconds and 4 git commands to generate.