Atomic Posted July 31, 2017 Share Posted July 31, 2017 Greetings, I would like Announcements to be viewable by logged in clients only. Is this possible with a ClientAreaPage hook? And would anyone have code they could share? It's just that we publish some of the Announcements on our blog and I don't want duplicated content penalties. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 31, 2017 Share Posted July 31, 2017 I would like Announcements to be viewable by logged in clients only. Is this possible with a ClientAreaPage hook? And would anyone have code they could share? It's just that we publish some of the Announcements on our blog and I don't want duplicated content penalties. the hook code required depends on how far you want to go with this... so if you just want to remove Announcements from the homepage, you can empty the array with a hook... https://forum.whmcs.com/showthread.php?127990-Remove-Announcements-from-home-page&p=512010#post512010 if you want to remove the Announcements navbar link for non-logged visitors (last hook in the post)... https://forum.whmcs.com/showthread.php?113067-Change-menu-Navbar&p=458811#post458811 if you really want to make the announcements client only, you can redirect non-logged in visitors to the login page.... existing logged in clients will be shown the announcements page directly... <?php # Make Announcements Client Only Hook # Written by brian! function announcements_client_only_hook($vars) { $client = Menu::context('client'); if (!$client) { header("Location: login.php"); exit; } } add_hook("ClientAreaPageAnnouncements", 1, "announcements_client_only_hook"); 0 Quote Link to comment Share on other sites More sharing options...
Atomic Posted July 31, 2017 Author Share Posted July 31, 2017 Cheers Brian, the last hook was what I was after. Works perfectly. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.