2013-11-09, 02:25:11
(2013-11-08, 23:52:15)mvlcek Wrote:This assumes german as second language. By default all entries in the default language (english) are also displayed.Code:$sidelists = return_i18n_search_results('story', null, 0, 15, 'title', 'de');
Sorting by title should work, although it is undocumented (except in some forum posts) and might have problems with encoded entities.
tried that, it didn't work at first. showed only pages in language #2, titles didn't change when I switched back to english, even though links lead to right pages within the current locale.
so i was thinking if there was a better way. like, grab language code directly from the page. and i made this tiny language indicator which i passed to your function:
PHP Code:
$langind = null;
if ($language == 'lng1') {
$langind = 'lng1'; }
else {
$langind = 'lng2'; }
//and then what i posted above with the suggested change:
$sidelists = return_i18n_search_results('story', null, 0, 15, 'reverseurl', $langind);
//... and the rest
and now it works properly in every language, yay
i hope this code is alright?
because i'm a total php newb, i didn't know a thing about it 2 weeks ago x)