문제

When I look at usertypes in admin menu, they are all in Russian language, but when I'm getting it from DB language appears to be English, can't figure it out. Sql looks like that:

$query = "SELECT cc.title AS category, a.title,
u.username,u.usertype as usertype, a.hits ,ua.avatar as avatar, ar.intotext as introtext,
u.lastvisitDate as lastvisit, s.userid as onlineid
FROM #__content AS a
LEFT JOIN #__categories AS cc ON a.catid = cc.id
LEFT JOIN #__users AS u ON u.id = a.created_by
LEFT JOIN #__comprofiler AS ua ON user_id = a.created_by
LEFT JOIN #__session s ON s.userid = a.created_by AND s.guest = 0
LEFT JOIN #__cck_store_item_cck_store_item_content AS ar ON ar.id = ".(int)$itemid."
WHERE a.id =  ".(int)$itemid."
and a.access = 1";
도움이 되었습니까?

해결책

You don't get stuff in a language, you use JText to translate keys from the database to the appropriate language for a user when the page is being prepared.

If what you want to do is to render the user group names in Russian you need to use JText().

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top