This is my ubb code
the warning message i get is to see on this website it's a dutch website
Does any one have salution or can you change my ubb so it does work
link:
http://www.koistart.be/artikelen.php?actie=bekijken&artikelid=2
my guess of the problem is that getimagesize() doesn't work on my server of give's a fault on my server so if you can replace the img part i will be you very thankfull
ubb script:
<?php
function img_veranderen($img)
{
$maxwidth = 400; // De maximale breedte van het plaatje dat je meteen zien (400 is een mooi formaat)
$maxheight = 400; // De maximale hoogte van het plaatje dat je meteen zien (400 is een mooi formaat)
$size = getimagesize($img);
if($size[0] > $size[1])
{
if($size[0] > $maxwidth)
{
$width = $maxwidth;
$tel = $width/$size[0]*$size[1];
$height= round($tel,0);
}
else
{
$width = $size[0];
$height = $size[1];
}
}
else
{
if($size[1] > $maxheight)
{
$height = $maxheight;
$tel = $height/$size[1]*$size[0];
$width= round($tel,0);
}
else
{
$width = $size[0];
$height = $size[1];
}
}
if($size[0] < $maxwidth && $size[1] < $maxheight)
return '<img src='.$img.' width='.$width.' height='.$height.' />';
else
return '<a style="cursor:" href="javascript:void(0)" onClick="window.open(\''.$img.'\', \'popup\', \'height='.$size[1].', width='.$size[0].', fullscreen=no, location=no, menubar=no, status=no, toolbar=no, scrollbars=no, resizable=no\')"><img style="border: 1px #000000 dashed;" src='.$img.' width='.$width.' height='.$height.' alt="Klik op dit plaatje om voor de ware grootte" /></a>';
}
function opmaak($string,$html="1",$smilies="1") {
$GLOBALS['phphighlite'] = array("stupid_thing");
$string = preg_replace("_\[*code\](.*?)\[*/code\]_ise", "phphighlite_replace('\\1')", $string);
if($html == "1") {
$string=htmlentities($string, ENT_QUOTES);
}
if($smilies == "1") {
$search = array(":)", ":(", ":d", ";)", "(h)", ":p", ":s", "(i)", ":$", ":::;:", ":::nerd:::", ":::cool:::", "::9:6;;:", ":::evil:;;", ":::vinger:::", ";::lijst:;:", ":::bier:::", ";::king:::", ":::koffie:::", ":|:/::", ":::rukker:::", "[hr]");
$replace = array("<img src=\"images/smilies/blij.gif\" border=\"0\">", "<img src=\"images/smilies/n_blij.gif\" border=\"0\">", "<img src=\"images/smilies/lach.gif\" border=\"0\">", "<img src=\"images/smilies/knipoog.gif\" border=\"0\">", "<img src=\"images/smilies/stoer.gif\" border=\"0\">", "<img src=\"images/smilies/tong.gif\" border=\"0\">", "<img src=\"images/smilies/verbaasd.gif\" border=\"0\">", "<img src=\"images/smilies/idee.gif\" border=\"0\">", "<img src=\"images/smilies/rood.gif\" border=\"0\">", "<img src=\"images/smilies/tongue.gif\" border=\"0\">", "<img src=\"images/smilies/nerd.gif\" border=\"0\">", "<img src=\"images/smilies/cool.gif\" border=\"0\">", "<img src=\"images/smilies/worshippy.gif\" border=\"0\">", "<img src=\"images/smilies/evil.gif\" border=\"0\">", "<img src=\"images/smilies/vinger.gif\" border=\"0\">", "<img src=\"images/smilies/lijstje.gif\" border=\"0\">", "<img src=\"images/smilies/bier.gif\" border=\"0\">", "<img src=\"images/smilies/koning.gif\" border=\"0\">", "<img src=\"images/smilies/koffie.gif\" border=\"0\">", "<img src=\"images/smilies/professor.gif\" border=\"0\">", "<img src=\"images/smilies/rukker.gif\" border=\"0\">", "<hr>");
$string = str_replace($search, $replace, $string);
}
$string = preg_replace("_\[img\](.*?)\[\/img\]_ise", "img_veranderen('\\1')", $string);
$search = array("#\[u\](.*?)\[\/u\]#si", "#\[i\](.*?)\[\/i\]#si", "#\[b\](.*?)\[\/b\]#si", "#\[b\](.*?)\[\/b\]#si", "#\[quote\](.*?)\[\/quote\]#si", "_\[img\](.*?)\[/img\]_ise", "#\[url\]([a-z]+?://){1}(.*?)\[/url\]#si", "#\[url\](.*?)\[/url\]#si", "#\[url=([a-z]+?://){1}(.*?)\](.*?)\[/url\]#si", "#\[url=(.*?)\](.*?)\[/url\]#si", "#\[color=(.*?)\](.*?)\[/color\]#si", "#\[li\](.*?)\[/li\]#si");
$replace = array("<u>\\1</u>", "<i>\\1</i>", "<b>\\1</b>", "<center>\\1</center>", "<table width=\"98%\" align=\"center\" border=0 cellpadding=3 cellspacing=0><tr><td width=\"100%\"><small>Quote:</small></td></tr><tr><td width=\"100%\" style=\"border: #999999 1px solid\" bgcolor=#f8f8f8>\\1</td></tr></table> ", "img_veranderen('\\1','\\1')", "<a href=\"\\1\\2\" target=\"_blank\">\\1\\2</a>", "<a href=\"http://\\1\" target=\"_blank\">\\1</a>", "<a href=\"\\1\\2\" target=\"_blank\">\\3</a>", "<a href=\"http://\\1\" target=\"_blank\">\\2</a>", "<font color=\"\\1\">\\2</font>", "<li>\\1</li>");
$string = preg_replace($search, $replace, $string);
$string = eregi_replace("\\[google=([^]]+)\\]","<a href='http://www.google.nl/search?q=\\1' target='_blank' title='Zoeken op google naar \\1'><u>\\1 </u></a>",$string);
$string = preg_replace('!\[me=((\w)*?)\]!', "<font color=\"#FF0000\">* \\1</font>", $string);
$string = str_replace('[li]', "<li>", $string);
$string = str_replace('[/li]', "</li>", $string);
$string = preg_replace('!\[me\]((.|\n)*?)\[/me\]!', "<font color=\"#FF0000\">* \\1</font>", $string);
$string = eregi_replace("(^|[>[:space:]\n])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])([<[:space:]\n]|$)", "\\1<a href=\"\\2://\\3\\4\" target=\"_blank\">\\2://\\3\\4</a>\\5", $string);
$string = eregi_replace("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})", "<a href=\"mailto:\\1\">\\1</a>", $string);
$string = nl2br($string);
$string = preg_replace("_\[*code\]([0-9])\[*/code\]_ise", "phphighlite('\\1')", $string);
return $string;
}
function phphighlite_replace($code) {
$code = trim(str_replace("\\\"", "\"", $code));
if(empty($code)) {
return "even verwijderd";
} else {
array_push($GLOBALS['phphighlite'], $code);
return "[code]".(count($GLOBALS['phphighlite'])-1)."[*/code]";
}
}
function phphighlite($id, $fixed=1) {
$page_popup = "";
// popup
if(isset($GLOBALS['phphighlite_tabel']) && isset($GLOBALS['phphighlite_id'])) {
GLOBAL $page;
if(isset($page)) {
$page_popup = "&page=".$page;
}
$extra = "<a href=\"code.php?id=".$GLOBALS['phphighlite_id']."&code=".$id."&type=text_veld\" target=\"new\"><img src=\"images/code_venster.gif\" alt=\"Code in een nieuw venster\" border=0></a> <a href=\"code.php?id=".$GLOBALS['phphighlite_id']."&code=".$id."&type=veld\" target=\"new\"><img src=\"images/code_textveld.gif\" alt=\"Code in een textveld\" border=0></a>";
} else {
$extra = "";
$GLOBALS['phphighlite_id'] = 0;
}
$code = $GLOBALS['phphighlite'][$id];
$splitted = explode("\n", $code);
$grootte = count($splitted)+1;
if(!strpos($code,"<?") && substr($code,0,2)!="<?") {
$code="<?".trim($code)."?>";
$addedtags=1;
}
$lid = "SELECT * FROM code WHERE codeid = '".$GLOBALS['phphighlite_id']."' AND type = 'text_veld' AND tid = '".$id."'";
$sql = mysql_query($lid);
$list = mysql_fetch_object($sql);
if($list->code == $code){
$bestaat = 1;
} else {
$bestaat = 0;
}
if($bestaat == 0)
{
mysql_query("INSERT INTO code (id, type, tid, codeid, code) VALUES ('', 'text_veld', '".$id."', '".$GLOBALS['phphighlite_id']."', '".addslashes($code)."')")or die(mysql_error());
$code__id = mysql_insert_id();
} else {
mysql_query("UPDATE code SET code = '".addslashes($code)."' WHERE id = '".$code__id."' ")or die(mysql_error());
}
ob_start();
$oldlevel=error_reporting(0);
highlight_string($code);
error_reporting($oldlevel);
$buffer = ob_get_contents();
ob_end_clean();
if(!empty($addedtags)) {
$openingpos = strpos($buffer,'<?');
$closingpos = strrpos($buffer, '?');
$buffer = substr($buffer, 0, $openingpos).substr($buffer, $openingpos+5, $closingpos-($openingpos+5)).substr($buffer, $closingpos+5);
}
// Regel nummers
$regel_nrs = '';
for($i=1; $i<$grootte; $i++) {
$regel_nrs .= $i."<br>\n";
}
// Einde regel nummers
$return = "<table style='table-layout: fixed; border: solid #E0E0E0; border-width: 1px; width: 95%' cellspacing='1' cellpadding='1'bgcolor='#F6F6F6'><tr><td width='90%' nowrap><img src=\"images/script.gif\" alt=\"\" border=0> <b>Code:</b></font></td> <td width='10%' nowrap>
<p align='right'>".$extra."</td>
</tr></table><br /> <table style='table-layout: fixed; border: solid #E0E0E0; border-width: 1px; width: 95%' cellspacing='1' cellpadding='1' bgcolor='#F6F6F6'> <tr> <td width='5%' bgcolor=\"#f1f1f1\" nowrap valign='top' align='top' style=\"border-right: 1px solid #E0E0E0\">
".$regel_nrs."</td><td width='86%' nowrap valign='top' align='top' bgcolor='#ffffff'>".$buffer."</td></tr></table>";
return $return;
}
function qoute($bericht) { // Zorgen dat er maar 1 qoute in een bericht staat...
$bericht = preg_replace("#\[quote\].*?\[/quote\]#si", "[...]", $bericht);
return stripslashes($bericht);
}
function kort_in(){
//
}
?>