Welcome to Geeklog Sunday, May 19 2013 @ 10:32 PM EDT
|
||||||||
![]() |
Forum Index > Extensions > Cool Hacks |
New Topic
|
Post Reply
|
multilingual featered story |
|||
| suvi |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/20/05 Posts: 44 |
There can be only one featured story and storys don't support php so far. I needed to make a biligual site (english/german). So I made this ugly hack in index.php in order to have the featured story adjusted to the selected language: if ( !empty ($_USER['language'])) { $lang = $_USER['language']; } elseif ( !empty ($_COOKIE['language'])) { $lang = $_COOKIE['language']; } else { $lang = $_language_default; } if ( strtolower($lang) == "english_utf-8" ) { //we don't do anthing, because the featured story is allready in english. } else { //now following the german context $A['introtext']= 'Zurich Telecom blablabla...'; $A['title'] = 'Wilkommen bei Zurich Telecom!'; } // display first article $display .= STORY_renderArticle ($A, 'y'); The STORY_renderArticle() Function just plots out the other text. It's ugly, it's small and it works. This hack works on GL 1.4 beta 1 . Anyone with a nicer hack please post. Cheers Suvi and jump good to 2006 from switzerland. |
||||||
|
|||||||
| LWC |
|
||||||
![]() ![]() ![]() ![]() ![]() Full Member Status: offline ![]() Registered: 02/19/04 Posts: 811 |
Why just the featured story? I see you use - at least partially - the original multilingual hack by Euan.
Euan's code is outdated and was later fixed and improved by yours truly - especially since Euan's version stopped working once Geeklog was upgraded. My code's purpose is to achieve the same thing, but while interfering as less as possible with Geeklog's core. If you use it, your visitors could choose a language (via a cookie) and will only see topics and stories (and in my new version, also polls) in that language. I've kept my hack updated in the "feature request" sub-site, which is down currently. And I don't know where else to keep this code, so I've just opened a new topic just for my own hack. I would always keep it updated there from now on. |
||||||
|
|||||||
| Content generated in: 0.19 seconds |
|
|
|