Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Coppermine and SMF messes greek fonts when bridged  (Read 3594 times)

0 Members and 1 Guest are viewing this topic.

blackRock

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 20
    • DecoClub
Coppermine and SMF messes greek fonts when bridged
« on: April 09, 2007, 05:08:18 pm »

I have the following issue when trying to bridge coppermine 1.4.10 and SMF 1.1.2:

I use the same database for both Coppermine and SMF in a local machine. I use greek as my language for both of them.
The table collation for coppermine is utf8_unicode_ci and works great when it is not bridged.
The table collation for coppermine is utf8_general_ci and also works great when it is not bridged.

The problem appears when I bridge them. SMF continues to work fine, but in Coppermine everything that comes from the database, such as categories and album names, appears like this: Εσωτερικοί Χώροι

I've tried to make SMF having the same collation as Coppermine but it didn't work. The problem becomes the reverse. SMF cannot show properly the characters.
In a topic I found that I should find in smf10.inc.php
Code: [Select]
$this->connect($db_connection);and replace it with
Code: [Select]
$this->connect($db_connection);
cpg_db_query("SET NAMES DEFAULT", $this->link_id);
but it did not do anything.

Coppermine install: http://localhost/cpg/
Forum install: http://localhost/forum/
Coppermine version: cpg1.4.10
Forum version: SMF 1.1.2
Test user account: -

BridgeManager settings:
Forum URL:  http://localhost/forum
Relative path to your BBS's config file:  ../forum/
Use post-based groups?:  0

Thanks in advance!
« Last Edit: April 11, 2007, 08:05:16 am by GauGau »
Logged

blackRock

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 20
    • DecoClub
Re: Coppermine and SMF messes greek fonts when bridged
« Reply #1 on: April 10, 2007, 09:41:07 am »

I solved it!

In file functions.inc.php, in function cpg_db_connect() I added mysql_query("SET NAMES utf8", $result); before return $result;

Before:
Code: [Select]
function cpg_db_connect()
{
        global $CONFIG;
        $result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
        if (!$result) {
                return false;
        }
        if (!mysql_select_db($CONFIG['dbname']))
                return false;


return $result;
}

After:
Code: [Select]
function cpg_db_connect()
{
        global $CONFIG;
        $result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
        if (!$result) {
                return false;
        }
        if (!mysql_select_db($CONFIG['dbname']))
                return false;

mysql_query("SET NAMES utf8", $result);
return $result;
}

The only problem was that everything was stored in database in greek got destroyed, but everything i store after the change works ok!

Although it works, is it a proper solution?
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.