BxBaseCmtsView.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. <?php
  2. /**
  3. * @package Dolphin Core
  4. * @copyright Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  5. * @license CC-BY - http://creativecommons.org/licenses/by/3.0/
  6. */
  7. defined('BX_DOL') or die('hack attempt');
  8. bx_import('BxDolCmts');
  9. bx_import('BxTemplPaginate');
  10. /**
  11. * @see BxDolCmts
  12. */
  13. class BxBaseCmtsView extends BxDolCmts {
  14. var $_oPaginate;
  15. var $_sStylePrefix;
  16. function BxBaseCmtsView( $sSystem, $iId, $iInit = 1 ) {
  17. BxDolCmts::BxDolCmts( $sSystem, $iId, $iInit );
  18. if(empty($sSystem))
  19. return;
  20. $this->_sJsObjName = 'oCmts' . ucfirst($sSystem) . $iId;
  21. $this->_oPaginate = new BxTemplPaginate(array(
  22. 'page_url' => 'javascript:void(0);',
  23. 'start' => 0,
  24. //'count' => $this->_oQuery->getObjectCommentsCount($this->getId(), 0),
  25. 'per_page' => $this->getPerView(),
  26. 'sorting' => $this->_sOrder,
  27. 'per_page_step' => 2,
  28. 'per_page_interval' => 3,
  29. 'on_change_page' => $this->_sJsObjName . '.changePage({start}, {per_page})',
  30. 'on_change_per_page' => $this->_sJsObjName . '.changePerPage(this)',
  31. 'on_change_sorting' => $this->_sJsObjName . '.changeOrder(this)'
  32. ));
  33. $this->_sStylePrefix = isset($this->_aSystem['root_style_prefix']) ? $this->_aSystem['root_style_prefix'] : 'cmt';
  34. BxDolTemplate::getInstance()->addJsTranslation('_sys_txt_cmt_loading');
  35. }
  36. /**
  37. * get full comments block with initializations
  38. */
  39. function getCommentsFirst () {
  40. $sRet = '<div id="cmts-box-' . $this->_sSystem . '-' . $this->getId() . '">';
  41. $sRet .= '<div class="cmt-browse">' . $this->_getBrowse() . '</div>';
  42. $sRet .= '<div class="cmts">' . $this->getComments (0, $this->_sOrder) . '</div>';
  43. if(($sPaginate = $this->getPaginate()) !== "")
  44. $sRet .= '<div class="cmt-show-more">' . $sPaginate . '</div>';
  45. if($this->isPostReplyAllowed ())
  46. $sRet .= '<div class="cmt-reply">' . $this->_getPostReplyBox() . "</div>";
  47. $sRet .= '</div>';
  48. $sRet .= $this->getCmtsInit ();
  49. return $sRet;
  50. }
  51. /**
  52. * get comments list for specified parent comment
  53. *
  54. * @param int $iCmtsParentId - parent comment to get child comments from
  55. */
  56. function getComments ($iCmtsParentId = 0, $sCmtOrder = 'asc', $iStart = 0, $iPerPage = -1) {
  57. if ($iCmtsParentId == 0 && $iPerPage == -1)
  58. $iPerPage = $this->getPerView();
  59. $sRet = '<ul class="cmts">';
  60. $aCmts = $this->getCommentsArray ($iCmtsParentId, $sCmtOrder, $iStart, $iPerPage);
  61. if (!$aCmts) {
  62. $sRet .= '<li class="cmt-no">' . _t('_There are no comments yet') . '</li>';
  63. } else {
  64. $i = 0;
  65. for ( reset($aCmts) ; list ($k, $r) = each ($aCmts) ; ++$i) {
  66. $sClass = '';
  67. if ($r['cmt_rated'] == -1 || $r['cmt_rate'] < $this->_aSystem['viewing_threshold']) {
  68. $sRet .= '<li id="cmt' . $r['cmt_id'] . '-hidden" class="cmt-replacement">';
  69. $sRet .= bx_process_output(_t('_hidden_comment', $r['cmt_author_name'])) . ' ' . ($r['cmt_replies'] > 0 ? _t('_Show N replies', $r['cmt_replies']) . '. ' : '') . '<a href="javascript:void(0)" onclick="javascript:' . $this->_sJsObjName . '.showReplacement(' . $r['cmt_id'] . ')">' . _t('_show_replacement') . '</a>.';
  70. if ($this->isRatable())
  71. $sRet .= $this->_getRateBox($r);
  72. $sRet .= '</li>';
  73. $sClass = ' cmt-hidden';
  74. }
  75. $isOwnComment = $r['cmt_author_id'] == $this->_getAuthorId();
  76. if ($isOwnComment)
  77. $sClass .= ' cmt-mine';
  78. $sRet .= '<li id="cmt'.$r['cmt_id'].'" class="cmt' . $sClass . '">';
  79. $sRet .= '<div class="cmt-cont">';
  80. $sRet .= $this->_getAuthorIcon($r);
  81. $sRet .= '<table class="cmt-balloon">';
  82. $sRet .= $this->_getCommentHeadBox($r);
  83. $sRet .= '<tr class="cmt-cont" ' . $sStyle . '>';
  84. $sRet .= $this->_getCommentBodyBox ($r);
  85. $sRet .= '</tr>';
  86. $sRet .= $this->_getActionsBox ($r, false);
  87. $sRet .= '<tr class="cmt-foot"><td class="' . $this->_sStylePrefix . '-foot-l">&nbsp;</td><td class="' . $this->_sStylePrefix . '-foot-m">&nbsp;</td><td class="' . $this->_sStylePrefix . '-foot-r">&nbsp;</td></tr>';
  88. $sRet .= '</table>';
  89. $sRet .= '<div class="cmt-replies">' . ($r['cmt_replies'] ? $this->_getRepliesBox($r) : '&nbsp;') . '</div>';
  90. if ($this->isPostReplyAllowed())
  91. $sRet .= $this->_getPostReplyBoxTo($r);
  92. $sRet .= '<div class="clear_both">&nbsp;</div>';
  93. if ($this->isRatable())
  94. $sRet .= $this->_getRateBox($r);
  95. $sRet .= '</div></li>';
  96. }
  97. }
  98. $sRet .= '</ul>';
  99. return $sRet;
  100. }
  101. /**
  102. * get one just posted comment
  103. *
  104. * @param int $iCmtId - comment id
  105. * @return string
  106. */
  107. function getComment($iCmtId, $sType = 'new')
  108. {
  109. $r = $this->getCommentRow ($iCmtId);
  110. $sRet = '';
  111. if($r['cmt_rated'] == -1 || $r['cmt_rate'] < $this->_aSystem['viewing_threshold']) {
  112. $sRet .= '<li id="cmt' . $r['cmt_id'] . '-hidden" class="cmt-replacement">';
  113. $sRet .= bx_process_output(_t('_hidden_comment', $r['cmt_author_name'])) . ' ' . ($r['cmt_replies'] > 0 ? _t('_Show N replies', $r['cmt_replies']) . '. ' : '') . '<a href="javascript:void(0)" onclick="javascript:' . $this->_sJsObjName . '.showReplacement(' . $r['cmt_id'] . ')">' . _t('_show_replacement') . '</a>.';
  114. if($this->isRatable())
  115. $sRet .= $this->_getRateBox($r);
  116. $sRet .= '</li>';
  117. $sClass = ' cmt-hidden';
  118. }
  119. $sRet .= '<li id="cmt' . $r['cmt_id'] . '" class="cmt cmt-mine cmt-just-posted' . $sClass . '">';
  120. $sRet .= '<div class="cmt-cont">';
  121. if ($this->isRatable())
  122. $sRet .= $this->_getRateBox($r);
  123. $sRet .= $this->_getAuthorIcon($r);
  124. $sRet .= '<table class="cmt-balloon">';
  125. $sRet .= $this->_getCommentHeadBox($r);
  126. $sRet .= '<tr class="cmt-cont" ' . $sStyle . '>';
  127. $sRet .= $this->_getCommentBodyBox ($r);
  128. $sRet .= '</tr>';
  129. if ($sType == 'new' && ($r['cmt_author_id'] == $this->_getAuthorId() || $this->isEditAllowedAll() || $this->isRemoveAllowedAll()))
  130. $sRet .= $this->_getActionsBox ($r, true);
  131. $sRet .= '<tr class="cmt-foot"><td class="' . $this->_sStylePrefix . '-foot-l">&nbsp;</td><td class="' . $this->_sStylePrefix . '-foot-m">&nbsp;</td><td class="' . $this->_sStylePrefix . '-foot-r">&nbsp;</td></tr>';
  132. $sRet .= '</table>';
  133. $sRet .= '<div class="cmt-replies">' . ($r['cmt_replies'] ? $this->_getRepliesBox($r) : '') . '</div>';
  134. if($sType != 'new' && $this->isPostReplyAllowed())
  135. $sRet .= $this->_getPostReplyBoxTo($r);
  136. $sRet .= '<div class="clear_both">&nbsp;</div></div></li>';
  137. return $sRet;
  138. }
  139. function getPaginate($iStart = -1, $iPerPage = -1) {
  140. return $this->_oPaginate->getPaginate($iStart, $iPerPage);
  141. }
  142. function getForm($sType, $iParentId) {
  143. return $this->_getPostReplyBox($sType, $iParentId);
  144. }
  145. function getActions($iCmtId, $sType = 'reply') {
  146. $aParams = array(
  147. 'cmt_id' => $iCmtId,
  148. 'cmt_replies' => $this->_oQuery->getObjectCommentsCount($this->getId(), 0),
  149. 'cmt_type' => $sType
  150. );
  151. $sRet = "";
  152. $sRet .= '<div class="cmt-replies">' . ($aParams['cmt_replies'] ? $this->_getRepliesBox($aParams) : '&nbsp;') . '</div>';
  153. if($this->isPostReplyAllowed())
  154. $sRet .= $this->_getPostReplyBoxTo($aParams);
  155. $sRet .= '<div class="clear_both">&nbsp;</div>';
  156. return $sRet;
  157. }
  158. /**
  159. * Get comments css file string
  160. *
  161. * @return string
  162. */
  163. function getExtraCss ()
  164. {
  165. BxDolTemplate::getInstance()->addCss('cmts.css');
  166. }
  167. /**
  168. * Get comments js file string
  169. *
  170. * @return string
  171. */
  172. function getExtraJs () {
  173. BxDolTemplate::getInstance()->addJs('BxDolCmts.js');
  174. }
  175. /**
  176. * Get initialization section of comments box
  177. *
  178. * @return string
  179. */
  180. function getCmtsInit() {
  181. $sToggleAdd = '';
  182. $sUseHtmlAdd = '';
  183. $ret = '';
  184. if($this->iGlobAllowHtml == 1 && $this->iGlobUseTinyMCE == 1 && ($this->isEditAllowed() || $this->isEditAllowedAll())) {
  185. bx_import('BxTemplConfig');
  186. $ret .= BxTemplConfig::getInstance()->sTinyMceEditorMicroJS;
  187. }
  188. $ret .= $sToggleAdd . "
  189. <script type=\"text/javascript\">
  190. var " . $this->_sJsObjName . " = new BxDolCmts({
  191. sObjName : '" . $this->_sJsObjName . "',
  192. sBaseUrl : '" . BX_DOL_URL_ROOT . "',
  193. sSystem : '" . $this->getSystemName() . "',
  194. sSystemTable: '" . $this->_aSystem['table_cmts'] . "',
  195. iAuthorId: '" . $this->_getAuthorId() . "',
  196. iObjId : '" . $this->getId () . "',
  197. sOrder : '" . $this->getOrder() . "',
  198. sDefaultErrMsg : '" . bx_js_string(_t('_Error occured')) . "',
  199. sConfirmMsg : '" . bx_js_string(_t('_Are you sure?')) . "',
  200. sAnimationEffect : '" . $this->_aSystem['animation_effect'] . "',
  201. sAnimationSpeed : '" . $this->_aSystem['animation_speed'] . "',
  202. isEditAllowed : " . ($this->isEditAllowed() || $this->isEditAllowedAll() ? 1 : 0) . ",
  203. isRemoveAllowed : " . ($this->isRemoveAllowed() || $this->isRemoveAllowedAll() ? 1 : 0) . ",
  204. sTextAreaId: '" . $this->sTextAreaId . "',
  205. iGlobAllowHtml: " . ($this->iGlobAllowHtml == 1 && $this->iGlobUseTinyMCE == 1 ? 1 : 0) . ",
  206. iSecsToEdit : " . (int)$this->getAllowedEditTime() . "});
  207. " . $this->_sJsObjName . ".oCmtElements = {";
  208. for (reset($this->_aCmtElements); list($k,$r) = each ($this->_aCmtElements); ) {
  209. $ret .= "\n'$k' : { 'reg' : '{$r['reg']}', 'msg' : \"". bx_js_string(trim($r['msg'])) . "\" },";
  210. }
  211. $ret = substr($ret, 0, -1);
  212. $ret .= "\n};\n";
  213. if ($this->iGlobAllowHtml == 1 && $this->iGlobUseTinyMCE == 1)
  214. $ret .= $this->_sJsObjName . ".createEditor(0, $('#cmts-box-" . $this->_sSystem . "-" . $this->_iId . "> .cmt-reply form [name=CmtText][tinypossible=true]'), true);\n";
  215. $ret .= "</script>";
  216. $this->getExtraJs();
  217. $this->getExtraCss();
  218. return $ret;
  219. }
  220. /**
  221. * private functions
  222. */
  223. function _getCommentHeadBox (&$a) {
  224. if ($a['cmt_author_id'] && $a['cmt_author_name'])
  225. $sAuthor = '<a href="' . getProfileLink($a['cmt_author_id']) . '" class="cmt-author">' . bx_process_output($a['cmt_author_name']) . '</a>';
  226. else
  227. $sAuthor = _t('_Anonymous');
  228. $sRet = '<tr class="cmt-head"><td class="' . $this->_sStylePrefix . '-head-l">&nbsp;</td><td class="' . $this->_sStylePrefix . '-head-m">' . bx_process_output($sAuthor) . ' ' . _t('_wrote') . ' <span class="cmt-posted-ago">' . $a['cmt_ago'] . ' (<span class="cmt-mood-text">' . _t($this->_aMoodText[$a['cmt_mood']]) . '</span>)</span></td><td class="' . $this->_sStylePrefix . '-head-r">&nbsp;</td></tr>';
  229. return $sRet;
  230. }
  231. function _getCommentBodyBox(&$a) {
  232. return '
  233. <td class="' . $this->_sStylePrefix . '-cont-l">&nbsp;</td>
  234. <td class="' . $this->_sStylePrefix . '-cont-m">
  235. <div class="cmt-mood">' . bx_process_output($a['cmt_mood']) . '</div>
  236. <div class="cmt-body">' . bx_process_output($a['cmt_text'], BX_DATA_TEXT_MULTILINE) . '</div>
  237. </td>
  238. <td class="' . $this->_sStylePrefix . '-cont-r">&nbsp;</td>';
  239. }
  240. function _getRateBox(&$a)
  241. {
  242. $sClass = '';
  243. if ($a['cmt_rated'] || $a['cmt_rate'] < $this->_aSystem['viewing_threshold'])
  244. $sClass = ' cmt-rate-disabled';
  245. return '
  246. <div class="cmt-rate'.$sClass.'">
  247. <div class="cmt-points">'._t( (1 == $a['cmt_rate'] || -1 == $a['cmt_rate']) ? '_N point' : '_N points', $a['cmt_rate']).'</div>
  248. <div class="cmt-buttons"><a title="'._t('_Thumb Up').'" href="javascript:void(0)" id="cmt-pos-'.$a['cmt_id'].'" class="cmt-pos"><img src="' . getTemplateIcon('spacer.gif') . '" /></a><a title="'._t('_Thumb Down').'" href="javascript:void(0)" id="cmt-neg-'.$a['cmt_id'].'" class="cmt-neg"><img src="' . getTemplateIcon('spacer.gif') . '" /></a></div>
  249. <div class="clear_both">&nbsp;</div>
  250. </div>';
  251. }
  252. function _getActionsBox (&$a, $isJustPosted) {
  253. $n = $this->getAllowedEditTime();
  254. $isEditAllowedPermanently = ($a['cmt_author_id'] == $this->_getAuthorId() && $this->isEditAllowed()) || $this->isEditAllowedAll();
  255. $isRemoveAllowedPermanently = ($a['cmt_author_id'] == $this->_getAuthorId() && $this->isRemoveAllowed()) || $this->isRemoveAllowedAll();
  256. if (!($n && $isJustPosted) && !$isEditAllowedPermanently && !$isRemoveAllowedPermanently)
  257. return '';
  258. $sRet = '<tr id="cmt-jp-'.$a['cmt_id'].'" class="cmt-jp"><td class="' . $this->_sStylePrefix . '-cont-l">&nbsp;</td><td class="' . $this->_sStylePrefix . '-cont-m">';
  259. if (($isEditAllowedPermanently || ($isJustPosted && $n)) && strpos($a['cmt_text'], 'video_comments') === false)
  260. $sRet .= '<a class="cmt-comment-manage-edit" title="'._t('_Edit').'" href="javascript:void(0)" onclick="' . $this->_sJsObjName . '.cmtEdit(this, \'' . $a['cmt_id'] . '\'); return false;">'._t('_Edit').'</a>&nbsp;';
  261. if ($isRemoveAllowedPermanently || ($isJustPosted && $n))
  262. $sRet .= '<a class="cmt-comment-manage-delete" title="'._t('_Remove').'" href="javascript:void(0)" onclick="' . $this->_sJsObjName . '.cmtRemove(this, \'' . $a['cmt_id'] . '\'); return false;">'._t('_Remove').'</a>';
  263. if ($isJustPosted && $n && !$isEditAllowedPermanently)
  264. $sRet .= _t('_available_for_n_seconds', $n);
  265. $sRet .= '</td><td class="' . $this->_sStylePrefix . '-cont-r">&nbsp;</td></tr>';
  266. return $sRet;
  267. }
  268. function _getRepliesBox (&$a) {
  269. $sContentShow = _t((isset($a['cmt_type']) && $a['cmt_type'] == 'comment' ? '_Show N comments' : '_Show N replies'), $a['cmt_replies']);
  270. $sContentHide = _t((isset($a['cmt_type']) && $a['cmt_type'] == 'comment' ? '_Hide N comments' : '_Hide N replies'), $a['cmt_replies']);
  271. return '<a class="cmt-replies-show" href="javascript:void(0)" onclick="' . $this->_sJsObjName . '.toggleCmts(this, \'' . $a['cmt_id'] . '\'); return false;">' . $sContentShow . '</a><a class="cmt-replies-hide" href="javascript:void(0)" onclick="' . $this->_sJsObjName . '.toggleCmts(this, \'' . $a['cmt_id'] . '\'); return false;">' . $sContentHide . '</a>';
  272. }
  273. function _getPostReplyBoxTo (&$a) {
  274. $sContent = _t(isset($a['cmt_type']) && $a['cmt_type'] == 'comment' ? '_Comment to this comment' : '_Reply to this comment');
  275. return '<div class="cmt-post-reply-to">
  276. <a href="javascript:void(0)" onclick="' . $this->_sJsObjName . '.toggleReply(this, \''.$a['cmt_id'].'\'); return false;">' . $sContent . '</a>
  277. </div>';
  278. }
  279. function _getPostReplyBox($sType = 'comment', $iCmtParentId = 0) {
  280. if ($sType == 'comment')
  281. $sSwitcher = '<a class="cmt-post-reply-text inactive" href="javascript:void(0)" onclick="javascript:' . $this->_sJsObjName . '.toggleType(this)">' . _t('_Add Your Comment') . '</a><a class="cmt-post-reply-video" href="javascript:void(0)" onclick="javascript:' . $this->_sJsObjName . '.toggleType(this)">' . _t('_Record Your Comment') . '</a>';
  282. else if ($sType == 'reply')
  283. $sSwitcher = '<a class="cmt-post-reply-text inactive" href="javascript:void(0)" onclick="javascript:' . $this->_sJsObjName . '.toggleType(this)">' . _t('_Reply as text') . '</a><a class="cmt-post-reply-video" href="javascript:void(0)" onclick="javascript:' . $this->_sJsObjName . '.toggleType(this)">' . _t('_Reply as video') . '</a>';
  284. return '
  285. <div class="cmt-post-reply">
  286. ' . $this->_getAuthorIcon(array('cmt_author_id' => $this->_getAuthorId())) . '
  287. <table class="cmt-balloon">
  288. <tr class="cmt-head">
  289. <td class="cmt-head-l">&nbsp;</td>
  290. <td class="cmt-head-m">' . $sSwitcher . '<div class="clear_both"></div></td>
  291. <td class="cmt-head-r">&nbsp;</td>
  292. </tr>
  293. <tr class="cmt-cont">
  294. <td class="cmt-cont-l">&nbsp;</td>
  295. <td class="cmt-cont-m">' . $this->_getFormBox($iCmtParentId) . '</td>
  296. <td class="cmt-cont-r">&nbsp;</td>
  297. </tr>
  298. <tr class="cmt-foot">
  299. <td class="cmt-foot-l">&nbsp;</td>
  300. <td class="cmt-foot-m">&nbsp;</td>
  301. <td class="cmt-foot-r">&nbsp;</td>
  302. </tr>
  303. </table>
  304. </div>';
  305. }
  306. function _getFormBox($iCmtParentId = 0, $sText = "", $sFunction = "submitComment(this)") {
  307. $sTinyStyle = ($this->iGlobAllowHtml == 1 && $this->iGlobUseTinyMCE == 1) ? ' tinypossible="true" ' : '';
  308. if ($this->_aSystem['is_mood'])
  309. $sMood = '
  310. <div class="cmt-post-reply-mood">
  311. <div class="cmt-post-mood-ctl"><input type="radio" name="CmtMood" value="1" id="' . $this->_sSystem . '-mood-positive" /></div>
  312. <div class="cmt-post-mood-lbl"><label for="' . $this->_sSystem . '-mood-positive">' . _t('_Comment Positive') . '</label></div>
  313. <div class="cmt-post-mood-ctl"><input type="radio" name="CmtMood" value="-1" id="' . $this->_sSystem . '-mood-negative" /></div>
  314. <div class="cmt-post-mood-lbl"><label for="' . $this->_sSystem . '-mood-negative">' . _t('_Comment Negative') . '</label></div>
  315. <div class="cmt-post-mood-ctl"><input type="radio" name="CmtMood" value="0" id="' . $this->_sSystem . '-mood-neutral" checked="checked" /></div>
  316. <div class="cmt-post-mood-lbl"><label for="' . $this->_sSystem . '-mood-neutral">' . _t('_Comment Neutral') . '</label></div>
  317. <div class="clear_both">&nbsp;</div>
  318. </div>';
  319. return '
  320. <form name="cmt-post-reply" onsubmit="' . $this->_sJsObjName . '.' . $sFunction . '; return false;">
  321. <input type="hidden" name="CmtParent" value="' . $iCmtParentId . '" />
  322. <input type="hidden" name="CmtType" value="text" />
  323. <div class="cmt-post-reply-text">
  324. <textarea name="CmtText" ' . $sTinyStyle . ' >' . bx_process_output($sText) . '</textarea>
  325. </div>
  326. <div class="cmt-post-reply-video">' . getApplicationContent('video_comments', 'recorder', array('user' => $this->_getAuthorId(), 'password' => $this->_getAuthorPassword(), 'extra' => implode('_', array($this->_sSystem . '-' . $this->getId(), $iCmtParentId))), true) . '</div>
  327. <div class="cmt-post-reply-post"><input type="submit" value="' . _t('_Submit Comment') . '" /></div>
  328. ' . $sMood . '
  329. </form>';
  330. }
  331. function _getAuthorIcon ($a) {
  332. global $oFunctions;
  333. if (!$a['cmt_author_id'] || !getProfileInfo($a['cmt_author_id'])) {
  334. if (!@include_once (BX_DIRECTORY_PATH_MODULES . 'boonex/avatar/include.php'))
  335. return '';
  336. return '<div class="thumbnail_block" style="float:none;width:'.(BX_AVA_ICON_W+8).'px;height:'.(BX_AVA_ICON_H+8).'px;"><div class="thumbnail_image" style="width:'.(BX_AVA_ICON_W+4).'px;height:'.(BX_AVA_ICON_H+4).'px;"><img src="' . $oFunctions->getSexPic('', 'small') . '" /></div></div>';
  337. } else {
  338. return $oFunctions->getMemberIcon($a['cmt_author_id']);
  339. }
  340. }
  341. function _getBrowse() {
  342. return "TODO: cmts browse";
  343. /*
  344. $sRet = '
  345. <div class="cmt-order">' . $this->_oPaginate->getSorting(array('asc' => '_oldest first', 'desc' => '_newest first')) . '
  346. <input type="checkbox" id="cmt-expand" name="cmt-expand" onclick="javascript:' . $this->_sJsObjName . '.expandAll(this)"/><label for="cmt-expand">' . _t('_expand all') . '</label>
  347. </div>
  348. <div class="cmt-pages">' . $this->_oPaginate->getPages() . '</div>
  349. <div class="clear_both">&nbsp;</div>';
  350. return $sRet;
  351. */
  352. }
  353. }