- Posts: 66
COMMUNITY FORUM
Disabling Author Page View
- Scott Oman
- Topic Author
- Offline
- Senior Member
Less
More
7 years 10 months ago #159923
by Scott Oman
Disabling Author Page View was created by Scott Oman
Dear K2 Developers and Community,
Originally I had planned to use the K2 author page as the public profile for users by customizing the layout, but I've decided to use a different component to do the job now. Eventually I'll have to modify/integrate K2 comments, K2 latest comments' module, and K2 top comments' module (username and images) to direct users to this component's profile.
However, I don't know how to disable the K2 Author Page. I hid all layout & view options for user (author) pages in K2 backend parameters, but the K2 author page is still accessible.
Is it possible to unpublish this page or disable this feature?
Thanks.
Kind regards,
Scott
Originally I had planned to use the K2 author page as the public profile for users by customizing the layout, but I've decided to use a different component to do the job now. Eventually I'll have to modify/integrate K2 comments, K2 latest comments' module, and K2 top comments' module (username and images) to direct users to this component's profile.
However, I don't know how to disable the K2 Author Page. I hid all layout & view options for user (author) pages in K2 backend parameters, but the K2 author page is still accessible.
Is it possible to unpublish this page or disable this feature?
Thanks.
Kind regards,
Scott
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 10 months ago #159925
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Disabling Author Page View
Hello Scott,
I would try a different approach.
If the URLs have a similar pattern eg: the username, you can create a redirect rule in the component's overrides or your htaccess files.
I would try a different approach.
If the URLs have a similar pattern eg: the username, you can create a redirect rule in the component's overrides or your htaccess files.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Scott Oman
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 66
7 years 10 months ago #159929
by Scott Oman
Replied by Scott Oman on topic Disabling Author Page View
That's interesting. I hadn't thought of that, but it might be beyond the scope of my skill-set/knowledge-base.
This would be an example of a user's K2 author page url:
www.mysite.com/component/k2/author/1863?Itemid=495
and the other component's profile page I'm hoping to redirect them to:
www.mysite.com/profile/page/1863?task=page.display&page_id=6
The only thing I see that is similar is the "1863", the user's ID #.
Do you think such a configuration would be possible given that users' ID #s are provided in the URLs?
If so, any additional information about creating a redirect would be greatly appreciated.
Many thanks.
Kind regards,
Scott
This would be an example of a user's K2 author page url:
www.mysite.com/component/k2/author/1863?Itemid=495
and the other component's profile page I'm hoping to redirect them to:
www.mysite.com/profile/page/1863?task=page.display&page_id=6
The only thing I see that is similar is the "1863", the user's ID #.
Do you think such a configuration would be possible given that users' ID #s are provided in the URLs?
If so, any additional information about creating a redirect would be greatly appreciated.
Many thanks.
Kind regards,
Scott
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 10 months ago #159944
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Disabling Author Page View
Hello Scott,
This does require some regex knowledge.
StackOverflow to the rescue :)
stackoverflow.com/questions/28643170/htaccess-redirecting-rewriting-pages-based-on-partial-url-pattern
This does require some regex knowledge.
StackOverflow to the rescue :)
stackoverflow.com/questions/28643170/htaccess-redirecting-rewriting-pages-based-on-partial-url-pattern
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Scott Oman
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 66
7 years 10 months ago #159951
by Scott Oman
Replied by Scott Oman on topic Disabling Author Page View
Not sure, but seems that would involve making an individual redirect for each and every user, which isn't practical.
Please Log in or Create an account to join the conversation.
- Scott Oman
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 66
7 years 10 months ago - 7 years 10 months ago #159961
by Scott Oman
Replied by Scott Oman on topic Disabling Author Page View
I solved this problem with the use of Metamod by inserting the following recipe in the module backend PHP area:
$url = $core_genius->info("url");
$c = preg_match('#^http://www\.mysite\.com/component/k2/author/([0-9]+)#', $url, $matches);
if ($c) {
$newurl = "www.mysite.com/profile/page/" . $matches[1] . "?task=page.display&page_id=6";
$app = JFactory::getApplication();
$app->redirect($newurl);
}
Now all avatars and links in the K2 comments area, K2 comments module, and K2 top commenters module all redirect to a different component's profile page. So if you're using K2 and have a similar problem (you'd like to redirect users to their custom profile pages or another component's page), you can use Metamod + that recipe. Just change "mysite" to your site url and change the destination "(new url) profile/page/" and "?task=page.display&page_id=6" according to your needs.
Kind regards,
Scott
$url = $core_genius->info("url");
$c = preg_match('#^http://www\.mysite\.com/component/k2/author/([0-9]+)#', $url, $matches);
if ($c) {
$newurl = "www.mysite.com/profile/page/" . $matches[1] . "?task=page.display&page_id=6";
$app = JFactory::getApplication();
$app->redirect($newurl);
}
Now all avatars and links in the K2 comments area, K2 comments module, and K2 top commenters module all redirect to a different component's profile page. So if you're using K2 and have a similar problem (you'd like to redirect users to their custom profile pages or another component's page), you can use Metamod + that recipe. Just change "mysite" to your site url and change the destination "(new url) profile/page/" and "?task=page.display&page_id=6" according to your needs.
Kind regards,
Scott
Last edit: 7 years 10 months ago by Scott Oman.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 10 months ago #159971
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Disabling Author Page View
Nice one Scott,
Kudos :)
Kudos :)
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- webdesign
- Offline
- New Member
Less
More
- Posts: 1
4 years 4 months ago #176392
by webdesign
Replied by webdesign on topic Disabling Author Page View
Hi Scott,
where can i find the module backend PHP?
Thanks
where can i find the module backend PHP?
Thanks
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 4 months ago #176399
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Disabling Author Page View
This is the module www.metamodpro.com but I doubt it's updated anymore...
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.