Search in mambo/smf-forums/coppermine-gallery

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

Previous topic - Next topic

rjprince

OK, 0.3 is up. I can't test the two-DB functionality, but it definitely pulls the db_name from the SMF settings.php file, so I don't see any reason it wouldn't work.

stephenvb, can you please download and test?

After stephenvb reports back (assuming success), I'm going to ask that everyone who's been testing to download the new version to test it again.

BTW, can I say I hate how PHP handles variable scoping. Hate. Hate. Hate.

stephenvb

#61
Yay!  It works!

(one small comment)  It displays the username instead of the name from SMF in the results, but can it just display the title (which would be consistent with the rest of the results) followed by the place?  Say remove "by cdadmin" from first result to be consistent with second result.

QuoteNational Trust list entire Detroit Region by cdadmin   (Other Related)
In topic "National Trust list entire Detroit Region:" In a rare move, the National Trust for Historic Preservation has listed the entire Detroit region as one of America's 11 Most Endangered Hist ...
05 August, 2005

Historic Detroit Neighborhoods (FAQs/Reference Information)
Have you ever wondered just where a certain neighborhood is located within Detroit?  We've got the answer!  Thanks to CityScapeDetroit for creating this map and allowing us to host a copy he ...
09 August, 2005

Great work though!  This adds so much value to my fledgling site.

rjprince

#62
Ah, my forum only displays the usernames, so I didn't even think of that as an option.

I see members.userName, members.realName, and messages.posterName. Can anyone point me to a quick rundown as to what is what?

If I'm just displaying a user name as the author of a message, is it safe to just use message.posterName?

Just saw your edit:

I could do that, but it's kind of useful on my site. Maybe I'll make it an mambot parameter.

But later. :)

[Unknown]

Quote from: rjprince on August 10, 2005, 10:53:51 PMI see members.userName, members.realName, and messages.posterName. Can anyone point me to a quick rundown as to what is what?

Err memberName you mean?  That's their username for logging in.  It really shouldn't be displayed anywhere.  The realName is their "real" displayed name.  That's the one to use.  The posterName is for guests and deleted members - it's set for everyone, but should only be shown if a matching ID_MEMBER members row is not found.

Quote from: rjprince on August 10, 2005, 10:53:51 PMIf I'm just displaying a user name as the author of a message, is it safe to just use message.posterName?

Not so much.  For one thing, they could have changed their name since posting.

-[Unknown]

rjprince

QuoteErr memberName you mean?

Err, yes, that's what I meant.

QuoteThe realName is their "real" displayed name.  That's the one to use.  The posterName is for guests and deleted members - it's set for everyone, but should only be shown if a matching ID_MEMBER members row is not found.

OK, easy change. I'll put in COALESCE(members.realName, message.posterName); that should do it.

I can't promise when the parameter for displaying or not will be added tonight, though. Depends on how much I want to procrastinate on other stuff. :D

rjprince

OK, I fixed which member names are being used as described above. I also turned the INNER JOIN connecting the member table into a LEFT JOIN so that deleted members won't keep a post from appearing in search. I also coalesced most of the display strings so there wouldn't be blank entries on the search results.

It's uploaded to my site (same link as above) as version 0.4.

I did not add a parameter to leave off the member name. I found a usability issue and I'd like input from the folks testing it before I make more changes.

The searchbot currently searches the body and the subject for the search text. The problem is, the default subject for replies is Re: <original subject>. This means that for every topic with the search text in the title, almost every post will appear in the search results. There are a few possibilities here:

1.) Only search subjects that don't match "Re: <original subject>" (I have access to the original subject for each result post). Upside: fairly simple to implement. Still returns multiple posts per thread if search text is in the posts. This is good if the thread is long and the search text isn't in most of the posts in the thread. Bad otherwise.

2.) Only return one result per topic, no matter how many posts match. Upside: Still fairly simple to implement, shouldn't hurt performance too much. Returns only one post per thread, which means in really long threads you still have to search manually.

3.) Something I haven't thought of but hopefully someone here will. :)

I know how I'll go about implementing either solution. What I need now are preferences and reasons for the preferences.

I also need people to download the new version and test it, preferably someone with some deleted users and people using alternate screennames to see if it works.

Thanks for any input - I even thank the bug finders. :)

stephenvb

Alternate screen names appear to be working.   (At least for me)

[Unknown]

If you only want to search topic subjects, you'll want to do it based on ID_FIRST_MSG, not whether Re: is there - for internationalization reasons.

SMF's search lists one result per topic, but may list multiple quotes from multiple posts in the topic which match.

-[Unknown]

d3v

Had to change couple of small things but I have this working on

Mambo 4.5.2.3
SMF 1.0.5

Thank you for this

rjprince

QuoteHad to change couple of small things but I have this working on

Mambo 4.5.2.3
SMF 1.0.5

What did you have to change? If we need to fork the versions, I'd like to make those changes available to others. I wrote if for Mambo 4.5.2.3 and SMF 1.1 beta 3, and I know at least one other person is using it for SMF 1.05 (don't know his Mambo version).

QuoteIf you only want to search topic subjects, you'll want to do it based on ID_FIRST_MSG, not whether Re: is there - for internationalization reasons.

I'd actually like to search message subjects that are different from the topic subject, so using ID_FIRST_MSG won't help. Assuming "Re:" is identifiable in the language files, I'll use that for the comparison.

"Re:" isn't a setting by any chance, is it?

rjprince

Found "Re:" in index.english.php. Not sure if it's worth the trouble to implement this part, because I don't have access to Load.php and would have to figure out the best way to pull in this value without it.

rjprince

#71
Version 0.5 of the searchbot is available at http://www.princeclan.org/component/option,com_docman/Itemid,91/

I modified the searchbot to not search the default subjects added to replies. If ANY change has been made to the default subject, then the subject is searched.

I could not get Load.php to load correctly without doing bad things to the site. So I compromised: the setting is in a variable which can be edited. If I add interactive settings, I'll make this an option that can be set from the admin panel.

However, this works well enough. Here are the directions from the readme file:

If you are not using the default English language files, you need to
modify the following lines in smf.search.php:

   // EDIT THIS LINE TO MATCH THE $txt['response_prefix'] = ENTRY IN YOUR LANGUAGE FILE index.english.php
   $response_prefix = 'Re: ';

Change the value of $response_prefix to the value of $txt['response_prefix'] in the index.<language>.php file.

rjprince

On thing I forgot to add:

Could some users please run some searches and report number of messages in their DB, number of results, and time to create the page (using the mambo page time code that's out there)?

I have no sense of how well this scales, but it's doing substring searches without full text indexing, so I'm thinking it's going to slow down at some size.

tempest2000

hi,
thanks for the plugin but i am having trouble installing it.

it seems to successfully upload the mambo and puts it in the list, but has no info next to it, and a message at the top saying:

Warning: file_get_contents(/home/httpd/vhosts/ourdomain.co.uk/httpdocs/mambots//search/smf.search.readme.txt.xml): failed to open stream: No such file or directory in /home/httpd/vhosts/ourdomain.co.uk/httpdocs/includes/domit/xml_domit_lite_parser.php on line 1031

If I change smf.search.xml in /httpdocs/mambots/search/ to smf.search.readme.txt.xml, it seems to read the info correctly and the error does not appear. the mambot seems to be installed. i also made the template change just before exactly as described.

however, i try various searches which i know will have results, and it does not come up with any smf posts.

any ideas rjprince?

thanks again!

tempest2000

#74
hmm, i changed smf.search.php to smf.search.readme.txt.php too and it all seems to work now - lots of results from the forum.

just as a further development: is it possible to add more radio paramaters to the search so that it can exclude forum posts etc. mambo articles now seem to get lost in all the forum results and it would be nice if people could have a bit more control of the results.

thanks again.

Sven0

#75
i get this error:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 12 bytes) in /usr/local/vhosts/httpd/htdocs/mambots/search/smf.search.php on line 193

how can i solve that?

Update: set the memory_limit = 16M in the php.ini, but:

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 515 bytes) in /usr/local/vhosts/httpd/htdocs/includes/joomla.php on line 4635

also if i try to search a non-existing word like asdfffssffs this error occurs:


Warning: main(/QueryString.php): failed to open stream: No such file or directory in /usr/local/vhosts/httpd/htdocs/forum/SSI.php on line 55

Fatal error: main(): Failed opening required '/QueryString.php' (include_path='.:') in /usr/local/vhosts/httpd/htdocs/forum/SSI.php on line 55

Sven0

#76
ok i deinstalled it and installed mod_smf_search_1.1b3.zip

but here is also an error, the URL is displayed as /index.php?option=com_smf&Itemid=198&?action=search2 with this error:

Query error, press Retry to continue if it doesnt continue automatically

the right URL would be without the ? before action=search2

how can i delete the ? in the script?

Update: found it in ssi.php

zigzag

Quote from: tempest2000 on December 03, 2005, 10:37:21 PM
hi,
thanks for the plugin but i am having trouble installing it.

it seems to successfully upload the mambo and puts it in the list, but has no info next to it, and a message at the top saying:

Warning: file_get_contents(/home/httpd/vhosts/ourdomain.co.uk/httpdocs/mambots//search/smf.search.readme.txt.xml): failed to open stream: No such file or directory in /home/httpd/vhosts/ourdomain.co.uk/httpdocs/includes/domit/xml_domit_lite_parser.php on line 1031

If I change smf.search.xml in /httpdocs/mambots/search/ to smf.search.readme.txt.xml, it seems to read the info correctly and the error does not appear. the mambot seems to be installed. i also made the template change just before exactly as described.

however, i try various searches which i know will have results, and it does not come up with any smf posts.

any ideas rjprince?

thanks again!
hmm, i changed smf.search.php to smf.search.readme.txt.php too and it all seems to work now - lots of results from the forum.

just as a further development: is it possible to add more radio paramaters to the search so that it can exclude forum posts etc. mambo articles now seem to get lost in all the forum results and it would be nice if people could have a bit more control of the results.

thanks again.

Hi,

I installed the mambot on a test site (different server) and had the same problem as Tempest2000 so I renamed the files as Tempest did and it worked fine (I'm using separate databases too).
So I did the exact same thing on my live site and got error messages so I uninstalled the mambot  and then everything on the site stopped working and I was prompted to download index.php on every link I clicked on  :o  Then for some unknown reason the site started working again but all the Joomla files had become unwritable.  Would this be caused by the mambot or is it likely to be a coincidence and something wrong on the server side? I want to get the search bot working but I'm a bit nervous to try it again so just wondered if anyone else had had the same problem.

zigzag

Ignore the previous post, I just found out that my hosts have had a major problem with the server and  are in the process of fixing it, so it was just coincidence that I happened to be installing the search bot at the same time  :D

ljk

I am running Joomla 1.0.11 and SMF 1.1 RC3. I just installed smf.search.alpha 0.5. I added the required code in the top of my Joomla template file as instructed in the readme file.

Now in the administrtor side of things when I try to edit any mambot I get an error message "Restricted Access" and the mambot is left locked.

The Joomla search box does not seem to return any forum topics either.

Any suggestions?

Advertisement: