Skip to content

Commit

Permalink
Working on #454 Hide stuff users don't have permission to use
Browse files Browse the repository at this point in the history
Hide "Contact Us" link if diabled to guests or disabled altogether.
  • Loading branch information
Starpaul20 committed Jun 27, 2014
1 parent a0cbf15 commit cdcc7a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion global.php
Expand Up @@ -411,7 +411,7 @@
$templatelist = '';
}

$templatelist .= "headerinclude,header,footer,gobutton,htmldoctype,header_welcomeblock_member,header_welcomeblock_guest,header_welcomeblock_member_admin,global_pm_alert,global_unreadreports,error,footer_languageselect_option";
$templatelist .= "headerinclude,header,footer,gobutton,htmldoctype,header_welcomeblock_member,header_welcomeblock_guest,header_welcomeblock_member_admin,global_pm_alert,global_unreadreports,error,footer_languageselect_option,footer_contactus";
$templatelist .= ",global_pending_joinrequests,nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active,footer_languageselect,footer_themeselect,header_welcomeblock_member_moderator,redirect,header_menu_calendar,nav_dropdown,footer_themeselector";
$templatelist .= ",global_boardclosed_warning,global_bannedwarning,error_inline,error_nopermission_loggedin,error_nopermission,debug_summary,header_quicksearch,header_menu_search,header_menu_memberlist,usercp_themeselector_option";
$templates->cache($db->escape_string($templatelist));
Expand Down Expand Up @@ -743,6 +743,13 @@
}
}

// If we use the contact form, show 'Contact Us' link when appropriate
$contact_us = '';
if(($mybb->settings['contactlink'] == "contact.php" && $mybb->settings['contact'] == 1 && ($mybb->settings['contact_guests'] != 1 && $mybb->user['uid'] == 0 || $mybb->user['uid'] > 0)) || $mybb->settings['contactlink'] != "contact.php")
{
eval('$contact_us = "'.$templates->get('footer_contactus').'";');
}

// DST Auto detection enabled?
$auto_dst_detection = '';
if($mybb->user['uid'] > 0 && $mybb->user['dstcorrection'] == 2)
Expand Down
3 changes: 2 additions & 1 deletion install/resources/mybb_theme.xml
Expand Up @@ -3418,7 +3418,7 @@ a.button {
{$lang_select}
{$theme_select}
<ul class="menu bottom_links">
<li><a href="{$mybb->settings['contactlink']}">{$lang->bottomlinks_contactus}</a></li>
{$contact_us}
<li><a href="{$mybb->settings['homeurl']}">{$mybb->settings['homename']}</a></li>
<li><a href="#top">{$lang->bottomlinks_returntop}</a></li>
<li><a href="<archive_url>">{$lang->bottomlinks_litemode}</a></li>
Expand All @@ -3445,6 +3445,7 @@ a.button {
<!-- The following piece of code allows MyBB to run scheduled tasks. DO NOT REMOVE -->{$task_image}<!-- End task image code -->
{$auto_dst_detection}
</div>]]></template>
<template name="footer_contactus" version="1800"><![CDATA[<li><a href="{$mybb->settings['contactlink']}">{$lang->bottomlinks_contactus}</a></li>]]></template>
<template name="footer_languageselect" version="1800"><![CDATA[<div class="language">
<form method="{$lang_redirect_url['form_method']}" action="{$lang_redirect_url['location']}" id="lang_select">
{$lang_redirect_url['form_html']}
Expand Down

0 comments on commit cdcc7a5

Please sign in to comment.