Gossamer Forum
Home : Products : Links 2.0 : Customization :

Category Search (non-english) Widgetz !!!

Quote Reply
Category Search (non-english) Widgetz !!!
I been waithing for this so long, and i see no light in a tunel Smile
Jerry done good mod Category Search u can see it at.
http://www.widgetz.com/links_mods/
But non-egnlish is not coming, Anyone can you help?
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
i'll make it now with your help..

just tell me a few things..

what is different about the category names in non-english?

are their more than one in the category.db? english and non english?

which one is listed in the links.db file? english or nonenglish?

if there are 2 categories.. and there is an english category.. and in links.db the english one is used.. then the current category search mod will work.. however if the nonenglish is listed.. there will need to be a little tweaking done..

jerry
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Hi Jerry,

For Chinese/Japanese/Korean char, It's 2 bytes per character.

Humm, Is it useful to you?
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Ok, here it goes,

Category name is displayed with non-English characters, and where you getting category name to form, as<%category%> it gets that name with non-English characters.
category.db is only one file
here is some lines from category.db


64|Kompiuteriai-Internetas/Internetas/Faksinis_rysys&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;|Kompiuteriai-Internetas\Internetas\Faksinis ryðys
65|Kompiuteriai-Internetas/Internetas/El_pastas&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;|Kompiuteriai-Internetas\Internetas\El. paðtas



in links.db all category names is only with English characters

I tried your English mod it works OK if there is no non-English character in category name.


I hope this will help
oh , Jerry leech links.db from another server and use with other links script?

Thak you Jerry for your help.

Rimvis
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
correction,

oh , Jerry is possible to leech links.db from another server and use with other links script?

Rimvis
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Any suggestions, anyone?!

Rimvis
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
 
Quote:
oh , Jerry is possible to leech links.db from another server and use with other links script?

You can try to use Net:FTP, but as Widgetz as stated in another Thread, it is quite cumbersome and uses a lot of server resources.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Codes look very clean to me. If they work...that is the most important thing.

I would recommend adding these codes in the Modification section of LINKS 2.0 in the Resource Center. And while you are at...if you are using Subcategories like Yahoo v2.1 or v.2.0, you might want to consider using the same logic in that Mod.

Thanks for the contribution.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
I figured it out!
Since widgetz's mod returned the value of <%category_name_escaped%> to search.cgi,
but the non-English mod make some change on $category_name_escaped,
the problem happen thus.

Somebody may have fixed it already, but I just think no harm to share my code:

Step 1:
in nph-build.cgi, sub build_category_pages,
find:
Code:
if ($nonenglish eq "") {
$title_linked = &build_linked_title ($cat);
$title = &build_unlinked_title ($cat);
$category_name = $cat;
$category_name_escaped = &urlencode ($cat);
$category_clean = &build_clean ($cat);
}
else {
$title_linked = &build_linked_title_mb ($cat, $nonenglish);
$title = &build_clean_mb ($nonenglish);
$category_name = &build_last_title_mb ($nonenglish);
$category_name_escaped = &build_last_title_mb ($nonenglish);
$category_clean = &build_clean_mb ($nonenglish);
}

Add the follow code after it:
Code:
$category_name_escaped_2 = &urlencode ($cat);

Step 2:
in site_html_templates.pl, sub site_html_category,

Add
Code:
category_name_escaped_2 => $category_name_escaped_2,

Step 3:
Modify Widgetz's code to
Code:
<option value="All" selected>anything</option>
<option value="<%category_name_escaped_2%>">anything</option>

Is my code stable? Would it cause any harm?
Did any code better than mine?
I'm just a perl beginner, please give some coaching.
Thanks.

-- Adam Hui
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Yes! I'm going to try.
-- Adam Hui
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Hello,

it works, but I think,

1.
note that if you select 'search in this category', not 'all' the search results displays all categories, the searchterm is found in (e.g. in description or title). The links are shown correct.

2.
To make it clearer to install, the following code:
Code:
$category_name_escaped_2 = &urlencode ($cat);
must be inside the closing bracket, directly after:
Code:
$category_clean = &build_clean_mb ($nonenglish);
Otherwise you get an error.

Regards Simon

------------------
Simon Ballmann
webmaster@fussballsuche.de
www.fussballsuche.de
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Well, I think I found an error.

at
Code:
http://www.fussballsuche.de/de/Vereine/Deutschland/Sonstige/
I have 6 categories, 'Frauenfussball' (no subcats), 'Jugendfussball' (no subcats), '1. Liga' (no subcats), '2. Liga' (no subcats), 'Regionalliga' (subcats!) and 'Sonstige' (no subcats).

If I searched the categories above the category 'Regionalliga' with the option to search only that category, it's all ok. Only the links of the selected category are shown.

If I searched the category 'Sonstige', the results are build with the search results from the last sub-category in 'Regionalliga' (the only category with sub-cats in it), which is above the category 'Sonstige'.

To see that in action use 'fc' to search for.

Regards Simon

------------------
Simon Ballmann
webmaster@fussballsuche.de
www.fussballsuche.de
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Sorry, don't mean 'code'. Wink

http://www.fussballsuche.de/de/Vereine/Deutschland/

Note:
To search all categories - choose 'Alle Kategorien', to search specific - choose 'Diese Kategorie'.

Regards Simon
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
For me, the code just works.
While testing in your Web,
it worked well in other subcat including Nordost,
but when I searched in subcat Nord, it also returned the links in Nordost .....

Does it mean that search.cgi treat Nordost as the subcat of Nord?

Thus, can anybody tell us that the meaning of &urlencode ($cat); in the code:
Code:
$category_name_escaped_2 = &urlencode ($cat);

and the meaning of ($values[$db_category] =~ /^$in{'category'}/) or next LINE; in the code:
Code:
if ($in{'category'} && $in{'category'} ne "All") {
($values[$db_category] =~ /^$in{'category'}/) or next LINE;
}

Welcome any discussion, thanks for any help.







------------------
Adam Hui
Never Give Up!
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
I just think DelPierro's problem would lie at
the terms /^$in{'category'}/ and or next LINE

-- Adam Hui

Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Folks, since this seems to be an active thread about the non-English mod for Categories, I'm hoping someone who has implemented this will be able to explain something to me:

I have downloaded the non-English mod and installed it, but I still can't get the category names to display in Turkish, which is the language I am translating Links into. How do you tell it to do that? There is a field called non-English, but when I type

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">

in that field it rejects the entry, I think because it is too long. Basically in which field and how do you tell it to display non-English characters? The Readme file for the mod does not explain this. Can someone help me out here, I am getting desperate. Thanks
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
erginsoy, you should not type <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9"> in the non-english field!!!

That field is for the non-english characters used in the category name. i.e (in english) boats/volvo, and in non-english (swedish) båtar\volvo.

Note the switch from / (in english field) to \ (for non-english field).
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
oceansky,

Quote:
but when I searched in subcat Nord, it also returned the links in Nordost .....

yes, you're right, I haven't seen that yesterday. But in this case in location-bar of the browser, only the cat 'Nord' is displayed to search, this would be ok. Only the search results are not correct.

Quote:
If I searched the category 'Sonstige', the results are build with the search results from the last sub-category in 'Regionalliga' (the only category with sub-cats in it), which is above the category 'Sonstige'.

In this case in the location-bar, the false cat to search in was displayed: 'West_Suedwest'.

Any ideas?

Regards Simon

------------------
Simon Ballmann
webmaster@fussballsuche.de
www.fussballsuche.de
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Luna I still don't get it. Do you type Turkish characters in the category name field and in the non-English field? (Doesn't work)Or English version in the name field, Turkish characters in non-English field? (ditto). You're goig to have to spell this out for me in words of one syllable! Thanks
Quote Reply
Re: Category Search (non-english) Widgetz !!! In reply to
Luna scrub that last question, I finally got it to work! So easy and yet so elusive. OK, for the benefit of you newbies out there like me, here is an idiot's guide to generating non-English characters in Categories:
1. Download non-English Mod from resource centre and install on server.
2. In the form for creating a new category fill in the Name field with the word(s)you want in you own language but using only standard English characters. (Don't forget to use an underline _ as a word separator.)So for example: Turkce
3. In the non-English field fill in the same word(s) but this time using your own language's special characters where appropriate. So for example: Türkçe
4. Er, that's it!
Quote Reply
Re: [DelPierro] Category Search (non-english) Widgetz !!! In reply to
May you post your complete search.cgi please?



Thanks,

Chris