We are currently working on our servers, so there may be outages on the domains.Zurzeit wird an unseren Servern gearbeitet, deshalb kann es zu Ausfällen bei den Domains kommen.
I couldn't use the standard WB selector (wherever I put it it crashed the template)
// fetch page language $sPageLang = strtolower(isset($wb->page) || ($wb instanceof frontend) ? $wb->page['language'] : 'EN');// fetch page_id for loaded page, you need it for canonical $iPageId = (isset($wb->page) || ($wb instanceof frontend) ? $wb->page['page_id'] :(PAGE_ID ?? ($page_id ?? 0)));// Dummy function if Lingual Snippet not loaded if (!function_exists('LangPageId')) { function LangPageId() { global $iPageId; return $iPageId; } }// get the page_id from language in level 0 for a given language if (\function_exists('getLangStartPageIds')) { $iLangStartPage = (int)(getLangStartPageIds($sPageLang)); }// get the page trail from languages in level 0 as array $aLangStartPageIds = []; if (\function_exists('getLangStartPageIds')) { $aLangStartPageIds = getLangStartPageIds(); }// to show flags in frontend $iMultiLang = 0; $iLangFound = count($aLangStartPageIds); switch ($iLangFound): case 0: $iMultiLang = 1; break; case 1: $iMultiLang = 0; break; default: $iMultiLang = 1; endswitch; $sMultiLang = ''; if (function_exists('language_menu')) { $sMultiLang = language_menu('png', false); $iMultiLang = intval(!empty($sMultiLang) ? 1 : $iMultiLang); }
echo '<div >'; echo '<span id="lang" style="height: 2.925em;">'; if (trim($sMultiLang) != '') { echo $sMultiLang; } echo '</span>'; echo '</div>';
.langmenu { margin-left :auto; margin-right :auto; padding :5px 24px; min-height :0.6em; text-align :left; display :table-cell; vertical-align :middle; }.langmenu {position: relative; }.langmenu img { border :0; max-width: 100%; width: 34px; }.langmenu a.default img { filter :alpha(opacity=100); -moz-opacity :1.0; opacity :1.0; }.langmenu a:hover img,.langmenu a.current img { filter :alpha(opacity=30); -moz-opacity :.3; opacity :.3; text-decoration: none; }.langmenu a:hover { text-decoration: none; }
<?php// no direct file accessif(count(get_included_files())==1) header("Location: ../index.php",TRUE,301);?><!DOCTYPE html><html lang="bg"><head><meta http-equiv="Content-Type" content="text/html; charset=<?php if(defined('DEFAULT_CHARSET')) { echo DEFAULT_CHARSET; } else { echo 'utf-8'; }?>" /> <meta name="description" content="<?php page_description(); ?>" /><meta name="keywords" content="<?php page_keywords(); ?>" /> <?php $includefile = WB_PATH . '/modules/wbstats/count.php'; if (file_exists($includefile)) { include_once $includefile; } if (function_exists('simplepagehead')) { simplepagehead('/', 1, 0, 1); } ?> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR;?>/css/fitgrid.css" /> <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR;?>/css/styles.css" /> <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR;?>/css/sm-core-css.css" /> <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR;?>/css/sm-clean.css" /> <link rel="stylesheet" type="text/css" href="<?php echo WB_URL;?>/include/font-awesome/css/font-awesome.css" /> <?php register_frontend_modfiles('css'); register_frontend_modfiles('jquery'); register_frontend_modfiles('js'); // buffering contents ob_start(); page_content(1); $page_content_1 = ob_get_contents(); ob_end_clean(); if(defined('TOPIC_BLOCK2') AND TOPIC_BLOCK2 != '') { $page_content_2 = TOPIC_BLOCK2; } else { ob_start(); page_content(2); $page_content_2 = ob_get_contents(); ob_end_clean(); } ob_start(); page_content(3); $page_content_3 = ob_get_contents(); ob_end_clean(); ?> <script type="text/javascript" src="<?php echo TEMPLATE_DIR;?>/js/jquery.sticky.js"></script> <script type="text/javascript" src="<?php echo TEMPLATE_DIR;?>/js/jquery.smartmenus.min.js"></script> <script type="text/javascript" src="<?php echo TEMPLATE_DIR;?>/js/jquery.backstretch.min.js"></script> <script type="text/javascript"> $(function() { $('#main-menu').smartmenus({ mainMenuSubOffsetX: -1, mainMenuSubOffsetY: 4, subMenusSubOffsetX: 6, subMenusSubOffsetY: -6 }); }); </script><script>if (window.innerWidth >=960) { $(window).load(function(){ $("#main-nav").sticky({ topSpacing: 0 }); });} </script> <?php$headerbild_id = "0";$takeit=false;if (file_exists(WB_PATH . '/media/headerbilder/header_0.jpg')) { $headerbild_id = 0; $takeit = true; }if (PARENT == 0) { if (file_exists(WB_PATH . '/media/headerbilder/header_' . PAGE_ID . '.jpg')) { $headerbild_id = PAGE_ID; $takeit = true; }} else { if (file_exists(WB_PATH . '/media/headerbilder/header_' . PARENT . '.jpg')) { $headerbild_id = PARENT; $takeit = true; } if (file_exists(WB_PATH . '/media/headerbilder/header_' . PAGE_ID . '.jpg')) { $headerbild_id = PAGE_ID; $takeit = true; }} ?> </head><body> <header> <div class="center"> <div class="row"> <div class="logo"> <a href="<?php echo WB_URL; ?>"><img src="<?php echo TEMPLATE_DIR; ?>/logo.png" width="210" height="58" alt="<?php echo WEBSITE_TITLE; ?>" border="0" /></a> </div> <div class="fg7 meta fg-no-mobile"> <?php show_menu2( $aMenu = 2, $aStart = SM2_ROOT, $aMaxLevel = SM2_MAX+1, $aOptions = SM2_ALL, $aItemOpen = '[li][a][menu_title]</a>', $aItemClose = '</li>', $aMenuOpen = '<ul>', $aMenuClose = '</ul>', $aTopItemOpen = false, $aTopMenuOpen = '<ul>' );?> </div> </div> </div> </header> <nav role="navigation" id="main-nav"> <div class="center"> <div class="row orow"> <input id="main-menu-state" type="checkbox" /> <label class="main-menu-btn" for="main-menu-state"> <span class="main-menu-btn-icon"></span> Toggle main menu visibility </label> <?php show_menu2( $aMenu = 1, $aStart = SM2_ROOT, $aMaxLevel = SM2_ALL, $aOptions = SM2_ALL, $aItemOpen = '[li][a][menu_title]</a>', $aItemClose = '</li>', $aMenuOpen = '<ul>', $aMenuClose = '</ul>', $aTopItemOpen = false, $aTopMenuOpen = '<ul id="main-menu" class="sm sm-clean">' );?> </div> </div> </nav> <?php if ($page_content_3 !='') { ?> <div> <?php echo $page_content_3; ?> </div> <?php } else { ?> <div class="schmuckbild fg-no-mobile"> </div> <?php } ?> <div class="main"> <div class="center"> <div class="row"> <?php if ($page_content_2 != '') { ?> <div class="fg9"> <article> <h1><?php echo PAGE_TITLE; ?></h1> <?php echo $page_content_1; ?> </article> </div> <div class="fg3"> <aside> <?php echo $page_content_2; ?> </aside> </div> <?php } else { ?> <div class="fg12"> <article> <h1><?php echo PAGE_TITLE; ?></h1> <?php echo $page_content_1; ?> </article> </div> <?php } ?> </div> <div class="row fg-no-desktop"> <div class="fg12 meta"> <?php show_menu2( $aMenu = 2, $aStart = SM2_ROOT, $aMaxLevel = SM2_MAX+1, $aOptions = SM2_ALL, $aItemOpen = '[li][a][menu_title]</a>', $aItemClose = '</li>', $aMenuOpen = '<ul>', $aMenuClose = '</ul>', $aTopItemOpen = false, $aTopMenuOpen = '<ul>' );?> </div> </div> </div> </div> <script type="text/javascript">$(function() { var $mainMenuState = $('#main-menu-state'); if ($mainMenuState.length) { // animate mobile menu $mainMenuState.change(function(e) { var $menu = $('#main-menu'); if (this.checked) { $menu.hide().slideDown(250, function() { $menu.css('display', ''); }); } else { $menu.show().slideUp(250, function() { $menu.css('display', ''); }); } }); // hide mobile menu beforeunload $(window).bind('beforeunload unload', function() { if ($mainMenuState[0].checked) { $mainMenuState[0].click(); } }); }});</script><?php if ($takeit==true) { ?><script> $(".schmuckbild").backstretch(["<?php echo WB_URL . '/media/headerbilder/header_' . $headerbild_id . '.jpg';?>"]);</script><?php } ?><?php page_footer(); ?></body></html>
<ul> <li class="menu-sibling"> <a href="https://skylog.bg/pages/bg.php" class="" title="BG"><span><img src="<?php echo WB_URL; ?>/media/flags/bg.png" alt="BG" title="BG"></span></a> </li> <li class="menu-sibling"> <a href="https://skylog.bg/pages/en.php" class="" title="EN"><span><img src="<?php echo WB_URL; ?>/media/flags/en.png" alt="EN" title="EN"></span></a> </li></ul>
<?php ob_start(); show_menu2(1, SM2_ROOT, SM2_CURR, SM2_ALL, '<li class="[class]"><a href="[url]" class="[class]"><span><img src="' . WB_URL . '/media/flags/[menu_title].png" name="[page_title]"></span></a>', "</li>", '<ul>', '</ul>', true, '<ul>');$sFlagmenu = ob_get_contents();ob_end_clean();echo $sFlagmenu;?>
the only issue I face is that in mobile version the language appears on the bottom of the page. Any idea how to keep it on the top?
.language-switcher { right: 35px; top: 5px; position: absolute; .language-switcher__language { display: inline;}.language-switcher__language.language-switcher__language_active { background: #fde067; padding: 2px;}
<div class="language-switcher" > <span class="language-switcher__language language-switcher__language_active"><a href="https://skylog.bg/pages/bg.php" class="" title="BG">BG</a></span> <span> / </span> <span class="language-switcher__language"><a href="https://skylog.bg/pages/en.php" class="" title="EN">EN</a></span></div>
<div class="logo"> <a href="<?php echo WB_URL; ?>"><img src="<?php echo TEMPLATE_DIR; ?>/logo.png" width="210" height="58" alt="<?php echo WEBSITE_TITLE; ?>" border="0" /></a> </div>
Quote from: rumen on May 04, 2024, 07:13:43 PMthe only issue I face is that in mobile version the language appears on the bottom of the page. Any idea how to keep it on the top? if i look into the source code, the code for the flagmenu is part of a div, called fg-no-mobile. this div is defined in fitgrid.css and use a display:block on the desktop-view and a display:none on mobilesTwo possible way's (maybe more)you use a new place for the flag menu, outside from the actual div fg-no-mobile, that is visible every time (maybe on the right side from the logo in the top)or you add a second flagmenu with a new css-class, that is visible only on mobilesfrom my personal view, in the mobile view the part in the top is a good place It is very simple (for example), to split the div class="logo" into two parts or put in this div another div with the same menu-code like the flag-menu on desktop-view and define a fixed position on the right side of this divTo the discussion about the old WB-Version... i talk and write with a lot of users outside from germany and i've to say, i think we, here in german's are the only country, where you can order a domain with the latest php-version, one day after the release i spend a lot of time in the last weeks, to upgrade 4 pages in canada with wb 2.7 or wb 2.8.1. this pages works well in the frontend, but it was not possible, to admin some pages after the php-upgrade there. Of course, i use the latest WB, but it will not run, latest php-version there, in this contract, was a PHP 7.4. The user needs now a new contract with new conditions and latest version there was a PHP 8.2.0, the active support for this end's at the end of this year (31 Dec 2024)Not every owner can understand this and we germans can not understand, why others work with php 5.6my tip for you: sometime's in the future, the provider of this page will switch off the old php-version's and the owner get the same problem with the admin area. be prepared for this. i work with locale copies on a locale server and i have it from all my customers. here i can test the whole WB-Upgrades, on rainy day's P.S.: in the case of the canada pages, the webmaster ordered a new server and copy the old wb-project to this server, but nothing works. he write a mail to me, but canada is far away from here. it was night here, but he was waiting for a answer. one hour later, he use the cms-builder from the provider and build a new page. all work was in vain, the upgrade was finish, but in a special folder from the old server
Well, I succeed to make it to appear in mobile menu like that but instead to appear in the right upper corner (as it is on the mobile menu appears in the left upper corner in the normal page ....
<div class="language-switcher" > <span class="language-switcher__language language-switcher__language_active"><a href="https://skylog.bg/pages/bg.php" class="" title="BG"><img src="<?php echo WB_URL; ?>/media/flags/bg.png" alt="BG" title="BG"></a></span> <span> / </span> <span class="language-switcher__language"><a href="https://skylog.bg/pages/en.php" class="" title="EN"><img src="<?php echo WB_URL; ?>/media/flags/en.png" alt="EN" title="EN"></a></span></div>
<div class="language-switcher fg7 meta" > <ul> <li class="menu-sibling"> <a href="https://skylog.bg/pages/bg.php" class="" title="BG"><img src="https://skylog.bg/media/flags/bg.png" alt="BG" title="BG" style="width:24px;height:24px;"></a> </li> <li class="menu-sibling"> <a href="https://skylog.bg/pages/en.php" class="" title="EN"><img src="https://skylog.bg/media/flags/en.png" alt="EN" title="EN" style="width:24px;height:24px;"></a> </li> </ul> </div>
.meta ul li { list-style-type:none; font-size:80%; text-transform:uppercase; display:inline-block; margin:0; /*! padding:0 1em; */ }
.language-switcher { right: 5px; top: 5px; position: absolute;}
FANTASTIC! Now it is really OK!
BTW I succeed to repair my local server with the Maria DB and PHPMyADMIN, installed WB 2.13.5 and when I have more time will start to upgrade page by page.