WonderRusCMS ravilr [russian edition - 0.5.1 BETA]

ravilr
Posts: 9
Joined: Sun Dec 22, 2013 7:26 am

WonderRusCMS ravilr [russian edition - 0.5.1 BETA]

Post by ravilr »

Hi. I want to thank for the good work done ))

1. Please add error_reporting(0); to index.php )))

2. Please add support Cyrillic symbols.
I'm from Russia and do not work to create a page with a Russian title :(
ravilr
Posts: 9
Joined: Sun Dec 22, 2013 7:26 am

Re: WonderCMS 0.5.1 BETA (DEMO AND DOWNLOAD)

Post by ravilr »

Hi. i done the task #2 :-)

I change function menu

Code: Select all

function menu($stags,$etags){
	global $c;
	$mlist = explode('<br />',$c['menu']);
	for($i=0;$i<count($mlist);$i++){
		
		$page = getSlug(translit($mlist[$i]));
		$page_title = $mlist[$i];
		if(!$page) continue;
		echo $stags." href='".$page."'>".str_replace('-',' ',$page_title)." ".$etags." \n";
	}
}

function translit($str){
    $alphavit = array(
    /*--*/
    "а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d","е"=>"e","ё"=>"yo","ж"=>"j","з"=>"z","и"=>"i","й"=>"i","к"=>"k","л"=>"l", "м"=>"m",
    "н"=>"n","о"=>"o","п"=>"p","р"=>"r","с"=>"s","т"=>"t","у"=>"y","ф"=>"f","х"=>"h","ц"=>"c","ч"=>"ch", "ш"=>"sh","щ"=>"sh",
    "ы"=>"i","э"=>"e","ю"=>"u","я"=>"ya",
    /*--*/
    "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D","Е"=>"E", "Ё"=>"Yo","Ж"=>"J","З"=>"Z","И"=>"I","Й"=>"I","К"=>"K", "Л"=>"L","М"=>"M",
    "Н"=>"N","О"=>"O","П"=>"P", "Р"=>"R","С"=>"S","Т"=>"T","У"=>"Y","Ф"=>"F", "Х"=>"H","Ц"=>"C","Ч"=>"Ch","Ш"=>"Sh","Щ"=>"Sh",
    "Ы"=>"I","Э"=>"E","Ю"=>"U","Я"=>"Ya","ь"=>"","Ь"=>"","ъ"=>"","Ъ"=>""
    );
    return strtr($str, $alphavit);
}
ravilr
Posts: 9
Joined: Sun Dec 22, 2013 7:26 am

Re: WonderCMS 0.5.1 BETA (DEMO AND DOWNLOAD)

Post by ravilr »

task #3 (add) - a separate style for loggedin

Code: Select all

if(is_loggedin()) echo " <link rel='stylesheet' href='themes/".$c["themeSelect"]."/setting-style.css'>";
ravilr
Posts: 9
Joined: Sun Dec 22, 2013 7:26 am

WonderRusCMS (ravilr (russian edition))

Post by ravilr »

Hi rob. I hope you don't mind that I will post here the Russian version?

WonderRusCms выпущена на основе бетта версии WonderCMS 0.5.1 beta

Что нового:
Переведен на русский язык
Поддержка русских названий страниц в меню
Добавлена возможность указать отдельный Title для страниц
Добавлен, активный пункт меню
Если страница не найдена выдает ответ 404
Отдельный файл стилей для режима Администрирования
wonderRusCms-0.5.2-BETA.zip.zip
WonderRusCMS 0.5.2 BETA
(21.98 KiB) Downloaded 1672 times
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: WonderRusCMS ravilr [russian edition - 0.5.1 BETA]

Post by wiz »

Hello ravilr,

here's a fix for supporting all characters in the navigation menu (also Cyrillic characters, so you can remove your "translit" function).

Open index.php and find

Code: Select all

function getSlug($p){
	$p = strip_tags($p);
	preg_match_all('/([a-z0-9A-Z-_]+)/', $p, $matches);
	$matches = array_map('strtolower', $matches[0]);
	$slug = implode('-', $matches);
	return strip_tags($p);
}
replace it with

Code: Select all

function getSlug($p){
	return strip_tags($p);
}
Be careful with your file names in the files folder, as you may have to rename them accordingly.
ravilr
Posts: 9
Joined: Sun Dec 22, 2013 7:26 am

Re: WonderRusCMS ravilr [russian edition - 0.5.1 BETA]

Post by ravilr »

Hello rob.
Сannot delete "translit" function, as the need for the correct url (translit url) and correct name files.
cyr.PNG
cyr.PNG (30.39 KiB) Viewed 28865 times
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: WonderRusCMS ravilr [russian edition - 0.5.1 BETA]

Post by wiz »

Does your local host support files with Russian characters? I think your local host is having problems with UTF-8 encoding.

I tested this with the fixes I posted above (the test was not done on a local server) and everything worked as expected. The file was saved correctly (in Russian, or any other language or set of characters) in the files folder.

Can you try this test on another server which isn't hosted locally?
ravilr
Posts: 9
Joined: Sun Dec 22, 2013 7:26 am

Re: WonderRusCMS ravilr [russian edition - 0.5.1 BETA]

Post by ravilr »

Everything works, but the name of the file is obtained as the screenshot, even on the external host server.
I always think that the name of the file on the server, and the url should be always on the Latin alphabet, so it i added to himself transliteration.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: WonderRusCMS ravilr [russian edition - 0.5.1 BETA]

Post by wiz »

There has to be some other problem. Either it's your local computer or settings on the server.

You said URL's should always be in latin and I have to say I disagree. Here's why:
Having any non latin characters in the URL is generally an unknown area and if you think of it, wouldn't it be great if someone did a search (through a search engine) in their native language and found your website as the top result (matching your non latin URL with the non-latin user search)?

WonderCMS supports this idea as an experiment.

Is there any chance you could give me the link to your external (non local) server so I test this out on ?

If you'd like to see how it works - you can test it out here.
You'll see that non-latin URL's work as intended and it also saves the file in the correct non-latin format.
ravilr
Posts: 9
Joined: Sun Dec 22, 2013 7:26 am

Re: WonderRusCMS ravilr [russian edition - 0.5.1 BETA]

Post by ravilr »

ок. I soon prepare hosting platform for you and send you the ftp.

About URL. Search engines, Google for example, has long been taken as their own transliteration.
see screenshot http://tinyurl.com/ocw75t7

Now I say that storing files on a server in Russian encoding (UNIX server) is bad form for developers (as considered in Russian)
Post Reply