Страница 1 из 6

Ошибки при открытии Сервисов

Добавлено: 27 янв 2012, 14:26
misha
Подскажите? НЕ открывается Сервис Избранное Пишет Ошибка.NOTICE:fav service inc:50(Undefined offset:3. С уважением Миша

Re: Ошибки при открытии Сервисов

Добавлено: 27 янв 2012, 15:19
consros
Выложи сюда или пришли личным сообщением если скрываешься, содержимое cfg/favorites.ini файла.
Или прикрепи его к ответу.

Re: Ошибки при открытии Сервисов

Добавлено: 27 янв 2012, 16:20
misha
Спасибо что так быстро откликнулись.Но если бы Вы ещё подсказали откуда я должен (могу) взять этот Файл-cfg/favorites.ini-и как его прикрепить. Моих познаний к сожалению не хватает. Но я быстро учусь. Михаил

Re: Ошибки при открытии Сервисов

Добавлено: 27 янв 2012, 16:25
consros
Надо зайти на Xtreamer и там в sda1/scripts/xRodnoeTV/cfg/ лежит этот файл.
Обычно зайти можно просто набрав \\myxtreamer\ в проводнике или http://myxtreamer/ в браузере.

Re: Ошибки при открытии Сервисов

Добавлено: 27 янв 2012, 19:58
misha
<?xml version="1.0" encoding="UTF-8" ?>
- <service>
<name>Favorites</name>
<description>Список избранных страниц всех сервисов. Практически любая понравившаяся Вам страница может быть добавлена в этот список с целью ускорения доступа к ней.</description>
<type>Internal service</type>
<version>1.0</version>
<author>GlavTV</author>
</service><?php
#############################################################################
# Author: consros 2011 #
#############################################################################

require_once 'interfaces/service.inc';
require_once 'interfaces/channel.inc';
require_once 'interfaces/item.inc';
require_once 'interfaces/exceptions.inc';
require_once 'interfaces/message.inc';
require_once 'tools/config.inc';

require_once 'services/utils/utilsService.inc';

class FavService extends Service {

const MAX_FAVORITES_ENTRIES = 100;

public function getServiceName() {
return 'Favorites';
}

public function startPage() {
return $this->show();
}

public function login() {
$channel = new Channel($this->lang->msg('Login'));
$channel->set(Channel::LINK,
$this->cfg->get('home_url') . '?srv=utils&req=login');
$channel->setSupportedTemplates('redirect');
return $channel;
}

public function show() {
$channel = new Channel($this->lang->msg('Favorites'));
$channel->set(Channel::THUMB_RATIO, 0);
$channel->setSupportedTemplates('detailed-list', 'icon-table');
$channel->addHotkey('enter', null,
$this->cfg->get('home_url') . '?srv=fav&req=count',
array('title' => Item::TITLE, 'url' => Item::LINK));
$channel->addHotkey('user1', $this->lang->msg('Delete'),
$this->cfg->get('home_url') . '?srv=fav&req=remove',
array('title' => Item::TITLE, 'url' => Item::LINK));

$cfgFav = new ConfigFile($this->cfg->get('cfgPath') . '/favorites.txt');
foreach ($cfgFav->getSectionNames() as $sectionName) {
$section = $cfgFav->getSection($sectionName);
foreach ($section as $title => $info) {
list($count, $time, $url, $descr) = explode('|', $info);
$item = new Item($title, $descr);
$item->set(Item::LINK, $url);
$thumb = $this->cfg->get('home_url') . "services/$sectionName/logo.png";
$item->set(Item::THUMBNAIL, $thumb);
$item->set('count', (int) $count);
$item->set(Item::TIME, $time);
$channel->addItem($item);
}
}
$channel->sortItems('!' . Item::TIME, '!count', Item::TITLE);
foreach ($channel->getItems() as $item) {
$item->set(Item::TIME, $this->tools->formatTime(
$item->get(Item::TIME)));
}
return $channel;
}

public function add() {
list($title, $url, $sectionName, $descr) = $this->getAddRemoveParams();

$cfgFav = new ConfigFile($this->cfg->get('cfgPath') . '/favorites.txt', $sectionName);
if (null != $cfgFav->get($title)) {
return new Message($this->lang->msg('Error'),
$this->lang->msg('Not added to favorites') . '. ' .
$this->lang->msg('Name already exists') . ': "' . $title .'"');
}

$time = date('Y-m-d H:i:s');
$info = "0|$time|$url|$descr";
$section = $cfgFav->getSection($sectionName);
$section = array($title => $info) + $section;
$section = array_slice($section, 0, self::MAX_FAVORITES_ENTRIES);
$cfgFav->setSection($sectionName, $section);
$cfgFav->saveFile();

return new Message($this->lang->msg('Message'),
$this->lang->msg('Added to favorites') . ': "' . $title .'"');
}

public function remove() {
list($title, $url, $sectionName) = $this->getAddRemoveParams();

$cfgFav = new ConfigFile($this->cfg->get('cfgPath') . '/favorites.txt', $sectionName);
if (null == $cfgFav->get($title)) {
return new Message($this->lang->msg('Error'),
$this->lang->msg('Not removed from favorites') . '. ' .
$this->lang->msg('No such name') . ': "' . $title .'"');
}

$section = $cfgFav->getSection($sectionName);
unset($section[$title]);
$cfgFav->setSection($sectionName, $section);
$cfgFav->saveFile();

return new Message($this->lang->msg('Message'),
$this->lang->msg('Removed from favorites') . ': "' . $title .'"');
}

public function count() {
list($title, $url, $sectionName) = $this->getAddRemoveParams();

$cfgFav = new ConfigFile($this->cfg->get('cfgPath') . '/favorites.txt');
$section = $cfgFav->getSection($sectionName);

$count = 0;
if (isset($section[$title])) {
list($count, $time, $url, $descr) = explode('|', $section[$title]);
$count++;
$time = date('Y-m-d H:i:s');
$info = "$count|$time|$url|$descr";
$section = array($title => $info) + $section;
$cfgFav->setSection($sectionName, $section);
$cfgFav->saveFile();
}
$channel = new Channel($this->lang->msg('Counter'),
$this->lang->msg('Counter increased') . ": $title, $count");
$channel->set(Channel::LINK, $this->getFullUrl($url));
$channel->setSupportedTemplates('redirect');
return $channel;
}

protected function getAddRemoveParams() {
$title = $this->getRequiredParam('title');
$url = $this->getSmallUrl($this->getRequiredParam('url'));
$descr = $this->getOptionalParam('descr', '');

$pos = strpos($url, '?');
$paramStr = false === $pos ? $url : substr($url, $pos + 1);
parse_str($paramStr, $params);
if (! isset($params['srv'])) {
throw new BadRequestException(
$this->lang->msg('Cannot parse data') . ": URL, SRV");
}

$descr = str_replace(array("\r", "\n", '\"', '"'), array(' ', ' ', '″', '″'), $descr);
$descr = ParserTools::removeHtmlTags($descr);
$title = str_replace(array("\r", "\n", '\"', '"', '=', '!'), array(' ', ' ', '″', '″', ' ', '.'), $title);
$title = ParserTools::removeHtmlTags($title);
return array($title, $url, $params['srv'], $descr);
}

protected function getFullUrl($url) {
return 0 === strpos($url, 'http:') ? $url : ($this->cfg->get('home_url') . "?$url");
}

protected function getSmallUrl($url) {
$prefix = $this->cfg->get('home_url') . '?';
return 0 === strpos($url, $prefix) ? substr($url, strlen($prefix)) : $url;
}
}
?>
Это?Не уверен

Re: Ошибки при открытии Сервисов

Добавлено: 27 янв 2012, 20:12
misha
<?xml version="1.0"?>
<zend-config xmlns:zf="http://framework.zend.com/xml/zend-config-xml/1.0/">
<xjbInstallationUUID>fc7fdc0945726def303d11ccd3020405</xjbInstallationUUID>
<xjbDbUUID>3f8068c5357410114b199b42add9da15</xjbDbUUID>
<setup>1</setup>
<useOnlineScraper>
<lang>en</lang>
<name>Xjb_Scraper_Online_Tmdb</name>
</useOnlineScraper>
<usePictureScraper>
<name>Xjb_Scraper_Picture_Tmdb</name>
</usePictureScraper>
<movieOverview>
<lastPage>1</lastPage>
<sortBy>name</sortBy>
<sortMode>asc</sortMode>
<numberItemsPerPage>50</numberItemsPerPage>
<hideArtwork>0</hideArtwork>
</movieOverview>
<defaultMovieViewList>viewMovieList</defaultMovieViewList>
<useOnlineScraperOnFilesystemScan>1</useOnlineScraperOnFilesystemScan>
<filesystemScanUseAlwaysFolderNames>0

Re: Ошибки при открытии Сервисов

Добавлено: 27 янв 2012, 20:14
misha
[Default]
lang = "ru"
timezone = "America/Juneau"
marginX = "2"
marginY = "2"

Re: Ошибки при открытии Сервисов

Добавлено: 27 янв 2012, 20:19
misha
[Default]
lang = "ru"
timezone = "America/Juneau"
marginX = "2"
marginY = "2"

Re: Ошибки при открытии Сервисов

Добавлено: 27 янв 2012, 20:19
agent_wowa
Не то, содержимое файла favorites.txt, каторый лежит тут >>> GlavTV/cfg/favorites.txt

Re: Ошибки при открытии Сервисов

Добавлено: 28 янв 2012, 02:11
misha
<?xml version="1.0"?>
<zend-config xmlns:zf="http://framework.zend.com/xml/zend-config-xml/1.0/">
<xjbInstallationUUID>fc7fdc0945726def303d11ccd3020405</xjbInstallationUUID>
<xjbDbUUID>3f8068c5357410114b199b42add9da15</xjbDbUUID>
<setup>1</setup>
<useOnlineScraper>
<lang>en</lang>
<name>Xjb_Scraper_Online_Tmdb</name>
</useOnlineScraper>
<usePictureScraper>
<name>Xjb_Scraper_Picture_Tmdb</name>
</usePictureScraper>
<movieOverview>
<lastPage>1</lastPage>
<sortBy>name</sortBy>
<sortMode>asc</sortMode>
<numberItemsPerPage>50</numberItemsPerPage>
<hideArtwork>0</hideArtwork>
</movieOverview>
<defaultMovieViewList>viewMovieList</defaultMovieViewList>
<useOnlineScraperOnFilesystemScan>1</useOnlineScraperOnFilesystemScan>
<filesystemScanUseAlwaysFolderNames>0