Search in mambo/smf-forums/coppermine-gallery

Started by bmwheaven, March 25, 2005, 03:46:38 PM

Previous topic - Next topic

Aravot


rjprince

djpillo, unless you were installing the mambo searchbot mentioned just a few posts up, that change is unnecessary - although it shouldn't hurt anything, either.

I have no idea how the searchbot works in an unwrapped site, but it works fine in a wrapped site.

jorgen

Quote from: rjprince on July 30, 2005, 10:27:50 PM
Here's version 0.1 of a searchbot for smf.

rjprince,
It works perfect for me. Now I can finally get rid of my second search-box on my site, and have one single box that searches the entire site.

Thanks a lot for making this mambot.

Orstio: Maybe you could upload this bot to mamboforge? (I think most people would like to use this bot instead of the search-module I made).

[Unknown]

Quote from: rjprince on July 30, 2005, 10:06:50 PM
Here's the comment I added in the derived function:

I don't personally think that's necessary.  As long as you're using it with SMF, this seems perfectly fine:

// The code in this function is derived from function loadUserSettings() in Sources/Load.php.
// Used by permission of [Unknown] at http://www.simplemachines.org/community/.
// Use of Simple Machines Forum is subject to the license agreement with which it is distributed.


I'll have to consider making the Settings.php inclusion a direct include.  I can see the benefits, but it's also supposed to be only included once (in case you add things in there, which you should be able to... hmm.)

-[Unknown]

rjprince

I'm perfectly willing to turn this over to you all at this point. It is GPL because it's based on other GPL search mambots from which I copied and pasted. I suspect most of the changes that will be needed are smf-specific, so someone here will be in a better position to make them. Just leave a reference to me in the comments at the top, if you would, and I'll be perfectly happy.

It still needs lots of testing, obviously, especially with different configurations - wrapped/unwrapped, same db, different db. I just remembered that the URL generated is specific to a wrapped site with my itemid for the menu, so I do need to figure out how to generate the URL in a  generic fashion.

Thanks for everyone's help with this, and for putting out such a good forum.

jorgen

Rjprince,
No need to tutn this searchmambot-project over to anyone. But If you give a notice to Orstio everytime you make a new version, I'm sure he'll upload it to the usercreated module-section: http://mamboforge.net/frs/?group_id=543

It is just a convinient way for users to access all modules in one convinient place.   8)

rjprince

Version .2 is uploaded, same link. I changed the comments per [Unknown]'s last post and also fixed it so it should work in wrapped or unwrapped situations. Here's the code that sets the base URL (config.smf.php and Settings.php are both loaded and appropriated variables declared global.):

if ($wrapped) {
mysql_select_db($mosConfig_db);

$database->setQuery("SELECT id FROM #__menu WHERE link='index.php?option=com_smf'");

$myurl = $_SERVER['PHP_SELF'] . "?option=com_smf&Itemid=" . $database->loadResult() ."&";
} else {
$myurl = $boardurl . "/index.php?";
}


I can verify it works on my wrapped site. I assume the DB code is correct for retrieving the Itemid on other wrapped sites, because it's not hard-coded here.

What I can't test is the unwrapped portion (the line after the else). It's pretty straightforward code, and it returns a URL that looks right, but I haven't tested it.

I also added a readme file describing the changes to index.php and warning in the install to make the changes in the readme file.  :-[

I considered making substitutions for the [] codes in the portion of text displayed by the search results. However, I decided against it because I did not want to leave unclosed tags if only part of a tagged section got included. So the user sees the actual [] codes, not formatted text.

I don't think this is worth fixing, unless someone knows of a way to do so easily. So as of now, I consider this feature-complete and simply awaiting more testing on as many different configurations as possible. Then we can make it beta.

Feel free to post it at MF if you want.

Orstio

QuoteVersion .2 is uploaded, same link. I changed the comments per [Unknown]'s last post and also fixed it so it should work in wrapped or unwrapped situations. Here's the code that sets the base URL (config.smf.php and Settings.php are both loaded and appropriated variables declared global.):

I think you have misinterpreted the meanings of wrapped, unwrapped, and stand-alone.

Wrapped:  Inside the Mambo template
Unwrapped:  Still used as a Mambo component, with a Mambo URL, but looks stand-alone
Stand-Alone:  Not really integrated with Mambo, uses standard URL.

That said, the url, even if $wrapped = false, should point to the ?option=com_smf link.

rjprince

Oh. Then nobody download it until I can fix it.

I assumed. :(

rjprince


stephenvb

Quote from: rjprince on July 30, 2005, 10:27:50 PM
If anyone is using different databases, I need that checked as well. And people who didn't install mambo in the root and smf in the "forum" directory, along with combinations of SEF on and off.

Please post comments and suggestions here.

I can't get any results from my forum.  It is a separate database, wrapped installation of SMF.  I installed the mambot, revised the template index.php and published the mambot.  Is there anything else I need to do to get it to see the forum database?  criticaldetroit.org

(I assume from looking at the bots, that this one runs first, followed by all the other search bots.)

Orstio

Hmm... some of this is derived from SMF 1.1 beta 3.  Has anyone else tested it on SMF 1.0.x?

Aravot

Quote from: Orstio on August 09, 2005, 09:32:33 PM
Hmm... some of this is derived from SMF 1.1 beta 3.  Has anyone else tested it on SMF 1.0.x?

Not me

rjprince

Quote from: stephenvb on August 09, 2005, 08:49:08 PM
Quote from: rjprince on July 30, 2005, 10:27:50 PM
If anyone is using different databases, I need that checked as well. And people who didn't install mambo in the root and smf in the "forum" directory, along with combinations of SEF on and off.

Please post comments and suggestions here.

I can't get any results from my forum.  It is a separate database, wrapped installation of SMF.  I installed the mambot, revised the template index.php and published the mambot.  Is there anything else I need to do to get it to see the forum database?  criticaldetroit.org

(I assume from looking at the bots, that this one runs first, followed by all the other search bots.)

1. Did you go in and publish the bot? I've found that sometimes I need to go into the mambot form itself, instead of clicking the x in the list.

2. Try turning on debug mode an copy and paste the SQL statement that looks like the one I listed earlier in the thread. This will also print a warning if the SQL is bad.

If the bot generates bad SQL, it doesn't raise an error outside debug mode.

If you try 1 and it doesn't work, post the info from 2 and I'll look at it tomorrow.

BTW, I don't intend to make this work with 1.0x if that's the problem, although I'll be happy to help someone else adapt it if they need mambo help. I don't have any means to test, and it's just to frustrating to develop that way.

stephenvb

Quote from: rjprince on August 09, 2005, 10:43:40 PM
1. Did you go in and publish the bot? I've found that sometimes I need to go into the mambot form itself, instead of clicking the x in the list.

2. Try turning on debug mode an copy and paste the SQL statement that looks like the one I listed earlier in the thread. This will also print a warning if the SQL is bad.

If the bot generates bad SQL, it doesn't raise an error outside debug mode.

If you try 1 and it doesn't work, post the info from 2 and I'll look at it tomorrow.

BTW, I don't intend to make this work with 1.0x if that's the problem, although I'll be happy to help someone else adapt it if they need mambo help. I don't have any means to test, and it's just to frustrating to develop that way.

I've published the module as indicated above and it didn't help.  I did turn on debug and got the following information:

Search Keyword belle
Notice: Table 'critica3_mamb1.smf_members' doesn't exist in /home/critica3/public_html/includes/database.php on line 221

/home/critica3/public_html/includes/database.php:405
/home/critica3/public_html/mambots/search/smf.search.php:151
/home/critica3/public_html/mambots/search/smf.search.php:102
/home/critica3/public_html/includes/mambo.php:2939
/home/critica3/public_html/components/com_search/search.php:105
/home/critica3/public_html/components/com_search/search.php:18
/home/critica3/public_html/index.php:182
Notice: Table 'critica3_mamb1.smf_messages' doesn't exist in /home/critica3/public_html/includes/database.php on line 221

/home/critica3/public_html/includes/database.php:405
/home/critica3/public_html/mambots/search/smf.search.php:105
/home/critica3/public_html/includes/mambo.php:2939
/home/critica3/public_html/components/com_search/search.php:105
/home/critica3/public_html/components/com_search/search.php:18
/home/critica3/public_html/index.php:182returned 0 matches


If this is an issue with using SMF 1.0.x, should I upgrade to the beta version?  Is there a problem with the SMF installation?  I've seen simliar errors with some modules (SMF Recent Topics, SMF Whos Online2) that I couldn't get to work either.

rjprince

I can't speak to whether you should upgrade or not, but the search bot has only been tested on the beta version.

A couple of quick questions:

1.) Is critica3_mamb1 the name of the DB where SMF is located? My site has both in the same, and if I screwed up the db it would explain a lot.

2.) Is smf_ the prefix for your smf tables? I assume so, because it's not mine, so it must be pulling it from somewhere correctly. But let's double check.

For the devs: did the data structure change between versions? The problem here would be the messages and members tables, it appears. If not, then it's probably a databse name issue.

If I get the answer to these two questions before 8 tonight, I'll take a quick look and see if the I'm switching the db correctly. It's possible that the mambo db function switches the db back without my knowing it; if so, I can fix that pretty easily.

One other thing you could try, if your comfortable running queries on MyPHPAdmin or something similar, is to copy the SQL from the debug output and try running it directly in the appropriate db. If that works, we'll have narrowed the problem down to the database and we'll have a good idea that it['s likely to work with the stable version.

stephenvb

Quote1.) Is critica3_mamb1 the name of the DB where SMF is located? My site has both in the same, and if I screwed up the db it would explain a lot.

critica3_mamb1 is the separate database for the Mambo installation.  The separate SMF database is critica3_smf1 (on my installation).

Quote2.) Is smf_ the prefix for your smf tables? I assume so, because it's not mine, so it must be pulling it from somewhere correctly. But let's double check.

Looking through the SMF database, it appears that smf_ is the prefix for all the tables.  (Note:  SMF was installed from Fantastico on my host and this is the way they were installed.)

QuoteOne other thing you could try, if your comfortable running queries on MyPHPAdmin or something similar, is to copy the SQL from the debug output and try running it directly in the appropriate db. If that works, we'll have narrowed the problem down to the database and we'll have a good idea that it['s likely to work with the stable version.

You've lost me here.  (I'll admit to not knowing much about the "magic" behind SMF and Mambo)  If you need this information you'll have to walk me through it.  Sorry.

rjprince

Don't worry about it. It's not necessary - the db name is definitely a problem, and hopefully the only one.

Once I make the change, we can find out if it works under the stable version or only the new beta.

Either way, this has to be fixed, so I'll look at it tonight.

jorgen

#58
Quote from: Orstio on August 09, 2005, 09:32:33 PM
Hmm... some of this is derived from SMF 1.1 beta 3.  Has anyone else tested it on SMF 1.0.x?

I've installed it on my live site (1.0.5, see signature) AND my local test site (1.1b3).

The bot seems to work fine in both!    :D

rjprince

Excellent. Then I'll fix the multi-db problem and we should be good to go. :)

I'd like to hear from everyone else about a week after I fix this. Hopefully we'll be ready to go alpha at that point.

Advertisement: