if ($reqPath->Level(1) == $manga['name']) { $foundManga = true; foreach ($manga['chapter'] as $list) { $chapterName = $list['name']; $tmpurl = explode('-', $reqPath->Level(2)); $tmpdir = explode('-', $list['name']); if (trim($tmpurl[1]) == trim($tmpdir[0])) { $foundChapter = true; break; } } } } // Read Manga Chapter Page if ($foundManga) { $listImage = new DirectoryReader($listManga->location . iconv('utf-8', 'tis-620', '[Manga] ') . $reqPath->Level(1) . '/' . iconv('utf-8', 'tis-620', $chapterName)); $totalImage = count($listImage->toArray()) - 1; if ($foundChapter && $totalImage != 1) { ?> <script language="javascript"> $(document).ready(function() { var imageId = 2; var imageTotal = 0; var nextChapter = false; var backChapter = false; var nextPage = true; // Disable context menu on an element $("#block-selected,#back-page,#next-page").noContext(); $('#back-page,#next-page').disableTextSelect();
</div></td> </tr> <tr> <td colspan="3"><div id="list-detail"> <div id="preload-list" align="center"><img src="<?php echo $this->domain; ?> images/loading.gif" width="48" height="48" border="0" vspace="3" hspace="3" /> </div> </div></td> </tr> </table> <?php } else { require '../../plugins/lib/4.directory.class.php'; $animeStore = new DirectoryReader("F:\\"); $torrentStore = new DirectoryReader("G:\\"); $arrList = array(); switch ($_GET['list']) { case 'anime': foreach ($animeStore->toArray() as $entry) { $arrName = array(); if (ereg('\\[ThaiSubs]', $entry)) { $tmp = ereg_replace('\\[ThaiSubs]|\\[OnGoing]|\\[Adult]|\\[Moive]|\\[PMP]|\\[OVA]', '', $entry); $anime = explode('[', $tmp); $ova = false; $oad = false; if (ereg('\\[OnGoing]', $entry)) { $type = 'OnGoing'; } else { if (ereg('\\[18+]', $entry)) { $type = '18+';
public function current() { return parent::getFileName(); } /*** members are only valid if they are a directory ***/ public function valid() { if (parent::valid()) { if (!parent::isDir()) { parent::next(); return $this->valid(); } return TRUE; } return FALSE; } } // end class try { /*** a new iterator object ***/ $it = new DirectoryReader('./'); /*** loop over the object if valid ***/ while ($it->valid()) { /*** echo the current object member ***/ echo $it->current() . '<br />'; /*** advance the internal pointer ***/ $it->next(); } } catch (Exception $e) { echo 'No files Found!<br />'; }
<?php if ($_POST['id'] <= $_POST['total']) { if ($_POST['id'] >= 2) { require_once 'engine.java.php'; $dirChapter = $HaKko->Document . 'translator/' . iconv('utf-8', 'tis-620', '[Manga] ') . $_POST['manga'] . '/' . iconv('utf-8', 'tis-620', $_POST['chapter']); $listImage = new DirectoryReader($dirChapter); foreach ($listImage->ToArray() as $index => $image) { if (is_file($listImage->location . '/' . $image) && $_POST['id'] == $index) { $selectedImage = $image; } } $image_file = $dirChapter . '/' . $selectedImage; $image_url = 'translator/' . rawurlencode('[Manga] ') . rawurlencode($_POST['manga']) . '/' . rawurlencode($_POST['chapter']) . '/' . rawurlencode($selectedImage); $width = getimagesize($image_file); echo json_encode(array('image' => $image_url, 'width' => $width[0], 'height' => $width[1])); } else { echo json_encode(array('image' => 'back')); } } else { echo json_encode(array('image' => 'next')); }
function __construct($path) { parent::__construct($path); } //Возвращаем текущее имя файла function current() { return parent::getFileName(); } //Нужна только директория function valid() { if (parent::valid()) { if (!parent::isDir()) { parent::next(); return $this->valid(); } return true; } return false; } } try { $it = new DirectoryReader('..'); while ($it->valid()) { echo $it->current() . "\n"; $it->next(); } } catch (Exception $e) { echo 'Файлов в директории нет!'; }
public function MangaTranslator($listManga) { $validFormat = '\\[Manga]|\\[Cancel]|\\[Download]|\\[Drop]|\\[Wait]'; foreach ($listManga->toArray() as $manga) { if (ereg('\\[Manga]', $manga)) { $tmpManga = array(); $tmpChapter = array(); $createdManga = filectime($listManga->location . $manga); $nameManga = ereg_replace($validFormat, '', $manga); $listChapter = new DirectoryReader($listManga->location . $manga); $mangaThumb = 'images/none-thumb.jpg'; $mangaCover = 'images/none-cover.jpg'; foreach ($listChapter->toArray() as $chapter) { $utfName = iconv('utf-8', 'tis-620', $chapter); if (is_file($listChapter->location . '/' . $utfName)) { $chkInfo = pathinfo($chapter); if ($chkInfo['filename'] == 'cover') { $mangaCover = 'translator/' . $manga . '/' . $chapter; } elseif ($chkInfo['filename'] == 'thumb') { $mangaThumb = 'translator/' . $manga . '/' . $chapter; } } } $tmp = explode('[', $manga); if (count($tmp) == 3) { $status = explode(']', $tmp[2]); $status = $status[0]; } else { $status = 'Active'; } $tmpManga['name'] = trim($nameManga); $tmpManga['status'] = trim($status); $tmpManga['created'] = $createdManga; $tmpManga['thumb'] = $mangaThumb; $tmpManga['cover'] = $mangaCover; $tmpManga['last_ch'] = 'None'; $tmpManga['last_id'] = 0; foreach ($listChapter->toArray() as $chapter) { $utfName = iconv('utf-8', 'tis-620', $chapter); $lastCreatedChapter = 0; if (is_dir($listChapter->location . '/' . $utfName) && $chapter !== '.' && $chapter !== '..') { $tmplist = array(); $createdChapter = filectime($listChapter->location . '/' . $utfName); $tmplist['created'] = $createdChapter; $tmplist['name'] = $chapter; $tmpChapter[] = $tmplist; if ($createdChapter > $lastCreatedChapter) { $lastChapter = explode('-', $chapter); $tmpManga['last_ch'] = $chapter; $tmpManga['last_id'] = $lastChapter[0]; } } } $tmpManga['chapter'] = $tmpChapter; $this->MangaStore[] = $tmpManga; } } }