public function __construct()
{
+ /* Check necessary requirements */
+ if(!$this->checkRequirements()) {
+ exit(1);
+ }
+
$this->cfg = new PHPFSPOT_CFG;
$this->db = new PHPFSPOT_DB(&$this, $this->cfg->fspot_db);
$this->tmpl->assign('searchfor', $_SESSION['searchfor']);
$this->tmpl->assign('page_title', $this->cfg->page_title);
$this->tmpl->assign('current_condition', $_SESSION['tag_condition']);
+
+ switch($_GET['mode']) {
+ case 'showpi':
+ if(isset($_GET['tags'])) {
+ $_SESSION['selected_tags'] = split(',', $_GET['tags']);
+ }
+ break;
+ }
+
+ $this->tmpl->assign('content_page', 'welcome.tpl');
$this->tmpl->show("index.tpl");
+
} // show()
private function get_tags()
if($end_with < $count)
$this->tmpl->assign("next_url", "javascript:showPhotoIndex(". $next_start .");");
}
-
+
+ $current_tags = "";
+ foreach($_SESSION['selected_tags'] as $tag)
+ $current_tags.= $tag .",";
+ $current_tags = substr($current_tags, 0, strlen($current_tags)-1);
+ $extern_link = "http://". $_SERVER['SERVER_NAME'] ."/index.php?mode=showpi&tags=". $current_tags;
+
+ $this->tmpl->assign('extern_link', $extern_link);
$this->tmpl->assign('count', $count);
$this->tmpl->assign('width', $this->cfg->thumb_width);
$this->tmpl->assign('images', $images);
} // get_photo_tags()
- function showTextImage($txt, $color=000000, $space=4, $font=4, $w=300)
+ public function showTextImage($txt, $color=000000, $space=4, $font=4, $w=300)
{
if (strlen($color) != 6)
$color = 000000;
} // showTextImage()
+ private function checkRequirements()
+ {
+ if(!function_exists("imagecreatefromjpeg")) {
+ print "PHP GD library extension is missing<br />\n";
+ $missing = true;
+ }
+
+ if(!function_exists("sqlite3_open")) {
+ print "PHP SQLite3 library extension is missing<br />\n";
+ $missing = true;
+ }
+
+ /* Check for HTML_AJAX PEAR package, lent from Horde project */
+ ini_set('track_errors', 1);
+ @include 'HTML/AJAX/Server.php';
+ if(isset($php_errormsg)) {
+ print "PEAR HTML_AJAX package is missing<br />\n";
+ $missing = true;
+ }
+ ini_restore('track_errors');
+
+ if(isset($missing))
+ return false;
+
+ return true;
+
+ } // checkRequirements()
+
+
}
?>