Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
IOS Hotels
and
IOS Rentals
online booking systems for Elxis CMS.
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
Security
»
IOS Slider only shows Guest level content
« previous
next »
Print
Pages: [
1
]
Author
Topic: IOS Slider only shows Guest level content (Read 5991 times)
Bezman
Newbie
Posts: 15
IOS Slider only shows Guest level content
«
on:
November 07, 2015, 14:41:52 »
Hi,
This is probably just me being stupid, as usual.
I am unable to get any slider to show news articles with an Access level higher than "Guest".
For example, if I use the IOS slider module, on the tab Parameters I select "Category" and then "News".
News is a category only available to logged in users, so all those articles have the access level set to "User" (aka minimum "2").
Now, even if I
am
logged in, as a user or as an administrator, the IOS slider refuses to show anything.
If I change the access level for any of the articles in the selected category from "User" down to "Guest", then IOS slider starts showing them.
What am I doing wrong?
(If I select another news category which only contains "public articles", then it works fine. And if I choose "Multiple categories", only "Guest" level articles are shown. I have the same problem with other news sliders, like iView... so I haven't bothered to test any other sliders, since the problem appears to be elsewhere.)
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: IOS Slider only shows Guest level content
«
Reply #1 on:
November 08, 2015, 12:31:00 »
I will chevk later and answer you agsin. Till then do this: Make sure caching is disabled in module and tell me if this solved the problem.
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Bezman
Newbie
Posts: 15
Re: IOS Slider only shows Guest level content
«
Reply #2 on:
November 08, 2015, 14:14:39 »
OK. Changed the cache settings from Yes to No, emptied the cache, logged out, logged in as another user - same result though.
Logged out and logged in as admin again - still the same.
Problem remains.
If you want the site's address, I can PM it to you.
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: IOS Slider only shows Guest level content
«
Reply #3 on:
November 08, 2015, 19:24:45 »
I checked the module.
IOS Slider only displays articles available to guests.
If an article/category is for registered users it will not display them regardless if you login or not. So, it works fine for the purpose it designed for (a frontend slider visible to site public visitors), although I understand it doesn't work as you want. I write you below a modification of the module that will make it work as you want but please read the notices at the end.
Open this file with a text editor:
modules/mod_iosslider/mod_iosslider.php
Go to line
278
and change this:
$lowlev = 0;
to this:
$lowlev = $elxis->acl()->getLowLevel(); $exactlev = $elxis->acl()->getExactLevel();
Go to line
302
and change this:
$sql .= "\n AND a.alevel = :lowlevel ORDER BY a.created DESC";
to this:
$sql .= "\n AND ((a.alevel <= :lowlevel) OR (a.alevel = :exactlevel)) ORDER BY a.created DESC";
Go to line
303
:
$binds[] = array(':lowlevel', $lowlev, PDO::PARAM_INT);
Add below:
$binds[] = array(':exactlevel', $exactlev, PDO::PARAM_INT);
Save the file and you are ready.
Be careful: The access check is applied on articles access level, not in category. Although Elxis might have fixed automatically the articles access level if you have made the category available to registered users, make sure the articles inside the category have the proper access level.
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Bezman
Newbie
Posts: 15
Re: IOS Slider only shows Guest level content
«
Reply #4 on:
November 25, 2015, 16:43:00 »
Thanks for the excellent code clip - I am not that good yet at php.
I have implemented and tested the change, and it appears to work fine - thank you!
Logged
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Support
»
Security
»
IOS Slider only shows Guest level content