Example #1
0
require_once './global.php';
require_once DIR . '/includes/functions_user.php';
require_once DIR . '/includes/functions_threadmanage.php';
require_once 'yrms/class/vietsubmanga_class.php';
require_once 'yrms/class/database_class.php';
require_once 'yrms/class/forumpost_class.php';
require_once 'yrms/class/award_class.php';
require_once 'yrms/include/function.php';
if (getParam('mangaid')) {
    $currentAction = 'edit';
} elseif (getParam('do') == 'reward') {
    $currentAction = 'reward';
} else {
    $currentAction = 'add';
}
$manga = new Manga();
switch ($currentAction) {
    case 'add':
        if (!$vbulletin->userinfo['userid']) {
            print_no_permission();
        }
        $pageTitle = $vbphrase['yrms_mangaadd'];
        $messagetype = "info";
        $message = $vbphrase['yrms_inputtip'];
        break;
    case 'edit':
        $manga->load(getParam('mangaid'));
        if (!$manga->checkOwner()) {
            print_no_permission();
        }
        $pageTitle = $vbphrase['yrms_edit'];
Example #2
0
<?php

chdir('./../');
require_once './global.php';
require_once DIR . '/includes/functions_user.php';
require_once DIR . '/includes/functions_threadmanage.php';
require_once 'yrms/class/vietsubmanga_class.php';
require_once 'yrms/class/database_class.php';
require_once 'yrms/class/forumpost_class.php';
require_once 'yrms/class/award_class.php';
require_once 'yrms/include/function.php';
$manga = new Manga();
if (!$manga->load(getParam('mangaid'))) {
    print_no_permission();
}
if (!$manga->checkOwner()) {
    print_no_permission();
}
$pageTitle = $vbphrase['yrms_edit'];
$messagetype = "info";
$message = $vbphrase['yrms_inputtip'];
$inputData = $manga->getData();
//unset($inputData['vbphrase']);
//unset($inputData['db']);
//unset($inputData['vbulletin']);
//print_pre($inputData);
if (isPost()) {
    $inputData = getPost();
    $error = findInputError($inputData);
    if (!$error) {
        $manga->setData($inputData);
Example #3
0
    }
    public function image()
    {
        $image = $this->page->find('.cover img');
        foreach ($image as $i) {
            return $i->src;
        }
    }
}
//$con=mysqli_connect("localhost","hashmkb_hash","hash@123","hashmkb_mangatracker");
// Check connection
/*if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}*/
foreach ($manga_pages as $href) {
    $manga = new Manga($href);
    //echo 'Title: ' . 'Sorry, you need to find a way to get this one from $manga->title() or something :p'. '<br />';
    /*echo 'Title: ' . $manga->title(). '<br />';
      echo 'Link: ' . $href . '<br />';
      echo 'Description: ' . $manga->desc() . '<br />';
      echo 'Status: ' . $manga->status() . '<br />';
      echo 'Genre: ' . $manga->genre() . '<br />';
      echo 'Author: ' . $manga->author() . '<br />';
      echo 'Release: ' . $manga->release() . '<br />';
      echo 'Image Link: ' . $manga->image() . '<br />';
      echo '<br /><br />';
      */
    $image = $manga->image();
    $desc = $manga->desc();
    if (!empty($image)) {
        //echo '<b>Image:</b> ' . $mangamerge['Image'] . '<br />';
Example #4
0
require_once 'yrms/class/vietsubmanga_class.php';
require_once 'yrms/class/database_class.php';
require_once 'yrms/include/function.php';
$currentUserId = $vbulletin->userinfo['userid'];
if (!$currentUserId) {
    print_no_permission();
}
$owner = getParam('owner');
$limit = 20;
$filter = getParam('filter');
$keyword = getParam('keyword');
$page = getParam('page');
if (!$page) {
    $page = 1;
}
$mangaObject = new Manga();
$totalManga = $mangaObject->getTotal();
$mangaCollection = $mangaObject->setPage($page)->setLimit($limit)->setFilter($filter)->setKeyword('%' . $keyword . '%')->getCollection();
$mangaDatas = array();
$tableorder = 1;
if (!empty($mangaCollection)) {
    foreach ($mangaCollection as $manga) {
        $mangaData = $manga->getData();
        $mangaData['status'] = $vbphrase["yrms_projectstatus{$mangaData['status']}"];
        if ($mangaData['numberofchapter'] == 0) {
            $mangaData['numberofchapter'] = '??';
        }
        if ($tableorder % 2 == 1) {
            $mangaData['rowtype'] = 'even';
        } else {
            $mangaData['rowtype'] = 'odd';
Example #5
0
chdir('./../');
require_once './global.php';
require_once DIR . '/includes/functions_user.php';
require_once DIR . '/includes/functions_threadmanage.php';
require_once 'yrms/class/vietsubmanga_class.php';
require_once 'yrms/class/database_class.php';
require_once 'yrms/class/forumpost_class.php';
require_once 'yrms/class/award_class.php';
require_once 'yrms/include/function.php';
if (!$vbulletin->userinfo['userid']) {
    print_no_permission();
}
$pageTitle = $vbphrase['yrms_mangaadd'];
$messagetype = "info";
$message = $vbphrase['yrms_inputtip'];
$manga = new Manga();
if (isPost()) {
    $inputData = getPost();
    $error = findInputError($inputData);
    if (!$error) {
        $manga->setData($inputData);
        if ($inputData['posturl']) {
            $threadId = extract_threadid_from_url($inputData['posturl']);
            $threadInfo = fetch_threadinfo($threadId);
            if ($threadInfo['forumid'] == $manga->getForumId()) {
                $manga->setThreadId($threadInfo['threadid'])->setPostId($threadInfo['firstpostid'])->setPosterId($threadInfo['postuserid']);
            } elseif ($threadInfo['forumid'] == $manga->getOnlineForumId()) {
                $manga->setPosterId($threadInfo['postuserid']);
            }
        }
        $manga->save();
Example #6
0
<?php

chdir('../../');
require_once './global.php';
require_once DIR . '/includes/functions_user.php';
require_once 'yrms/class/vietsubmanga_class.php';
require_once 'yrms/class/database_class.php';
require_once 'yrms/include/function.php';
switch (getPost('do')) {
    case 'checkVietSubManga':
        $filter = 'mangatitle';
        $rawKeywords = array_map('trim', explode(',', getPost('mangaNames')));
        $mangaObject = new Manga();
        $existedMangas = array();
        $keywords = array();
        foreach ($rawKeywords as $rawKeyword) {
            if ($rawKeyword && !in_array($rawKeyword, $keywords)) {
                $keywords[] = $rawKeyword;
            }
        }
        if ($keywords) {
            foreach ($keywords as $key => $keyword) {
                $result = $mangaObject->setFilter($filter)->setKeyword($keyword)->getCollection();
                if ($result) {
                    $existedMangas = array_merge($result, $existedMangas);
                }
            }
        }
        if ($existedMangas) {
            $existedList = array();
            foreach ($existedMangas as $existedManga) {
Example #7
0
            $contenttemplatename = 'yrms_message';
        } else {
            $messagetype = "error";
            $message = nl2br(construct_phrase($vbphrase['yrms_msg_error_head'], $vbphrase['yrms_reward']) . "\n" . $error);
            $messagebox = vB_Template::create('yrms_messagebox');
            $messagebox->register('messagetype', $messagetype);
            $messagebox->register('message', $message);
        }
    }
    if (!isset($contenttemplatename)) {
        $contenttemplatename = 'yrms_vietsubmanga_manga_reward';
    }
}
if ($_REQUEST['do'] == 'mangaedit') {
    $pagetitle = $vbphrase['yrms_edit'];
    $manga = new Manga($_GET['mangaid']);
    $type_check[$manga->type] = "checked";
    $status_check[$manga->status] = "checked";
    if (isset($_POST['submitted'])) {
        $manga->postid = $_POST['postid'];
        $manga->illustration = $_POST['illustration'];
        $manga->mangatitle = $_POST['mangatitle'];
        $manga->othertitle = $_POST['othertitle'];
        $manga->author = $_POST['author'];
        $manga->type = $_POST['type'];
        $manga->numberofchapter = $_POST['numberofchapter'];
        $manga->finishedchapter = $_POST['finish edchapter'];
        $manga->originalcomposition = $_POST['originalcomposition'];
        $manga->status = $_POST['status'];
        $manga->genre = $_POST['genre'];
        $manga->summary = $_POST['summary'];