public function getRssFeeds() { $urls = $this->getRssUrl(); if (empty($urls)) { return null; } $item = array(); $globalLimit = $this->helpers->config('rssmix|itemsLimit'); $limit = round($globalLimit / count($urls)); foreach ($urls as $url) { $title = isset($url['title']) ? $url['title'] : ''; try { $imagePath = ''; if (!empty($url['image'])) { $iC = new enicImage(); $imagePath = $iC->get($url['image'], 25, 25, 'crop'); } } catch (Exception $e) { // Au cas où l'image n'existe plus } $rss = $this->getRssFeed($url['url'], $limit); foreach ($rss as $key => $currentRss) { $rss[$key]['img'] = $imagePath; $rss[$key]['fluxTitle'] = $title; } $item = array_merge($rss, $item); } return $item; }
public function processUpdate() { if (!Kernel::isAdmin()) { return $this->error('rssmix.noRight', true, '||'); } $ppo = new CopixPPO(); //check errors : if (isset($this->flash->error)) { $ppo->error = $this->flash->error; } if (isset($this->flash->success)) { $ppo->success = $this->flash->success; } if (!$this->istyreq('id')) { return $this->error('rssmix.error'); } $id = (int) $this->request('id'); $url = $this->service->getRssUrl($id); if (empty($url)) { return $this->error('rssmix.error'); } $ppo->url = $url[0]['url']; $ppo->title = $url[0]['title']; if (!empty($url[0]['image'])) { $imageClass = new enicImage(); try { $ppo->image = $imageClass->get($url[0]['image'], 50, 50, 'crop'); } catch (Exception $e) { $ppo->error = $e->getMessage(); } } $ppo->id = $id; $ppo->formAction = $this->url('rssmix|default|updatep', array('id' => $id)); return _arPPO($ppo, 'update.tpl'); }