global $_GET, $_REQUEST, $_SESSION, $distros, $lang;
require_once("quiz/Const.php");
require_once("conf/config.php");
require_once("conf/database.php");
// real head
session_start();
function strrevpos($instr, $needle)
{
$rev_pos = strpos (strrev($instr), strrev($needle));
if ($rev_pos===false) return false;
else return strlen($instr) - $rev_pos - strlen($needle);
}
function after_last ($this, $inthat)
{
if (!is_bool(strrevpos($inthat, $this)))
return substr($inthat, strrevpos($inthat, $this)+strlen($this));
}
function before_last ($this, $inthat)
{
return substr($inthat, 0, strrevpos($inthat, $this));
}
function getPageName()
{
$str = $_SERVER['SCRIPT_NAME'];
$str = after_last("/", $str);
$str = before_last(".", $str);
return $str;
}
/**/
$params = "";
if($_REQUEST['css']!=null)
{
$params.="&css=";
$params.=$_REQUEST['css'];
}
if($_REQUEST['lang']!=null)
{
if($params=="")
$params.="&lang=";
else
$params.="&lang=";
$params.=$_REQUEST['lang'];
}
$pageName=getPageName();
/*
$site = $pageName;
$site.=".php";
header("location: http://brustracja.sf.net/linux/".$site.$params);
*/
if(in_array($pageName,$distros))
{
// print("http://".SITE_ADDRESS.SITE_PREFIX."distros.php?id=".$pageName);
header("location: http://".SITE_ADDRESS.SITE_PREFIX."/distro.php?id=".$pageName.$params);
exit(0);
}
$lang = $_SESSION['lang'];
if($_GET['css'] != null)
$style = $_GET['css'];
else if($_SESSION['css']!=null)
$style = $_SESSION['css'];
else
// $style="style_bw.css";
$style="style_dotted.css";
$_SESSION['css'] = $style;
?>
jakilinux.org »
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 94
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 94
Notice: Undefined index: distro1 in /sites/polishlinux.org/include/head_utf8.php on line 100
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 104
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 104
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 110
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 117
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 124
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 128
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 130
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 132
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 138
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 145
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 152
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 159
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 166
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 173
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 175
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 182
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 189
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 196
Notice: Undefined variable: pageName in /sites/polishlinux.org/include/head_utf8.php on line 206
require_once("conf/config.php");
require_once("quiz/Distro.php");
global $excludes;
// this is used i.e. for specifying which systems DO NOT appear in the "Compare this system with" list
$excludes = "distro_features.distro_name NOT IN ('PCBSD', 'DesktopBSD')";
function getDistrosTable()
{
$link = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$link)
{
return false;
}
else
$db = mysql_select_db(DB_NAME);
$array = array();
$sql = "SELECT distro_features.* FROM distro_features LEFT JOIN wp_endistro distro ON distro.distro_name=distro_features.distro_name ORDER BY distro_popularity ASC";
// print($sql);
$result = mysql_query($sql,$link);
while ($record = mysql_fetch_array ($result))
{
array_push($array, $record);
}
return $array;
}
function getDistros()
{
global $excludes;
$link = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$link)
{
return false;
}
else
$db = mysql_select_db(DB_NAME);
$array = array();
$sql = "SELECT distro.distro_name FROM distro_features LEFT JOIN distro ON distro.distro_name=distro_features.distro_name WHERE ".$excludes." ORDER BY popularity ASC";
// print($sql);
$result = mysql_query($sql,$link);
while ($record = mysql_fetch_array ($result))
{
array_push($array, $record);
}
return $array;
}
function getDistroFeatures($distroName)
{
global $excludes;
$link = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$link)
{
return false;
}
else
$db = mysql_select_db(DB_NAME);
$array = array();
$sql = sprintf("SELECT * FROM distro_features WHERE distro_name='%s' AND ".$excludes, $distroName);
$result = mysql_query($sql,$link);
$record = mysql_fetch_array ($result);
return $record;
}
function getDistro($distroName, $lang)
{
global $_SESSION;
$link = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$link)
{
return false;
}
else
$db = mysql_select_db(DB_NAME);
$array = array();
$sql = sprintf("SELECT * FROM distro WHERE distro_name='%s'", $distroName);
print($sql);
$result = mysql_query($sql,$link);
$record = mysql_fetch_array ($result);
if($lang!='pl')
$appendLang = "_".$lang;
$distro = new Distro($record['DISTRO_NAME'], $record['DISTRO_SCRIPT'], $record['DISTRO_LONG_NAME'], $record['lead'.$appendLang], $record['body'.$appendLang], $record['pros'.$appendLang], $record['cons'.$appendLang], $record['links'.$appendLang], $record['reviews'.$appendLang], $record['download'.$appendLang], $record['screenshots'.$appendLang], $record['footer']);
$distro->id = $record['ID'];
$distro->lastModDate = $record['LAST_MOD_DATE'];
return $distro;
}
?>