ragazzi ho un enorme problema...
il mio script non mi riconosce certi accenti e caratteri...
ad esempio se tento di scrivere l'ascensore esce l\'ascensore.
qualcuno saprebbe aiutarmi???questa è la è la pagina dove ci andrebbe un replace..ma dove???grazie a ki mi aiuterà...
Codice PHP:
<?php
define('IN_PHPBB', true);
include('wapconfig.php');
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
require ($phpbb_root_path . 'includes/bbcode.'.$phpEx);
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-cache, must-revalidate");
$bbfile = "bbcode_wap.tpl";
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$title = (isset($title)) ? $title : $wapconfig['site_title'];
//////////////////////////////////
// Make Headers & Footers //
//////////////////////////////////
$pm = ($userdata['user_new_privmsg'] != 0 || $userdata['user_unread_privmsg'] != 0)
? "<anchor>" . $lang['wap_new_pm_alert'] . "<go href=\"" . append_sid("wappm.php") . "\" />##HAI NUOVI INBOX##</anchor>
"
: "";
$header = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
//The line below stops the highlighting editor getting confused...
//<?php
$header .= "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
$header .= "\n<wml><head><meta forua=\"true\" http-equiv=\"Cache-Control\" content=\"no-cache\"/></head>";
$header .= "<template>\n<do type=\"prev\" name=\"Previous\" label=\"Back\">\n<prev/>\n</do>\n";
$header .= "<do type=\"accept\" name=\"Menu\" label=\"Menu" . $lang['wap_menu'] . "\">\n<go href=\"" . append_sid("wapmenu.php") . "\"/>\n</do>";
$header .= "<do type=\"accept\" name=\"home\" label=\"Online" . $lang['wap_online'] ."\">\n<go href=\"" . append_sid("wapmisc.php?action=online") . "\"/>\n</do>\n</template>";
$header .= "\n<card id=\"forum\" title=\"$title\" newcontext=\"true\">
\n[i]$pm[/i]";
$menu = "
<anchor>" . $lang['wap_stats'] . "<go href=\"" . append_sid("wap.php") . "\" />Bacheca</anchor>
";
$page_showfooter = 1;
foreach ($footer_show as $val)
{
if($_SERVER['PHP_SELF'] == $val)
$page_showfooter = 0;
}
if(!$userdata['session_logged_in'])
{
$footer = ($page_showfooter) ? "$menu <anchor>" . $lang['wap_bacheca'] . "<go href=\"" . append_sid("wap.php") . "\" />Bacheca</anchor></p></card></wml>" : "</p></card></wml>";
}
else
{
$footer = ($page_showfooter) ? "$menu <anchor>" . $lang['wap_whos_online'] . "<go href=\"" . append_sid("wapmisc.php?action=online") . "\" />Online</anchor></p></card></wml>" : "</p></card></wml>";
}
function wap_validate($post_text,$smiles=1,$tags=1,$uid="",$quote=0)
{
global $phpbb_root_path, $phpEx;
$post_text = str_replace("&","&",$post_text);
if($tags)
{
$post_text = str_replace("\n","
",$post_text);
if(!$quote)
{
$post_text = str_replace("
"," *aaaa* ",$post_text);
}
}
if(!$quote)
{
$post_text = bbencode_second_pass($post_text,$uid);
}
$post_text = stripslashes($post_text);
$post_text = strip_tags($post_text);
$post_text = str_replace(" *aaaa* ","
",$post_text);
if($smiles)
{
$post_text = wap_smilies_pass($post_text);
}
if($quote)
{
strip_tags($post_text);
htmlentities($post_text);
$post_text = str_replace("
", "\n", $post_text);
$post_text = str_replace(":" . $uid, "", $post_text);
}
return $post_text;
}
function prepare_wap_post($txt,$uid)
{
$txt = bbencode_first_pass($txt, $uid);
$txt = str_replace("\n","
",$txt);
return $txt;
}
function wap_smilies_pass($message)
{
static $orig, $repl;
if (!isset($orig))
{
global $db, $board_config, $url_path;
$orig = $repl = array();
$sql = 'SELECT code, smile_url FROM ' . SMILIES_TABLE;
if( !$result = $db->sql_query($sql) )
{
echo $lang['wap_not_obtain_smiles'];
}
$smilies = $db->sql_fetchrowset($result);
usort($smilies, 'wap_smiley_sort');
for($i = 0; $i < count($smilies); ++$i)
{
$orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/";
if($smilies[$i]['smile_url'] == "")
{
$repl[] = '***image***';
}
else {
# $repl[] = '***image***';
$repl[] = '[img]' . $url_path . '/' . $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '[/img]';
}
}
}
if (count($orig))
{
$message = preg_replace($orig, $repl, ' ' . $message . ' ');
$message = substr($message, 1, -1);
}
return $message;
}
function wap_smiley_sort($a, $b)
{
if ( strlen($a['code']) == strlen($b['code']) )
{
return 0;
}
return ( strlen($a['code']) > strlen($b['code']) ) ? -1 : 1;
}
?>