the changes can also be seen in the pre-loaded pack.
you need to modify
page_header.php, overall_header.tpl and search.php
in your case you only
need to modify search.php as you do not desire to hide the link showen at the top for any users.
anyway I will describe the complete solution.
in page_header.php
- Code: Select all
[FIND]
$view_pages_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);
[AFTER, ADD]
if ($view_pages_ary[''.PAGE_SEARCH.'']['auth_view'])
{
$template->assign_block_vars('switch_search_on', array());
}
in file overall_header.tpl
- Code: Select all
[FIND]
<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>
[REPLACE WITH]
<!-- BEGIN switch_search_on -->
<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>
<!-- END switch_search_on -->
in file search.php
- Code: Select all
[FIND]
// End session management
//
[AFTER ADD]
// Added for Extra permission MOD
// Start auth check
//
$is_auth = array();
$is_auth = auth(AUTH_ALL, PAGE_SEARCH, $userdata);
if( !$is_auth['auth_read'] )
{
if ( !$userdata['session_logged_in'] )
{
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=search.$phpEx", true));
exit;
}
$message = ( !$is_auth['auth_view'] ) ? $lang['Not_Authorised'] : sprintf ($lang['Sorry_no_auth'],$is_auth['auth_read_type']);
message_die(GENERAL_MESSAGE, $message);
}
//
// End auth check
//
you also need to add a extra entry in your DB,
- Code: Select all
'INSERT IGNORE INTO ' . FORUMS_TABLE . ' (forum_id ,cat_id, forum_name, forum_desc, forum_status )
VALUES ("'.PAGE_SEARCH.'", "0", "SEARCH PAGE", "Search Page Control", 1)',
modify the already included db_update.php to included this aswell.
(you may run the file again, it does not harm)
when this is done, you may look up the "special page forum" SEARCH, inside ACP->forum permission assign VIEW permission to users who may SEE the link to the page, assign READ permission to the users you would grant access to USE the page.
e.g.
VIEW = ALL
READ = REG