require_once("mail.php"); //connectTo123Inkt(); //default connection; connectToSiteDB(); //Tempory fix, because the 123inkt DB cant be used. function connectTo123Inkt() { global $_DBHOST,$_DBUSER, $_DBPASS, $_DBNAME; /* if(!mysql_connect($_DBHOST, $_DBUSER, $_DBPASS)){ $msg = "Waarschijnlijk is de mysql server down, meld dit a.u.b. aan de beheerder"; sendMail::ERROR("Database connection error",$msg); if( !@mysql_select_db($_DBNAME) ) { $msg = "Deze database is helaas niet toegankelijk"; sendMail::ERROR("Database connection error",$msg); } } */ } function connectToSiteDB() { global $_DBHOST_SITE, $_DBUSER_SITE, $_DBPASS_SITE,$_DBNAME_SITE; mysql_close(); if(!mysql_connect($_DBHOST_SITE, $_DBUSER_SITE, $_DBPASS_SITE)){ $msg = "Waarschijnlijk is de mysql server down, meld dit a.u.b. aan de beheerder"; sendMail::ERROR("Database connection error",$msg); if( !@mysql_select_db($_DBNAME_SITE) ) { $msg = "Deze database is helaas niet toegankelijk"; sendMail::ERROR("Database connection error",$msg); } } } ?> /* * * usage: * $groupListUrl = getGroupListUrl($currentgroupid); * generateUrl($groepid, $groepnaam [, $groupListUrl]); * * generateTitle($listgroup) * */ function replace_accents($str) { $str = htmlentities($str); $str = preg_replace('/&([a-zA-Z])(uml|acute|grave|circ|tilde);/','$1',$str); return html_entity_decode($str); } function generateUrl($g,$n,$url = false) { global $_DOMAIN; $domain = $_DOMAIN; $baseurl = $domain."shop/group"; //return $baseurl; $n = trim($n); $n = str_replace("/", "_", $n); $urlsuffix = "/".$n."_".$g.".html"; if (!$url) $url = getpregroup($g); // dit duurt te lang (>=1sec) als je veel links op 1 page hebt... en dan is t ook overbodig werk! $return = $baseurl . $url . $urlsuffix; $return = ereg_replace("[ _]+", "_", $return); $removechars = array("(", ")", ",", '#', "'",'"'); $return = str_replace($removechars, "", $return); return replace_accents($return); // watch out ... site not yet in utf8 return replace_accents(utf8_decode($return)); } function generateTitle($g) { // dit duurt te lang (>=1sec) als je veel links op 1 page hebt... en dan is t ook overbodig werk! $q = mysql_query("SELECT groupname FROM `".DBGLOBAL."`.`category_description` WHERE lang='".SITE."' AND groupid = '$g'"); if (mysql_num_rows($q) > 0) { $n = trim(mysql_result($q,0,'groupname')); $title = "$n /"; $title .= getRpregroup($g); //$return = str_replace("/", ", ", substr($title,1)); $return = str_replace("/", ", ", $title); return $return; } else return 0; } function getGroupListUrl($g) { global $_LANGUAGE, $_DBNAME; //return $baseurl; $n = trim(@mysql_result(@mysql_query("SELECT groupname FROM `".$_DBNAME."`.`category_description` WHERE lang='".$_LANGUAGE."' AND groupid = '$g'"),0,'groupname')); $n = str_replace("/", "_", $n); $url = getpregroup($g) . "/" . $n; $return = $url; $return = ereg_replace("[ _]+", "_", $return); $removechars = array("(", ")", ",", '#', "'",'"'); $return = str_replace($removechars, "", $return); return $return; } function getpregroup($pregroup) { global $_LANGUAGE, $_DBNAME; $q = mysql_query("SELECT `subgroupof_id` , groupname FROM `".$_DBNAME."`.`category_links` LEFT JOIN `".$_DBNAME."`.`category_description` ON `".$_DBNAME."`.`category_links`.`subgroupof_id` = `".$_DBNAME."`.`category_description`.groupid WHERE lang='".$_LANGUAGE."' AND `".$_DBNAME."`.`category_links`.groupid = '$pregroup'"); if (mysql_num_rows($q) > 0) { $y = $return = ""; while ($crow = mysql_fetch_assoc($q)) { $n = $crow['groupname']; $n = str_replace("/", "_", $n); $y .= getpregroup($crow['subgroupof_id']); $return .= $y . "/" . trim($n); } return $return; } } function getRpregroup($pregroup) { $q = mysql_query("SELECT `subgroupof_id` , groupname FROM `".DBGLOBAL."`.`category_links` LEFT JOIN `".DBGLOBAL."`.`category_description` ON `".DBGLOBAL."`.`category_links`.`subgroupof_id` = `".DBGLOBAL."`.`category_description`.groupid WHERE lang='".SITE."' AND `".DBGLOBAL."`.`category_links`.groupid = '$pregroup'"); if (mysql_num_rows($q) > 0) { $y = $return = ""; while ($crow = mysql_fetch_assoc($q)) { $n = $crow['groupname']; $n = str_replace("/", "_", $n); $y = getRpregroup($crow['subgroupof_id']) . $y; $return .= trim($n) . "/" . $y ; } return $return; } } ?> if (file_exists($_SERVER['DOCUMENT_ROOT']."/micro-site/config.inc.php")) require_once($_SERVER['DOCUMENT_ROOT']."/micro-site/config.inc.php"); // Config file else if (file_exists($_SERVER['DOCUMENT_ROOT']."/config.inc.php")) require_once($_SERVER['DOCUMENT_ROOT']."/config.inc.php"); // Config file else require_once("config.inc.php"); //configuratie file. //slaat plaatje op, kijkt wel even of deze een logische aspectratio heeft. function savePicture( $source, $name ) { global $_PICTURE_WIDTH_THUMB, $_PICTURE_WIDTH_NORMAL, $_IMAGE_DIR; $destination_tumb = $_SERVER['DOCUMENT_ROOT'].$_IMAGE_DIR.$name."_tumb.jpg"; $destination_norm = $_SERVER['DOCUMENT_ROOT'].$_IMAGE_DIR.$name.".jpg"; // Get image size list($width, $height, $type, $attr) = @getimagesize($source); if( $width == 0 || $height == 0) { return false; } // Create temp image according to type switch ($type) { case 1: $oldImg = @imagecreatefromgif($source); break; case 2: $oldImg = @imagecreatefromjpeg($source); break; case 3: $oldImg = @imagecreatefrompng($source); break; } if( $oldImg == "" ) { return false; //imagecreatefromX is mislukt.. dus stop maar. } //create $aspectratio = $width/$height; //if( $aspectratio > 1.7 || $aspectratio < 0.6 ) // return false; //Vreemde afmeting... zal wel geen plaatje van printer zijn. //Save tumbnail if($width > $_PICTURE_WIDTH_THUMB) { //Resize image according to ratio $newHeight = round($_PICTURE_WIDTH_THUMB / $aspectratio); $newImg = imagecreatetruecolor($_PICTURE_WIDTH_THUMB, $newHeight); imagecopyresampled ($newImg, $oldImg, 0, 0, 0, 0, $_PICTURE_WIDTH_THUMB, $newHeight, $width, $height); // Save the picture imagejpeg($newImg, $destination_tumb, 90); } else { //just copy it copy($source,$destination_tumb); } //Save normal sized picture if($width > $_PICTURE_WIDTH_NORMAL) { //Resize image according to ratio $newHeight = round($_PICTURE_WIDTH_NORMAL / $aspectratio); $newImg = imagecreatetruecolor($_PICTURE_WIDTH_NORMAL, $newHeight); imagecopyresampled ($newImg, $oldImg, 0, 0, 0, 0, $_PICTURE_WIDTH_NORMAL, $newHeight, $width, $height); // Save the picture imagejpeg($newImg, $destination_norm, 90); } else { //just copy it copy($source,$destination_norm); } //change chmod chmod($destination_tumb, 0777); chmod($destination_norm, 0777); return true; } ?> function createFooter($_FOOTERSECTION) { $output = ""; $output .= "