WebsiteBaker Support (2.8.x) > Templates, Menus & Design
PHP - execute certain code depending on ?lang=
pcwacht:
Cleaned it up a bit for clarity and readablitity
--- Code: ---<?php
if (LANGUAGE==SE) {
$section_id = 10; //change this section_id for Your needings
} elseif (LANGUAGE==EN) {
$section_id = 11; //change this section_id for Your needings
} else {
$section_id = 12; //change this section_id for Your needings
}
if (isset($section_id)) { // Maker sure section isset
$query_sec = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE section_id = '$section_id' ");
if($query_sec->numRows() > 0) {
$section = $query_sec->fetchRow();
$section_id = $section['section_id'];
$module = $section['module'];
require(WB_PATH.'/modules/'.$module.'/view.php'); //statt view.php die alternative eintragen!
}
}
<?
--- End code ---
Have fun,
John
Navigation
[0] Message Index
[*] Previous page
Go to full version