• 11-11-2009, 20:06:42
    #1
    küçük bir blog sistemi var. Mysql gerektirmeyen txtblog isminde. ama türkçe karakter sorunu var. aşağıda index kodları bulunuyor.

    <?php
    /***************************************************************************
    *
    * TxtBlog CMS
    *
    * Created by: Leo Kent, leo [dot] kent [at] gmail [dot] com
    *
    * TxtBlog CMS is released under the GNU Public License.
    *
    * You are free to use and modify TxtBlog CMS. All changes 
    * must be uploaded to sourceforge.net/projects/txtblogcms/
    * or emailed to leo [dot] kent [at] gmail [dot] com
    *
    * The TxtBlog CMS team request that footer linking back to
    * the project Home Page should not be tampered with as a
    * lot of work went into the project.
    * Thanks
    *
    ***************************************************************************/
    
    define ("txtbloged", 1);
    require_once("config.php");
    require_once("includes/template_functions.php");
    require_once("includes/functions.php");
    
    // Which function is needed?
    if ( isset($_GET['y']) && isset($_GET['m']) ) {
    
    	showMonth();
    	
    } else {
    
    	showIndex();
    
    }
    
    // The Functions
    
    function showMonth() {
    	global $config_date_format, $txtblog_body, $txtblog_title, $config_title;
    
    	$txtblog_body = "";
    	$txtblog_title = "$config_title - Archives";
    
    	$year = $_GET['y'];
    	$month = $_GET['m'];
    
    	$files = findFiles("data/$year/$month");
    	
    	if (isset($files)) {
    	foreach ($files as $file) {
    				
    		include ("data/$year/$month/$file");
    		$date_array = explode(" ",$date);
    		$date = date($config_date_format, mktime($date_array[0], $date_array[1], $date_array[2], $date_array[3], $date_array[4], $date_array[5]));
    		$txtblog_body .= "<span class='blog_title'>$title</span><br>\n<span class='blog_date'>$date</span><br>\n".bb2html($blog)."<br>\n<hr size='1'>\n";
    
    	}
    	}
    }
    
    function showIndex() {
    	global $txtblog_title, $txtblog_body, $config_date_format, $config_title;
    	
    	$txtblog_title = "$config_title - Home";
    	$txtblog_body = "";
    	
    	// Search all the data dirs and make an array of all files	
    	$years = findDirs("data");
    	
    	if (isset($years)) {
    	foreach ($years as $year) {
    	
    		$months = findDirs("data/$year");
    		
    		if (isset($months)) {
    		foreach ($months as $month) {
    			
    			$files = findFiles("data/$year/$month");
    			
    			// Vars for array shortening the array
    			$file_count = count($files);
    			$i = 0;
    			$limit = 5;
    			
    			// Create a new array with a limited number of files
    			while (($i < $limit) && ($file_count > $i)) {
    			
    				$new_array[] = $files[$i];
    				$i++;
    			
    			}
    			
    			// For each file in the new array add it to the body
    			if (isset($new_array)) {
    				foreach ($new_array as $file) {
    				
    					include ("data/$year/$month/$file");
    					$date_array = explode(" ",$date);
    					$date = date($config_date_format, mktime($date_array[0], $date_array[1], $date_array[2], $date_array[3], $date_array[4], $date_array[5]));
    					$txtblog_body .= "<span class='blog_title'>$title</span><br>\n<span class='blog_date'>$date</span><br>\n".bb2html($blog)."<br>\n<hr size='1'>\n";
    				
    				}
    			}
    	
    		}
    		}
    	}
    	}
    }
    
    
    
    // Include the template file
    if (!file_exists("templates/".$config_template."/index.tpl")) { die("Template File Missing!"); }
    require_once("templates/".$config_template."/index.tpl");
    
    ?>
    bu sorunu nasıl çözerim?
  • 11-11-2009, 20:20:11
    #2
    Bu dosyadan çözülmez,tema anasayfasını koyman gerekli,yada meta kısmını değiştiriceksin
  • 11-11-2009, 20:26:36
    #3
    tema sayfasında şöyle bir kod var;

    Alıntı
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  • 11-11-2009, 20:27:35
    #4
    Üyeliği durduruldu
    Buradaki Charset değerini ,

    charset=iso-8859-1 değilde, charset=iso-8859-9 şeklinde düzeltip denermisiniz.
  • 11-11-2009, 20:29:04
    #5
    en üste bunu ekleyin
    <?php
    header ("Content-Type: text/html; charset=iso-8859-9");
    ?>

    olmadı bunu ekleyin,
    <?php
    header ("Content-Type: text/html; charset=utf8");
    ?>
  • 11-11-2009, 20:29:22
    #6
    evet. tamamdır, teşekkürler. 1 sayısını 9 yapınca düzeldi.
  • 11-11-2009, 21:09:07
    #7
    Üyeliği durduruldu
    cekerizcefa adlı üyeden alıntı: mesajı görüntüle
    evet. tamamdır, teşekkürler. 1 sayısını 9 yapınca düzeldi.
    utf-8 e cevirebilirseniz her zaman rahat edersiniz