$array_where[] = 'catid = ' . $cat; } } $array_where[] = 'status=1'; $db->where(implode(' AND ', $array_where)); $sth = $db->prepare($db->sql()); if (!empty($key)) { $keyword = '%' . addcslashes($key, '_%') . '%'; $sth->bindParam(':keyword1', $keyword, PDO::PARAM_STR); $sth->bindParam(':keyword2', $keyword, PDO::PARAM_STR); $sth->bindParam(':keyword3', $keyword, PDO::PARAM_STR); } $sth->execute(); $num_items = $sth->fetchColumn(); if (!empty($num_items)) { $download_config = nv_mod_down_config(); $array = array(); $today = mktime(0, 0, 0, date('n'), date('j'), date('Y')); $yesterday = $today - 86400; $db->select('id, catid, title, alias, introtext , uploadtime, author_name, filesize, fileimage, view_hits, download_hits, comment_hits')->order('uploadtime DESC')->limit($per_page)->offset(($page - 1) * $per_page); $sth = $db->prepare($db->sql()); if (!empty($key)) { $keyword = '%' . addcslashes($key, '_%') . '%'; $sth->bindParam(':keyword1', $keyword, PDO::PARAM_STR); $sth->bindParam(':keyword2', $keyword, PDO::PARAM_STR); $sth->bindParam(':keyword3', $keyword, PDO::PARAM_STR); } $sth->execute(); while ($row = $sth->fetch()) { $cattitle = '<a href="' . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $list_cats[$row['catid']]['alias'] . '">' . $list_cats[$row['catid']]['title'] . '</a>'; $uploadtime = (int) $row['uploadtime'];
} else { $download_config['is_addfile_allow'] = false; } if ($download_config['is_addfile_allow'] and $download_config['is_upload']) { $download_config['is_upload_allow'] = nv_set_allow($download_config['who_upload'], $download_config['groups_upload']); } else { $download_config['is_upload_allow'] = false; } $download_config['is_autocomment_allow'] = nv_set_allow($download_config['who_autocomment'], $download_config['groups_autocomment']); return $download_config; } } global $site_mods, $module_name, $module_info, $lang_module, $nv_Request; $content = ""; $module = $block_config['module']; $mod_config = nv_mod_down_config($module); if (isset($site_mods[$module])) { if ($module == $module_name) { $lang_block_module = $lang_module; } else { $temp_lang_module = $lang_module; $lang_module = array(); include NV_ROOTDIR . "/modules/" . $site_mods[$module]['module_file'] . "/language/" . NV_LANG_INTERFACE . ".php"; $lang_block_module = $lang_module; $lang_module = $temp_lang_module; } $path = NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $site_mods[$module]['module_file']; if (!file_exists(NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $site_mods[$module]['module_file'] . '/block_upload.tpl')) { $path = NV_ROOTDIR . "/themes/default/modules/" . $site_mods[$module]['module_file']; } $xtpl = new XTemplate("block_upload.tpl", $path);