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