Eretig
Forum Replies Created
-
Forum: Plugins
In reply to: [Cross-Linker] [Plugin: Cross-linker] Cyrillic alphabet supportOops, I was wrong with permalink’s fix. This is bad idea, it’s remove all crosslinks from page, what contains link to itself.
Here is right condition for deleting only crosslinks to itself, not all crosslinks:
((basename(get_permalink(@substr($point_to,strlen('post:'))))==$current_uri)&&($link_to_itself!=1) )
Also if you don’t want to see cross links to itself in posts when you look at category or archive, you need to add “$post” to the “global” section of function “interlink_w_u()” and add one more condition in our lovely line:
(($post->ID == @substr($point_to,strlen('post:'))) && ($link_to_itself!=1))
In the end, with all changes we have this statement:
if( ( (assign_correct_uri($point_to)==$current_uri) || ($is_the_same_uri==1) || (basename(get_permalink(@substr($point_to,strlen('post:'))))==$current_uri) || ($post->ID == @substr($point_to,strlen('post:'))) ) && ($link_to_itself!=1) )
And sorry for my poor english, please.
Forum: Plugins
In reply to: [Cross-Linker] [Plugin: Cross-linker] Cyrillic alphabet supportThere is just one file: /plugins/cross-linker/crosslink.php
Number of string with conditions for permalinks: 1713 in plugin version 1.4.4
After changes it must look like this:if( ( (assign_correct_uri($point_to)==$current_uri)&&($link_to_itself!=1) ) || (($link_to_itself!=1)&&($is_the_same_uri==1)) || ((basename(get_permalink())==$current_uri)&&($link_to_itself!=1) ))
What about function strtolower_utf8() – I add it in the begin of file, after line
if(function_exists('add_action')) add_action('admin_menu', 'crosslinker_add_pages');
and replace all words “strtolower” with “strtolower_utf8”.
But be careful and don’t change function name to “strtolower_utf8_utf8” ??Forum: Plugins
In reply to: [Cross-Linker] [Plugin: Cross-linker] Cyrillic alphabet supportHi!
Thank you for this plugin!
But I find two problems with it:- it can’t work with wordpress’es permalinks;
- it wann’t work properly with capital cyrillic.
Here is my variant to fix it:
- add to line
if( ( (assign_correct_uri($point_to)==$current_uri)&&($link_to_itself!=1) ) || (($link_to_itself!=1)&&($is_the_same_uri==1)))
one more condition:
((basename(get_permalink())==$current_uri)&&($link_to_itself!=1) )
- use this function instead of “strtolower”:
function strtolower_utf8($string){ $convert_to = array( "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "à", "á", "a", "?", "?", "?", "?", "?", "è", "é", "ê", "?", "ì", "í", "?", "?", "e", "?", "ò", "ó", "?", "?", "?", "?", "ù", "ú", "?", "ü", "y", "а", "б", "в", "г", "д", "е", "ё", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ъ", "ы", "ь", "э", "ю", "я" ); $convert_from = array( "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "à", "á", "?", "?", "?", "?", "?", "?", "è", "é", "ê", "?", "ì", "í", "?", "?", "D", "?", "ò", "ó", "?", "?", "?", "?", "ù", "ú", "?", "ü", "Y", "А", "Б", "В", "Г", "Д", "Е", "Ё", "Ж", "З", "И", "Й", "К", "Л", "М", "Н", "О", "П", "Р", "С", "Т", "У", "Ф", "Х", "Ц", "Ч", "Ш", "Щ", "Ъ", "Ъ", "Ь", "Э", "Ю", "Я" ); return str_replace($convert_from, $convert_to, $string); }
Regards, Nick.