Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: 1 [2]

Author Topic: Multi-Language Mod - sNews 1.7  (Read 2173 times)

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: Multi-Language Mod - sNews 1.7
« Reply #15 on: January 11, 2011, 03:26:40 PM »

It's a crazy thing.

I just install your SQL Database, I can see your articles test etc...
But I can't see at all the French part. It's always stay in EN content with link like
http://localhost:8888/snews17-multilingual/EN/index.php?sessionlang=FR

Only the links Home Archive Site Map etc... change in French. But not the content ?

Really I don't understand at all what happen. How it's possible that works for you or Fred K and not me with exactly the same settings ?  I'm turning mad  :P
« Last Edit: January 11, 2011, 03:44:41 PM by stephane »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Multi-Language Mod - sNews 1.7
« Reply #16 on: January 11, 2011, 04:13:00 PM »

OK.... I have installed the exact same project with the exact same database file (the download package) for online testing at:
http://www.snews.ca/snews17ml/
The login for both english and french administration is still the default test | test .

1. The first Mod has to be after the return $db[$variable]; to work online (and before it to work on localhost for me)
2. I am getting the same result online - the French link switches the Language file but it does not switch to French database tables (content).
   But, this is caused by the Mod after the return $db[$variable];

VERY FRUSTRATING...
ML-Mod 1.7 (1) MUST be before return $db[$variable]; to work online but switching to French (the other language) always returns a blank page!

This first Mod in function db($variable) is the problem area...... more work required there....
« Last Edit: January 11, 2011, 04:22:58 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: Multi-Language Mod - sNews 1.7
« Reply #17 on: January 11, 2011, 04:28:28 PM »

Thanks for testing again Keyrocks.

I just notice :

If I put the first MOD after the return $db[$variable]; the site in localhost (MAMP) is display but in fact the links doesn't switch language content (Only default sNews links). AND if I remove completely this first MOD it's exactly the same.
I think this first part of the MOD has to be BEFORE the return $db[$variable]; and it's normal no ? the return $db... must display the DB content, I imagine. So the different variable has to be before it. But in this case it doesn't work on localhost with MAMP. How this is possible  ???


 
Logged

_ph_

  • Newbie
  • *
  • Karma: 1
  • Posts: 1
Re: Multi-Language Mod - sNews 1.7
« Reply #18 on: February 21, 2012, 02:53:48 AM »

I think than i found the solution, i am on winXP and it work online for me, here is my code change (have to be cleaned), check for "//phph" for modified code :

Code: [Select]
// CONFIGURE DATABASE VARIABLES
function db($variable) {
$db = array(
# Edit database connection information only
'dbhost' => 'XXXXXXXXXX', // MySQL host
'dbname' => 'XXXXXXXXXX', // Database name
'dbuname' => 'XXXXXXXXXX', // Database Username
'dbpass' => 'XXXXXXXXXX', // Database password
'sessionlang' => 'EN', // Default session language (DB tables without lang prefix) //phph
// Table prefix for multiple sNews systems on one database. Leave it blank if not used.
'prefix' => 'sn_'
);

// ----------------------------------
// _ph_-Mod !!!
// ----------------------------------
//phph--->
if ($variable == 'prefix')
        {
            if(empty($lang))
                $lang = session_lang();
            $ret = $db['prefix'].($lang==$db['sessionlang'] ? '' : strtolower($lang).'_' );
            //echo ('</br>$lang = '.$lang); // For debugging !!!
            //echo ('</br>ret = '.$ret); // For debugging !!!
            return $ret;
        }
//phph<---
// ----------------------------------
// ----------------------------------

return $db[$variable];
# ML-Mod 1.7 (1)
$db['sessionlang'] = 'EN'; // Default session language (DB tables without lang prefix)
$lang = session_lang(); // Sets Database prefix as Session prefix.
if ($variable == 'prefix') { return $db['prefix'].($lang==$db['sessionlang'] ? '' : $lang.'_' ); }
# END: ML-Mod 1.7 (1)

}

Hope it can help !!! ;)
« Last Edit: February 21, 2012, 11:43:43 AM by _ph_ »
Logged

bobcat

  • Jr. Member
  • **
  • Karma: 1
  • Posts: 67
    • ESL Jobs by Country
Re: Multi-Language Mod - sNews 1.7
« Reply #19 on: October 16, 2012, 08:58:34 AM »

I think than i found the solution, i am on winXP and it work online for me, here is my code change (have to be cleaned), check for "//phph" for modified code :

Code: [Select]
// CONFIGURE DATABASE VARIABLES
function db($variable) {
$db = array(
# Edit database connection information only
'dbhost' => 'XXXXXXXXXX', // MySQL host
'dbname' => 'XXXXXXXXXX', // Database name
'dbuname' => 'XXXXXXXXXX', // Database Username
'dbpass' => 'XXXXXXXXXX', // Database password
'sessionlang' => 'EN', // Default session language (DB tables without lang prefix) //phph
// Table prefix for multiple sNews systems on one database. Leave it blank if not used.
'prefix' => 'sn_'
);

// ----------------------------------
// _ph_-Mod !!!
// ----------------------------------
//phph--->
if ($variable == 'prefix')
        {
            if(empty($lang))
                $lang = session_lang();
            $ret = $db['prefix'].($lang==$db['sessionlang'] ? '' : strtolower($lang).'_' );
            //echo ('</br>$lang = '.$lang); // For debugging !!!
            //echo ('</br>ret = '.$ret); // For debugging !!!
            return $ret;
        }
//phph<---
// ----------------------------------
// ----------------------------------

return $db[$variable];
# ML-Mod 1.7 (1)
$db['sessionlang'] = 'EN'; // Default session language (DB tables without lang prefix)
$lang = session_lang(); // Sets Database prefix as Session prefix.
if ($variable == 'prefix') { return $db['prefix'].($lang==$db['sessionlang'] ? '' : $lang.'_' ); }
# END: ML-Mod 1.7 (1)

}

Hope it can help !!! ;)

Life saving post a year after the original topic!

Probably should have read through the whole thread first, but got through every step and found its not working (switching databases)

The above post, makes this mod work - for anyone looking to try it.

Thanks!

Pages: 1 [2]