search module?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: search module?

Post by Ted »

Anything that includes it's own files should probably be done as a module.  If you'd like to do so, that would be great!  If not, I'm sure someone else could probably do it.  Search is a pretty requested module around here.

Thanks!
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

Re: search module?

Post by megabob3 »

Rocko if you are not working on create the module, i can do that.

I am starting on it however ;)

Bye :)
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

Re: search module?

Post by megabob3 »

megabob3 wrote: Rocko if you are not working on create the module, i can do that.

I am starting on it however ;)

Bye :)
I saw it and i do not liked it.

Maybe i don't understood very well it, however i aborted this mission, sorry.
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

Re: search module?

Post by megabob3 »

http://phpdig.net/  it's really funny and i guess better, guys i am waiting your module :D
100rk

Re: search module?

Post by 100rk »

megabob3 wrote: http://phpdig.net/  it's really funny and i guess better, guys i am waiting your module :D
Because of the time consuming indexing process, PHP must not be safe_mode configured and the server that performs the index must not timeout. Also, the PHP allow_url_fopen option must be enabled. (http://www.phpdig.net/navigation.php?action=doc)

I am afraid this limitation makes phpdig unusable on most of webhostings. :-(
koehler

Re: search module?

Post by koehler »

Why not let google do the work for you ? After finishing my mod_rewrite work for the news module my site was well indexed from the SE's
100rk

Re: search module?

Post by 100rk »

koehler wrote: Why not let google do the work for you ? After finishing my mod_rewrite work for the news module my site was well indexed from the SE's
You have no guarantee Your pages will be indexed, You have no control about indexing frequency, Your own search module can provide more detail settings about what/when/why/where index or not (or propably provide some interface for CMSMS modules for centralized realtime search in database tables)... ;-)
Last edited by 100rk on Tue Apr 19, 2005 11:55 am, edited 1 time in total.
sagarkale

Re: search module?

Post by sagarkale »

Hello Friends,

Any progress on Search module/plugin. Can anybody upload/mail WIP copy of phpDig/iSearch version?

Thanx
Alex_Leipzig

Re: search module?

Post by Alex_Leipzig »

Hi there,

I installed isearch on my website (www.uni-leipzig.de/~ialt/cms/) and I quite like it. The configuration is almost too detailled, but very good. Spidering was alright, too. Now I'm trying to integrate isearch as a user tag:

Code: Select all

/* Include the iSearch search form */
/* Relative reference to isearch directory */
$isearch_path = "../modules/isearch2";
/* Optional - set the width of the entry box in chars */
$isearch_searchFormWidth = 12;
/* Optional - set target frame for search results. */
/* Default value is "_self". */
$isearch_resultFrame = "_self";
/* Optional - add a "Search Internet" button to be displayed.*/
/* Default value is True.*/
$isearch_allowSearchInternet = False;
include("$isearch_path/inc/form.inc.php");
Here is the error message that I get on the search page (http://www.uni-leipzig.de/~ialt/cms/ind ... ge=Sitemap):
Warning: Failed opening '../modules/isearch2/inc/form.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /data/homewww/isuew/webdir/cms/lib/content.functions.php(432) : eval()'d code on line 12
Can somebody help me out?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: search module?

Post by Ted »

What file (with full path) is actually opening form.inc.php?
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Re: search module?

Post by nils73 »

I have been playing around with version 0.10 and --- WOW --- very nice. However, I have followed the search-discussion to this very point. Has anybody come up with a search-feature yet? Would be very nice to have one apart from Google, because in Intranets (where I would like to use CMSMS) this is not possible.

Any modules, hints, solutions?

Regards
Nils
Alex_Leipzig

Re: search module?

Post by Alex_Leipzig »

wishy wrote: What file (with full path) is actually opening form.inc.php?
I'm afraid I don't understand the question...
roman
Forum Members
Forum Members
Posts: 77
Joined: Thu May 12, 2005 9:38 am
Location: slovakia

Re: search module?

Post by roman »

I am working on creating search plugin for this CMS. It's not flexibly, but is running.

In template of page is user tag {search_this_site} which is containing:

$buttonText = 'Search';
if (!empty($params['buttonText']))
$buttonText = $params['buttonText'];
return '


';

And you must create page with Page Alias "search_results" witch is containing tag {search_result}
In this tag you must paste code:

$q = $_POST['q'];
echo "Searching results for: '",$q,"'";
$query1 = "SELECT `content_name`,`content_alias` FROM `ubg`.`content` WHERE `content_name` LIKE '%".$q."%'";
$result1 = mysql_query($query1) or die("Search error");
print "In titles of items:\n";
while ($row = mysql_fetch_object($result1)) {
  print "\t\n";
  echo "\t  ";
  echo "\tcontent_alias,"'>",$row->content_name,"\n";
  print "\t\n";
}
print "\n";
mysql_free_result($result1);




Similar I like to do it part for searching items, where I'l deump link for items, where in it's content is searchable string (not working now):
$query = "SELECT `content_id` FROM `ubg`.`content_props` WHERE `content`
LIKE '%".$q."%'";
$result = mysql_query($query) or die("Search error");
print "\n";
while ($row2 = mysql_fetch_object($result, MYSQL_ASSOC)) {
  $num=$row2->content_id;
 
}
mysql_free_result($result);
roman
Forum Members
Forum Members
Posts: 77
Joined: Thu May 12, 2005 9:38 am
Location: slovakia

Re: search module?

Post by roman »

rocko wrote: works dis mit 9.3 oder 01.2
works mit 0.9.2. if it's working witn newest wersion, i don't now. noch, you must change string my site with yoursite(path) string, or making some nicest code
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Re: search module?

Post by nils73 »

roman,

I picked up your idea on full-text-search and developed 'something' a little bit more standard-compliant, but it still lacks a lot of features, like proper encoding of html-entities and some security features that block sql-injections. After all, I am not really good at PHP ... so this might be an excuse. This one works with 0.10 but it should do with 0.9 as well ... just make sure you edit the SQL-Statement (starting with SELECT) to meet the database-prefix (here: cms_) if you have changed it during install.

Here's the code:

Code: Select all

global $gCms;
$q = $_POST['q'];
/* Transforming special characters into HTML readable entities  
   $q = str_replace(array('Ä','Ö','Ü','ä','ö','ü','ß'),array('Ä','Ö','Ü','ä','ö','ü','ß'),$q);
   ---> not finished yet */
echo "<h4>Your search results for: '",$q,"'</h4>\n";

// Query the database (full text search)
$query1 = "SELECT cc.content_name, cc.content_alias FROM cms_content AS cc, cms_content_props AS ccp WHERE cc.content_id = ccp.content_id AND ccp.content LIKE '%".$q."%'";
$result1 = mysql_query($query1) or die("There was an error processing your request.");

// Count the results
$counter = "SELECT COUNT(content_id) FROM cms_content_props WHERE content LIKE '%".$q."%'";
$count_result = mysql_query($counter);

if ((mysql_result($count_result,0)) > 0) // are there results?
  {
    // yes, there are results ...
    print "<p>The following results have been found:</p>\n<ol>\n";
    while ($row = mysql_fetch_object($result1))
      {
        echo "\t<li><a href='",$gCms->config['root_url'],"/",$row->content_alias,".shtml'>",$row->content_name,"</a></li>\n";
      }
    print "</ol>\n";
    mysql_free_result($result1); // reset
  }
else
  {
  // no, nothing was found
  print "<p>Sorry, your search yielded no results.</p>\n";
  print "<p>Please try again using a different search word.</p>\n";
  }
mysql_free_result($count_result); // reset
Make sure to follow the steps outlined by roman to set up the script with CMSMS.

Regards,
Nils
Post Reply

Return to “Modules/Add-Ons”