query("SELECT * FROM pics WHERE id='".intval($file)."' LIMIT 1"); if($db->get_num($query) == '0') die('Picture not found'); $data = $db->get_array($query); $path = "/".$data['folder']."/".($data['erotic'] == "Y" ? "adult/" : "").$data['id'].".jpg"; if($data['erotic'] == "Y") { include "adult_view_top.tpl"; } elseif($data['accept'] != "Y") { include "mod_view_top.tpl"; } else { include "view_top.tpl"; } ?>