"; if ($users==1){ $o.=$plugin_cf['online']['first_part_singular']; $o.=" " . $users . " "; $o.= $plugin_cf['online']['last_part_singular']; } else { $o.=$plugin_cf['online']['first_part_plural']; $o.=" " . $users . " "; $o.= $plugin_cf['online']['last_part_plural']; } $o.="

"; return $o; } ?>",$sbmessage); $sbmessage = str_replace(chr(13),"
",$sbmessage); $sbmessage = str_replace(chr(10),"
",$sbmessage); $sbmessage = str_replace(";",",",$sbmessage); if(eregi("true",$plugin_cf['sblog']['cleanText'])){ $sbmessage = sb_cleantext(stripslashes($sbmessage)); } if (!$fp = fopen($sbfile, 'a')) { $tvari.="
ERROR: Cannot open file ($sbfile)"; } else { if(eregi("true",$plugin_cf['sblog']['record_Release'])){ $sbentry = "\n##" . $sbname .";". $sbemail .";". $sbwebsite .";". date($plugin_cf['sblog']['time_format']) .";". date($plugin_cf['sblog']['date_format']) .";". $sbimage .";". $sbmessage .";". $_SERVER["REMOTE_ADDR"] . ";[END OF RECORD]"; } else { $sbentry = "\n" . $sbname .";". $sbemail .";". $sbwebsite .";". date($plugin_cf['sblog']['time_format']) .";". date($plugin_cf['sblog']['date_format']) .";". $sbimage .";". $sbmessage .";". $_SERVER["REMOTE_ADDR"] . ";[END OF RECORD]"; } if ($plugin_cf['sblog']['emailNotice'] !=="") { //////////////////////////////////////////////////// //Mailer: // $kopf = $plugin_tx['sblog']['mail_header']." ".$page; $page = $_SERVER[QUERY_STRING]; $ipbesucher = $_SERVER['REMOTE_ADDR']; $nachrichtanmich = "\n\n" . $kopf . " ".$plugin_tx['sblog']['mail_file']." \"".$page."\"\n\n" ."*******************************************************\n" // ." From: ".$kopf." ".$plugin_tx['sblog']['mail_file']." \"".$page."\"\n\n" ." Text: \n".$sbmessage."\n\n From IP: $ipbesucher \n\n" ."*******************************************************\n" .""; $webmaster=$plugin_cf['sblog']['emailNoticeTo']; $header ="FROM:CMSimple sBlog <$webmaster>\n"; $header .="X-Mailer :PHP/" . phpversion()."\n"; $header .="X-Sender-IP: " .$_SERVER['REMOTE_ADDR']. "\n"; $header .="Content-Type: text/plain"; mail ($webmaster, $kopf, $nachrichtanmich, $header); /////////////////////////////////////////////// } if (fputs($fp,$sbentry) == FALSE) $tvari.="
ERROR: Cannot write to file ($sbfile)"; fclose($fp); header('Location: '.$_SERVER['REQUEST_URI']);exit; } } $tvari .= "
\n"; // first DIV encompasses whole output with editor, closes at the bottom /////// OUTPUT 1 ///////////////////// if(eregi("true",$plugin_cf['sblog']['chronological_order'])){ if(ini_get('allow_url_fopen') != 1){ $vartl = "\n"; } sb_commentOutput(); $tvari .= $vartl; $tvari .= "
"; // $tvari .= "

 

"; } ///////// End of OUTPUT 1 //////////////////////// $tvari .= "\n"; $tvari .= "\n"; $tvari .= "
".$plugin_tx['sblog']['txt_newentry'] . "
\n"; $tvari .= "
\n"; $tvari .= "
\n"; if(eregi("true",$plugin_cf['sblog']['simpleCaptcha'])){ $tvari.=$plugin_tx['sblog']['txt_simpleCaptcha'].":* ".$sbrandom."

\n"; $tvari.="\n"; } $tvari .= $plugin_tx['sblog']['txt_name'] . "*:
" . "
\n"; if(eregi("true",$plugin_cf['sblog']['email'])){ $tvari .= $plugin_tx['sblog']['txt_email'] . ":
" . "
\n";} if(eregi("true",$plugin_cf['sblog']['website'])){ $tvari .= $plugin_tx['sblog']['txt_website'] . ":
" . " 
\n";} if(eregi("true",$plugin_cf['sblog']['image'])){ $tvari .= $plugin_tx['sblog']['txt_image'] . ":
" . " 
(e.g. www.myWebSite.com/images/myImage.jpg)
\n";} $tvari .= $plugin_tx['sblog']['txt_message'] . "*:
" . "
\n"; $tvari .= "" . $plugin_tx['sblog']['txt_required'] . "
 
\n"; $tvari .= "
  
\n"; $tvari .= "
\n"; $tvari .= "
\n"; // $tvari .= " 
\n"; /////// OUTPUT 2 ///////////////////// if(!eregi("true",$plugin_cf['sblog']['chronological_order'])){ if(ini_get('allow_url_fopen') != 1){ $vartIE = "\n"; $tvari .= $vartIE; } sb_commentOutput(); $tvari .= $vartl; } ///////// End of OUTPUT 2 //////////////////////// $tvari .= "
\n"; // closing of first DIV return $tvari; } function sb_cleantext($rawcode){ // This will remove HTML tags, javascript sections // and white space. It will also convert some // common HTML entities to their text equivalent // Clever bits cut and pasted from php_manual_en.html#ref.pcre $search = array ("']*?>.*?'si", // Strip out javascript "'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags "'([\r\n])[\s]+'", // Strip out white space "'&(quot|#34);'i", // Replace HTML entities "'&(amp|#38);'i", "'&(lt|#60);'i", "'&(gt|#62);'i", "'&(nbsp|#160);'i", "'&(iexcl|#161);'i", "'&(cent|#162);'i", "'&(pound|#163);'i", "'&(copy|#169);'i", "'&#(\d+);'e"); // evaluate as php $replace = array ("", "", "\\1", "\"", "&", "<", ">", " ", chr(161), chr(162), chr(163), chr(169), "chr(\\1)"); $sb_cleantext = preg_replace($search, $replace, $rawcode); // delete ."cleaned" when tested return $sb_cleantext; }//end of sb_cleantext function sb_commentOutput() { GLOBAL $sbfile, $vartl, $imgpath, $plugin_cf, $newwidth, $newheight, $width, $height; if(is_file($sbfile)){ $fp = fopen($sbfile, "r"); while (!feof($fp)) { $line = fgets($fp, 4096); if(substr($line,0,2) != '##'){ list($sbname,$sbemail,$sbwebsite,$sbtime,$sbdate,$sbimage,$sbmessage,$sbipaddr) = split( ";", $line); $vartm = ""; if ($sbmessage != '') $vartm .= "
\n"; if ($sbmessage != '') $vartm .= "
\n"; if ($sbmessage != '') $vartm .= "\n"; if ($sbmessage != '') $vartm .= "\n"; if ($sbimage != ''){ makeImg($sbimage); if(ini_get("allow_url_fopen") == 1) { // if ($newwidth != "" || $newheight != ""){ if (eregi("http://", $sbimage)){ $vartm .= "\n"; } else { $vartm .= "\n"; } } else { // in case allow_url_fopen = off --------------- if (eregi("http://", $sbimage)){ $vartm .= "\n"; } else { $vartm .= "\n"; } } } if ($sbmessage != '') $vartm .= "\n"; if ($sbmessage != '') $vartm .= "\n"; if ($sbmessage != '') $vartm .= "
" . $sbname . " | \n"; if ($sbmessage != '') $vartm .= "" . $sbdate . ", " . $sbtime . " | \n"; if ($sbemail != '') $vartm .= "\"" \n"; if ($sbwebsite != '') $vartm .= "\"" \n"; if ($sbmessage != '') $vartm .= "\""\n"; if ($sbmessage != '') $vartm .= "
\""
\""
\""
\""
" . $sbmessage . " 
\n"; if(eregi("true",$plugin_cf['sblog']['chronological_order'])){ $vartl = $vartl . $vartm; } else { $vartl = $vartm . $vartl; } } // end of - if(substr($line,0,2) != '##') - } return $vartl; fclose($fp); } }//end of sb_commentOutput function makeImg($sbimage) { // resizing of images global $hmax, $wmax, $plugin_cf, $newwidth, $newheight, $width, $height; // max width and height, max new width and new height if (eregi("http:",$sbimage)) { list($width, $height, $type, $attr) = getimagesize($sbimage); } else { list($width, $height, $type, $attr) = getimagesize("http://" . $sbimage); } $hmax = $plugin_cf['sblog']['max_height']; $wmax = $plugin_cf['sblog']['max_width']; $hscale = $height / $hmax; $wscale = $width / $wmax; if (($hscale > 1) || ($wscale > 1)) { $scale = ($hscale > $wscale)?$hscale:$wscale; } else { $scale = 1; } $newwidth = floor($width / $scale); $newheight= floor($height / $scale); if ($newwidth == "0") $newwidth = ""; if ($newheight == "0") $newheight = ""; return $newwidth; return $newheight; return $width; return $height; } ?>'; //echo $plugin; $num=0; foreach ($lines as $thisline){ $thisline=trim($thisline); if (!empty($thisline)) { list($email,$title,$url,$recurl,$description)=explode($linkdelimiter,$thisline); if($admin=='plugin_main'){ $edimg='edit.gif'; $tooltip= 'title='.$url; if ((isset($_GET['editid']))&&($_GET['editid']==$num)){$edimg='edita.gif';} if (ISSET($_POST['check'])){ //$code = @file_get_contents($recurl) or $err[0]='Can\'t open remote URL!';//prob('Can\'t open remote URL!'); $code = strtolower(@file_get_contents($recurl)); if ((strstr($code,$site_url))||($recurl=='nolink')) { $notthere='style="background-color: #008000"'; }else{ $notthere='style="background-color: #FF0000"'; } } $t .='
delete Edit Up Down '; } else{ $t.= ''; } $num += 1; } $t.="

Linkex plugin, by Amir

"; $postyp='send'; $postval=$plugin_tx['linkex']['form_addlink']; if($admin=='plugin_main'){ $geturi='?&'.$plugin.'&admin=plugin_main'; if (isset($_GET['editid'])){ if (count($err)==0){ $linp=explode($linkdelimiter,$lines[$_GET['editid']]); $data = array('email'=> $linp[0],'title'=> $linp[1],'url'=> $linp[2],'recurl'=> $linp[3],'description'=> $linp[4]); } $postyp=$_GET['editid']; $postval=$plugin_tx['linkex']['form_update']; $geturi .='&editid='.$postyp; } $t.='
Click this button
to check for valid URL with reciprocal.
'; $t.='

Use this form to add or edit links.
To add a site with no reciprocal link, write "nolink" in "URL with reciprocal:"

'; } else { $geturi=$_SERVER['QUERY_STRING']; $t.='

'.$plugin_tx['linkex']['form_title1'].'
'.$plugin_tx['linkex']['form_title2'].'

'; } $t.='

'.$err[0].'

'.$plugin_tx['linkex']['form_email'].'
'.$err[1].'
'.$plugin_tx['linkex']['form_website'].'
'.$err[2].'
'.$plugin_tx['linkex']['form_url'].'
'.$err[3].'
'.$plugin_tx['linkex']['form_reciprocal_url'].'
'.$err[4].'
'.$plugin_tx['linkex']['form_description'].'

'.$err[5].'

'; return $t; } function prob($problem) { //echo "problem".$problem; if (!($problem)){ $problem='Couldn\'t open file data.dat for appending! Please CHMOD this file to 666 !'; } echo '

ERROR

 

'.$problem.'

 

 

Back to the previous page

'; exit; } function checkfields($ln,$num,$errorm ){ global $err; $ln = trim($ln); if (strlen($ln)){ $ln = htmlspecialchars($ln); } else{ $err[$num]=$errorm; } return stripslashes($ln); } ?>