Deleted some useless files.
[z3nb0x.git] / index.php
blob7979502275abe4b80356b8e6f65aea6d8de92469
1 <?php
2 // REQUIRE _____________________________________________________________
4 require_once(dirname(__FILE__)."/_inc/z3nb0x.class.php");
5 require_once(dirname(__FILE__)."/_inc/z3nErrorManager.class.php");
11 // SETTING UP A NEW Z3NB0X _____________________________________________
13 $z3nb0x = new z3nb0x();
20 // CHECKING OUT PHP SETTINGS ___________________________________________
22 // Drops an error if magic_quotes_gpc is On :
23 if(function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc())
25 $msg = dgettext("z3nb0x", "Bad PHP config !");
26 $exp = dgettext("z3nb0x", "I've detected that the PHP directive called <i>magic_quotes_gpc</i> is set to <i>On</i>. Please set it to <i>Off</i> in your <i>php.ini</i> file.");
28 $z3nb0x->getErrorManager()->addError(new z3nError($msg, $exp));
35 // CHECKING OUT USER DEFINED SETTINGS __________________________________
37 // Drops an error if z3nb0x path is empty :
39 $p = $z3nb0x->getInstallPath();
41 if(empty($p))
43 $msg = dgettext("z3nb0x", "Bad config !");
44 $exp = dgettext("z3nb0x", "Hey, I need to know where z3nb0x is installed. Please open the <i>Z3NB0X.ini</i> file and fill in your preferences.");
46 $z3nb0x->getErrorManager()->addError(new z3nError($msg, $exp));
48 else
50 // Drops an error if z3nb0x path cannot be found :
51 if(!is_dir($z3nb0x->getInstallPath()))
53 $msg = dgettext("z3nb0x", "Bad config !");
54 $exp = sprintf(dgettext("z3nb0x", "I wasnt able to find where z3nb0x is installed. Are you sure it is in %s ?"), "<i>".$z3nb0x->getInstallPath()."</i>");
56 $z3nb0x->getErrorManager()->addError(new z3nError($msg, $exp));
61 // Drops an error if z3nb0x cache path is empty :
63 $c = $z3nb0x->getCachePath();
65 if(empty($c))
67 $msg = dgettext("z3nb0x", "Bad config !");
68 $exp = dgettext("z3nb0x", "Hey, I need to know where you want me to store cached files. Please open the <i>Z3NB0X.ini</i> file and fill in your preferences.");
70 $z3nb0x->getErrorManager()->addError(new z3nError($msg, $exp));
72 else
74 // Drops an error if z3nb0x cache path cannot be found :
75 if(!is_dir($z3nb0x->getCachePath()))
77 $msg = dgettext("z3nb0x", "Bad config !");
78 $exp = sprintf(dgettext("z3nb0x", "I wasn't able to find your cache directory. Are you sure it is in %s ?"), "<i>".$z3nb0x->getCachePath()."</i>");
80 $z3nb0x->getErrorManager()->addError(new z3nError($msg, $exp));
82 else
84 // Drops an error if z3nb0x cache path is not writeable :
85 if(!is_writeable($z3nb0x->getCachePath()."/"))
87 $msg = dgettext("z3nb0x", "Bad config !");
88 $exp = sprintf(dgettext("z3nb0x", "I wasn't able to write in your cache directory (%s). Please chmod it so I can write in it."), "<i>".$z3nb0x->getCachePath()."</i>");
90 $z3nb0x->getErrorManager()->addError(new z3nError($msg, $exp));
96 // Drops an error if no theme were selected
98 $t = $z3nb0x->getTheme();
100 if(empty($t))
102 $msg = dgettext("z3nb0x", "Bad config !");
103 $exp = dgettext("z3nb0x", "Don't you want z3nb0x to look nice ? Please open the <i>Z3NB0X.ini</i> file and fill in your preferences.");
105 $z3nb0x->getErrorManager()->addError(new z3nError($msg, $exp));
107 else
109 // Drops an error if chosen theme doesn't exist :
110 if(!is_dir("_themes/".$z3nb0x->getTheme()))
112 $msg = dgettext("z3nb0x", "Bad config !");
113 $exp = sprintf(dgettext("z3nb0x", "I wasn't able to detect the theme you have chosen (%s). Please verify that the theme really exists in %s."), "<i>".$z3nb0x->getTheme()."</i>", "<i>".$z3nb0x->getInstallPath()."/_themes/</i>");
115 $z3nb0x->getErrorManager()->addError(new z3nError($msg, $exp));
123 // OKAY, LET'S DISPLAY SOMETHING _______________________________________
125 $z3nb0x->display();