/* INTERNAL EMAIL */ sendInternalEmail(); /* EMAIL CONFIRMATION */ sendEmailConfirmation(); /* SHOW RESPONSE */ switch ($form) { case CONTACT_FORM: include 'form_success_contact.php'; break; case DISCOVERY_FORM: $discovery = file_get_contents('form_success_discovery.php'); $discovery = str_replace('@@user@@', $user, $discovery); echo $discovery; break; case DOWNLOAD_FORM: if (!AddDownload($user, $app, $version)) { trigger_error("Failed to add download...\n"); } $download = file_get_contents('form_success_download.php'); $download = str_replace('@@user@@', $user, $download); $file = ''; if ($app == 1) { //Windows $file = '/downloads/QuikID-installer4_5_0.exe'; } else { if ($app == 2) { //Android $file = '/downloads/quikID-beta-pro-4_5_0.apk'; } } $download = str_replace('@@file@@', $file, $download);
if ($size > $mb) { $mysize = sprintf("%01.2f", $size / $mb) . " MB"; } elseif ($size >= 1024) { $mysize = sprintf("%01.2f", $size / 1024) . " Kb"; } else { $mysize = $size . " bytes"; } return $mysize; } if (isset($_POST['ratinglid']) && isset($_POST['ratinguser']) && isset($_POST['rating'])) { addrating(intval($_POST['ratinglid']), $_POST['ratinguser'], intval($_POST['rating']), $_POST['ratinghost_name'], $_POST['ratingcomments']); } $d_op = isset($_POST['d_op']) ? $_POST['d_op'] : (isset($_GET['d_op']) ? $_GET['d_op'] : ''); switch ($d_op) { case "AddDownload": AddDownload(); break; case "NewDownloads": require_once "modules/{$module_name}/new.php"; NewDownloads(); break; case "NewDownloadsDate": require_once "modules/{$module_name}/new.php"; NewDownloadsDate(); break; case "TopRated": require_once "modules/{$module_name}/top.php"; TopRated(); break; case "MostPopular": require_once "modules/{$module_name}/pop.php";
function IndexDownloadsMain() { if (isset($_GET['cat'])) { $cat = SafeEnv($_GET['cat'], 11, int); } else { $cat = 0; } if ($cat != 0) { System::site()->SetTitle('Файлы в категории ' . SafeDB(IndexDownloadsGetTree()->IdCats[$cat]['title'], 255, str)); } if (isset($_GET['page'])) { $page = SafeEnv($_GET['page'], 10, int); } else { $page = 1; } if (System::config('downloads/show_last') == '1') { IndexDownloadsGetTree()->ShowCats($cat); IndexDownloadsGetTree()->BreadCrumbs($cat); } if ($cat != 0 || System::config('downloads/show_last') == '1') { $downs = System::database()->Select('downloads', GetWhereByAccess('view', ($cat != 0 ? "`category`='{$cat}' and " : '') . "`active`='1'")); SortArray($downs, 'public', true); // Постраничная навигация $num = System::config('downloads/filesonpage'); $navigation = new Navigation($page); $nav_link = Ufu('index.php?name=downloads' . ($cat != 0 ? '&cat=' . $cat : ''), 'downloads/' . ($cat != 0 ? '{cat}/' : '') . 'page{page}/', true); $navigation->FrendlyUrl = System::config('general/ufu'); $navigation->GenNavigationMenu($downs, $num, $nav_link); if (System::database()->NumRows() > 0) { System::site()->AddTemplatedBox('', 'module/download.html'); System::site()->AddBlock('download', true, true, 'dl'); foreach ($downs as $down) { AddDownload($down); } } elseif (!isset(IndexDownloadsGetTree()->Cats[$cat]) && count(IndexDownloadsGetTree()->Cats) > 0) { System::site()->AddTextBox('', '<p align="center">В этой категории пока нет файлов.</p>'); } } }