Can we get charset var added in directadmin.conf

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,366
Location
www.poralix.com
Hello and greetings,

I'd like to get charset var added in directadmin.conf

Now we have

Code:
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

in /usr/local/directadmin/data/skins/SKIN_NAME/header.html

And I'd like you to replace direct "windows-1252" with a token, which would be defined in directadmin.conf

As we use different encoding on our pages, we should always to change the file manually.
 
Hello,

I looked at this request to start implementing it, but quickly realized we've already got tools for this, because "|LANG_ENCODING|" is already a variable, stored on a per-language basis, eg:
/usr/local/directadmin/data/skins/enhanced/lang/en/lf_standard.html

to still use our skin, and our English pack, but change the charset, do:
Code:
cd /usr/local/directadmin/data/skins/enhanced
echo "LF_STANDARD=lf_standard2.html" > files_custom.conf
cd lang/en
cp lf_standard.html lf_standard2.html
and edit lf_standard2.html, and set:
Code:
LANG_ENCODING=windows-1252
That will be safe from updates too.

With it, the only thing you need to watch out for (very very rarely) when we make additions to lf_standard.html, you'd need to add the additions to lf_standard2.html.

Related (which I just found, after writing you the guide, hehe):
http://help.directadmin.com/item.php?id=364

John
 
Hello John,

Thanks for your guide and link. It works for other skins too.

We're currently using /usr/local/directadmin/data/skins/power_user/ skin, and the skin had no lang directory, and header.html had no "|LANG_ENCODING|". Does it get updated together with enhanced skin on new directadmin release? I guess no...

So I've copied lang/en directory from enhanced skin and updated header.html file, I've got now

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">


And header.html starts the following way:

Code:
# head /usr/local/directadmin/data/skins/power_user/header.html
|LF_STANDARD|
|LF_IMAGES|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=|LANG_ENCODING|">
<title>|HOSTNAME| - |DEAMONNAME| v|VERSION|</title>

        <script language="JavaScript">
        <!--
        //timer for auto-logout


One issue we met at first, as the language was set to ru (not en), encoding was displayed as none, and in Enhanced skin we saw a lot of none instead of regular words of navigation... So

Code:
#cp -r lang/en lang/ru

brought everything in order.

Thanks again.
 
Another way of doing it (which would work for power_user) would be to use this:
http://help.directadmin.com/item.php?id=295

on the header.html, eg:
Code:
cd /usr/local/directadmin/data/skins/power_user
cp header.html header2.html
perl -pi -e 's/windows-1252/UTF-8/' header2.html
echo "HTM_HEADER=header2.html" > files_custom.conf
I'm not too sure about bringing the LANG tokens into power_user.. but use whatever works for you.

John
 
Back
Top