Beispiel #1
0
    /**
     * Post all new comments to usenet.
     */
    protected function postAll()
    {
        // Get all comments that we have not posted yet.
        $newComments = $this->pdo->query(sprintf('SELECT rc.text, rc.id, %s, u.username, r.nzb_guid
				FROM releasecomment rc
				INNER JOIN users u ON rc.userid = u.id
				INNER JOIN releases r on rc.releaseid = r.id
				WHERE (rc.shared = 0 or issynced = 1) LIMIT %d', $this->pdo->unix_timestamp_column('rc.createddate'), $this->siteSettings['max_push']));
        // Check if we have any comments to push.
        if (count($newComments) === 0) {
            return;
        }
        echo '(Sharing) Starting to upload comments.' . PHP_EOL;
        // Loop over the comments.
        foreach ($newComments as $comment) {
            $this->postComment($comment);
        }
        echo PHP_EOL . '(Sharing) Finished uploading comments.' . PHP_EOL;
    }