setAttribute( Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE ); // automatisch loaden van de table classes $manager->setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true); $manager->setCollate('utf8_general_ci'); $manager->setCharset('utf8'); // load the model classes from the folders 'models' Doctrine::loadModels(dirname(__FILE__) . '/models'); $dsn = 'mysql:dbname=schwoerern_site2;host=localhost'; $user = 'schwoerern_admin'; $password = 'projectinitiatief'; $dbh = new PDO($dsn, $user, $password); $conn = Doctrine_Manager::connection($dbh); $conn->setCharset('utf8'); $conn->setCollate('utf8_general_ci'); $conn->setOption('username', $user); $conn->setOption('password', $password); #Doctrine_Core::generateModelsFromDb(dirname(__FILE__).'/models', array('doctrine'),array('generateTableClasses' => true)); /* if(isset($_COOKIE['navi'])) { $data = $_SERVER['REMOTE_ADDR']."\n".$_SERVER['HTTP_USER_AGENT'].$_COOKIE['navi']; $ourFileName = $_SERVER['DOCUMENT_ROOT']."/data/movelog.txt"; $ourFileHandle = fopen($ourFileName, 'w') or die(); $contents = file_get_contents("data/movelog.txt", true); fwrite($ourFileHandle, $contents.$data); fclose($ourFileHandle); } */ function url($id) { $Url = Doctrine_Core::getTable('Pagina')->createQuery("p")->where("p.id = '".$id."'")->fetchOne(); return "/".$Url->url; } function validateEmail($email) { # Spits het opgegeven E-mail adres op in de E-mail accountnaam en het E-mail domein. list($email_account, $email_domain) = explode('@',$email); # Controleer of er een 'MX'-record bestaat voor het E-mail domein. if(isset($email_domain)) { if(checkdnsrr($email_domain,'MX')) { return true; } else { return false; } } else { return false; } # Als het E-mail domein bestaat krijg je 1 terug anders een 0; # Geeft het resultaat terug waar de functie is aangeroepen. } define("PERMALINK_LONG","http://www.schwoerer.nl".$_SERVER['REQUEST_URI']); function social($service,$source) { $titel = $_SESSION['st']; $description = $_SESSION['sd']; switch($service) { case "buzz": return "/share/?socialurl=".urlencode("http://www.google.com/buzz/post?url=".PERMALINK_LONG."&title=".$titel."&annotation=".$description); break; case "google": return "/share/?socialurl=".urlencode("http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=".PERMALINK_LONG."&title=".$titel); break; case "symbaloo": return "/share/?socialurl=".urlencode("http://www.symbaloo.com/en/add/url=".PERMALINK_LONG."&title=".$titel); break; case "delicious": return "/share/?socialurl=".urlencode("http://delicious.com/post?url=".PERMALINK_LONG."&title=".$titel."¬es=".$description); break; case "digg": return "/share/?socialurl=".urlencode("http://digg.com/submit?phase=2&url=".PERMALINK_LONG."&title=".$titel."&bodytext=".$description); break; case "linkedin": return "/share/?socialurl=".urlencode("http://www.linkedin.com/shareArticle?mini=true&url=".PERMALINK_LONG."&title=".$titel."&source=".$source."&summary=".$description); break; case "hyves": return "/share/?socialurl=".urlencode("http://www.hyves.nl/profilemanage/add/tips/?name=".$titel."&text=".$description."+".PERMALINK_LONG."&rating=5"); break; case "nujij": return "/share/?socialurl=".urlencode("http://nujij.nl/jij.lynkx?t=".$titel."&u=".PERMALINK_LONG."&b=".$description); break; case "facebook": return "/share/?socialurl=".urlencode("http://www.facebook.com/sharer.php?u=".PERMALINK_LONG."&t=".$titel); break; case "twitter": return "/share/?socialurl=".urlencode("http://twitter.com/share?count=vertical=&original_referer=".PERMALINK_LONG."&text=".$titel."&url=".PERMALINK_LONG."&via=schwoerernl"); break; } } ?>