1
theprof
New Chess Module Hack for Comments!?
  • 2004/7/15 0:01

  • theprof

  • Quite a regular

  • Posts: 225

  • Since: 2004/7/14


How to disable the comments in Chess from showing up in my Comments Block, but keeping the comment enable for the Chess Section itself?

2
Dave_L
Re: New Chess Module Hack for Comments!?
  • 2004/7/15 0:44

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Here's a modification to the Recent Comments block's template (system_block_comments.html) that will accomplish this:

<table width="100%" cellspacing="1" class="outer">
  <{foreach 
item=comment from=$block.comments}>
  [
color=ff0000]<{if not $comment.module|stristr:'modules/chess'}>[/color]
  <
tr class="<{cycle values="even,odd"}>">
    <
td align="center"><img src="<{$xoops_url}>/images/subject/<{$comment.icon}>" alt="" />td>
    <
td><{$comment.title}>td>
    <
td align="center"><{$comment.module}>td>
    <
td align="center"><{$comment.poster}>td>
    <
td align="right"><{$comment.time}>td>
  tr>
  [
color=ff0000]<{/if}>[/color]
  <{/foreach}>
table>


Hmmmm ... on second thought, this may not be a good solution. If there are ten comments in the array $block.comments, and seven of them are from the chess module, then only three comments would be displayed. If that's an issue, I could look at the script that generates $block.comments, and see about excluding the chess module comments at that level.

3
theprof
Re: New Chess Module Hack for Comments!?
  • 2004/7/15 3:37

  • theprof

  • Quite a regular

  • Posts: 225

  • Since: 2004/7/14


Well, I think it will be a plus to have comments to go back and forth with your opponent, but keeping it strickly in the game and not the whole community....Great work..

4
Dave_L
Re: New Chess Module Hack for Comments!?
  • 2004/7/15 16:13

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


As an alternative to changing the template, here's a hack that prevents the chess module comments from being added to the array $block.comments.

modules/system/blocks/system_blocks.php (function b_system_comments_show)

$criteria = new CriteriaCompo(new Criteria('com_status'XOOPS_COMMENT_ACTIVE));
[
color=ff0000]$module_handler =& xoops_gethandler('module');
$chess_module =& $module_handler->getByDirname('chess');
if (
is_object($chess_module)) {
   
$criteria->add(new Criteria('com_modid'$chess_module->getVar('mid'), '!='));
}[/
color]
$criteria->setLimit(intval($options[0]));

Login

Who's Online

323 user(s) are online (223 user(s) are browsing Support Forums)


Members: 0


Guests: 323


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits