This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ include('init.php'); $db = new dbcon(); $id = (int) $_GET['id']; $update="UPDATE `%sfiles` SET `views` = `views` +1 WHERE `id` = '$id'"; $db->query($update); //Update counter $sql = "SELECT `ratio` FROM `%sfiles` WHERE `id` = '$id'"; $db->query($sql); if (mysql_num_rows($db->result) === 0) { $id = 0; } $tempratio = mysql_fetch_row($db->result); $ratio = $tempratio['0']; // Index 0 is ratio, ref query abv. $xtpl = new XTemplate('thumb.xtpl', $tpldir); $xtpl->assign('RATIO', $ratio); $xtpl->assign('URL', $url); $xtpl->assign('SITETITLE', $lang['sitetitle']); $xtpl->assign('TPLDIR', $tpldir); $rows[1]=array('MENU_ALT' => $lang['reportimage'], 'LINK' => $basedir . 'report.php?bilde=' . $_GET[id] ); $rows[2]=array('MENU_ALT' => $lang['upload'] . ' ' . $lang['image'], 'LINK' => '/' ); $rows[3]=array('MENU_ALT' => $lang['faq'], 'LINK' => $basedir . 'faq.php' ); $rows[4]=array('MENU_ALT' => $lang['stats'], 'LINK' => $basedir . 'stats.php' ); $rows[5]=array('MENU_ALT' => $lang['myuser'], 'LINK' => $basedir . 'user.php' ); for ($i = 1; $i <= count($rows); $i++) { $xtpl->assign('TEXT', $rows[$i]); $xtpl->assign('ROW_NR', $i); $xtpl->parse('main.table.row'); } // parse the table $xtpl->parse('main.table'); $xtpl->assign('TEXT_SHOWBIGIMAGE', $lang['showbigimage']); $xtpl->assign('TEXT_CLICK2VIEWBIGGERIMAGE', $lang['click2viewbiggerimage']); if ($simpleurl) { $imgurl = "http://".$url.$basedir.'l/'.$id; } else { $imgurl = "http://".$url.$basedir.'l/'.$id.'x'.$_GET['code']; } $xtpl->assign('IMAGEURL', $imgurl); $xtpl->assign('BASEDIR', $basedir); $xtpl->assign('IMGID', $_GET[id]); include($includedir . 'gads.php'); $xtpl->parse('main'); $xtpl->out('main'); ?>