jojaba
Forum Replies Created
-
Forum: Plugins
In reply to: [Access Category Password] Not working with custom rolesThat’s right. Only the regular user roles (native WP roles) are taken in account.
- This reply was modified 9 years, 6 months ago by jojaba.
Sorry for the delay, the forum doesn’t lift the old threads on top of the list anymore when there are new replies, so I don’t notice them. Blah.
No problem, I was busy anyway…
By looking on a chars entities table (here for example: https://dev.w3.org/html5/html-author/charref), I think this could be a nice way to find out wich non-accented character will match the accented one.
First, you convert the term to htmlentities, then you look after the &xxxxx; patterns and remove all these patterns except the second chars of each pattern (wich are the non accented char) in the term. For example, the “é” matches the “é”, you can see that just after the &, you have the “e”…
About the ä, what do you use then in your urls? “ae” like in german?- This reply was modified 9 years, 6 months ago by jojaba.
Im not sure we need a filter here.
I think that the regexp should be changed to match accented terms either. I see it that way:- First get an accented version of the term, let’s say
$a_pr_term - Then change the handling regexp to
/(\b$pr_term|$pr_term\b|\b$a_pr_term|$a_pr_term\b)/iu
Simple, but, the problem is to get the accented term… I’m not sure, but maybe a “didyoumean” search would be interesting here… Otherwise, it is indeed a bit complicated.
You said it would be easier to get this from the database (mysql), that would be also a way to investigate…
An article form a french developper: http://patisserie.keensoftware.com/en/pages/gerer-les-accents-dans-les-recherches-textes
I didn’t read everything, but that would be a good source of inspiration, no?Forum: Plugins
In reply to: [Access Category Password] Protect category page, not just postHello,
We would like for there to be only one form for the whole category, not a form for every post
For the moement this is not possible.
it requires that a password be entered for every single post
Wrong. As soon you entered the password, you don’t need to enter it again for other protected posts in the same session. 😉
- This reply was modified 9 years, 6 months ago by jojaba.
Concerning filtering, I’m not sure it is possible. I think you have to use the filter API to add a filter. Or, is this the answer: Custom Hooks | Plugin Developer Handbook | WordPress Developer Resources ?
- This reply was modified 9 years, 6 months ago by jojaba.
Hey, WordPress have already a function to remove accents: remove_accents()
How WordPress handle this (more robust I guess): formatting.php file on TracOK, the function where you can find the regexp is the
relevanssi_highlight_terms()function in the /lib/excerpts-highlight.php file, is that right? (by the way, is that function also used for terms in a title?)
I think in theforeach ($terms as $term)loop you should handle both cases: the accented and non-accented characters on each $term and $excerpt by using a function that converts accented characters to non-accented characters. An example of such a function I picked on a Web page (not sure it is complete, you can also avoid replace uppercase accented characters with uppercase characters):$unwanted_array = array( 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y' ); $str = strtr( $str, $unwanted_array );Maybe there is a better way, with iconv for instance…
Forum: Plugins
In reply to: [Groups] Write access to posts created by user in same group possible?Thanks for the reply Kento.
What I exactly need (I’m not sure your plugin will make this available) is to create user groups and then be able to give on each user write permission on each post by using this group. To be clearer, a writer should be able to give write permission to one or more groups in each of his posts.
I don’t know if this is in your plans, but maybe you could give me some advise to develop this (I don’t know for instance how I can give permissions on one post to mulitple authors…)Regards, Joël
Forum: Plugins
In reply to: [Autocomplete For Relevanssi] Some problems I meetIs the issue solved Li-An?
Forum: Plugins
In reply to: [Autocomplete For Relevanssi] Some problems I meetjs in head section:
/wp-content/plugins/autocomplete-for-relevanssi/awesomplete-gh-pages/awesomplete.jsInline js in the footer (just before </body> ending tag):
<script> var searchInputs = document.getElementsByName("s"); for(var i = 0; i < searchInputs.length; i++) { var awesomplete = new Awesomplete(searchInputs[i]); awesomplete.list = ["..."];// your indexed words awesomplete.minChars = 2; awesomplete.maxItems = 5; } </script>Forum: Plugins
In reply to: [Autocomplete For Relevanssi] Some problems I meetHello,
Thanks for the feedback.
I see on the autoptimize plugin page that js loading is delayed to footer, this is why afr doesn’t work I guess. The js must be loaded before the content to get this plugin work…
What belongs your theme, you have to add yourself the styling of afr in your theme stylesheet (typically: /wp-content/theme/theme_name/style.css). I don’t know Hueman theme, I can’t help you to solve this problem, sorry.- This reply was modified 9 years, 6 months ago by jojaba. Reason: link to autoptimize plugin
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Autocomplete?Forum: Plugins
In reply to: [Relevanssi - A Better Search] Autocomplete?I just found a nice tool made By Lea Verou, called Awesomplete. I really like what she does, it is mostly simple and lightweight. I usually don’t like dependencies (except if it is loaded by default like jQuery for WordPress), but for Lea’s work I make an exception without worrying. 😉
Awesomplete page.
Using this widget, I will have options for the words load :- loading the list on server side before page is sent to the browser,
- or loading with ajax technlogy.
Your opinion?
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Autocomplete?Thanks for that answer Mikko.
How about first getting all the words in the relevanssi table (php), and keep them in an JS array for all pages? this would avoid the multiple ajax requests and save bandwidth don’t you think? Or is it a bad idea because the list of words is probably too big?- This reply was modified 9 years, 7 months ago by jojaba.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Autocomplete?Hello,
I need also this feature. I would like to develop it for relevanssi. Here’s how I would like to do it :
- If someone begins to type a word in the serach box (after 3 characters for instance), an ajax request is sent (I will use jQuery for that)
- The php file launched will have a look to the wp_relevanssi table and find the words beginning with the typed characters
- each time a character is added, the same request is done, the list of suggestion is each time updated.
Is this the best way to do it?
Thanks in advance.
- This reply was modified 9 years, 7 months ago by jojaba.