Show message if not authorized to download

Since Opentools.de has now gone away I've created this forum to house FAQs and support for this mod in phpBB2.

Moderator: Experts

Locked
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Show message if not authorized to download

Post by DavidIQ »

If a user is not authorized to download a file they don't see anything. This changes that:

Code: Select all

#
#----[ OPEN ] ----
#
attach_mod/dislpaying.php 

#
#----[ FIND ] ----
#
		// Display Notice (attachment there but not having permissions to view it)
		// Not included because this would mean template and language file changes (at this stage this is not a wise step. ;))

#
#----[ REPLACE WITH ] ----
#
		$template->assign_block_vars('postrow.noaccess', array()); 

# 
#-----[ FIND ]------------------------------------------ 
# 
function display_post_attachments($post_id, $switch_attachment)
{
	global $attach_config, $is_auth;

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
function display_post_attachments($post_id, $switch_attachment)
{
	global $attach_config, $is_auth, $template;

#
#----[ FIND ] ----
#
	if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod']) || (!($is_auth['auth_download'] && $is_auth['auth_view'])))

#
#----[ REPLACE WITH ] ----
#
	if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod']))// || (!($is_auth['auth_download'] && $is_auth['auth_view']))) 

#
#----[ OPEN ] ----
#
templeates/subsilver/viewtopic_attach_body.tpl 

#
#----[ FIND ] ----
#
</style>

#
#----[ AFTER, ADD ] ----
#
<!-- BEGIN noaccess --> 
   <div align="center"><hr width="95%" /></div> 
   <table width="95%" border="1" cellpadding="2" cellspacing="0" class="attachtable" align="center"> 
   <tr><td width="100%" class="attachheader" align="center"><b><span class="gen">You are not allowed to view downloads!!!</span></b></td></tr> 
   <tr><td width="100%" class="attachheader" align="center"><b><span class="gen">Please register or request access to attachments</span></b></td></tr> 
   </table> 
   <div align="center"><hr width="95%" /></div> 
<!-- END noaccess -->  
binhaus
Posts: 1
Joined: Tue Aug 14, 2007 6:23 am

unregisterd ( or not loged yet ) need see the images photo

Post by binhaus »

Hi
fist of all thanks for great mod..
i have install it haft year ago.. and till now it work great..
but long time ago i have post the question on the phpbb forums for the bit change of this mod which allow people not loged( or unregistered ) can not see the attachments but still see images photo attached ....
Then i have waiting for long time seem my post at phpbb is deep on flood of other post..
at that time this require is not really much important to me..
but now when my visiters increasing much more than before, people need to see the images attached but do not need to login in !!

So i need help to make the option of CPA or direct modifi the sources php that make a way unregisterd ( or not loged yet ) users can see all attached pictures ( jpg, gif... ) but not the other stuff?? ( zip, exe )
:idea:
thanks for any help
Ben
streamino
Posts: 15
Joined: Tue Oct 30, 2007 10:45 am

Re: Show message if not authorized to download

Post by streamino »

hi david ,How could we redirect the guests to the login page when they want to download the attachments.if they are users they can download it .But they arent users they will redirect the login page ..After they login the site also could download attachments.
Locked