Показать пользователю читал ли он топик (решено для 0.4, не работает в 0.3)
Хочу показать пользователю читал ли он топик. В LS для этого все есть — поле в базе и функция GetTopicRead в Topic.Mapper, однако когда я вставляю в topic.tpl {$oTopic->getTopicRead()} то выскакивает ошибка «Не найден класс модуля — getTopicRead» Понимаю что надо что-то дописать в экшн, но не понимаю что. Помогите советом.
Update: проверено — в 0.4 {$oTopic->getDateRead()} работает, в 0.3.1 выдает ошибку:
Fatal error: Uncaught exception 'Exception' with message 'Не найден класс модуля — getDateRead' in P:\home\test2.ru\www\classes\engine\Engine.class.php:95 Stack trace: #0 P:\home\test2.ru\www\classes\engine\Engine.class.php(183): Engine->LoadModule('getDateRead', true) #1 P:\home\test2.ru\www\classes\engine\Entity.class.php(61): Engine->_CallModule('getDateRead', Array) #2 [internal function]: Entity->__call('getDateRead', Array) #3 P:\home\test2.ru\www\templates\compiled\%%27^27A^27A2FB40%%topic.tpl.php(128): TopicEntity_Topic->getDateRead(1) #4 P:\home\test2.ru\www\classes\lib\external\Smarty-2.6.19\libs\Smarty.class.php(1868): include('P:\home\test2.r...') #5 P:\home\test2.ru\www\templates\compiled\%%DE^DE2^DE2B923A%%topic.tpl.php(17): Smarty->_smarty_include(Array) #6 P:\home\test2.ru\www\classes\lib\external\Smarty-2.6.19\libs\Smarty.class.php(1255): include('P:\home\test2.r...') #7 P:\home\test2.ru\www\classes\lib\external\Smarty-2.6.19\libs\Smarty.class.php(1105): Smarty->fetch('actions/ActionB… in P:\home\test2.ru\www\classes\engine\Engine.class.php on line 95
Update: проверено — в 0.4 {$oTopic->getDateRead()} работает, в 0.3.1 выдает ошибку:
Fatal error: Uncaught exception 'Exception' with message 'Не найден класс модуля — getDateRead' in P:\home\test2.ru\www\classes\engine\Engine.class.php:95 Stack trace: #0 P:\home\test2.ru\www\classes\engine\Engine.class.php(183): Engine->LoadModule('getDateRead', true) #1 P:\home\test2.ru\www\classes\engine\Entity.class.php(61): Engine->_CallModule('getDateRead', Array) #2 [internal function]: Entity->__call('getDateRead', Array) #3 P:\home\test2.ru\www\templates\compiled\%%27^27A^27A2FB40%%topic.tpl.php(128): TopicEntity_Topic->getDateRead(1) #4 P:\home\test2.ru\www\classes\lib\external\Smarty-2.6.19\libs\Smarty.class.php(1868): include('P:\home\test2.r...') #5 P:\home\test2.ru\www\templates\compiled\%%DE^DE2^DE2B923A%%topic.tpl.php(17): Smarty->_smarty_include(Array) #6 P:\home\test2.ru\www\classes\lib\external\Smarty-2.6.19\libs\Smarty.class.php(1255): include('P:\home\test2.r...') #7 P:\home\test2.ru\www\classes\lib\external\Smarty-2.6.19\libs\Smarty.class.php(1105): Smarty->fetch('actions/ActionB… in P:\home\test2.ru\www\classes\engine\Engine.class.php on line 95
12 комментариев
У меня идеально работает.
Вот как выводит:
http://s09.radikal.ru/i182/1007/77/79fb2f587e3d.png
У меня на 0.3.1
Fatal error: Uncaught exception 'Exception' with message 'Не найден класс модуля — getDateRead' in P:\home\test1.ru\www\classes\engine\Engine.class.php:95
Я вставил это после:
Просто в любое нужное места шаблона topic.tpl вставляешь и все!
Если нужно при просмотре записей блога — тогда в topic_list.tpl