Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Profile for kikutnik666

  • OFFLINE
  • Time Zone: GMT +0:00
  • Local Time: 17:59
  • Posts: 1
  • Profile Views: 2783
  • Location: Unknown
  • Gender: Unknown
  • Birthdate: Unknown

Signature

Posts

Posts

emo
Hello.
My friend is using your component, he told me that it's very good tool and it helps lot in his work- so I've decided to try it.

Few days ago I've started to install it, make some changes on frontend and it'sgreat.
But now I see that this tool is not for me with this features :/ I must have a component where I will decide which file is for which user, not group.
I've made one new feature- which group can download file (if, you aren't in this group- sorry, you can't download) and now I need some help, because I don't know how to change the code...
User 1 can look on file asd.txt, user 2 can see document qwe.txt, and user 3 can see both and he can also download it and so on.

I think it's not big change in the code, but I don't know how it should be...
Thanks a lot for answer

And this is my trick for download only for one group (with ID 9)

file.php
        echo '<div class="toolbar">';
if ($this->access->canDownload) {
if ($this->access->licenseID) {
echo '<a class="modal download" rel="{handler: \'iframe\', size: {x: ' . JOOMDOC_LIGHTBOX_WIDTH . ', y: ' . JOOMDOC_LIGHTBOX_HEIGHT . '}, onClose: function() {}}" href="' . JRoute::_(JoomDOCRoute::viewLicense($this->access->licenseID, $this->access->licenseAlias, $this->access->relativePath, $this->access->alias)) . '">' . JText::_('JOOMDOC_DOWNLOAD_FILE') . '</a>';
} else {
if ($groups[9] == 9){
echo '<a class="download" href="' . JRoute::_(JoomDOCRoute::download($access->relativePath, $access->alias)) . '" title="">' . JText::_('JOOMDOC_DOWNLOAD_FILE') . '</a>';
}else{
echo "Sorry -can't download";
}
}
}


default.php
            if ($access->licenseID) {
echo '<a class="modal download" rel="{handler: \'iframe\', size: {x: ' . JOOMDOC_LIGHTBOX_WIDTH . ', y: ' . JOOMDOC_LIGHTBOX_HEIGHT . '}, onClose: function() {}}" href="' . JoomDOCRoute::viewLicense($access->licenseID, $access->licenseAlias, $access->relativePath, $access->alias) . '">' . JText::_('JOOMDOC_DOWNLOAD_FILE') . '</a>';
} else {
$user = JFactory::getUser();
$groups = $user->get('groups');
 
if ($groups[9] == 9){
echo '<a class="download" href="' . JRoute::_(JoomDOCRoute::download($access->relativePath, $access->alias)) . '" title="">' . JText::_('JOOMDOC_DOWNLOAD_FILE') . '</a>';
}else{
echo "Sorry -can't download";
}
if ($access->canOpenFile || $access->canOpenFolder) {
// link to open file/subfolder
echo '<a href="' . $viewDocuments . '" class="readmore" title="">';
}
// as item title use document title or file name. use title only if published. (that means that owner will see it even if unpublished)
echo JText::_('JOOMDOC_DISPLAY_FILE');
if ($access->canOpenFile || $access->canOpenFolder) {
echo '</a>';
}
}
Acces for single use ...
Category: Community Support
More
User Login Empty