DZIEDI Posted August 13, 2008 Report Share Posted August 13, 2008 Visi garie un mīkstie burti rādās kā ķeburi. It kā mēģināju visu failus pārkonvertēt uz utf-8 un index.php headā arī nomainīju uz utf-8, tik un tā nepalīdzēja. Varat lūdzu palīdzēt? Man vairs nav idejas. Čatu var lejupielādēt šeit: http://www.ajaxdaddy.com/download/jquery-shoutbox.zip Link to comment Share on other sites More sharing options...
Aleksejs Posted August 13, 2008 Report Share Posted August 13, 2008 No kuras vietas tie teksti tiek ņemti? Ja no DB, tad pārliecinies, ka DB ar kodējumiem viss kārtībā un ka saņem korektu UTF-8 no turienes. Link to comment Share on other sites More sharing options...
DZIEDI Posted August 13, 2008 Author Report Share Posted August 13, 2008 teksts tiek ņemts no *.txt faila. Tam arī uzliku utf-8 kodējumu. Arī nemainījās. Link to comment Share on other sites More sharing options...
Aleksejs Posted August 13, 2008 Report Share Posted August 13, 2008 To tavu (tieši tavu) nedarbīgo čatu var arī ieraudzīt? Link to comment Share on other sites More sharing options...
DZIEDI Posted August 13, 2008 Author Report Share Posted August 13, 2008 http://chat.ghostbt.lv/ Link to comment Share on other sites More sharing options...
Klez Posted August 13, 2008 Report Share Posted August 13, 2008 daddy-shoutbox.php shis atgriezh rezultaatu utf-8 ? Link to comment Share on other sites More sharing options...
DZIEDI Posted August 13, 2008 Author Report Share Posted August 13, 2008 (edited) nav ne jausmas. Katrā gadījumā vienā failā bija rakstīts kaut kas par utf-16 Lūk faila satrs <?php function replace(&$item, $key) { $item = str_replace('|', '-', $item); } if (!function_exists('file_put_contents')) { function file_put_contents($fileName, $data) { if (is_array($data)) { $data = join('', $data); } $res = @fopen($fileName, 'w+b'); if ($res) { $write = @fwrite($res, $data); if($write === false) { return false; } else { return $write; } } } } //file_put_contents('debug.txt', print_r($_GET, true)); switch($_GET['action']) { case 'add': array_walk($_POST, 'replace'); $arr = file('messages.txt'); if(count($arr) > 10) array_shift($arr); $_POST['nickname'] = htmlentities($_POST['nickname']); $_POST['message'] = htmlentities($_POST['message']); $time = time(); $arr[] = $time.'|'.$_POST['nickname'].'|'.$_POST['message'].'|'.$_SERVER['REMOTE_ADDR']."\n"; file_put_contents('messages.txt', implode('', $arr)); $data['response'] = 'Good work'; $data['nickname'] = $_POST['nickname']; $data['message'] = $_POST['message']; $data['time'] = $time; break; case 'view': $data = array(); $arr = file('messages.txt'); if(!$_GET['time']) $_GET['time'] = 0; foreach($arr as $row) { $aTemp = null; list($aTemp['time'], $aTemp['nickname'], $aTemp['message']) = explode('|', $row); if($aTemp['message'] AND $aTemp['time'] > $_GET['time']) $data[] = $aTemp; } //file_put_contents('debug.txt', print_r($data, true)); break; } require_once('JSON.php'); $json = new Services_JSON(); $out = $json->encode($data); print $out; ?> Edited August 13, 2008 by DZIEDI Link to comment Share on other sites More sharing options...
Klez Posted August 13, 2008 Report Share Posted August 13, 2008 šis neatgriež rezultātu utf-8 kodeejumaa .. http://chat.ghostbt.lv/demos/jquery-shoutb...dy-shoutbox.php paraadi shito failu JSON.php Link to comment Share on other sites More sharing options...
DZIEDI Posted August 13, 2008 Author Report Share Posted August 13, 2008 Paldies par centību, atradu citu čatu. Ja kādam vēl ir interese, tad to var lejupielādēt šeit: http://miniup.net/files/e7e5112cbc1b2d3aff...%20+%20Ajax.rar Link to comment Share on other sites More sharing options...
DZIEDI Posted August 13, 2008 Author Report Share Posted August 13, 2008 Netaisot jaunu topic`u vēlējos vēl lūgt palīdzību ar *.js failu. var defaults = { 'ys-input-nickname': self.prefs.defaultNickname, 'ys-input-message': self.prefs.defaultMessage }; self.prefs.defaultNickname vietā man vajadzētu dabūt šo te global $lietotajs; $lietotajs['vards]' Kā lai to pareizi uzraksta? Rakājos googlē, tur konkrētu par šo lietu neko neatradu. Link to comment Share on other sites More sharing options...
Klez Posted August 14, 2008 Report Share Posted August 14, 2008 pameklee veel kaadu citu chatu .... 'ys-input-nickname': self.prefs.defaultNickname, 'ys-input-nickname': <?php echo $lietotajs['vards']; ?>, Link to comment Share on other sites More sharing options...
pilots Posted August 14, 2008 Report Share Posted August 14, 2008 par sākuma tematu runājot, varbūt bija nepieciešams norādīt UTF8 without BOM. Link to comment Share on other sites More sharing options...
DZIEDI Posted August 14, 2008 Author Report Share Posted August 14, 2008 Varbūt, bet kā jau iepriekš minēju, paldies, bet tas vairs nav aktuāli. Paldies, Klez, problēmu beigās atrisināju js failu pārkopējot uz php failu un ieliekot script tagos, un tālāk pēc tavas shēmas. Link to comment Share on other sites More sharing options...
Recommended Posts