Joomla Forum

Joomla Hacks => Mambo-SMF 1.3.x => Topic started by: Geoffrey Makstutis on August 08, 2005, 09:11:03 AM



Title: integrated search
Post by: Geoffrey Makstutis on August 08, 2005, 09:11:03 AM
Hi,

I'm wondering if anyone has (or knows of) a mambot that will allow you to search SMF forums from within the main Mambo search function? I noted that the SMF-Bridge project has just released a mambo to do this. I've had a look at it, but (not being a very advanced PHP/Mambo coder) I couldn't see what would be needed to make it work for Mambo-SMF.

Anyone willing to take up the gauntlet?


Title: Re: integrated search
Post by: Editor (cowboy) on August 09, 2005, 12:58:54 PM
Geoffrey,

There's probably some restrictions on the code, because I don't see why it wouldn't work. I can check that when I get a chance. It should be fairly easy.


Title: Re: integrated search
Post by: d3vlabs on August 09, 2005, 01:18:26 PM
Here's the file's URL: http://mamboforge.net/frs/download.php/6942/smf.search.zip

This is the readme that comes with the file

Code:
IMPORTANT! THE INDEX.PHP FOR YOUR MAMBO TEMPLATE MUST BE MODIFIED!

The SMF bridge instructions tell you to add this code immediately above </head>:

global $sc, $context;

if (!defined('SMF')){
  require ("administrator/components/com_smf/config.smf.php");
  require_once ($smf_path."/SSI.php");
}

$sc = &$context['session_id'];

You need to change this code to the following:

global $sc, $context;

if (!defined('SMF')){
  require ("administrator/components/com_smf/config.smf.php");
    require ($smf_path . "/Settings.php");
  require_once ($smf_path."/SSI.php");
}

$sc = &$context['session_id'];

Simply add the missing line between the require statements.

If you don't do this, your site will not function!

I attempted this with Latest MamboHacks bridge and Latest Mambo. The bot DID NOT WORK. cowboy, post your thoughts or maybe post your working version  ;D please. This is a heavily anticipated feature...at least by me


Title: Re: integrated search
Post by: d3vlabs on August 14, 2005, 06:21:38 AM
err I didnt realized that MamboHacks SMF bridge modifieds mambo/index.php and not mambo/templates/templatename/index.php. This is better actually since it will work on any template you have. To make smf searchbot work on your site using Mambohacks.com bridge add this code to your mambo/index.php:

Code:
if (file_exists($smf_path."/Settings.php"))
require ($smf_path . "/Settings.php");

right after

Code:
if (file_exists($smf_path."/SSI.php"))
require_once ($smf_path."/SSI.php");[

This should be around line 28 under //MAMBOHACKS.COM category. Make sure you do this after you patch your index.php file via bridge's backend component.
This is tested on Mambo 4.5.2.3 with the latest bridge. Take care.


Title: Re: integrated search
Post by: Editor (cowboy) on August 15, 2005, 11:28:20 AM
d3vlabs,

Nice job, it worked.

It just return to many result, like 1000+ for me. It still needs to implement result paging.


Title: Re: integrated search
Post by: Milos on March 01, 2006, 02:29:19 PM
Is there any possibility to make this bot to work without bridge?



Title: Re: integrated search
Post by: trade on May 26, 2006, 02:34:27 AM

  I can not find the code you said....What I added is below

 
Code:
<?php 
global $sc$context$settings;

if (!
defined('SMF')){
// Get the configuration. This will tell Mambo where SMF is, and some integration settings
$database->setQuery("
SELECT `variable`, `value1`
FROM #__smf_config
"
);
$variables $database->loadAssocList();

foreach (
$variables as $variable){
$variable_name $variable['variable'];
$
$variable_name $variable['value1'];
}
require (
$smf_path."/SSI.php");
}

$sc = &$context['session_id'];
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

mysql_select_db($mosConfig_db);

echo 
'
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?beta4"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_session_id = "'
$context['session_id'], '";
// ]]></script>'
;

echo 
'
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc1" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?beta4" media="print" />
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';
?>





 So I don't know where to change. If possilbe, could you tell me ?
 I think the version of bridge is different. Mine is 1.1.4

 Thanks !


Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com