Pnuts CC's Blog Flower & World, Life & Paradise.

MO : Manga Online

Notice: The old “php my Manga” project have renamed as “MO”.

Introduce

So, what’s MO? Of cause, MO is the name of the cutest robot in movie “wall.e”.

mo1

But I’ll not talk about him/her. The “MO” here is short for “Manga Online”, which a simple php project that allow people people view manga online. I say it simple, because There is no database needed, so you can put it everywhere as you like, also you call setup a apache server and put it on your localhost server. ( Believe me, this is a good idea, considering the browser speed. )

Sample Sites

http://mo.pnuts.cc or http://manga.pnuts.cc

If you are so lazy to download the source code and setup. You can always just visit the foregoing urls.

Screen slots & User Manual

image

*The Chinese on index says :

*1 “贴吧” do NOT support search, you need type the full name.

For example : “初音”.

*2 OneManga is a websites that provider English Manga, you need type the English name of manga.

For example : “bokura”.

image

Next : Show next image.

Prev : Show previous image.

[-] : Min the number in the textbox by 1.

[+] : Add the number in the textbox by 1.

GO : Show the page whose page number in the textbox.

Chapters : Back to the Chapter List page. You can pick another chapter of this book.

Index : Back to Index.

Keyboard

There are two ways to move the page.

[w], [a], [s], [d] : For game player.

[h], [j], [k], [l] : For Vim User.

If the page is already at bottom, [s] or [j] will show next image.

[<] : Previous Image.

[>] : Next Image.


The following is for developer.

Setup

If you know what’s php, you’ll know how to set it up. And the follow mods may need :

GD, Curl, the mods I forget.

Download

I have already set up a project on Codeplex. The project index is :

http://manga.codeplex.com/

If you ask me why Codeplex, not sourceforge. That’s because the username “pnuts” of sourceforge has been taken by someone else. So I haaaaaate it. I like Microsoft’s products may be another reason.

A Example Of Provider

I put it here because I am dying for someone who can help me add new providers. It’s very easy, if you have interest, just try.

// Every Provider shoulds implements IProvider
class TestProvider implements IProvider {
	// The name of the provider, this will be show at index.
	function getName() {
		return "Test Provider";
	}

	// The http ref of the provider's website.
	// This is needed when download a image.
	// Because most websites prevent links from a different site.
	function getRef() {
		return "127.0.0.1";
	}

	// The encode of provider.
	function getEncode() {
		return "utf-8";
	}

	// Wether the provider's website prevent Hotlink.
	function preventHotlink() {
		return true;
	}

	// Search a key word.
	// Params :
	//     $keyword		 :     string
	//         The keywords to search.
	//     $pageNo       :     int
	//         The page number which to deal with.
	//         Because the search result may not in one page.
	// Return :
	// [] represent array.
	//     [
	//         'books'          =>     [ Book ... ],
	//         'pageCount'      =>     int
	//     ]
	function search($keyword, $pageNo) {
		return array(
			'books' => array( new Book($pageNo, "TestBook ".$pageNo) ),
			'pageCount' => 2
		);
	}

	// Get the book with the given id.
	// Search a key word.
	// Params :
	//     $bookId       :     string
	//         Id of the book.
	// Return : Book
	function getBook($bookId) {
		return new Book($bookId, "TestBook ".$bookId);
	}

	// Get the Chapters of the book.
	// Params :
	//     $bookid       :     string
	//         Id of the book.
	//     $pageNo       :     int
	//         You can split chapters into pages,
	//         and the $pageNo is the page number.
	// Return :
	// [] represent array.
	//     [
	//         'chapters'       =>     [ Chapter ... ],
	//         'pageCount'      =>     int
	//     ]
	function getChapters($bookId, $pageNo) {
		return array(
			'chapters' => array(
				new Chapter(1, "TestChapter 1"),
				new Chapter(2, "TestChapter 2")
			),
			'pageCount' => 2
		);
	}

	// Get the book with the given id.
	// Search a key word.
	// Params :
	//     $bookId       :     string
	//         Id of the book.
	//     $chapterId    :     string
	//         Id of the chapter.
	// Return : Chapter
	function getChapter($bookId, $chapterId) {
		return new Chapter($chapterId, "TestChapter ".$chapterId);
	}

	// Get the url of the image.
	// Params :
	//     $bookId       :     string
	//         Id of the book.
	//     $providerId   :     string
	//         Id of the chapter.
	//     $imgNo        :     int
	// Return : [ string ]
	//
	//               !!!! IMPORTANT !!!!
	//     The return is a array of the image url.
	function getImageUrl($bookId, $chapterId, $imgNo) {
		return array("http://www.google.com/intl/en_ALL/images/srpr/logo1w.png");
	}

	//Get the count of image.
	// Params :
	//     $bookId       :      string
	//     $chapter      :      string
	// Return : int
	function getImageCount($bookId, $chapterId) {
		return 20;
	}
}

License

Apache License Version 2.0

Comments (1) Trackbacks (2)
  1. Awesome I’ve seen on this in awhile. Thanks for sharing.


Leave a comment