Jump to content
MakeWebGames

Making support for special characters?


dark
 Share

Recommended Posts

Hello.

I've just installed a new theme (header.php++)

But then the site just show "?", in all menus, instead for utennavnok6.jpg

How can I modify the header so the site support my special characters?

Here's the header.php

?<?php

class headers {
function startheaders() {
global $ir, $set;
$back="black"; //Define the background colour of your site here.
echo <<<EOF
<html>
<head>
<title>{$set['game_name']}</title>
<html>
<head>
<style>
body {
background: {$back};
font-family: Tahoma;
}
table {
font-family: Tahoma;
font-size: 12px;
}
a:link {
text-decoration: none;
color: #333333;
}
a:hover {
text-decoration: underline;
color: #666666;
}
a:active {
text-decoration: none;
color: #666666;
}
a:visited {
text-decoration: none;
color: #333333;
}        
.table th {
background-color: #6666666;
text-align: center;
}
.table {
text-align: center;
}
.table td {
background-color: #999999;
text-align: center;
}
</style>
</head><body>
<center><table width=900 border=0 cellpadding=0 cellspacing=0><tr><td style='background: url("topheaderimage2.png"); height:170px;'>
EOF;
}
function userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global $db,$c,$userid, $set;
$IP = ($_SERVER['HTTP_X_FORWARDED_FOR'])
   ?  $_SERVER['HTTP_X_FORWARDED_FOR']
   :  $_SERVER['REMOTE_ADDR'];
$db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid");
if(!$ir['email'])
{
global $domain;
die ("<body>Your account may be broken. Please mail [email protected]{$domain} stating your username and player ID.");
}
if($dosessh && ($_SESSION['attacking'] || $ir['attacking']))
{
print "You lost all your EXP for running from the fight.";
$db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid");
$_SESSION['attacking']=0;
}
$enperc=(int) ($ir['energy']/$ir['maxenergy']*100);
$wiperc=(int) ($ir['will']/$ir['maxwill']*100);
$experc=(int) ( $ir['exp']/$ir['exp_needed']*100);
$brperc=(int) ($ir['brave']/$ir['maxbrave']*100);
$hpperc=(int) ($ir['hp']/$ir['maxhp']*100);
$enopp=100-$enperc;
$wiopp=100-$wiperc;
$exopp=100-$experc;
$bropp=100-$brperc;
$hpopp=100-$hpperc;
$d="";
$u=$ir['username'];
if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="[img=donator.gif]"; }

$gn=""; 
global $staffpage;

$bgcolor = 'FFFFFF';

print <<<OUT

<table width=100% height=95 border=0 cellpadding=0 cellspacing=0>
<tr valign="middle"><td width=540></td><td width=170 align="center">
[b]Name:[/b] $gn{$u} [{$ir['userid']}] $d

[b]Money:[/b] {$fm}

[b]Level:[/b] {$ir['level']}

[b]Crystals:[/b] {$ir['crystals']}

[[url='logout.php']Emergency Logout[/url]]
</td><td width=156 align="center">
[b]Energy:[/b] {$enperc}%

<img src=greenbar.png width=$enperc height=5><img src=redbar.png width=$enopp height=5>

[b]Will:[/b] {$wiperc}%

<img src=bluebar.png width=$wiperc height=5><img src=redbar.png width=$wiopp height=5>

[b]Brave:[/b] {$ir['brave']}/{$ir['maxbrave']}

<img src=yellowbar.png width=$brperc height=5><img src=redbar.png width=$bropp height=5>

[b]Health:[/b] {$hpperc}%

<img src=greenbar.png width=$hpperc height=5><img src=redbar.png width=$hpopp height=5>

</td><td width=47></td></tr>
</table>
</td></tr>
<td background='middleheaderimage2.png'>

<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr valign="top"><td width=26></td><td width=197><center>

OUT;
if($ir['fedjail'])
{
$q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid");
$r=$db->fetch_row($q);
die("[b]<font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s).

Reason: {$r['fed_reason']}</font>[/b]</body></html>");
}
if(file_exists('ipbans/'.$IP))
{
die("[b]<font color=red size=+1>Your IP has been banned from {$set['game_name']}, there is no way around this.</font>[/b]</body></html>");
}
}
function menuarea()
{
include "mainmenu.php";
global $ir,$c;
$bgcolor = 'FFFFFF';
print '</td><td width=38></td><td width=597><center>';
if($ir['hospital'])
{
 print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes.
";
}
if($ir['jail'])
{
 print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes.
";
}
}
function smenuarea()
{
include "smenu.php";
global $ir,$c;
$bgcolor = 'FFFFFF';
print '</td><td width=38></td><td width=597><center>';
}
function endpage()
{
global $db;
print <<<OUT
</td><td width=45></td></tr>
</table>
</td></tr>
<tr><td><image src='bottomheaderimage2.png'></td></tr></table>
OUT;
}
}
?>
Link to comment
Share on other sites

Re: Making support for special characters?

Okay... I'll explain more...

Ho can I use the Sweedish character's on my side without changing every single word?

It worked before I replaced the old header.php.... Now all my special character's are changed into "?" Ex: "Mainmenu" = "Huvv??meny"

I want to use the new header.php (see code in last post) AND the characters:

utennavnok6.jpg

Link to comment
Share on other sites

Re: Making support for special characters?

Consider the use of meta tags - specifically:

 

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

 

It may be prudent to set the collation of the database to latin_swedish_ci as well, but I advise extreme caution here. Mixing collations, character sets etc. can prove tricky.

Link to comment
Share on other sites

Re: Making support for special characters?

Thanks. But do I have to add the Meta-tags in every page? Or just header.php?

I inserted the meta-tags you provided into my header.php, but the page still show "?", instead of my characters.

The old (and orginal) header.php showed all my characters fine! But this modified version does not... why?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...