<?php
/*
nSys 2.0 Flat - News System by b3.portal
HomePage: http://bosniamaj.co.cc
Theese are some main functions often used in the script
DO NOT EDIT IF YOU ARE NOT FAMILIAR WITH PHP PROGRAMMING
*/
/* Global functions */
/* Choose lang */
function ChooseLang($LangFile)
{
if(!is_file("../include/InstalledLangs.txt"))
{
$output="<div id=\"error\" class=\"Error\">Error! File with installed languages is missing, find it in your script folder and upload, or <a href=\"http://bosniamaj.co.cc\" target=\"_blank\">try to download the script again</a>.</div>";
}
else
{
$InstalledLangsFile=file("../include/InstalledLangs.txt", FILE_IGNORE_NEW_LINES);
$Counter=0;
foreach($InstalledLangsFile as $Number => $LangInfo)
{
$LangDetail=explode(" - ",$LangInfo);
if($LangFile==$LangDetail[1]) { $Counter++; $YourLang=$LangDetail[0]; }
}
if($Counter>0)
{
if(setcookie("nSysLang",$LangFile,time()+3600*24*365,"","")) { header("Location: ./."); $output="Your language is $YourLang and you will be redirected"; exit(); }
else { $output="<div id=\"error\" class=\"Error\">Error! To select language your cookies must be enabled, try to enable them in your browser, or <a href=\"mailto:hide@address.com\">report this problem to nSys 2.0 creator</a>.</div>"; }
}
else
{
$output="<div id=\"error\" class=\"Error\">Error! The language you are trying to select is not installed, contact your administrator.</div>";
}
}
return $output;
}
/* Choose lang */
/* Global functions */
?>