7
Hello,
Could someone help me with the search function please, I'm really struggling to understand what needs to be edited, I've got it to show up in the search results but it's not picking up anything just showing 0 results so I must be missing something:
I've called Author 'Business Directory'
and the directory is named 'BusinessDirectory'
and the XOOPS url is 'http://www.mysite.co.uk/xoops2/'
search.php
// XOOPS2 - Auth version 1 - Search function
// Presented by ADMIN @ ROUTE286, 2004.
function auth_search ( $queryarray , $andor , $limit , $offset , $userid )
{
// ¤³¤³¤«¤éÊѹ¹¹àÌܤǤ¹¡£
// ¡ü ǧ¾Ú¥Ç¥£¥ì¥¯¥È¥ê(¥Õ¥©¥ë¥À)
// config.php ¤ËµºÜ¤·¤Æ¤¤¤ë¤â¤Î¤ÈƱ¤¸¤Ç¤¹¤¬¡¢
// ´ÖÀÜ»ØÄê¤Ï "/home/(¥â¥¸¥å¡¼¥ë̾)/(¥Ç¥£¥ì¥¯¥È¥ê̾)" ¤Ç¤¹¡£
// $auth_dir = "modules/auth/sample";
// ľÀÜ»ØÄê¤Ç¤âµºÜ²Äǽ¤Ç¤¹¡£
// $auth_dir = "/home/username/htdocs/xoops/modules/auth/sample";
$auth_dir = "modules/auth/sample";
// ¡ü ½ÐÎÏ¥µ¥¤¥º
// ɽ¼¨¤¹¤ë¥µ¥¤¥º(Ⱦ³Ñʸ»ú¿ô)¡£
// ¥Õ¥¡¥¤¥ë¤ÎƬÉôʬ¤¬½ÐÎϤµ¤ì¤Þ¤¹¡£
$auth_size = 77;
// ¡ü ¶èÀÚ¤ê(¥Ç¥ê¥ß¥¿)
// config.php ¤ÎµºÜ¤Ë¹ç¤ï¤»¤ÆÊѹ¹¤·¤Þ¤¹¡£Æ¬¤Ë index.php ¤ò´Þ¤á¤Æ²¼¤µ¤¤¡£
// "index.php/" "index.php?" ¤È¤·¤Þ¤¹¡£
// Apache ¤Ë¤è¤ë index.php ¤Î¾Êά¤ò¹Ô¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï "" ¤È¤Ç¤¤Þ¤¹¡£
$auth_delimiter = "index.php/";
// ¤³¤³¤Þ¤ÇÊѹ¹¹àÌܤǤ¹¡£°Ê²¼¤ÏÊѹ¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
if ( isset ( $queryarray ) )
{
return "";
}
$auth_searchcount = 0;
$auth_handle = opendir ( $auth_dir );
while ( FALSE !== ( $auth_filename = readdir ( $auth_handle ) ) )
{
if ( FALSE !== strstr ( $auth_filename , ".htm" ) )
{
$auth_filelist = file ( "$auth_dir/$auth_filename" );
$auth_file = implode ( "" , $auth_filelist );
$auth_file = strip_tags ( $auth_file );
$auth_title = mb_strimwidth ( $auth_file , 0 , $auth_size , "..." );
// $auth_title = $auth_filename;
if ( $andor == "and" || $andor == "AND" )
{
$auth_ok = 1;
foreach ( $queryarray as $auth_query )
{
if ( FALSE === ( strpos ( $auth_file , $auth_query ) ) )
{
$auth_ok = 0;
break;
}
}
}
else
{
foreach ( $queryarray as $auth_query )
{
$auth_ok = 0;
if ( FALSE !== ( strpos ( $auth_file , $auth_query ) ) )
{
$auth_ok = 1;
break;
}
}
}
if ( $auth_ok == 1 )
{
if ( ( $offset <= $auth_searchcount )
&& ( ( $offset + $limit ) > $auth_searchcount ) )
{
$ret[] = array(
"link" => "$auth_delimiter"."$auth_filename" ,
"image" => "search.gif" ,
"title" => "$auth_title" ,
"uid" => "0" ,
"time" => ""
);
}
$auth_searchcount ++;
}
}
}
return $ret;
}
?>
xoops_version.php
// $Id: xoops_version.php,v 1.4 2003/09/21 07:40:10 kousuke Exp $
// XOOPS2 - Auth version 1
// Presented by ADMIN @ ROUTE286, 2004.
// ¡ü ¥â¥¸¥å¡¼¥ë̾
// ¥á¥¤¥ó¥á¥Ë¥å¡¼¤Ëɽ¼¨¤µ¤ì¤ë̾¾Î¤Ç¤¹¡£
$modversion['name'] = 'Auth ¥â¥¸¥å¡¼¥ë';
// ¡ü ÊÝ´ÉÀè¥Ç¥£¥ì¥¯¥È¥ê
// ¥Ç¥£¥ì¥¯¥È¥ê auth ¤«¤éÊ̤Î̾Á°¤Ë¤·¤¿¾ì¹ç¤ÏÊѹ¹¤·¤Æ²¼¤µ¤¤¡£
$modversion['dirname'] = "auth";
// ¡ü ¥µ¥Ö¥á¥Ë¥å¡¼
// ¥µ¥Ö¥á¥Ë¥å¡¼¤òÄɲä·¤¿¤¤¾ì¹ç¤Ï°Ê²¼¤ÎµºÜ¤òÄɲä·¤Þ¤¹¡£
// $modversion['sub'][1]['name'] = "¥á¥Ë¥å¡¼Ì¾";
// $modversion['sub'][1]['url'] = 'index.php/¥Õ¥¡¥¤¥ë̾';
// ¸À¸ìÊ̤˥á¥Ë¥å¡¼Ì¾¤òʬ¤±¤¿¤¤¾ì¹ç¤Ï
// $modversion['sub'][1]['name'] = _AT_MENU_1;
// $modversion['sub'][1]['url'] = 'index.php/¥Õ¥¡¥¤¥ë̾';
// ¤È¤·¡¢lunguage/(¸À¸ì)/main.php ¤Ë°Ê²¼¤òÄɲä·¤Þ¤¹¡£
// define ( "_AT_MENU_1" , "¥á¥Ë¥å¡¼Ì¾");
// ¡ü ¸¡º÷µ¡Ç½
// ¸¡º÷µ¡Ç½¤òÄɲ乤ë¾ì¹ç¤Ï°Ê²¼¤Î¤È¤³¤í¤òÄɲä·¤Þ¤¹¡£
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = "search.php";
$modversion['search']['func'] = "auth_search";
// ¤³¤³¤Þ¤Ç¸¡º÷µ¡Ç½ÄɲÃ
$modversion['description'] = $modversion['name'];
$modversion['version'] = "1.13";
$modversion['credits'] = "";
$modversion['author'] = 'Presented by ADMIN @ ROUTE286.';
$modversion['help'] = "help.html";
$modversion['license'] = "GPL see LICENSE";
$modversion['official'] = 0;
$modversion['image'] = "files/authlogo.gif";
$modversion['hasMain'] = 1;
$modversion['hasAdmin'] = 0;
?>