1
jakob
Comments only viewable for members?
  • 2004/10/6 15:47

  • jakob

  • Just popping in

  • Posts: 14

  • Since: 2002/10/18


Hi,

I'm running a website using XOOPS 2.0.5. Is it possible to only let logged in users view news comments?

Anonymous users should still be able to read the news.

TIA,

Jakob

2
ackbarr
Re: Comments only viewable for members?

you can accomplish this with a slight smarty template change:

in the template news_article.html:
change:
<div style="text-align: center; padding: 3px;
margin:3px;"
>
<{
$commentsnav}>
<{
$lang_notice}>
div>

<
div style="margin:3px; padding: 3px;">

<{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}>

div>

to:
[b]<{if $xoops_isuser eq 1}>[/b]
<
div style="text-align: center; padding: 3px;
margin:3px;"
>
<{
$commentsnav}>
<{
$lang_notice}>
div>

<
div style="margin:3px; padding: 3px;">

<{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}>

div>
[
b]<{/if}>[/b]

3
jakob
Re: Comments only viewable for members?
  • 2004/10/6 17:13

  • jakob

  • Just popping in

  • Posts: 14

  • Since: 2002/10/18


Hi,

It didn't work for me.

In DB%3ANewsArticle.html I found this code:


_tpl_vars['commentsnav']; ?>

_tpl_vars['lang_notice']; ?>





_tpl_vars['comment_mode'] == 'flat'): ?>
_tpl_vars;
$this->_smarty_include("db:system_comments_flat.html", array());
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?>
_tpl_vars['comment_mode'] == 'thread'): ?>
_tpl_vars;
$this->_smarty_include("db:system_comments_thread.html", array());
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?>
_tpl_vars['comment_mode'] == 'nest'): ?>
_tpl_vars;
$this->_smarty_include("db:system_comments_nest.html", array());
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?>




When I placed the code around this section, all I saw, was that my code was visible on the page!

Sorry, I'm not a PHP/Xoops expert. Am I doing something wrong?

Jakob

4
jakob
Re: Comments only viewable for members?
  • 2004/10/6 17:16

  • jakob

  • Just popping in

  • Posts: 14

  • Since: 2002/10/18


Sorry, I got it now

Tanks!

Login

Who's Online

348 user(s) are online (272 user(s) are browsing Support Forums)


Members: 0


Guests: 348


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