// active menu elements, titles and explanations (depending on params) $sMac1 = $sMac2 = $sMac3 = $sMac4 = $sMac5 = $sMac6 = ''; $sTitle = $sText = 'Home'; if ($_GET) { switch($_GET['module']) { case 'home': $sMac1 = 'class="active"'; $sText = 'RewriteRule ^home/{0,1}$ index.php?module=home [QSA,L]'; if (isset($_GET['key']) && $_GET['key']) { $sTitle .= ' - ' . $_GET['key']; $sText = 'RewriteRule ^home/([^/.]+)/{0,1}$ index.php?module=home&key=$1 [QSA,L]'; } break; case 'frontpage': $sMac2 = 'class="active"'; $sTitle = 'Front Page'; $sText = 'RewriteRule ^frontpage/{0,1}$ index.php?module=frontpage [QSA,L]'; if (isset($_GET['value'])) { $sTitle .= ' - ' . (int)$_GET['value'] . ' page'; $sText = 'RewriteRule ^frontpage/([0-9]+)/{0,1}$ index.php?module=frontpage&value=$1 [QSA,L]'; } break; case 'maestros': $sMac3 = 'class="active"'; $sTitle = 'Music Legends'; $sText = 'RewriteRule ^maestros/{0,1}$ index.php?module=maestros [QSA,L]'; if (isset($_GET['key']) && isset($_GET['value'])) { $sTitle .= ' - ' . (int)$_GET['value'] . ' ' . $_GET['key']; $sText = 'RewriteRule ^maestros/([^/.]+)/([0-9]+)/{0,1}$ index.php?module=maestros&key=$1&value=$2 [QSA,L]'; } break; case 'kashmiripandits': $sMac4 = 'class="active"'; $sTitle = 'Kashmiri Pandits'; $sText = 'RewriteRule ^kashmiripandits/{0,1}$ index.php?module=kashmiripandits [QSA,L]'; if (isset($_GET['value1']) && isset($_GET['value2'])) { $sTitle .= ' - ' . (int)$_GET['value1'] . ' : ' . (int)$_GET['value2']; $sText = 'RewriteRule ^kashmiripandits/([0-9]+)/([0-9]+)/{0,1}$ index.php?module=kashmiripandits&value1=$1&value2=$2 [QSA,L]'; } break; case 'worldwide': $sMac5 = 'class="active"'; $sTitle = 'World Wide'; $sText = 'RewriteRule ^worldwide/{0,1}$ index.php?module=worldwide [QSA,L]'; break; case 'viewpoint': $sMac6 = 'class="active"'; $sTitle = 'View Point'; $sText = 'RewriteRule ^viewpoint/{0,1}$ index.php?module=viewpoint [QSA,L]'; break; case 'other': if (isset($_GET['key'])) { $sTitle = 'Other - ' . $_GET['key'] . ' (or, error 404, not found)'; $sText = 'RewriteRule ^([^/]+)/{0,1}$ index.php?module=other&key=$1 [QSA,L]'; } break; } } else { $sMac1 = 'class="active"'; } // Display main page $aKeys = array( '{url}' => 'http://www.kashmir-issue.com/', '{mact1}' => $sMac1, '{mact2}' => $sMac2, '{mact3}' => $sMac3, '{mact4}' => $sMac4, '{mact5}' => $sMac5, '{mact6}' => $sMac6, '{title}' => $sTitle, '{explanation}' => $sText, ); echo strtr(file_get_contents('index.html'), $aKeys);