$val){ $tekst=str_replace($key,$val,$tekst); } return $tekst; } function valuta($bedrag,$soort="Ä",$kleur="#000000",$width='75',$nvtTekst="n.v.t."){ if($bedrag){ $bedrag=round($bedrag,2); $exp=explode(".",$bedrag); $omgedraait= strrev($exp[0]); $metpunten=chunk_split($omgedraait,3,"."); $teruggedraait=strrev($metpunten); if(substr($teruggedraait,0,1)=="."){ $eind=substr($teruggedraait,1); }else{ $eind=$teruggedraait; } if(strlen($exp[1])==0){ $komma="00"; } elseif(strlen($exp[1])==1){ $komma=$exp[1]."0"; } else{ $komma=$exp[1]; } $output="
".$soort."".$eind.",".$komma."
"; return $output; }else{ return $nvtTekst; } } function in_prullenbak($naam,$in,$id){ $show=mysql_fetch_assoc(mysql_query("select * from ".$in." where id=".$id)); mysql_query("INSERT INTO `prullenbak` ( `id` , `naam` , `inhoud` , `in` ) VALUES ( '', '".$naam."', '".serialize($show)."', '".$in."')"); mysql_query("delete from ".$in." where id=".$id); } function bijbehorend($id,$koppel=0){ if($koppel==0){ $query=mysql_query("select * from shop_koppel where met='".$id."'") or die(mysql_error()); if(mysql_num_rows($query)>0){ return true; }else{ return false; } }else{ $query=mysql_query("select * from shop_koppel where met='".$id."' and koppel='".$koppel."'") or die(mysql_error()); if(mysql_num_rows($query)>0){ return true; }else{ return false; } } } function uit_prullenbak($id){ $show=mysql_fetch_assoc(mysql_query("select * from prullenbak where id=".$id)); $inhoud=unserialize($show['inhoud']); mysql_query("INSERT INTO `".$show['in']."` (`id`) VALUES ('".$inhoud['id']."')"); foreach($inhoud as $key=>$val){ mysql_query("update ". $show['in'] . " set `".$key."`='".$val."'"); } mysql_query("delete from prullenbak where id=".$id)or die(mysql_error()); } function rollbut($naam,$begin,$over=NULL,$to=NULL,$click=NULL,$target=NULL){ #start script $out=""; #maak link if(!empty($to)){ $out.=""; } #maak plaatje begin $out .="$val){ $tekst=str_replace($key,"",$tekst); } return $tekst; } function goUrl($url,$aant='1'){ $ondercontent=implode("",file("pages/onderhtml.php")); if($url=="back"){ die(' Actie succesvol uitgevoerd. Je word over 3 seconden terug gestuurd pagina gestuurd. Klik hier om al te gaan.'.$ondercontent); }else{ header("location:".$url); die(); }} function user($id,$back){ $show=mysql_fetch_assoc(mysql_query("select * from `user` where id ='".$id."'")); $out=$show[$back]; return $out; } function datum($datum){ $out=date("d-m-y \o\m H:i:s",$datum); return $out; } ## Wat variablen definiŽren ## $UserIP = $_SERVER['REMOTE_ADDR']; $UserID = ( !IsSet( $eigenid )) ? 0 : $eigenid; $Pagina = ( empty( $_SERVER['REQUEST_URI'] )) ? 'Onbekend' : $_SERVER['REQUEST_URI']; ## Oude (inactieve) records verwijderen ## mysql_query( "Delete From online Where tijd < ".( time() - 300 )."" ); $S_online = mysql_query( "Select * From online Where userid = '".$UserID."'" ); if( !mysql_num_rows( $S_online )) { ## Okť, nog geen record gevonden, toevoegen dus :) ## mysql_query( "Insert Into online (id , userid, ip, pagina, tijd) VALUES ('' , '".$UserID."' , '".$UserIP."' , '".$Pagina."' , '".time()."')" ); } else { ## Al een record aanwezig, updaten dus :) ## mysql_query( "Update online Set pagina = '".$Pagina."', tijd = '".time()."' Where userid = '".$UserID."'" ); } function parse($tekst,$emoticons=NULL,$html=NULL){ # if(empty($html)){ #$tekst=htmlspecialchars($tekst); #$tekst=nl2br($tekst); #} // [b], [u], [i] en [s] $tekst = preg_replace('!\[u\](.*?)\[/u\]!', "\\1", $tekst); $tekst = preg_replace('!\[b\](.*?)\[/b\]!', "\\1", $tekst); $tekst = preg_replace('!\[i\](.*?)\[/i\]!', "\\1", $tekst); $tekst = preg_replace('!\[s\](.*?)\[/s\]!', "\\1", $tekst); $tekst = preg_replace('!\[art\](.*?)\[/art\]!', "", $tekst); // letter grootte $tekst = preg_replace("#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#si", "\\2", $tekst); // letter kleur $tekst = preg_replace("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "\\2", $tekst); // de /me code na maken met [me] en [me=] tags $tekst = preg_replace('!\[me=((\w)*?)\]!', "* \\1", $tekst); $tekst = preg_replace('!\[me\]((.|\n)*?)\[/me\]!', "* \\1", $tekst); // tags om een lijst te maken $tekst = str_replace("[list]", "", $tekst); $tekst = str_replace("[/listo]", "", $tekst); $tekst = preg_replace("/\[list=([a1])\]/si", "
    ", $tekst); $tekst = preg_replace( "#\[quote\](.*?)\[\/quote\]#si" , '
    quote:
    \\1
    ' , $tekst); // de [url=][/url] en [url=][/url] tags $tekst = eregi_replace("\[url\][[:space:]]*(http://)?([^\\[]*)[[:space:]]*\[/url\]", "\\2", $tekst); $tekst = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","\\2",$tekst); // maak automatisch van [url=http://www.site.nl]http://www.site.nl[/url] een link $tekst = preg_replace("#([\n ])([a-z]+?)://([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)#i", "\\1\\2://\\3", $tekst); // maak automatisch van www.site.nl een link $tekst = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)?)#i", "\\1www.\\2.\\3\\4", $tekst); // maak automatisch van jan@jan.nl een email-link $tekst = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1\\2@\\3", $tekst); // de [img][/img] tag $tekst = preg_replace("#\[img\](http(s)?://)([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\[/img\]#si", "", $tekst); if(!empty($html)){ $tekst=preg_replace_callback("[\[ADD_GB\]]", "gb",$tekst); $tekst=preg_replace_callback("[\[ADD_FORUM\]]", "forum",$tekst); $tekst=preg_replace_callback("[\[ADD_NIEUWS\]]", "nieuws",$tekst); $tekst=preg_replace_callback("[\[ADD_FOTO\]]", "fotos",$tekst); $tekst=preg_replace_callback("[\[ADD_LOGIN\]]", "ubb_login",$tekst); $tekst=preg_replace_callback("[\[ADD_LOGUIT\]]", "ubb_loguit",$tekst); $tekst=preg_replace_callback("[\[ADD_USERS\]]", "ubb_users",$tekst); $tekst=preg_replace_callback("[\[ADD_SHOP\]]", "shop",$tekst); $tekst=preg_replace_callback("[\[ADD_MANDJE\]]", "mandje",$tekst); $tekst=preg_replace_callback("[\[ADD_SITES\]]", "sites",$tekst); $tekst=preg_replace_callback("[\[ADD_NIEUWSBRIEF\]]", "nieuwsbrief",$tekst); $tekst=preg_replace_callback("[\[ADD_REGISTER\]]", "ubb_aanmelden",$tekst); $tekst = eregi_replace("\\[reactie=([^\\[]*)\\]([^\\[]*)\\[/reactie\\]","\\2",$tekst); $tekst = eregi_replace("\\[mailform\\]",'
    ',$tekst); $tekst = eregi_replace("\\[tekst_k=([^\\[]*)\\]","",$tekst); $tekst = eregi_replace("\\[tekst_g=([^\\[]*)\\]","",$tekst); $tekst = eregi_replace("\\[/mailform\\]",'
    \\1
    \\1
    ',$tekst); } if (empty($emoticons)){ $tekst=smile_parse($tekst); } return $tekst; } function k_serialize($array){ $i=1; $out=NULL; foreach($array as $key=>$val){ if($i!=1){ $out.="}]|[{"; } $out.=$key."}]=[{".$val; $i++; } $out=str_replace("'","}]q[{",$out); if(!is_array($array)){ $out="0}]=[{}]|[{}]=[{0"; } return $out; } function k_unserialize($string){ $exp1=explode("}]|[{",$string); if(count($exp1)>1){ $out=NULL; foreach($exp1 as $key=>$val){ $exp2=explode("}]=[{",$val); $out[str_replace("}]q[{","'",$exp2[0])]=$exp2[1]; } }else{ $out="Dit is geen array"; } return $out; } function email($to, $subject, $message,$nl2br=true) { global $config; if($nl2br){ $message=nl2br($message); } $expto=explode("@",$to); $nameto=$expto[0]; $from=$config['mail']["from"]; $namefrom=$config['mail']["namefrom"]; $smtpServer = $config['mail']["smtp"]["server"]; //ip address of the mail server. This can also be the local domain name $port = $config['mail']["smtp"]["port"]; // should be 25 by default, but needs to be whichever port the mail server will be using for smtp $timeout = $config['mail']["smtp"]["timeout"]; // typical timeout. try 45 for slow servers $username = $config['mail']["smtp"]["user"]; // the login for your smtp $password = $config['mail']["smtp"]["pass"]; // the password for your smtp $localhost = "127.0.0.1"; // Defined for the web server. Since this is where we are gathering the details for the email $newLine = "\r\n"; // aka, carrage return line feed. var just for newlines in MS $secure = $config['mail']["smtp"]["secure"]; // change to 1 if your server is running under SSL //connect to the host and port $smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout); $smtpResponse = fgets($smtpConnect, 4096); if(empty($smtpConnect)) { $output = "Failed to connect: $smtpResponse"; // echo $output; return $output; } else { $logArray['connection'] = "

    Connected to: $smtpResponse"; // echo "

    connection accepted
    ".$smtpResponse."

    Continuing

    "; } //you have to say HELO again after TLS is started fputs($smtpConnect, "HELO $localhost". $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['heloresponse2'] = "$smtpResponse"; //request for auth login fputs($smtpConnect,"AUTH LOGIN" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['authrequest'] = "$smtpResponse"; //send the username fputs($smtpConnect, base64_encode($username) . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['authusername'] = "$smtpResponse"; //send the password fputs($smtpConnect, base64_encode($password) . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['authpassword'] = "$smtpResponse"; //email from fputs($smtpConnect, "MAIL FROM: <$from>" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['mailfromresponse'] = "$smtpResponse"; //email to fputs($smtpConnect, "RCPT TO: <$to>" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['mailtoresponse'] = "$smtpResponse"; //the email fputs($smtpConnect, "DATA" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['data1response'] = "$smtpResponse"; //construct headers $headers = "MIME-Version: 1.0" . $newLine; $headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine; //$headers .= "To: \"$nameto\"<$to>" . $newLine; $headers .= "From: \"$namefrom\"<$from>" . $newLine; //observe the . after the newline, it signals the end of message fputs($smtpConnect, "To: $to \r\nSubject: $subject\r\n$headers\r\n\r\n$message\r\n.\r\n"); $smtpResponse = fgets($smtpConnect, 4096); $logArray['data2response'] = "$smtpResponse"; // say goodbye fputs($smtpConnect,"QUIT" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['quitresponse'] = "$smtpResponse"; $logArray['quitcode'] = substr($smtpResponse,0,3); fclose($smtpConnect); //a return value of 221 in $retVal["quitcode"] is a success return($logArray); } include("log.php"); include("loadhtmla.php"); ?> No such file or directory