×
Kunena 5.2.6 released and Blue eagle 1.6.6 released (25 Jul 2021)

The Kunena team has announce the arrival of Kunena 5.2.6 [K 5.2.6] which is now available for download as a native Joomla extension for J! 3.9.x. This version addresses most of the issues that were discovered in K 5.2 and issues discovered during the development stages of K 5.2.6

× This category contains miscellaneous, uncategorised user contributions, (templates, modules, plugins and hacks) relating to older versions of Kunena that are no longer supported.

This category may also contain a few topics relating to K 1.6 that may have been moved here possibly by mistake.

The topics in this category are for historical interest only. Owing to the structural differences between K 1.6 and K 1.7, these ideas in these topics will not work with later versions and, for that reason, the topics are locked.

Question Prevent View of Messages

More
12 years 4 months ago #1 by milgaz
Hi,

I want to prevent guests from viewing the messages but also keep them to see the category and the message title. Actually, a guest should see only the titles. How do I do this?

Thanks..

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago - 12 years 4 months ago #2 by sozzled
Replied by sozzled on topic Re:Prevent View of Messages
This is not possible with the standard, out-of-the-box Kunena. You would have to alter the way that Kunena operates. Do you have examples of other forum software where these features are available?
Last edit: 12 years 4 months ago by sozzled.

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #3 by milgaz
Replied by milgaz on topic Re:Prevent View of Messages
yes, for example, I saw it in a turkish web site based on vbulletin.

www.medikalforum.net

I think I have to change the "view.php" in kunena and insert something like that:

$user =& JFactory::getUser();
if ($user->get('guest')) {
echo "You should register to see the content of this message";
}
else {
....(the code that is present in kunena)......


The problem is that I could not find where to place this piece of code.

Actually, another way may be this:

When you view a message as "guest", you can also see the "forum tools" on the right. If you click on "post new topic" as "guest", you get a message that you should register. I want exactly this to happen in my case.

Thanks for interest..

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago - 12 years 4 months ago #4 by @quila
Replied by @quila on topic Re:Prevent View of Messages
Hi milgaz,

there is a more ways to do this, just a quick two.

1). open the file kunena.php line 579, in this way the Guest can't see the page of the message.

/components/com_kunena/

change this
######################################################################
        case 'view':
            if (file_exists(KUNENA_ABSTMPLTPATH . '/view.php')) {
                include (KUNENA_ABSTMPLTPATH . '/view.php');
                }
            else {
                include (KUNENA_PATH_TEMPLATE_DEFAULT .DS. 'view.php');
                }
 
            break;
 
        #######################################################################
with this
######################################################################
        case 'view':
		        $hidemessage='You should register to see the content of this message';
        if ($kunena_my->get('guest')) {
        echo '<h1>'.$hidemessage.'</h1>';
        }
        else {
            if (file_exists(KUNENA_ABSTMPLTPATH . '/view.php')) {
                include (KUNENA_ABSTMPLTPATH . '/view.php');
                }
            else {
                include (KUNENA_PATH_TEMPLATE_DEFAULT .DS. 'view.php');
                }
            }
 
            break;
 
        #######################################################################

2). open the file message.php line 100, in this way the Guest see all post except the content.

/components/com_kunena/template/default_ex/

changr this
<div class = "msgtext"><?php echo $msg_text; ?></div>
with this
<div class = "msgtext">
		<?php 
		        $hidemessage='You should register to see the content of this message';
        if ($kunena_my->get('guest')) {
        echo '<h1>'.$hidemessage.'</h1>';
        }
        else {
            echo $msg_text;
            }
		?>
		</div>

Hope this helps.

Regards
Last edit: 12 years 4 months ago by @quila.

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago - 12 years 4 months ago #5 by @quila
Replied by @quila on topic Re:Prevent View of Messages
milgaz wrote:

Actually, another way may be this:

When you view a message as "guest", you can also see the "forum tools" on the right. If you click on "post new topic" as "guest", you get a message that you should register. I want exactly this to happen in my case.


Hi again,
for this try the file in attachment and let me know if work.

Regards

File Attachment:

File Name: REDIRECT_LOGIN.zip
File Size:34 KB
Attachments:
Last edit: 12 years 4 months ago by @quila.

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #6 by milgaz
Replied by milgaz on topic Re:Prevent View of Messages
Thanks in advance Moderator.

I have tried your first simple suggestion and it worked. The problem now is that when onmouseover the message title, the content can be viewed. I get rid of this by changing flat.php line 236:

<?php echo CKunenaLink::GetThreadLink('view', $leaf->catid, $leaf->id, kunena_htmlspecialchars(stripslashes($leaf->subject)), kunena_htmlspecialchars(stripslashes($messagetext[$leaf->id])) , 'follow', 'fb-topic-title fbm');?>

to

<?php echo CKunenaLink::GetThreadLink('view', $leaf->catid, $leaf->id, kunena_htmlspecialchars(stripslashes($leaf->subject)), kunena_htmlspecialchars(stripslashes($leaf->subject)), 'follow', 'fb-topic-title fbm');?>

Now, when onmouseover the message title, it shows message title.

Should I make any other changes?

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #7 by @quila
Replied by @quila on topic Re:Prevent View of Messages
Hi,

Glad to help you.

I think no. That's all. Remember, this is a hack and next time when you upgrade Kunena, need to do again.

Regards

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #8 by david-jp
This works ok if you want all forums to be protected, but what if there are some which you want guests to read, but others you don't?

David

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.104 seconds