Exclude articles from category with denied access

News Show Pro GK5 - flexible, responsive and easily extendable free Joomla module support forum.
Rate this topic: Evaluations: 2, 6.00 on the average.Evaluations: 2, 6.00 on the average.Evaluations: 2, 6.00 on the average.Evaluations: 2, 6.00 on the average.Evaluations: 2, 6.00 on the average.Evaluations: 2, 6.00 on the average.6.00 out of 6 based on 2 vote(s)
GK User
Mon Jul 10, 2017 2:23 pm
I have the "popular articles" module in sidebar, but I have some categories, which allowed to see only for registered users, but NSP5 show articles from that categories even for guests.

This causes article links to change from

pickupguild.ru/istorii-soblaznenij/3350-fast-s-krasavitsej-modelyu

to

pickupguild.ru/[CURRENT_MENU_ITEM_O_O, it will cause too many duplicates!]?id=3350:fast-s-krasavitsej-modelyu&catid=16:istorii-soblaznenij

, which returns 404 error. How to exclude articles from restricted categories?
User avatar
Expert Boarder

GK User
Thu Jul 13, 2017 8:17 am
ive the same problem + articles with "start publishing" in the future are visible to.
User avatar
Fresh Boarder

GK User
Thu Jul 13, 2017 12:01 pm
This is extremely important to fix, because just one not published article makes X 404 pages, where X = count of all items in web-site menu. Just one article. So if we have 100 not published articles and 100 menu items, it will born 10000 404 error pages, which is deadable for SEO
User avatar
Expert Boarder

teitbite
Fri Jul 14, 2017 10:06 am
Hi

Ok I will report that to programmers, but please one of You send me an access to FTP and joomla panel access to my email [email protected] so they will be able to have an environment to apply the fix.
User avatar
Moderator

GK User
Fri Jul 14, 2017 10:54 am
Done, check youre email.
User avatar
Fresh Boarder

GK User
Tue Jul 18, 2017 10:56 am
Hello. Whats about fixing?
User avatar
Expert Boarder

GK User
Sat Jul 22, 2017 11:49 am
Anyone alive?
User avatar
Expert Boarder

teitbite
Wed Jul 26, 2017 2:58 pm
Hi

Please do not bump threads. Every new post changes the time of last activity and pushes this question to the end of the line.

I've found Your mail @Szczerba, but it's missing an url to the site You have this problem with.

Anyway I've passed what You send to programmers.
User avatar
Moderator

GK User
Fri Jul 28, 2017 10:41 pm
I found the way to fix it manually

1. Open file "/modules/mod_news_pro_gk5/tmpl/view.php"
2. In functions header, text, readMore, lists - after line:
Code: Select all
$link = static::itemLink($item, $config);

Insert:
Code: Select all
if (strpos($link, '?id=') !== false) return '';

3. In function getImageHTML - after line:
Code: Select all
$img_link = $IMG_LINK;

Insert:
Code: Select all
if (strpos($img_link, '?id=') !== false) return '';


It will not show unavailable articles for guests, so there are will no 404 errors. I will remake it to show unavailable items, but with link with <span> tag instead of <a>, and text "Only for registered users" instead of intro text for it
User avatar
Expert Boarder

teitbite
Mon Jul 31, 2017 2:07 pm
Hi

Thank You for pointing that out. Sending this to programmers.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.