简体   繁体   English

如何在Joomla登录时才能提供下载文件! 1.5.23?

[英]How to make download files only available on login on Joomla! 1.5.23?

I'm sure this is a minor problem but I just want to get some opinion on this one. 我确定这是一个小问题,但我只是想对这个问题有所了解。 Using Joomla! 使用Joomla! 1.5.23. 1.5.23。 It's a member site. 这是一个会员网站。 There are some pdf up for download on some pages. 在某些页面上有一些pdf可供下载。 On specific pages pdf files under that must require one to be logged in. How do I do that without having to make the page restricted? 在特定页面上,其下的pdf文件必须要求登录。如何在不限制页面的情况下执行此操作? Anyone can browse the page but once they start to click on the pdfs for download they have to login. 任何人都可以浏览页面,但一旦他们开始点击pdf进行下载,他们就必须登录。 How do I do it? 我该怎么做? Thanks. 谢谢。

i think you want this in your joomla content component. 我想你想在你的joomla内容组件中使用它。 So first you need to made some changes in joomla template in /templates/your_templatename/html/com_content/article/default.php and create a new user instant 首先,您需要在/templates/your_templatename/html/com_content/article/default.php中对joomla模板进行一些更改,并创建一个新的用户即时

<?php $user = JFactory::getUser();?>

find this line in a if statement 在if语句中找到这一行

if($this->params->get('show_pdf_icon'))

put this line with and statement like this 把这一行和这样的声明放在一起

if($this->params->get('show_pdf_icon') && !empty($user->id))

If user is login then and then it can show pdf icon. 如果用户登录,那么它可以显示pdf图标。 You can put this in any icon you want to show for user login 您可以将其放在要显示的任何图标中以供用户登录

I would try a document manager extension, like DOCman for example: https://www.joomlatools.com/extensions/docman/ . 我会尝试文档管理器扩展,例如DOCman: https ://www.joomlatools.com/extensions/docman/。

You can insert links to private documents in your articles that redirect the visitor to a login page before they can download. 您可以在文章中插入指向私人文档的链接,这些文档会将访问者重定向到登录页面,然后才能下载。

Unfortunately support for Joomla 1.5 is deprecated, upgrading your Joomla site is advised. 不幸的是,不推荐支持Joomla 1.5,建议升级你的Joomla网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM