1
0

searchSettings.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /* $Id: searchSettings.php 2893 2007-04-14 13:20:30Z b4rt $ */
  3. /*******************************************************************************
  4. LICENSE
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License (GPL)
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. To read the license please visit http://www.gnu.org/copyleft/gpl.html
  14. *******************************************************************************/
  15. // prevent direct invocation
  16. if ((!isset($cfg['user'])) || (isset($_REQUEST['cfg']))) {
  17. @ob_end_clean();
  18. @header("location: ../../../index.php");
  19. exit();
  20. }
  21. /******************************************************************************/
  22. // search engine base
  23. require_once("inc/searchEngines/SearchEngineBase.php");
  24. // init template-instance
  25. tmplInitializeInstance($cfg["theme"], "page.admin.searchSettings.tmpl");
  26. // set vars
  27. $searchEngine = tfb_getRequestVar('searchEngine');
  28. if (empty($searchEngine))
  29. $searchEngine = $cfg["searchEngine"];
  30. if (is_file('inc/searchEngines/'.$searchEngine.'Engine.php')) {
  31. include_once('inc/searchEngines/'.$searchEngine.'Engine.php');
  32. $sEngine = new SearchEngine(serialize($cfg));
  33. if ($sEngine->initialized) {
  34. $tmpl->setvar('is_file', 1);
  35. $tmpl->setvar('mainTitle', $sEngine->mainTitle);
  36. $tmpl->setvar('searchEngine', $searchEngine);
  37. $tmpl->setvar('mainURL', $sEngine->mainURL);
  38. $tmpl->setvar('author', $sEngine->author);
  39. $tmpl->setvar('version', $sEngine->version);
  40. if (strlen($sEngine->updateURL) > 0) {
  41. $tmpl->setvar('update_pos', 1);
  42. $tmpl->setvar('updateURL', $sEngine->updateURL);
  43. }
  44. if (!($sEngine->catFilterName == '')) {
  45. $tmpl->setvar('cat_pos', 1);
  46. $tmpl->setvar('catFilterName', $sEngine->catFilterName);
  47. $cats = array();
  48. foreach ($sEngine->getMainCategories(false) as $mainId => $mainName) {
  49. array_push($cats, array(
  50. 'mainId' => $mainId,
  51. 'in_array' => (@in_array($mainId, $sEngine->catFilter)) ? 1 : 0,
  52. 'mainName' => $mainName
  53. )
  54. );
  55. }
  56. $tmpl->setloop('cats', $cats);
  57. }
  58. } else {
  59. $tmpl->setvar('is_file', 0);
  60. }
  61. }
  62. $tmpl->setloop('Engine_List', tmplSetSearchEngineDDL($searchEngine,true));
  63. //
  64. tmplSetTitleBar("Administration - Search Settings");
  65. tmplSetAdminMenu();
  66. tmplSetFoot();
  67. tmplSetIidVars();
  68. // parse template
  69. $tmpl->pparse();
  70. ?>