public function __construct(Dossier $dossier) { $this->setClass('dossier'); $this->addComponent(new Title($dossier->getTitle(), 2)); $author = $dossier->getAuthor(); if ($author instanceof TeamMember) { $author = $author->getPseudo(); } $timestamp = strftime("%d/%m/%Y", $dossier->getTimestamp()); $subtitle = $timestamp . " par " . $author; $this->addComponent(new Title($subtitle, 4)); $content = new SimpleBlockComponent(); $content->setClass('content'); $content->setContent(Format::convertTextToHtml($dossier->getContent())); $content->setContentPinned(true); $this->addComponent($content); $id = $dossier->getCommentID(); $comment = new SimpleTextComponent(); $comment->setClass('comment'); $comment->setContent('~ <a href="http://commentaires.zerofansub.net/t' . $id . '.htm" target="_blank">Commentaires</a> - <a href="http://commentaires.zerofansub.net/posting.php?mode=reply&t=' . $id . '" target="_blank">Ajouter un commentaire</a> ~'); $this->addComponent($comment); }
$views = new HeaderComponent(); $views->setClass("views"); $rssUrl = buildRssUrlIfAvailable(); $title = new Title(null, 2); $title->addComponent(new RssLink($rssUrl)); $title->addComponent("Vues"); $views->addComponent($title); $views->addComponent($viewsLinks); /******************************\ FILL PAGE \******************************/ $page = PageContent::getInstance(); $page->addComponent(new Title("Zéro fansub", 1)); if (TEST_MODE_ACTIVATED) { $options = new SimpleBlockComponent(); $options->setClass('testFeatures'); $options->addComponent("Options : "); $link = new Link(Url::getCurrentUrl(), "show prepared"); if ($link->getUrl()->hasQueryVar('showPrepared')) { $link->getUrl()->removeQueryVar('showPrepared'); $link->setClass('reverse'); } else { $link->getUrl()->setQueryVar('showPrepared'); } $options->addComponent($link); $link = new Link(Url::getCurrentUrl(), "show old"); if ($link->getUrl()->hasQueryVar('showOld')) { $link->getUrl()->removeQueryVar('showOld'); $link->setClass('reverse'); } else { $link->getUrl()->setQueryVar('showOld');
private function fillWithDownloadData($releaseContent, $release) { $fileList = new SimpleListComponent(); $fileList->setClass("fileList"); $ddlLinks = new GroupedLinks(new Image("images/icones/ddl.png")); $ddlLinks->setClass("ddlLinks"); $megauploadLinks = new GroupedLinks(new Image("images/icones/megaup.jpg")); $megauploadLinks->setClass("megauploadLinks"); $freeLinks = new GroupedLinks(new Image("images/icones/free.jpg")); $freeLinks->setClass("freeLinks"); $rapidShareLinks = new GroupedLinks(new Image("images/icones/rapidshare.jpg")); $rapidShareLinks->setClass("rapidShareLinks"); $mediaFireLinks = new GroupedLinks(new Image("images/icones/mediafire.jpg", "Mediafire")); $mediaFireLinks->setClass("mediaFireLinks"); $torrentLinks = new GroupedLinks(new Link($release->getTorrentUrl(), new Image("images/icones/torrent.png"))); $torrentLinks->setClass("torrentLink"); $fileDescriptors = $release->getFileDescriptors(); $index = 1; foreach ($fileDescriptors as $descriptor) { $description = new SimpleTextComponent(); $path = $descriptor->getFilePath(); $name = basename($path); if (empty($name)) { $name = Debug::createWarningTag("aucun fichier renseigné"); } $description->addLine($name); $url = "ddl/" . $path; $size = "Taille : "; try { $size .= Format::formatSize(filesize($url)); } catch (Exception $e) { $size .= Debug::createWarningTag("inconnue"); } $size .= " "; $description->addComponent($size); if ($descriptor->getCRC() !== null) { $description->addComponent("CRC : " . $descriptor->getCRC() . " "); } $id = null; if ($release->getProject()->isDoujin()) { $pages = ""; if ($descriptor->getPageNumber() != null) { $n = $descriptor->getPageNumber(); $pages = $n . " page" . ($n > 1 ? "s" : null) . " "; } $description->addComponent($pages); } else { $array = array(); if ($descriptor->getVideoCodec() !== null) { $array[] = $descriptor->getVideoCodec()->getName(); if ($id == null) { $id = $descriptor->getVideoCodec()->getName(); } } if ($descriptor->getSoundCodec() !== null) { $array[] = $descriptor->getSoundCodec()->getName(); if ($id == null) { $id = $descriptor->getSoundCodec()->getName(); } } if ($descriptor->getContainerCodec() !== null) { $array[] = $descriptor->getContainerCodec()->getName(); if ($id == null) { $id = $descriptor->getContainerCodec()->getName(); } } $codecs = ""; if (!empty($array)) { $codecs = "Codecs : " . implode(" ", $array) . " "; } $description->addComponent($codecs); } if ($descriptor->getReleaseSource() !== null) { $description->addComponent("Source : " . $descriptor->getReleaseSource() . " "); } if ($descriptor->getID() != null) { $id = $descriptor->getID(); } else { if ($id == null) { $id = $index; } } $index++; if ($descriptor->getComment() !== null) { $description->addLine(); $comment = new SimpleBlockComponent(); $comment->setClass("comment"); $comment->setContent($descriptor->getComment()); $description->addComponent($comment); } $description->addLine(); $description->addLine(); $fileList->addcomponent($description); $linkName = count($fileDescriptors) == 1 ? "Télécharger" : $id; $ddlLinks->addLink(new Link($url, $linkName)); if ($descriptor->getMegauploadUrl() !== null) { $megauploadLinks->addLink(new Link($descriptor->getMegauploadUrl(), $linkName)); } if ($descriptor->getFreeUrl() !== null) { $freeLinks->addLink(new Link($descriptor->getFreeUrl(), $linkName)); } if ($descriptor->getRapidShareUrl() !== null) { $rapidShareLinks->addLink(new Link($descriptor->getRapidShareUrl(), $linkName)); } if ($descriptor->getMediaFireUrl() !== null) { $mediaFireLinks->addLink(new Link($descriptor->getMediaFireUrl(), $linkName)); } if ($descriptor->getTorrentUrl() !== null) { $torrentLinks->addLink(new Link($descriptor->getTorrentUrl(), $linkName)); } } $releaseContent->addComponent(new title("Fichiers")); $releaseContent->addComponent($fileList); $releaseContent->addComponent(new title("Téléchargements")); $list = new SimpleListComponent(); $list->setClass("linkList"); $list->addcomponent($ddlLinks); if (!$megauploadLinks->isEmpty()) { // MU links removed because MU down //$list->addComponent($megauploadLinks); } if (!$freeLinks->isEmpty()) { $list->addComponent($freeLinks); } if (!$rapidShareLinks->isEmpty()) { $list->addComponent($rapidShareLinks); } if (!$mediaFireLinks->isEmpty()) { $list->addComponent($mediaFireLinks); } $list->addComponent($torrentLinks); $list->addComponent(new XdccLink()); $streamingsLinks = new GroupedLinks(new Image("images/icones/streaming.png")); $streamingsLinks->setClass("streamingsLinks"); foreach ($release->getStreamings() as $link) { $streamingsLinks->addLink($link); } if (!$streamingsLinks->isEmpty()) { $list->addComponent($streamingsLinks); } $bonusLinks = new GroupedLinks(new Image("images/icones/bonus.png")); $bonusLinks->setClass("bonusLinks"); foreach ($release->getBonuses() as $link) { $bonusLinks->addLink($link); } if (!$bonusLinks->isEmpty()) { $list->addComponent($bonusLinks); } $releaseContent->addComponent($list); }
<!--/FACEBOOK--> <!--GOOGLE--> <script type="text/javascript"> window.___gcfg = {lang: 'fr'}; (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> <!--/GOOGLE--> <?php $preload = new SimpleBlockComponent(); $preload->setID("preload"); $preload->setClass("hidden"); $dir = "styles/" . $_SESSION[STYLE] . "/images/"; $descStack = DirectoryManager::getContent($dir, true); $files = array(); while (!empty($descStack)) { $descriptor = array_pop($descStack); if ($descriptor['type'] === 'file') { $files[] = $dir . $descriptor['name']; } else { if ($descriptor['type'] === 'directory') { foreach ($descriptor['content'] as $sub) { $sub['name'] = $descriptor['name'] . '/' . $sub['name']; array_push($descStack, $sub); } } else { // ignore others (not recognized)
$_SESSION[STYLE] = null; } else { // keep it as is } $_SESSION[STYLE] = Check::getInputIn(isset($_GET[STYLE]) ? $_GET[STYLE] : $_SESSION[STYLE], $styles, "default"); if (TEST_MODE_ACTIVATED && Url::getCurrentUrl()->hasQueryVar('setdate')) { $_SESSION[CURRENT_TIME] = Url::getCurrentUrl()->getQueryVar('setdate'); } else { $_SESSION[CURRENT_TIME] = time(); } /**********************************\ TEST FEATURES \**********************************/ if (TEST_MODE_ACTIVATED) { $features = new SimpleBlockComponent(); $features->setClass('testFeatures'); $features->addComponent('Testing mode : '); $link = new Link(Url::getCurrentUrl(), 'clear DB'); if (DB_USE) { $link->getUrl()->setQueryVar('clearDB'); } else { $link->getUrl()->setUrl('#'); $link->setClass('deactivated'); } $features->addComponent($link); $link = new Link(Url::getCurrentUrl(), 'PHP info'); if (Url::getCurrentUrl()->hasQueryVar('phpinfo')) { $link->getUrl()->removeQueryVar('phpinfo'); $link->setClass('reverse'); } else { $link->getUrl()->setQueryVar('phpinfo');