- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
/**
* commentsPostController: контроллер для метода post модуля comments
*
* @package modules
* @subpackage comments
* @version 0.2
*/
class commentsPostController extends simpleController
{
//......
$formTitles = array(
'Я, <b>' . htmlspecialchars($user->getLogin()) . '</b>, находясь в здравом уме и твердой памяти, торжественно заявляю:',
'Помни, <b>' . htmlspecialchars($user->getLogin()) . '</b>, за тобой могут следить!',
'Семь раз отмерь — один отрежь, <b>' . htmlspecialchars($user->getLogin()) . '</b>!',
'Где здесь C++, <b>' . htmlspecialchars($user->getLogin()) . '</b>?!',
);
$session = $this->toolkit->getSession();
if ($onlyForm) {
$currentTitleIndex = mt_rand(0, sizeof($formTitles) - 1);
$session->set('comments_form_title_index', $currentTitleIndex);
} else {
$currentTitleIndex = $session->get('comments_form_title_index', -1);
if (!isset($formTitles[$currentTitleIndex])) {
$currentTitleIndex = mt_rand(0, sizeof($formTitles) - 1);
$session->set('comments_form_title_index', $currentTitleIndex);
}
}
//......
}
но позже
Плюсую! :)
любопытно )
:)
и я даже знаю кто )))