Witam. zainstalowałem sobie sBlog ale mam problem z polskimi znakami, zamiast ich wyswietlaja sie “krzaczki” probowalem juz to naprawic ale nie przynioslo efektow
Zmień tytuł na konkretny używając funkcji
Inaczej temat poleci do śmietnika.
Czy może mi ktoś pomóc?
Podaj adres swojego bloga.
Masz kodowanie znaków:
a powinno być
8859- 2
Chyba dlatego są ,krzaczki".
a gdzie to kodowanie zmieni? w jakim pliku?
W index.php
i to wystarczy jesli wpisze tylko do index.php? bo ja bym chcial zeby sie wszedzie pokazywalo ;?
Powinno. Chyba, że kodowanie znaków możesz zmienić w opcjach tak jak to jest w “worldpress”
niestety po skopiowaniu do pliku index.php polskie znaki dalej nie działają…
<?php
/ **************************************************
Project sBLOG
Author Servous
License GPL
************************************************** /
// make sure that config.php has been uploaded
if(!file_exists('config.php')) {
header('Location: install/index.php');
exit;
}
// make sure that the dir 'install' has been deleted
else if(is_dir('install')) {
echo 'Please remove the directory install and all of it\'s content!';
exit;
}
if(isset($_REQUEST['date']) && strlen($_REQUEST['date']) == 6 || isset($_REQUEST['date']) && strlen($_REQUEST['date']) == 8) {
$year = substr($_REQUEST['date'], 0, 4);
$month = substr($_REQUEST['date'], 4, 2);
$day = substr($_REQUEST['date'], 6, 2);
$date = $_REQUEST['date'];
}
else {
$date = 0;
}
if(isset($_REQUEST['cat']) && intval($_REQUEST['cat']) > 0) {
$cat = intval($_REQUEST['cat']);
}
else {
$cat = null;
}
// include headers
require('inc/tpl_header.php'); // header
require('inc/tpl_menu.php'); // menu
// include blocks
require('inc/block_custom.php'); // custom blocks
// include functions
require('inc/sRenderPost.php');
// declare truncate() is not already declared
if(!function_exists('truncate')) {
require('inc/func_truncate.php');
}
/* start */
ob_start();
?>
<?php
require('inc/mysql.php');
// fetch all posts from a certain category
if(isset($cat) && $cat != 0) {
$query = 'SELECT d.id, UNIX_TIMESTAMP(d.date_created) AS date_created, UNIX_TIMESTAMP(d.date_modified) AS date_modified, d.topic, d.text, d.category_id, c.category FROM ' . $conf_mysql_prefix . 'data AS d, ' . $conf_mysql_prefix . 'categories AS c WHERE d.category_id=c.id AND category_id=\'' . $cat . '\' ORDER BY date_created DESC, date_modified DESC';
}
// fetch posts for yyyymmdd
else if(isset($date) && strlen($date) == 8) {
$query = 'SELECT d.id, UNIX_TIMESTAMP(d.date_created) AS date_created, UNIX_TIMESTAMP(d.date_modified) AS date_modified, d.topic, d.text, d.category_id, c.category FROM ' . $conf_mysql_prefix . 'data AS d, ' . $conf_mysql_prefix . 'categories AS c WHERE d.category_id=c.id AND SUBSTRING(d.date_created, 1, 10)=\'' . $year . '-' . $month . '-' . $day . '\' ORDER BY date_created DESC, date_modified DESC';
}
// fetch posts for yyyymm
else if(isset($date) && strlen($date) == 6) {
$query = 'SELECT d.id, UNIX_TIMESTAMP(d.date_created) AS date_created, UNIX_TIMESTAMP(d.date_modified) AS date_modified, d.topic, d.text, d.category_id, c.category FROM ' . $conf_mysql_prefix . 'data AS d, ' . $conf_mysql_prefix . 'categories AS c WHERE d.category_id=c.id AND SUBSTRING(d.date_created, 1, 7)=\'' . $year . '-' . $month . '\' ORDER BY date_created DESC, date_modified DESC';
}
// fetch all posts
else {
$query = 'SELECT d.id, UNIX_TIMESTAMP(d.date_created) AS date_created, UNIX_TIMESTAMP(d.date_modified) AS date_modified, d.topic, d.text, d.category_id, c.category FROM ' . $conf_mysql_prefix . 'data AS d, ' . $conf_mysql_prefix . 'categories AS c WHERE d.category_id=c.id ORDER BY date_created DESC, date_modified DESC';
}
// set active page
if(!isset($_REQUEST['p'])) {
$page = 1;
}
else {
$page = $_REQUEST['p'];
}
$q = mysql_query($query);
$n = mysql_num_rows($q);
if($n > 0) {
$counter = 0;
// prevent division by zero error
if(isset($conf_page_disp) && $conf_page_disp > 0) {
$pages = ceil($n / $conf_page_disp);
}
else {
$conf_page_disp = 5;
$pages = 0;
}
// jump to active page in database
mysql_data_seek($q, (($page - 1) * $conf_page_disp));
while($r = mysql_fetch_assoc($q)) {
$counter++;
if($counter > $conf_page_disp) {
break;
}
// render the post
sRenderPost($r['id'], $r['category_id'], $r['category'], $r['date_created'], $r['date_modified'], $r['topic'], $r['text']);
}
if($pages > 1) {
echo "\t\t\t" . '' . "\n";
echo "\t\t\t" . '
’ . “\n”; echo “\t\t\t\t” . ’
’ . “\n”; if($page > 1) { echo “\t\t\t\t\t” . ‘« ’ . lang(‘First’) . ’ « ’ . lang(‘Previous’) . '’ . “\n”; } else { echo “\t\t\t\t\t” . ‘« ’ . lang(‘First’) . ’ « ’ . lang(‘Previous’) . “\n”; } echo “\t\t\t\t” . ’
’ . “\n”; echo “\t\t\t\t” . ’
’ . “\n”; if($page < $pages) { echo “\t\t\t\t\t” . ‘’ . lang(‘Next’) . ’ » ’ . lang(‘Last’) . ’ »’ . “\n”; } else { echo “\t\t\t\t\t” . lang(‘Next’) . ’ » ’ . lang(‘Last’) . ’ »’ . “\n”; } echo “\t\t\t\t” . ’
’ . “\n”; echo “\t\t\t\t” . ’
’ . “\n”; echo “\t\t\t\t\t” . $page . ’ ’ . lang(‘of’) . ’ ’ . $pages . “\n”; echo “\t\t\t\t” . ’
’ . “\n”; echo “\t\t\t” . ’
’ . “\n”; echo “\t\t\t” . ‘’ . “\n”; } } else { if(array_key_exists(‘cat’, $_REQUEST)) { echo ’
’ . lang(‘There are no posts assigned to this category.’) . ’
’ . “\n”; } else if(array_key_exists(‘date’, $_REQUEST)) { echo ’
’ . lang(‘No posts were posted on this date.’) . ’
’ . “\n”; } else { echo ’
’ . lang(‘The sBLOG is empty!’) . ’
’ . “\n”; } } mysql_close(); ?> <?php $tpl_temp = trim(ob_get_contents()); $tpl_main = str_replace(’’, $tpl_temp, $tpl_main); ob_end_clean(); /* end */ require(‘inc/tpl_foot.php’); echo $tpl_main; ?>[/code]
Takie powino byc kodowanie jak nie dziala to pokombinuj
A w opcjach nie masz ustawień kodowania? sBlog to mało popularny skrypt, a forumowa wróżka jest na urlopie.