| DocMan 1.4 Suggesting Registration |
|
|
|
| Tuesday, 11 September 2007 | |
|
And again... an impossible mission... We need DocMan for Joomla in version 1.40RC2 to tell a user to register if he did not have rights to download an item. So we wanted users to be able to see the files available but only be able to download after a registration and subsequent login as a "Registered User".
To achieve this, we set "Guest" permissions in the "Configuration" module of Docman to "View" only. This disabled non-registered users from downloading - but they could still see the files. The document permissions stayed on "Everybody". Then, we changed the original template to suggest that a user registers when he lacked the permissions to download. We had to change this file: "<joomladir>"\components\com_docman\themes\default\templates\documents\tasks.tpl.php The area we changed initially said this: if ( $this->theme->conf->task_download ) : if( $this->doc->links->download ) : ?><li><a href="<?php echo $this->doc->links->download ?>"><?php echo _DML_TPL_DOC_DOWNLOAD ?></a></li><?php endif; endif; The new code then reads: if ( $this->theme->conf->task_download ) : if( $this->doc->links->download ) : ?><li><a href="<?php echo $this->doc->links->download ?>"><?php echo _DML_TPL_DOC_DOWNLOAD ?></a></li><?php else: ?><li><a href="./index.php?option=com_registration&task=register"><?php echo "Register to download" ?></a></li><?php endif; endif; Now, whenever a user lacks permission to download a file, he'll see a button that says "Register to download" and that will point him to the registration page. Works like a champ! |
|
| Last Updated ( Tuesday, 11 September 2007 ) |






