NewTorrent = $NewTorrent; $this->Torrent = $Torrent; $this->Error = $Error; $this->UploadForm = $UploadForm; $this->Categories = $Categories; $this->TorrentID = $TorrentID; # Platforms # See classes/config.php $this->SeqPlatforms = $SeqPlatforms; $this->GraphPlatforms = $GraphPlatforms; $this->ImgPlatforms = $ImgPlatforms; $this->DocPlatforms = $DocPlatforms; $this->RawPlatforms = $RawPlatforms; # Formats # See classes/config.php $this->SeqFormats = $SeqFormats; $this->ProtFormats = $ProtFormats; $this->GraphXmlFormats = $GraphXmlFormats; $this->GraphTxtFormats = $GraphTxtFormats; $this->ImgFormats = $ImgFormats; $this->MapVectorFormats = $MapVectorFormats; $this->MapRasterFormats = $MapRasterFormats; $this->BinDocFormats = $BinDocFormats; $this->CpuGenFormats = $CpuGenFormats; $this->PlainFormats = $PlainFormats; # Misc $this->Codecs = $Codecs; $this->Archives = $Archives; $this->Resolutions = $Resolutions; # Quick constructor test if ($this->Torrent && $this->Torrent['GroupID']) { $this->Disabled = ' readonly="readonly"'; $this->DisabledFlag = true; } } /** * ======================== * = New functional class = * ======================== * * Contains functions that output discreet torrent form fields. * Useful for = echoing in skeleton tables in the sections. */ /** * Upload notice * * Broken into multiple NewTorrent tests for sanity. * Each if statement should contain one discreet content block. */ public function uploadNotice() { if ($this->NewTorrent) { $Twig = Twig::go(); echo $Twig->render('torrent_form/upload_notice.html'); } # fi NewTorrent } /** * Announce URLs * * Announce URLs displayed on the form. * They're added to torrents in torrentsdl.class.php. * Bio Gazelle supports tiered swarms, T1 private and T2 public. */ public function announceSource() { if ($this->NewTorrent) { $HTML = '
HTML; } /** * Source (randomize infohash) */ $TorrentSource = Users::get_upload_sources()[0]; $HTML .= << Source HTML; $HTML .= ''; } # fi NewTorrent return $HTML; } /** * Display torrent upload errors */ public function error() { if ($this->NewTorrent) { if ($this->Error) { echo <<$this->Error
HTML; } } # fi NewTorrent } /** * head * * Everything until the catalogue number field. * Server-side torrent scrubbing admonishment. */ public function head() { $ENV = ENV::go(); G::$DB->query( " SELECT COUNT(`ID`) FROM `torrents` WHERE `UserID` = ".G::$LoggedUser['ID'] ); list($Uploads) = G::$DB->next_record(); # Torrent form hidden values $AuthKey = G::$LoggedUser['AuthKey']; $HTML = << HTML; if (!$this->NewTorrent) { # Edit form hidden fields $TorrentID = display_str($this->TorrentID); $CategoryID = display_str($this->Torrent['CategoryID'] - 1); $HTML .= <<