1
rlankford
Some User Can't See Comments!
  • 2005/7/21 19:19

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


I have a strange problem. I say it's strange because I haven't been able to find anything about it on the forums here.

This problem crosses all modules (as it should since they all link to the same comment php files). Some members of my site see comments just like they should. Others, can't see comments anywhere. If they go to a page that should have comments, they'll see the comment bar, but no comments. If I append the text "&com_mode=thread" onto the end of the URL, then suddenly the comments appear. It appears to be a problem for certain users. But one of the users that can't see comments is assigned to the webmaster group, so I can't see how it's related to permissions.

I'm using the latest version (2.0.13) and need help on this please!!

2
rlankford
Re: Some User Can't See Comments!
  • 2005/8/1 21:11

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


Well, I found the problem myself.

It appears that in the file "include\comment_view.php", there is a section of code that looks like this:

Quote:

if ($com_mode == '') {
if (is_object($xoopsUser)) {
$com_mode = $xoopsUser->getVar('umode');
} else {
$com_mode = $xoopsConfig['com_mode'];
}


Some of my site's members had a umode of nothing. In other words, $com_mode became an empty string. This doesn't work with the common template code that people insert in order to display comments:

Quote:

<!-- start comments loop -->
<{if $comment_mode == "flat"}>
<{include file="db:system_comments_flat.html"}>
<{elseif $comment_mode == "thread"}>
<{include file="db:system_comments_thread.html"}>
<{elseif $comment_mode == "nest"}>
<{include file="db:system_comments_nest.html"}>
<{/if}>
<!-- end comments loop -->


As you can see, a $comment_mode equal to the empty string will cause no comments to be displayed. So, to correct the issue on my site, I've added a single line to the code above:

Quote:

if ($com_mode == '') {
if (is_object($xoopsUser)) {
$com_mode = $xoopsUser->getVar('umode');
if ($com_mode == '') {$com_mode = $xoopsConfig['com_mode'];}; }
else {
$com_mode = $xoopsConfig['com_mode'];
}


So now if the umode returns nothing, the $com_mode variable gets the default XOOPS setting instead.

--------------------------

I won't include this as a bug fix because I don't know that I've fixed the bug. Umode, for all I know, maybe shouldn't ever return an empty string. In that case, the code that generates the umode variable should be checked. Other than that, however, this hack seems to work just fine for me.

Login

Who's Online

164 user(s) are online (85 user(s) are browsing Support Forums)


Members: 0


Guests: 164


more...

Donat-O-Meter

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

Latest GitHub Commits