Page 1 of 1

Show message if not authorized to download

Posted: Sat Nov 04, 2006 7:29 pm
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 -->  

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

Posted: Tue Aug 14, 2007 6:34 am
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

Re: Show message if not authorized to download

Posted: Wed Apr 09, 2008 7:23 am
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.