Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Template Shares
Reply
  #1  
Old 9th January 2014, 21:33
majio majio is offline
Senior Member
 
Join Date: Jun 2009
P2P
Posts: 20
Default Locale - Language issues on forum and chat txt!!!
Hey i have tried to change the "locale" language on the server and on the SQL database UTF8 and such... to utf8 danish .. close to Norwegian so i can use Æ Ø Å chars but nothing works....

Everytime i use those norwegian characters its making the text Vanish!

Bump:
PHP Code:
<?php
require_once("include/bittorrent.php");
dbconn(false);
loggedinorreturn();
parked();
if (
get_user_class() < UC_USER)
stderr("Sorry""You do not have permission to view this page.");
iplogger();
if (isset(
$_GET['del']))
    {
        if (
is_valid_id($_GET['del']))
            {
                if ( (
get_user_class() >= UC_MODERATOR) ) {
                    
sql_query("DELETE FROM forumchat WHERE id=".mysql_real_escape_string($_GET['del']));
                }
            }
}
?>
<html><head>
<title>ShoutBox</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8”>
<META HTTP-EQUIV=REFRESH CONTENT="120; URL=forumchat.php">
<style type="text/css">
A {color: #000000; font-weight: bold; }
A:hover {color: #FF0000;}
.small {font-size: 8pt; font-family: tahoma; }
.date {font-size: 7pt;}
</style>
<STYLE>BODY {
background-color: #F0F0E6;
SCROLLBAR-3DLIGHT-COLOR: #004E98;
SCROLLBAR-ARROW-COLOR: #004E98;
SCROLLBAR-DARKSHADOW-COLOR: white;
SCROLLBAR-BASE-COLOR: white;
}
</STYLE>
</head>
<body bgcolor=#F5F4EA>
<?

/*
if ($CURUSER["chatpost"] == 'no')
{
print("<h2><br><center>You are banned!</center></h2>");
exit;
}
else
{
*/

if($_GET["sent"]=="yes")
    if(!
$_GET["shbox_text"])
    {
        
$userid=0+$CURUSER["id"];
    }
else
{
    
$userid=0+$CURUSER["id"];
    
$username=htmlspecialchars(trim($CURUSER["username"]));
    
$date=sqlesc(time());
    
$text=trim($_GET["shbox_text"]);
    
    
sql_query("INSERT INTO forumchat (id, userid, username, date, text) VALUES ('id'," sqlesc($userid) . ", " sqlesc($username) . ", $date, " sqlesc($text) . ")") or sqlerr(__FILE____LINE__);
    print 
"<script type=\"text/javascript\">parent.document.forms[0].shbox_text.value='';</script>";
}

$res sql_query("SELECT * FROM forumchat ORDER BY date DESC LIMIT 70") or sqlerr(__FILE____LINE__);
if (
mysql_num_rows($res) == 0)
    print(
"\n");
    else
{
    print(
"<table border=0 cellspacing=0 cellpadding=2 width='100%' align='left' class='small'>\n");

    while (
$arr mysql_fetch_assoc($res))
        {
$res2 sql_query("SELECT username,class,avatar,donor, title,enabled,warned FROM users WHERE id=$arr[userid]") or sqlerr(__FILE____LINE__);
$arr2 mysql_fetch_assoc($res2);
$resowner sql_query("SELECT id, username, class FROM users WHERE id=$arr[userid]") or print(mysql_error());
$rowowner mysql_fetch_array($resowner);


if (
$rowowner["class"] == "7")
$usercolor"<font color=darkred>" .htmlspecialchars($rowowner["username"]). "</font>";
if (
$rowowner["class"] == "6")
$usercolor"<font color=#2587A7>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "5")
$usercolor"<font color=#B000B0>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "4")
$usercolor"<font color=#ff5151>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "3")
$usercolor"<font color=#6464FF>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "2")
$usercolor"<font color=#009F00>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "1")
$usercolor"<font color=#f9a200>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "0")
$usercolor"<font color=#000000>" .htmlspecialchars($rowowner["username"]). "</font>";

if (
get_user_class() >= UC_MODERATOR) {
$del="<span class='date'>[<a href=forumchat.php?del=".$arr[id].">del</a>]</span>";
}

print(
"<tr><td><span class='date'>[".strftime("%d.%m %H:%M",$arr["date"])."]</span>
$del
</span>
<a href='userdetails.php?id="
.$arr["userid"]."' target='_blank'>$usercolor</a>" .
(
$arr2["donor"] == "yes" "<img src=pic/star.gif alt='DONOR'>" "") .
(
$arr2["warned"] == "yes" "<img src="."pic/warned.gif alt='Warned'>" "") .
" ".format_comment($arr["text"])."
</td></tr>\n"
);
}
print(
"</table>");
}
?>
</body>
</html>
Bump: I changed the locale on the server side .. to NB_NO utf 8 and also in apache2 MySQL ..

such as this :

Quote:
sudo nano /etc/mysql/my.cnf

my.cnf:

[client]
default-character-set = utf8
[mysqld]
character-set-server = utf8

sudo /etc/init.d/mysql restart

sudo nano /etc/php5/apache2/php.ini

; PHP’s default character set is set to empty.
; http://php.net/default-charset
default_charset = “UTF-8″

sudo nano /etc/apache2/conf.d/charset

#AddDefaultCharset UTF-8
to
AddDefaultCharset UTF-8

sudo /etc/init.d/apache2 restart
but this didn’t work for me. Any other ideas?

Bump: The forum chat, shout box and the Forum txt are vanishing if i use Norwegian chars like ÆØÅ
Reply With Quote
  #2  
Old 10th February 2014, 02:23
Dingo38 Dingo38 is offline
Senior Member
 
Join Date: Oct 2013
P2P
Posts: 35
Default
Might sound a silly question? But do you have the correct fonts installed on your computer.
Reply With Quote
Reply

Tags
chat , forum , issues , language , locale , txt

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 00:13. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.