/***
Swedish TVSAJTEN
***/
//Globals
$GLOBALS["langPageNotFound"] = "Sidan hittades inte på tvsajten!";
$GLOBALS["langErrorAjaxLoad"] = "Hämtningen av informationen misslyckades! Försök igen senare!";
$GLOBALS["langErrorVote"] = "Något blev fel vid hämtningen av röstresultat!";
$GLOBALS["langErrorClip"] = "Klippet hittades inte i vår databas!";
$GLOBALS["langDays"] = Array("söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag");
$GLOBALS["langMonths"] = Array("");
//Top menu
$GLOBALS["langTab"] = Array("TV-Tablå","Nyheter","Dumburken","Trailers","Dagens filmer & recensioner","Om..");
$GLOBALS["langSubmenuTv-tabla"] = Array("Utökad tablå","Minimal tablå","Skräddarsy tablån");
//$GLOBALS["langSubmenuTyck_till"] = Array("Forumet","Röstningsresultat");
$GLOBALS["langSubmenuOm"] = Array("Om TVSajten","Egen TV-tablå");
$GLOBALS["langLogoHome"] = "TV Sajten - Hem";
//captcha
$GLOBALS["langReloadCaptcha"] = "Ladda om sidan om inte bilden syns";
$GLOBALS["langCaptchaSecurity"] = "Säkerhetskontroll:";
$GLOBALS["langCaptchaText"] = "Skriv texten på bilden ovan:";
$GLOBALS["langCaptchaUnreadable"] = "Bilden oläslig?";
$GLOBALS["langCaptchaReloadLink"] = "Ladda om bilden!";
$GLOBALS["langCaptchaNoShow"] = "Bilden visar inget?";
$GLOBALS["langCaptchaReloadPage"] = "Ladda om sidan!";
//login
$GLOBALS["langForgotPassword"] = "Glömt lösenordet?";
$GLOBALS["langLoginButton"] = "Logga in";
$GLOBALS["langRegisterButton"] = "Registrera dig";
$GLOBALS["strHtmlTitle"] = "TVsajten TV-tablå. TV-Tablåer till TV med alla TVkanaler.";
$GLOBALS["strMetaDesc"] = '';
$GLOBALS["langTitle"] = Array("tv-tabla" => $GLOBALS["strHtmlTitle"],
"melodifestivalen" => "Senaste nytt inom Schlagervärlden, Melodifestivalen och Eurovision - TV Sajten, en smartare dumburk!",
"tv-nyheter" => "Senaste nytt i TV och Filmvärlden! - TV Sajten, en smartare dumburk!",
"dumburken" => "Roliga, fräcka och häftiga klipp! - TV Sajten, en smartare dumburk!",
"trailers" => "Aktuella trailers från bio-världen! - TV Sajten, en smartare dumburk!",
"recensioner" => "Recensioner och betyg av filmer! - TV Sajten, en smartare dumburk!",
"om" => "Kontakta oss eller använd vår egna tablå på din hemsida! - TV Sajten, en smartare dumburk!"
);
$GLOBALS["langDesc"] = Array("tv-tabla" => '',
"melodifestivalen" => '',
"tv-nyheter" => '',
"dumburken" => '',
"trailers" => '',
"recensioner" => '',
"om" => ''
);
?>
/***
Settings for TVSAJTEN
***/
//Basic settings
$GLOBALS["strHomePage"] = "http://".$_SERVER["HTTP_HOST"];
$GLOBALS["strPath2Home"] = "/var/www/tvsajten.se/www/";
$GLOBALS["strStartPage"] = "tv-tabla";
$GLOBALS["strCopyright"] = "© TVSAJTEN ".date("Y",time());
$GLOBALS["strAllowedPages"] = Array("tv-tabla","tv-nyheter","dumburken","svar_pa_tal","recensioner","om","samarbeten","trailers","sitemap");
$GLOBALS["strLinkTab"] = Array("tv-tabla","tv-nyheter","dumburken","trailers","recensioner","om");
//$GLOBALS["strLinksTv-tabla"] = Array("","kort","skraddarsy_tabla");
$GLOBALS["strLinksTv-tabla"] = Array("kort","","skraddarsy_tabla");
//$GLOBALS["strLinksTyck_till"] = Array("","rostningsresultat");
$GLOBALS["strLinksOm"] = Array("","egen_tabla");
//$GLOBALS["strLinksTv-nyheter"] = Array("test","test2");
$GLOBALS["tld"] = "http://".getenv("SERVER_NAME");
$GLOBALS["strSessionTime"] = 604800; //7 dagar
$GLOBALS["strNoLogin"] = $GLOBALS["strPath2Home"]."php/login/show_nologin.php";
$GLOBALS["strCaptcha"] = '$2a$F54¤%#=???½lsjl234fWWet(pp2352aEPqjsljweWERwlkjskLiljlwerhjERGCCCC¤#&())=($';
//HTML
$GLOBALS["strRobots"] = <<<_eof_
_eof_;
//$GLOBALS[""] = "";
function curPageURL() {
$pageURL = 'http';
if (@$_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
class mysql_db
{
var $db_user = 'root';
var $db_pass = 'inetsql1825';
var $db_host = 'localhost';
var $db_name = 'tv';
var $db_port = '3306';
var $query_result,$connect_id,$db_error;
function connect()
{
$this->connect_id = mysql_connect($this->db_host.":".$this->db_port,$this->db_user,$this->db_pass);
if ($this->connect_id)
{
if (mysql_select_db($this->db_name,$this->connect_id))
{
return $this->connect_id;
}
else
{
print $this->error();
exit;
}
}
else
{
print $this->error();
exit;
}
}
function error()
{
if (mysql_error() != '')
{
echo 'MySQL Error: '.mysql_error().'
'.$this->db_error;
exit;
}
}
function query($query)
{
$this->db_error = $query;
if ($query != NULL)
{
$this->query_result = mysql_query($query, $this->connect_id);
if (!$this->query_result)
{
return $this->error();
}
else
{
return $this->query_result;
}
}
else
{
return 'MySQL Error: Empty Query!';
}
}
function noLogin()
{
mysql_db::disconnect();
header("Location: ".$GLOBALS["tld"]."/index.php?error=4");
exit;
}
function noLoginText()
{
mysql_db::disconnect();
include_once($GLOBALS["strNoLogin"]);
exit;
}
function numRows($query_id = "")
{
if ($query_id == NULL)
{
$return = mysql_num_rows($this->query_result);
}
else
{
$return = mysql_num_rows($query_id);
}
if (!$return)
{
$this->error();
}
else
{
return $return;
}
}
function fetchRow($query_id = "")
{
if ($query_id == NULL)
{
$return = mysql_fetch_array($this->query_result, MYSQL_ASSOC);
}
else
{
$return = mysql_fetch_array($query_id, MYSQL_ASSOC);
}
if (!$return)
{
$this->error();
}
else
{
return $return;
}
}
function affectedRows($query_id = "")
{
if ($query_id == NULL)
{
$return = mysql_affected_rows($this->query_result);
}
else
{
$return = mysql_affected_rows($query_id);
}
if (!$return)
{
$this->error();
}
else
{
return $return;
}
}
function free($query_id = "")
{
if ($this->connect_id)
{
if ($query_id == NULL)
{
mysql_free_result($this->query_result);
}
else
{
mysql_free_result($query_id);
}
}
}
function disconnect()
{
if ($this->connect_id)
{
mysql_close($this->connect_id);
}
}
function getRow($select,$table,$sql)
{
if ($this->connect_id)
{
$check_db = mysql_db::query("SELECT ".$select." FROM ".$table." WHERE ".$sql);
$check_numrows = mysql_db::numRows();
if ($check_numrows > 0)
{
$get_db = mysql_db::fetchRow($check_db);
mysql_db::free($check_db);
return Array($check_numrows,$get_db);
}
else
{
return Array(0,Array());
}
}
}
} // end class
?>
class clean
{
function cleanDB($is)
{
return mysql_escape_string($is);
}
function onlyLettersAZ($is)
{
return preg_replace("[^a-zA-Z]","",$is);
}
function onlyLettersAndNumbers($is)
{
return preg_replace("[^a-zA-Z0-9_-]","",$is);
}
function onlyLetters($is)
{
return preg_replace("[^a-zA-ZÅÄÖåäö]","",$is);
}
function sessionClean($is)
{
return preg_replace("[^0-9a-zA-Z_-]","",$is);
}
function onlyNumbers($is="")
{
return preg_replace("[^0-9]","",$is);
}
function channelClean($is)
{
return preg_replace("[^0-9_-]","",$is);
}
function cleanHTML($is)
{
$is = trim($is);
$is = stripslashes($is);
$is = htmlspecialchars($is, ENT_QUOTES);
return $is;
}
function replaceBreakRow($is)
{
return preg_replace("/\r\n|\n\r|\n|\r/", "
", $is);
}
function checkEmailOK($is)
{
if (preg_match("/^[a-z0-9_]+([_\\.-][a-z0-9_]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/", $is))
{
return true;
}
else
{
return false;
}
}
} // end class
?>