Example #1
0
    /**
     * @param $relid
     * @param $uid
     */
    public function postComment($relid, $uid)
    {
        $text = 'This release has failed to download properly. It might fail for other users too.
		This comment is automatically generated.';
        $dbl = $this->pdo->queryOneRow(sprintf('SELECT text FROM release_comments WHERE releaseid = %d AND userid = %d', $relid, $uid));
        if ($dbl['text'] != $text) {
            $this->rc->addComment($relid, $text, $uid, '');
        }
    }
Example #2
0
    /**
     * @note  Post comment for the release if that release has no comment for failure.
     *        Only one user is allowed to post comment for that release, rest will just
     *        update the failed count in dnzb_failures table
     *
     * @param $relid
     * @param $uid
     */
    public function postComment($relid, $uid)
    {
        $dupe = 0;
        $text = 'This release has failed to download properly. It might fail for other users too.
		This comment is automatically generated.';
        $check = $this->pdo->queryDirect(sprintf('
				SELECT text
				FROM release_comments
				WHERE releaseid = %d', $relid));
        if ($check instanceof \Traversable) {
            foreach ($check as $dbl) {
                if ($dbl['text'] == $text) {
                    $dupe = 1;
                    break;
                }
            }
        }
        if ($dupe === 0) {
            $this->rc->addComment($relid, $text, $uid, '');
        }
    }
Example #3
0
use nzedb\Videos;
use nzedb\XXX;
use nzedb\DnzbFailures;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
if (isset($_GET['id'])) {
    $releases = new Releases(['Settings' => $page->settings]);
    $data = $releases->getByGuid($_GET['id']);
    if (!$data) {
        $page->show404();
    }
    $rc = new ReleaseComments($page->settings);
    $fail = new DnzbFailures(['Settings' => $page->settings]);
    if ($page->isPostBack()) {
        $rc->addComment($data['id'], $_POST['txtAddComment'], $page->users->currentUserId(), $_SERVER['REMOTE_ADDR']);
    }
    $criteria = $mov = $xxx = '';
    if ($data['videos_id'] != 0) {
        $showInfo = (new Videos(['Settings' => $page->settings]))->getByVideoID($data['videos_id']);
        if (count($showInfo) > 0) {
            $criteria = ['title' => '', 'summary' => '', 'countries_id' => '', 'image' => '', 'id' => ''];
            $done = 1;
            $needed = count($criteria);
            foreach ($showInfo as $info) {
                foreach ($criteria as $key => $value) {
                    if (empty($value) && !empty($info[$key])) {
                        $criteria[$key] = $info[$key];
                        $done++;
                    }
                }