- 001
- 002
- 003
- 004
- 005
- 006
- 007
- 008
- 009
- 010
- 011
- 012
- 013
- 014
- 015
- 016
- 017
- 018
- 019
- 020
- 021
- 022
- 023
- 024
- 025
- 026
- 027
- 028
- 029
- 030
- 031
- 032
- 033
- 034
- 035
- 036
- 037
- 038
- 039
- 040
- 041
- 042
- 043
- 044
- 045
- 046
- 047
- 048
- 049
- 050
- 051
- 052
- 053
- 054
- 055
- 056
- 057
- 058
- 059
- 060
- 061
- 062
- 063
- 064
- 065
- 066
- 067
- 068
- 069
- 070
- 071
- 072
- 073
- 074
- 075
- 076
- 077
- 078
- 079
- 080
- 081
- 082
- 083
- 084
- 085
- 086
- 087
- 088
- 089
- 090
- 091
- 092
- 093
- 094
- 095
- 096
- 097
- 098
- 099
- 100
<?php
sfConfig::set('show_counters', true);
/**
* Lite
*
* @category Symfony
* @package Plugins
* @subpackage liteSearchsite
* @author
* @since 12.11.2008
* @version $Id: actions.class.php 28664 2011-03-15 13:14:49Z ringtail $
*/
/**
* class liteSearchsiteActions. Функции для работы с поиском
*
* @category Symfony
* @package Plugins
* @subpackage liteSearchsite
* @author Tretyakov Ilya <[email protected]>
* @version $Id: actions.class.php 28664 2011-03-15 13:14:49Z ringtail $
*/
class liteSearchsiteActions extends sfActions
{
protected $searchsite;
protected $search_server = 'http://217.148.52.134:17000/';
/**
* конструктор
*
* @see sfComponent
*/
public function __construct($context, $moduleName, $actionName)
{
$this->searchsite = new liteSearchsite();
parent::__construct($context, $moduleName, $actionName);
}
/**
* Поиск. главная
*
* @param unknown_type $request
*/
public function executeIndex($request)
{
if ($request) {
$page = $request->getParameter('id');
$this->text = htmlspecialchars($request->getParameter('search_text'));
$reqid = $request->getParameter('reqid');
$page = $request->getParameter('p');
$numdoc = $request->getParameter('numdoc');
}
if (!$page) $page = 0;
if (!$this->searchsite->checkServer($this->search_server)) { throw new sfException('Ахтунг!'); }
if (!1) {
$this->search_work = 0;
} else
if ($this->searchsite->uploadXml($this->search_server, $this->text, $reqid, $page, $numdoc)) {
$this->pages_found = $this->searchsite->getCountItem();
$this->start_page = $this->searchsite->getStartPage();
$this->pages_found_word = $this->searchsite->getWordLinks();
$this->reqid = $this->searchsite->getRegId();
$this->pages = $this->searchsite->getPages();
$this->count_results = $this->searchsite->getDifPages();
if ($this->pages) {
$this->nextpagelink = $this->searchsite->getLinkNextPage();
$this->prepagelink = $this->searchsite->getLinkPrePage();
}
$this->search_work = 1;
if (!$this->pages_found) {
$this->no_result = 1;
$this->pages_found = 0;
} else {
$this->no_result = 0;
$this->list = $this->searchsite->getList($page);
//пересчитаем
//$this->pages_found = $this->searchsite->getCountItem();
//$this->searchsite->setCountPages();
//$this->pages_found_word = $this->searchsite->getWordLinks();
//$this->pages = $this->searchsite->getPages();
//$this->count_results = $this->searchsite->getDifPages();
if ($this->pages) {
$this->nextpagelink = $this->searchsite->getLinkNextPage();
$this->prepagelink = $this->searchsite->getLinkPrePage();
}
}
} else {
$this->search_work = 0;
}
}
guest 20.12.2013 09:38 # +1