Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Fixed: Nav bar not display correctly on Opera Mobile / Mini due to fl…
Browse files Browse the repository at this point in the history
…oated divs.

Changed: Each style can now have it's own style_ie6.css.
Changed: Updated stylesheets to be common accept for colours.
Updated stylesheets, added style_ie6.css to each style and removed install.css.
  • Loading branch information
HeyRatFans committed Aug 18, 2012
1 parent 7e1059b commit 7cd7eb6
Show file tree
Hide file tree
Showing 23 changed files with 2,909 additions and 1,794 deletions.
32 changes: 11 additions & 21 deletions forum/include/html.inc.php
Expand Up @@ -334,22 +334,13 @@ function html_get_user_style_path()
return $user_style;
}

function html_get_style_sheet()
function html_get_style_sheet($filename = 'style.css')
{
if (!($user_style = html_get_user_style_path())) {
return html_get_forum_file_path('styles/default/style.css');
return html_get_forum_file_path(sprintf('styles/default/%s', basename($filename)));
}

return html_get_forum_file_path(sprintf('styles/%s/style.css', basename($user_style)));
}

function html_get_mobile_style_sheet()
{
if (!($user_style = html_get_user_style_path())) {
return html_get_forum_file_path('styles/default/mobile.css');
}

return html_get_forum_file_path(sprintf('styles/%s/mobile.css', basename($user_style)));
return html_get_forum_file_path(sprintf('styles/%s/%s', basename($user_style), basename($filename)));
}

function html_get_script_style_sheet()
Expand Down Expand Up @@ -477,14 +468,12 @@ function html_include_javascript($script_filepath)
printf("<script type=\"text/javascript\" src=\"%s\"></script>\n", $script_filepath);
}

function html_include_css($script_filepath, $media = 'screen', $id = false)
function html_include_css($script_filepath, $media = 'screen')
{
$path_parts = path_info_query($script_filepath);

if (!array_keys_exist($path_parts, 'basename', 'filename', 'extension', 'dirname')) return;

$id = ($id !== false) ? $id : sprintf('style_%s', preg_replace('/[^a-zA-Z]+/', '', $script_filepath));

if (forum_get_setting('use_minified_scripts', false, false)) {
$path_parts['basename'] = sprintf('%s.min.%s', $path_parts['filename'], $path_parts['extension']);
}
Expand All @@ -493,7 +482,7 @@ function html_include_css($script_filepath, $media = 'screen', $id = false)

$script_filepath.= isset($path_parts['query']) ? "?{$path_parts['query']}" : '';

printf("<link rel=\"stylesheet\" id=\"%s\" href=\"%s\" type=\"text/css\" media=\"%s\" />\n", $id, $script_filepath, $media);
printf("<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\" media=\"%s\" />\n", $script_filepath, $media);
}

// Draws the top of the HTML page including DOCTYPE, head and body tags
Expand Down Expand Up @@ -776,7 +765,7 @@ function html_draw_top()
printf("<link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"%s\" />\n", html_get_forum_file_path(sprintf('styles/%s/images/apple-touch-icon-72x72.png', $user_style_path)));
printf("<link rel=\"apple-touch-icon\" sizes=\"114x114\" href=\"%s\" />\n", html_get_forum_file_path(sprintf('styles/%s/images/apple-touch-icon-114x114.png', $user_style_path)));

printf("<link rel=\"shortcut icon\" type=\"image/ico\"href=\"%s\" />\n", html_get_forum_file_path(sprintf('styles/%s/images/favicon.ico', $user_style_path)));
printf("<link rel=\"shortcut icon\" type=\"image/ico\" href=\"%s\" />\n", html_get_forum_file_path(sprintf('styles/%s/images/favicon.ico', $user_style_path)));
}

$opensearch_path = html_get_forum_file_path(sprintf('search.php?webtag=%s&amp;opensearch', $webtag));
Expand Down Expand Up @@ -805,11 +794,12 @@ function html_draw_top()
}
}

$style_path_ie6 = html_get_forum_file_path('styles/default/style_ie6.css');
if (($style_path_ie6 = html_get_style_sheet('style_ie6.css'))) {

echo "<!--[if IE 6]>\n";
echo "<link rel=\"stylesheet\" href=\"$style_path_ie6\" type=\"text/css\" />\n";
echo "<![endif]-->\n";
echo "<!--[if IE 6]>\n";
html_include_css($style_path_ie6);
echo "<![endif]-->\n";
}

if (isset($inline_css)) {

Expand Down
2 changes: 1 addition & 1 deletion forum/include/light.inc.php
Expand Up @@ -164,7 +164,7 @@ function light_html_draw_top()
echo "<meta name=\"robots\" content=\"$robots\" />\n";
}

if (($stylesheet = html_get_mobile_style_sheet())) {
if (($stylesheet = html_get_style_sheet('mobile.css'))) {
echo "<link rel=\"stylesheet\" href=\"$stylesheet\" type=\"text/css\" media=\"screen\" />\n";
}

Expand Down
2 changes: 1 addition & 1 deletion forum/nav.php
Expand Up @@ -36,7 +36,6 @@
require_once BH_INCLUDE_PATH. 'pm.inc.php';
require_once BH_INCLUDE_PATH. 'session.inc.php';

// Number of forums available
cache_disable();

html_draw_top("class=navpage", "forumlinks.js");
Expand Down Expand Up @@ -89,6 +88,7 @@
echo forum_links_draw_dropdown('openForumLink');

echo "</div>\n";
echo "<div style=\"clear: both\"></div>\n";

html_draw_bottom();

Expand Down
4 changes: 3 additions & 1 deletion forum/styles/apple/style.css
Expand Up @@ -594,7 +594,9 @@ div.poll_option_list ol li {
}

.forumlinks {
font-family: verdana, arial, helvetica, sans-serif;
background-color: #5483B1;
color: #FFFFFF;
font-family: verdana, arial, helvetica, sans-serif;
}

.google_adsense_register_note {
Expand Down

0 comments on commit 7cd7eb6

Please sign in to comment.