createFile (); if ($file->downloadForbidden($this->remUser, $message) AND !$this->repository->See_Files_no_download) { echo $message; return; } if ((($file->licenseagree AND $file->license) OR trim(preg_replace('/&#?[a-z0-9]+;/i','',strip_tags($this->repository->Default_Licence)))) AND ($func == 'startdown' OR ($func == 'finishdown' AND remositoryRepository::getParam($_POST, 'agreecheck', 'off') != 'on'))) { $view = new remositoryDownloadAgreeHTML($this); $view->downloadAgreeHTML($file); return; } if ($func == 'finishdown' AND $this->repository->wrongCheck($_POST['da'],$this->idparm,'finishdown')){ echo _DOWN_LEECH_WARN; $this->remositoryHome(); exit; } $this->fileid = $file->id; $this->containerid = $file->containerid; if ($file->windowtitle) $interface->SetPageTitle($file->windowtitle); else $interface->SetPageTitle($file->filetitle); if (remositoryRepository::getParam($_POST,'submit_vote','')) { $user_rating = remositoryRepository::getParam($_POST,'user_rating',0); if (($user_rating>=1) AND ($user_rating<=5)) { if (!$file->userVoted($this->remUser)) $file->addVote($this->remUser, $user_rating); } } $newcomment = remositoryRepository::getParam($_POST,'comment'); if ($newcomment AND strlen($newcomment) >= $this->repository->Min_Comment_length AND !$file->userCommented($this->remUser)) { $thecomment = new remositoryComment(); $thecomment->setEachValue($this->remUser->id,$this->remUser->fullname,$this->remUser->name,'Review Title',$newcomment); $thecomment->saveComment($file); } if ($this->repository->Scribd AND in_array($file->filetype,explode(',', $this->repository->ExtsDisplay))) { $displaynow = remositoryRepository::getParam($_REQUEST, 'displaynow', 2); } else $displaynow = 0; $database = $interface->getDB(); // Change for multiple repositories // $database->setQuery("SELECT id FROM #__downloads_files WHERE repnum = $this->repnum AND (submitdate > '$file->submitdate' OR ('$file->submitdate' = submitdate AND id < $file->id)) ORDER BY submitdate DESC, id DESC LIMIT 1"); $database->setQuery("SELECT id FROM #__downloads_files WHERE (submitdate > '$file->submitdate' OR ('$file->submitdate' = submitdate AND id < $file->id)) ORDER BY submitdate DESC, id DESC LIMIT 1"); $next = $database->loadResult(); // Change for multiple repositories // $database->setQuery("SELECT id FROM #__downloads_files WHERE repnum = $this->repnum AND (submitdate < '$file->submitdate' OR ('$file->submitdate' = submitdate AND id > $file->id)) ORDER BY submitdate DESC, id LIMIT 1"); $database->setQuery("SELECT id FROM #__downloads_files WHERE (submitdate < '$file->submitdate' OR ('$file->submitdate' = submitdate AND id > $file->id)) ORDER BY submitdate DESC, id LIMIT 1"); $previous = $database->loadResult(); $view = new remositoryFileInfoHTML($this); $view->fileinfoHTML($file, $autodown, $displaynow, $next, $previous); // Uncomment the next two lines if using JomComment in Joomla 1.5 // require_once($interface->getCfg('absolute_path').'/plugins/content/jom_comment_bot.php'); // echo jomcomment($file->id, "com_remository"); } public function getContainerID () { return $this->containerid; } public function getFileID () { return $this->fileid; } }