diff options
author | Sergey Kartashoff <gluke@php.net> | 2002-08-03 11:23:51 +0000 |
---|---|---|
committer | Sergey Kartashoff <gluke@php.net> | 2002-08-03 11:23:51 +0000 |
commit | 7a0fbd668a830629187216d8e6abb44d2305ed78 (patch) | |
tree | 7470f45bdb00ede3375de5463adcb729ece97e19 /ext/mnogosearch | |
parent | 61a73183ccbfa69bff26080adb8329733e72729c (diff) | |
download | php-git-7a0fbd668a830629187216d8e6abb44d2305ed78.tar.gz |
- UDM_PARAM_STORED mnogosearch parameter has been added to set
stored address.
Diffstat (limited to 'ext/mnogosearch')
-rw-r--r-- | ext/mnogosearch/index.php | 6 | ||||
-rw-r--r-- | ext/mnogosearch/php_mnogo.c | 10 |
2 files changed, 13 insertions, 3 deletions
diff --git a/ext/mnogosearch/index.php b/ext/mnogosearch/index.php index 4bf504f9cf..1d05e64ce6 100644 --- a/ext/mnogosearch/index.php +++ b/ext/mnogosearch/index.php @@ -5,7 +5,7 @@ $Id$ */ -/* mnoGoSearch-php-lite v.1.3 +/* mnoGoSearch-php-lite v.1.4 * for mnoGoSearch ( formely known as UdmSearch ) free web search engine * (C) 2001-2002 by Sergey Kartashoff <gluke@mail.ru>, * mnoGoSearch Developers Team <devel@mnogosearch.org> @@ -105,7 +105,8 @@ $de=urldecode($de); if ($db=="") $db='01/01/1970'; if ($de=="") $de='31/12/2020'; -$storedaddr="localhost"; +// define this to enable stored support +// $storedaddr="localhost"; $storedocurl='/cgi-bin/storedoc.cgi'; if (isset($q)) { @@ -652,6 +653,7 @@ function make_nav($query_orig){ if (Udm_Api_Version() >= 30204) { if ($have_query_flag)Udm_Set_Agent_Param($udm_agent,UDM_PARAM_QUERY,$query_orig); + if ($storedaddr != '') Udm_Set_Agent_Param($udm_agent,UDM_PARAM_STORED,$storedaddr); } if ($m=='any') { diff --git a/ext/mnogosearch/php_mnogo.c b/ext/mnogosearch/php_mnogo.c index 60b5d16d6f..507467e979 100644 --- a/ext/mnogosearch/php_mnogo.c +++ b/ext/mnogosearch/php_mnogo.c @@ -78,6 +78,7 @@ #define UDM_PARAM_QSTRING 23 #define UDM_PARAM_REMOTE_ADDR 24 #define UDM_PARAM_QUERY 25 +#define UDM_PARAM_STORED 26 /* udm_add_search_limit constants */ #define UDM_LIMIT_URL 1 @@ -293,6 +294,7 @@ DLEXPORT PHP_MINIT_FUNCTION(mnogosearch) REGISTER_LONG_CONSTANT("UDM_PARAM_SYNONYM", UDM_PARAM_SYNONYM,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCHD", UDM_PARAM_SEARCHD,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UDM_PARAM_STORED", UDM_PARAM_STORED,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("UDM_PARAM_QSTRING", UDM_PARAM_QSTRING,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("UDM_PARAM_REMOTE_ADDR", UDM_PARAM_REMOTE_ADDR,CONST_CS | CONST_PERSISTENT); @@ -975,6 +977,11 @@ DLEXPORT PHP_FUNCTION(udm_set_agent_param) UdmVarListReplaceStr(&Agent->Conf->Vars,"q",val); break; + + case UDM_PARAM_STORED: + UdmVarListReplaceStr(&Agent->Conf->Vars,"StoredAddr",val); + + break; #endif #endif @@ -1540,13 +1547,14 @@ DLEXPORT PHP_FUNCTION(udm_make_excerpt) if (Excerpt != NULL) { char *HlExcerpt = UdmHlConvert(&Res->WWList, Excerpt, Agent->Conf->lcs, Agent->Conf->bcs); UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",1); - UdmVarListReplaceStr(&(Res->Doc[row].Sections),"body",HlExcerpt); + UdmVarListReplaceStr(&(Res->Doc[row].Sections),"Body",HlExcerpt); UDM_FREE(HlExcerpt); UDM_FREE(Excerpt); } else { UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",0); RETURN_FALSE; } + }else{ php_error(E_WARNING,"%s(): row number too large", get_active_function_name(TSRMLS_C)); RETURN_FALSE; |