Monday, April 26, 2010

Ошо "Хайр, эрх чөлөө, ганцаардал"

Өнгөрсөн жил Ошогийн "Хайр, эрх чөлөө, ганцаардал"-ыг уншсан. Үнэхээр гоё ном! Ачиймаа эгчийн орчуулганд байна уу, ямар ч байсан уншихад их энгийн атлаа гүн юм.
Хайр бол эрх чөлөө гэсэн Жиймэн багшийн минь үг орой руу орох шиг л болсон доо.
Хайрлах гэдгийг нөгөө хүнээ өмчлөх гэж ойлгодог хүмүүс их бий шүү. Ер нь энэ ном хайрын тухайн их зүйлийг хэлнэ дээ. Уншаагүй хүн байвал хурдхан уншаарай гэж зөвлөе.

First update:
Энэ ном 5000 төгрөгөөр зарагдаж байдаг байхаа. Интерном, Боловсрол гээд номын дэлгүүрүүдэд лав байдгийн

IF

За нэг дуртай шүлгээ оруулъя. Энэ шүлгээрээ Киплинг Нобель авсан гэсэн. Киплинг чинь Маугли-г зохиосон хүн шүү дээ. Хүн гэдэг ойлголтыг шүлгэнд багтааж хэлсийн болуу даа.

"If"

by Rudyard Kipling

If you can keep your head when all about you
Are losing theirs and blaming it on you;
If you can trust yourself when all men doubt you,
But make allowance for their doubting too;
If you can wait and not be tired by waiting,
Or, being lied about, don't deal in lies,
Or, being hated, don't give way to hating,
And yet don't look too good, nor talk too wise;

If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
If you can meet with triumph and disaster
And treat those two imposters just the same;
If you can bear to hear the truth you've spoken
Twisted by knaves to make a trap for fools,
Or watch the things you gave your life to broken,
And stoop and build 'em up with wornout tools;

If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss,
And lose, and start again at your beginnings
And never breath a word about your loss;
If you can force your heart and nerve and sinew
To serve your turn long after they are gone,
And so hold on when there is nothing in you
Except the Will which says to them: "Hold on";

If you can talk with crowds and keep your virtue,
Or walk with kings - nor lose the common touch;
If neither foes nor loving friends can hurt you;
If all men count with you, but none too much;
If you can fill the unforgiving minute
With sixty seconds' worth of distance run -
Yours is the Earth and everything that's in it,
And - which is more - you'll be a Man my son!

Энэ шүлгийн сайхан орчуулга хайж байна. Олж өгвөл тун их баярлана. :)

FCK editor ийг symfony дээр тохируулах

FCKeditor ийг symfony 1.0 дээр тохируулах тухай нэг бичлэг оруулъя.
1. FCKeditor -ийг татаж авна. http://ckeditor.com/blog/FCKeditor_2.6.6_released
2. Symfony -ийн /web/js/ директор дотор задална.
3. symfony дотор //config/settings.yml файлыг ямар нэг эдитор програмаар нээж дараахь өөрчлөлтийг хийнэ.
.settings:
rich_text_fck_js_dir: js/fckeditor
4. /web/js/fckeditor/fckconfig.js javascript файлыг нээж edit хийнэ.

var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | php

5. Дараа нь /web/js/fckeditor/editor/filemanager/connectors/php/config.php файл дотор
$Config['Enabled'] = true;
$Config['UserFilesPath'] = '/userfiles/' ;
/эдгээр нь 28-32 р мөрөнд байгаа байх/
тохиргоог хийж өөрийн upload хийх директорыг тохируулна. Сонгосон директорынхоо permission -ийг 777 болгохоо мартав даа.

6. Эцэст нь template хэсэг дээр ашиглахдаа
$options = array(
'rich' => 'fck',
'height' => 500,
'width' => 500,
);
echo textarea_tag('inputname', 'text', $options );

-----------------------------------------------------
Нэмэлт мэдээлэл:
'''Custom settings recommandation'''

'''FCKeditor 2.5.x Resources Browser configuration'''

The Resources Browser of FCKeditor 2.5 is in the normal configuration not working. Take the following steps to solve this problem:

1. Make the following changes in the config.php (web/js/fckeditor/editor/filemanager/connectors/php):

// Old code: $Config['Enabled'] = false ;
$Config['Enabled'] = true ;

// Old code: $Config['UserFilesPath'] = '/userfiles/' ;
$Config['UserFilesPath'] = DIRECTORY_SEPARATOR . 'userfiles' . DIRECTORY_SEPARATOR ;

// Old code: $Config['UserFilesAbsolutePath'] = '' ;
$Config['UserFilesAbsolutePath'] = $_SERVER[DOCUMENT_ROOT] . $Config['UserFilesPath'] ;

// Old code: $Config['QuickUploadPath']['File'] = $Config['UserFilesPath'] ;
// Old code: $Config['QuickUploadAbsolutePath']['File']= $Config['UserFilesAbsolutePath'] ;
$Config['QuickUploadPath']['File'] = $Config['FileTypesPath']['File'] ;
$Config['QuickUploadAbsolutePath']['File'] = $Config['FileTypesAbsolutePath']['File'] ;

// Old code: $Config['QuickUploadPath']['Image'] = $Config['UserFilesPath'] ;
// Old code: $Config['QuickUploadAbsolutePath']['Image']= $Config['UserFilesAbsolutePath'] ;
$Config['QuickUploadPath']['Image'] = $Config['FileTypesPath']['Image'] ;
$Config['QuickUploadAbsolutePath']['Image'] = $Config['FileTypesAbsolutePath']['Image'] ;

// Old code: $Config['QuickUploadPath']['Flash'] = $Config['UserFilesPath'] ;
// Old code: $Config['QuickUploadAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath'] ;
$Config['QuickUploadPath']['Flash'] = $Config['FileTypesPath']['Flash'] ;
$Config['QuickUploadAbsolutePath']['Flash'] = $Config['FileTypesAbsolutePath']['Flash'] ;

// Old code: $Config['QuickUploadPath']['Media'] = $Config['UserFilesPath'] ;
// Old code: $Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath'] ;
$Config['QuickUploadPath']['Media'] = $Config['FileTypesPath']['Media'] ;
$Config['QuickUploadAbsolutePath']['Media'] = $Config['FileTypesAbsolutePath']['Media'] ;

2. An extra addition that should be made to the file is the insertion of security logic around the statement

$Config['Enabled'] = true ;

to ensure that only authenticated users with a certain role are able to upload etc.

3. Additional steps needed:
a. create directory userfiles in the document-root
b. create sub-directory file in directory userfiles
c. create sub-directory image in directory userfiles
d. create sub-directory flash in directory userfiles
e. create sub-directory media in directory userfiles
f. chmod the directories to 0777
g. optional: chown the directories with an appropriate user and group