Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
Bug reports and fixes
.
Home
Help
Login
Register
Elxis CMS Forum
»
Extensions
»
Components
»
IOS Downloads - Listing for more than one usergroup
« previous
next »
Print
Pages: [
1
]
Author
Topic: IOS Downloads - Listing for more than one usergroup (Read 7523 times)
CREATIVE Options
Authorized Elxis Professional
Elxis Community
Hero Member
Posts: 2334
Professional services for Elxis CMS
IOS Downloads - Listing for more than one usergroup
«
on:
June 15, 2011, 14:49:02 »
I have start a modification on IOS Downloads so a listing can be accessed from 2 user groups.
Steps:
1. Add a custom field in DB "access2" in ***_downloads_files
DELETED OLD CODE FROM CREATIVE OPTIONS
«
Last Edit: June 17, 2011, 13:25:01 by CREATIVE Options
»
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: IOS Downloads - Listing for more than one usergroup
«
Reply #1 on:
June 15, 2011, 22:15:45 »
You confused the download access with the add new listing access. You only need to add a second download access.
downloads.class.php
Line 400: public $access = '29'; //download access
Add bellow:
public $access2 = '29'; //download access
admin.downloads.php
line 671: $lists['access'] = mosAdminMenus::Access($row);
Add bellow:
$ac = $row->access;
$row->access = $row->access2;
$lists['access2'] = mosAdminMenus::Access($row);
$row->access = $ac;
unset($ac);
line 937: $row->access = ''.intval($row->access).'';
Add bellow:
$row->access2 = ''.intval($row->access2).'';
admin.downloads.html.php
line 965:
<tr>
<td valign="top"><?php echo $adminLanguage->A_ACCESS; ?></td>
<td><?php echo $lists['access']; ?></td>
</tr>
Add bellow:
<tr>
<td valign="top"><?php echo $adminLanguage->A_ACCESS; ?></td>
<td><?php echo $lists['access2']; ?></td>
</tr>
downloads.php
line 747, add access2:
$database->setQuery("SELECT id, file, downloads, access,
access2
FROM....
line 755:
if (!in_array($row->access, explode(',',$my->allowed))) {
Convert it to:
if (!in_array($row->access, explode(',',$my->allowed)) && !in_array($row->access2, explode(',',$my->allowed))) {
If you want to also edit listings from frontend you have also to make similar changes as for the admin area.
downloads.html.php
line 459:
."\n AND access IN (".$my->allowed.")";
convert it to:
."\n AND ((access IN (".$my->allowed.")) OR (access2 IN (".$my->allowed.")))";
line 547:
if (in_array($row->access, explode(',',$my->allowed))) {
convert it to:
if (in_array($row->access, explode(',',$my->allowed)) || in_array($row->access2, explode(',',$my->allowed))) {
line 616:
."\n AND access IN (".$my->allowed.")";
convert it to:
."\n AND ((access IN (".$my->allowed.")) OR (access2 IN (".$my->allowed.")))";
line 825:
if (!in_array($row->access, explode(',',$my->allowed))) {
convert it to:
if (!in_array($row->access, explode(',',$my->allowed)) && !in_array($row->access2, explode(',',$my->allowed))) {
line 839:
if (in_array($row->access, explode(',',$my->allowed))) {
convert it to:
if (in_array($row->access, explode(',',$my->allowed)) || in_array($row->access2, explode(',',$my->allowed))) {
If you want to also edit listings from frontend you have also to make similar changes as for the admin area.
WARNING
:
access and access2 should at least of the same level. If for example you provide access = 18 (registered) and access2 = 29 (public frontend) guests will be able to download the file (because of the
OR
operator used to check access)! So you must set both access elements to at least user group 18 (registered) if you want to restrict access only to registered users and above.
«
Last Edit: June 15, 2011, 22:22:42 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
CREATIVE Options
Authorized Elxis Professional
Elxis Community
Hero Member
Posts: 2334
Professional services for Elxis CMS
Re: IOS Downloads - Listing for more than one usergroup
«
Reply #2 on:
June 15, 2011, 23:22:33 »
Thank you Datahell,
I will apply them ASAP, and I will get back.
Logged
CREATIVE Options
Authorized Elxis Professional
Elxis Community
Hero Member
Posts: 2334
Professional services for Elxis CMS
Re: IOS Downloads - Listing for more than one usergroup
«
Reply #3 on:
June 16, 2011, 20:28:43 »
Hmm...
doesn't work.
Setting 1st group "Professionals"
Setting 2nd group "Students"
And return:
Access 1= "Students"
&
Access 2 = "Public Front end"
Any idea ?
[attachment deleted by admin]
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: IOS Downloads - Listing for more than one usergroup
«
Reply #4 on:
June 16, 2011, 22:22:01 »
This is an exercise for you:
find the problem by your self!
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
CREATIVE Options
Authorized Elxis Professional
Elxis Community
Hero Member
Posts: 2334
Professional services for Elxis CMS
Re: IOS Downloads - Listing for more than one usergroup
«
Reply #5 on:
June 16, 2011, 23:08:45 »
LOL
Logged
wbread
Sr. Member
Posts: 354
Re: IOS Downloads - Listing for more than one usergroup
«
Reply #6 on:
June 17, 2011, 00:40:29 »
datahell
can approach the issue is from the other side
make two listings with its own settings as a category on the forum
Logged
CREATIVE Options
Authorized Elxis Professional
Elxis Community
Hero Member
Posts: 2334
Professional services for Elxis CMS
Re: IOS Downloads - Listing for more than one usergroup
«
Reply #7 on:
June 17, 2011, 08:05:31 »
No because, It's customer's website who upload every month ~10 - 15 files for different access level.
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: IOS Downloads - Listing for more than one usergroup
«
Reply #8 on:
July 11, 2011, 21:23:44 »
Done!
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
wbread
Sr. Member
Posts: 354
Re: IOS Downloads - Listing for more than one usergroup
«
Reply #9 on:
July 11, 2011, 22:12:52 »
Quote from: datahell on June 16, 2011, 22:22:01
This is an exercise for you:
find the problem by your self!
Quote from: datahell on July 11, 2011, 21:23:44
Done!
just perfect
came as something past and found the answer under your nose,
?
Logged
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Extensions
»
Components
»
IOS Downloads - Listing for more than one usergroup