Доброго времени суток. Есть плагин, Используем транслит вместо кириллицы в ссылках дополнительных полей от LazyDev, я его подправил под dle 17, он работает как нужно. Все доп поля такого вида работают нормально:
if ( preg_match( "#\\[xfvalue_{$preg_safe_name} limit=['\"](.+?)['\"]\\]#i", $tpl->copy_template, $matches ) ) {
$tpl->set( $matches[0], clear_content($xfieldsdata[$value[0]], $matches[1]) );
}
if ( preg_match( "#\\[xfvalue_{$preg_safe_name} limit-totranslit=['\"](.+?)['\"]\\]#i", $tpl->copy_template, $matches ) ) {
$tpl->set( $matches[0], totranslit(clear_content($xfieldsdata[$value[0]], $matches[1])) );
}
$sql_select = "SELECT p.id, p.autor, p.date, p.short_story, CHAR_LENGTH(p.full_story) as full_story, p.xfields, p.title, p.descr, p.keywords, p.category, p.alt_name, p.comm_num, p.allow_comm, p.allow_main, p.approve, p.fixed, p.symbol, p.tags, e.news_read, e.allow_rate, e.rating, e.vote_num, e.votes, e.view_edit, e.disable_index, e.editdate, e.editor, e.reason {$user_select}FROM " . PREFIX . "_post p LEFT JOIN " . PREFIX . "_post_extras e ON (p.id=e.news_id) {$user_join}";
$sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post p INNER JOIN " . PREFIX . "_xfsearch xf on (xf.news_id=p.id) {$cat_join}WHERE {$stop_list}xf.tagname = '{$xfname}' AND xf.tagvalue='{$xf}' AND approve=1";
$data_xf = xfieldsload();
$this_xf = array_filter($data_xf, function($item) use($xfname) {
return $item[0] == $xfname && $item[34] == 1;
});
if ($this_xf) {
$sql_select_ids = false;
$translit_xf = totranslit($xf, true, false);
$url_page = $config['http_home_url'] . "xfsearch/{$xfname}/" . rawurlencode(dle_strtolower(str_replace(["'", """, "&", "{", "[", ":", "/"], ["'", '"', "&", "{", "[", ":", "⁄"], $translit_xf)));
if ($xf != $translit_xf) {
$re_url = $url_page . '/';
header("HTTP/1.0 301 Moved Permanently");
header("Location: {$re_url}");
die("Redirect");
}
$xf_temp = $db->super_query("SELECT tagvalue FROM " . PREFIX . "_xfsearch WHERE tagname='{$xfname}' AND tagvalue_translit='{$xf}' LIMIT 1");
$sql_select = "SELECT p.id, p.autor, p.date, p.short_story, CHAR_LENGTH(p.full_story) as full_story, p.xfields, p.title, p.category, p.alt_name, p.comm_num, p.allow_comm, p.fixed, p.tags, e.news_read, e.allow_rate, e.rating, e.vote_num, e.votes, e.view_edit, e.editdate, e.editor, e.reason {$user_select} FROM " . PREFIX . "_post p INNER JOIN " . PREFIX . "_xfsearch xf on (xf.news_id=p.id) {$cat_join} LEFT JOIN " . PREFIX . "_post_extras e ON (p.id=e.news_id) {$user_join} WHERE {$stop_list} xf.tagname = '{$xfname}' AND xf.tagvalue_translit='{$xf}' AND p.approve=1 " . $where_date . " ORDER BY " . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number'];
$sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post p INNER JOIN " . PREFIX . "_xfsearch xf on (xf.news_id=p.id) {$cat_join}WHERE {$stop_list}xf.tagname = '{$xfname}' AND xf.tagvalue_translit='{$xf}' AND approve=1";
$xf = stripslashes($xf_temp['tagvalue']);
} else {
$sql_select = "SELECT p.id, p.autor, p.date, p.short_story, CHAR_LENGTH(p.full_story) as full_story, p.xfields, p.title, p.descr, p.keywords, p.category, p.alt_name, p.comm_num, p.allow_comm, p.allow_main, p.approve, p.fixed, p.symbol, p.tags, e.news_read, e.allow_rate, e.rating, e.vote_num, e.votes, e.view_edit, e.disable_index, e.editdate, e.editor, e.reason {$user_select}FROM " . PREFIX . "_post p LEFT JOIN " . PREFIX . "_post_extras e ON (p.id=e.news_id) {$user_join}";
$sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post p INNER JOIN " . PREFIX . "_xfsearch xf on (xf.news_id=p.id) {$cat_join}WHERE {$stop_list}xf.tagname = '{$xfname}' AND xf.tagvalue='{$xf}' AND approve=1";
}
Здесь, к сожалению у меня не хватает знаний.
Заранее спасибо за любую помощь.