示例#1
0
文件: RSS.php 项目: kaibosh/nZEDb
 /**
  * Get movies for RSS.
  *
  * @param int   $limit
  * @param int   $userID
  * @param array $excludedCats
  *
  * @return array
  */
 public function getMyMoviesRss($limit, $userID = 0, $excludedCats = [])
 {
     return $this->pdo->query(sprintf("\n\t\t\t\tSELECT r.*, mi.title AS releasetitle, g.name AS group_name,\n\t\t\t\t\tCONCAT(cp.title, '-', c.title) AS category_name,\n\t\t\t\t\t%s AS category_ids,\n\t\t\t\t\tCOALESCE(cp.id,0) AS parentCategoryid\n\t\t\t\tFROM releases r\n\t\t\t\tINNER JOIN category c ON c.id = r.categoryid\n\t\t\t\tINNER JOIN category cp ON cp.id = c.parentid\n\t\t\t\tINNER JOIN groups g ON g.id = r.group_id\n\t\t\t\tLEFT OUTER JOIN movieinfo mi ON mi.imdbid = r.imdbid\n\t\t\t\tWHERE %s %s\n\t\t\t\tAND r.nzbstatus = %d\n\t\t\t\tAND r.categoryid BETWEEN 2000 AND 2999\n\t\t\t\tAND r.passwordstatus %s\n\t\t\t\tORDER BY postdate DESC %s", $this->releases->getConcatenatedCategoryIDs(), $this->releases->uSQL($this->pdo->query(sprintf('SELECT imdbid, categoryid FROM user_movies WHERE user_id = %d', $userID), true), 'imdbid'), count($excludedCats) ? ' AND r.categoryid NOT IN (' . implode(',', $excludedCats) . ')' : '', NZB::NZB_ADDED, $this->releases->showPasswords, ' LIMIT ' . ($limit > 100 ? 100 : $limit) . ' OFFSET 0'), true, nZEDb_CACHE_EXPIRY_MEDIUM);
 }