Aug 08, 2008, 02:20 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: 1 ... 13 14 [15] 16 17 ... 40   Go Down
  Print  
Author Topic: Support/Comments for AjaxSearch  (Read 85078 times)
0 Members and 2 Guests are viewing this topic.
atma
Jr. Member
*
Posts: 20


Born in USSR


« Reply #210 on: May 31, 2007, 02:35 AM »

If you had problems with search not latin symbols (cyrillic In my case), offer my decision.
Replace in file AjaxSearch.js line ~111:
Code:
search: s,
with
Code:
search: unescape( encodeURIComponent( s ) ),
and line ~140:
Code:
    $('current-search-results').setHTML(decodeURIComponent(request));
with
Code:
    $('current-search-results').setHTML(decodeURIComponent( escape( request ) ));

Only it works in Firefox 1.5, Internet Explorer 6.0.2900.2180, Opera 9.0.8502, Camino 1.0.2, Safari 2.0.4
Logged
rthrash
Foundation
*
Posts: 9,032



WWW
« Reply #211 on: May 31, 2007, 07:50 AM »

I'm assuming it also works in Firefox 2.0.x and IE 7, too?
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
atma
Jr. Member
*
Posts: 20


Born in USSR


« Reply #212 on: May 31, 2007, 10:47 AM »

I'm assuming it also works in Firefox 2.0.x and IE 7, too?
Yes, of course Smiley
Works in Firefox 1.5, Internet Explorer 6.0.2900.2180, Opera 9.0.8502, Camino 1.0.2, Safari 2.0.4 and higher.
Logged
FuryDE
Full Member
***
Posts: 134



« Reply #213 on: Jun 01, 2007, 06:44 AM »

Hello.

I got a little (hope so) problem with this snippet. I'm using modX 0.9.5 and updated AjaxSearch to the current version 1.6.

I added

Code:
[!AjaxSearch? &ajaxSearch=`0` &AS_landing=`30` &AS_showResults=`0`!]

to my template and on page ID 30 I added

Code:
[!AjaxSearch? &AS_showResults=`1` &AS_showForm=`0` &showMoreResults=`1`!]
to the content. I intentionally deactivated ajaxSearch because it's my first steps with this snippet. So now to my problem: The search does not find any results. I have tried many different searches but they all lead to nothing. At last, I think that it finds nothing for nothing is outpu. The source just shows a

Code:
<div id="ajaxSearch_output" style="opacity:0;"> </div>
Well, that opacity:0 is interesting, but this is not the problem yet.

Can anybody help me here? BTW: all pages of my site are currently set to be "searchable".

Thanks and greetings from the "Bierstadt Einbeck" in Germany
Martin
Logged
nos
Member
**
Posts: 88


« Reply #214 on: Jun 01, 2007, 10:20 AM »

Always there is the problem with AS and special chars - utf-8 (atma's patch doesn't work for me)

is it AS or the server config?

my personal dilemma is that my knowledge of IT at this time does not allow to move the AS coders or my hoster to act.

With a search the PHP request header allows utf8 und ISO-8859-1. The response header only delivers ISO-8859-1.  DB config is like this:
collation_connection     utf8_general_ci     ok
collation_database     utf8_general_ci     ok
collation_server     latin1_swedish_ci   Huh
I'm not allowed to change server configs. The Hoster surely doesn't want to  ("latin1_swedish_ci is a standard config in europe." he says).

One could say it is better to search the way FlexSearch for example does (that meens to change AS for more flexibility with hosters).

By the way: With &ajaxSearch=`0` search finds but is case sensitiv i. e. "über" doesn't find "Über" (in my 0.9.6 install).
Though modX is mostly an ingenious tool in my eyes (3. install), ...
Logged
atma
Jr. Member
*
Posts: 20


Born in USSR


« Reply #215 on: Jun 01, 2007, 12:51 PM »

Always there is the problem with AS and special chars - utf-8 (atma's patch doesn't work for me)

is it AS or the server config?

Maybe you help this:
add in file AjaxSearch.inc.php after
Code:
$selected = mysql_select_db($database, $db) or die ("Cannot select database (connectForAjax)");

similar code (this in my case)
Code:
mysql_query("SET CHARACTER SET utf8;");
         mysql_query("SET NAMES 'utf8';");
         mysql_query("SET character_set_results = 'utf8';");
         mysql_query("SET collation_connection = 'utf8_general_ci';");
Logged
OpenGeek
MODx Co-Founder
Foundation
*
Posts: 4,546


looking a little more like my avatar again...


WWW
« Reply #216 on: Jun 01, 2007, 01:11 PM »

Good call atma.  I thought this had been updated, but apparently not.  You only need the first call BTW:
Code:
mysql_query("SET CHARACTER SET utf8;");
See more information regarding this at http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html; and in particular, this section describes how SET CHARACTER SET works...
Quote
SET CHARACTER SET is similar to SET NAMES but sets character_set_connection and collation_connection to character_set_database and collation_database. A SET CHARACTER SET x statement is equivalent to these three statements:

SET character_set_client = x;
SET character_set_results = x;
SET collation_connection = @@collation_database;

I'll make sure and get AjaxSearch updated and into the 0.9.6.1 release.
Logged

Jason Coward
MODx Co-Founder
xPDO Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
If you think of yourselves as helpless and ineffectual, it is certain that you will create a despotic government to be your master. The wise despot, therefore, maintains among his subjects a popular sense that they are helpless and ineffectual.
  — Frank Herbert
MotSmart
MODx RTL Guru.
Moderators
*
Posts: 839



WWW
« Reply #217 on: Jun 01, 2007, 05:20 PM »

This issue will be lost here, anybody made a bug/suggest yet?
« Last Edit: Jun 01, 2007, 05:22 PM by MotSmart » Logged

[Search] [Add-ons] | [MODx Lovers Don't miss this link!]
[Documentation] [Wiki]
[Persian support forum]
[RoadMap] [SVN] [RTL SVN Branch] [Development] [Trac] [FishEye+Crucible] [Confluence] | [My Google Code]
[برای دسترسی به راهنمای فارسی به  » وبگاه مادایکس فارسی « و یا به » انجمنهای پشتیبانی فارسی مادایکس « مراجعه کنید]
A Person is Either your Brother in Faith or Your Equal in Humanity. - Imam Ali.  # Discover Islam. | # Discover Middle East @ PressTV.
MEGU
Moderators
*
Posts: 734



WWW
« Reply #218 on: Jun 02, 2007, 01:21 AM »

Dear All,

I thank your great work, Ajaxserch.

> Dear MotSmart.
I have also same trouble with strange black box under the search box.
I think that Ajaxsearch do not work with to that state.
I checked about this trouble in detail.
The result, AjaxSearch has some trouble with CACHE, I think.

I tried the the following:

First, create a simple document like the following.
Code:
<html>
<head>
</head>
<body>
<div id="search">[!AjaxSearch? ajaxSearch=`1` &addJscript=`1`!]</div>
</body>
</html>
The template of document is blank.
Document cache is "YES".

Access to the page which created the above.
At first, Ajaxsearch would work normally.

And again, access to  this page (not REROAD).
(The word "Search here..." will appear in textbox).

In this situation, AjaxSearch do not work.

Next, Clear cache in the manager.
Again, access to this page.
AjaxSearch works.

The same phenomenon is caused in the sample web site.
Then, the strange black box will appear under the search box with IE(6).

Sincerely yours,
---*---*---*---*---*---
P.S.
If document cache is "NO", this issue would not be caused.
« Last Edit: Jun 02, 2007, 01:24 AM by MEGU » Logged
MotSmart
MODx RTL Guru.
Moderators
*
Posts: 839



WWW
« Reply #219 on: Jun 02, 2007, 09:24 AM »

Combination of ATMA and MEGU solutions worked like a charm for me... many thanks
Logged

[Search] [Add-ons] | [MODx Lovers Don't miss this link!]
[Documentation] [Wiki]
[Persian support forum]
[RoadMap] [SVN] [RTL SVN Branch] [Development] [Trac] [FishEye+Crucible] [Confluence] | [My Google Code]
[برای دسترسی به راهنمای فارسی به  » وبگاه مادایکس فارسی « و یا به » انجمنهای پشتیبانی فارسی مادایکس « مراجعه کنید]
A Person is Either your Brother in Faith or Your Equal in Humanity. - Imam Ali.  # Discover Islam. | # Discover Middle East @ PressTV.
nos
Member
**
Posts: 88


« Reply #220 on: Jun 02, 2007, 11:58 AM »

@ atma and the other AS friends

sorry, both of your suggestions don't work for me, not even in combination. Does that mean, the collation_server has to be utf8 too? (see Reply #214) or what could have been run the wrong way?

(Additional info: db fields are set to utf8 too, Editor is set to raw entity coding, modx is set to utf-8 coding, pages are ok in look and html's show original chars i.e. ä)

Looking via phpMyAdmin into a db field the word "Geräte" is written "Geräte" on the (utf-8 coded) page, in html source it reads there "Ger%C3%83%C2%A4te".

So, if I search for "Geräte" AS will find (no highlight in the page and "Geräte" in the search term message).

Huh
Logged
atma
Jr. Member
*
Posts: 20


Born in USSR


« Reply #221 on: Jun 02, 2007, 01:27 PM »

I'm not allowed to change server configs. The Hoster surely doesn't want to  ("latin1_swedish_ci is a standard config in europe." he says).
but you have permission to phpMyAdmin... At the main page of phpMyAdmin this field are readonly?

After you will create (edit) page MODx and will receive the same result in phpMyAdmin, AjaxSearch too will earn normally... I hope  Roll Eyes
Quote
So, if I search for "Geräte" AS will find (no highlight in the page and "Geräte" in the search term message).
What about CSS:
.AS_ajax_extract{xxx;}
.AS_ajax_highlight{xxx};
.ajaxSearch_highlight {xxx;}
.ajaxSearch_highlight1 {xxx;}
etc?
« Last Edit: Jun 02, 2007, 04:04 PM by atma » Logged
nos
Member
**
Posts: 88


« Reply #222 on: Jun 03, 2007, 04:28 AM »

thanks for reply atma,
I can not reach this page in phpMyAdmin. I've got three possible dbs from the hoster - creating a new db is only possible from a confixx interface. phpMyAdmin states: creating new db - no rights, so it's readonly - yes.

sql statement:
SHOW VARIABLES LIKE 'character_set%';
SHOW VARIABLES LIKE 'collation%';
results in
collation_connection     utf8_general_ci
collation_database    utf8_general_ci
collation_server    latin1_swedish_ci  <--- I can not change
(MySQL 5.0.32-Debian_7etch1-log)

as for AS highligting css): search without special chars is running fine.


* nos_sql_screen.gif (12.24 KB, 383x121 - viewed 140 times.)
« Last Edit: Jun 03, 2007, 04:31 AM by nos » Logged
OpenGeek
MODx Co-Founder
Foundation
*
Posts: 4,546


looking a little more like my avatar again...


WWW
« Reply #223 on: Jun 03, 2007, 10:46 AM »

@nos: you do not need to change the server value.  You just need utf8 as the database_connection_charset value so that the MODx db connection knows what charset your database (and the tables in it) actually has.  That's what SET CHARACTER SET statement does; it switches the MySQL client connection to the proper charset/collation for whatever queries follow it.
Logged

Jason Coward
MODx Co-Founder
xPDO Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
If you think of yourselves as helpless and ineffectual, it is certain that you will create a despotic government to be your master. The wise despot, therefore, maintains among his subjects a popular sense that they are helpless and ineffectual.
  — Frank Herbert
nos
Member
**
Posts: 88


« Reply #224 on: Jun 04, 2007, 02:42 AM »

@opengeek
I agree and see it this way too. So why AS doesn't work accordingly? I did this changes dicussed here (see replies below) but nothing changes in AS output.
 Sad
Logged
Pages: 1 ... 13 14 [15] 16 17 ... 40   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!