- Posts: 10
- Thank you received: 0
Kunena 7.0.4 Released
The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0
Question Restrict download of files only to registered users
How can I restrict the download of files which are uploaded in the forum to registered users only? I cannot find an option for this.
Only registered users can post messages om my forum but anyone can view the messages.
I want only registered users to be able to download files.
Thanks,
Eric
Please Log in or Create an account to join the conversation.
change in kunena.file.upload.php line 90:
It works only for new posts....
Please Log in or Create an account to join the conversation.
Yes, that works fine! Thanks!
So there is no option to set?
Cheers,
Eric
Please Log in or Create an account to join the conversation.
Change in kunena.parser.php line 357:
into
I have included a additional language string which was shown for guests. You can here define your own text like "This attachment is only seen for registered users".
You have to insert _KUNENA_BBCODE_HIDEFILE in your language file or change this line:
Please Log in or Create an account to join the conversation.
Here the better way to work with all files (also from old posts):
Change in kunena.parser.php line 357:
Code:case 'file': if($between) { $task->autolink_disable--; # continue autolink conversion $tag_new = "<div class=\"fb_file_attachment\"><span class=\"contentheading\">"._KUNENA_FILEATTACH."</span><br>"._KUNENA_FILENAME ."<a href='".$between."' target=\"_blank\" rel=\"nofollow\">".(($tag->options["name"])?htmlspecialchars($tag->options["name"]):$between)."</a><br>"._KUNENA_FILESIZE.htmlspecialchars($tag->options["size"], ENT_QUOTES)."</div>"; return TAGPARSER_RET_REPLACED; } return TAGPARSER_RET_NOTHING; break;
into
Code:case 'file': if($between) { if ($my->id==0) { // Hide between content from non registered users $tag_new = '<b>' . _KUNENA_BBCODE_HIDEFILE . '</b>'; } else { $task->autolink_disable--; # continue autolink conversion $tag_new = "<div class=\"fb_file_attachment\"><span class=\"contentheading\">"._KUNENA_FILEATTACH."</span><br>"._KUNENA_FILENAME ."<a href='".$between."' target=\"_blank\" rel=\"nofollow\">".(($tag->options["name"])?htmlspecialchars($tag->options["name"]):$between)."</a><br>"._KUNENA_FILESIZE.htmlspecialchars($tag->options["size"], ENT_QUOTES)."</div>"; } return TAGPARSER_RET_REPLACED; } return TAGPARSER_RET_NOTHING; break;
I have included a additional language string which was shown for guests. You can here define your own text like "This attachment is only seen for registered users".
You have to insert _KUNENA_BBCODE_HIDEFILE in your language file or change this line:
intoCode:$tag_new = '<b>' . _KUNENA_BBCODE_HIDEFILE . '</b>';
Code:$tag_new = '';
Hi roland76,
This one is even better than the previous solution! Thank you very much for your help!
Cheers,
Eric :laugh:
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.