Location: PHPKode > projects > Free Blog Creator > freeblog/entry.php
<?php
if(!sizeof($_GET)){
$updir = dirname(__FILE__)."/log/entry/";
$dir_file = opendir( $updir );
while (false !== ($file_name = readdir($dir_file))) {
if(is_file("$updir/$file_name") && $file_name != "." && $file_name != ".."){
$dirlist[]=$file_name;
}        
}
closedir( $dir_file );
?>
<?php
for($i=sizeof($dirlist)-1;$i>=0;$i--){

$Log=@file(dirname(__FILE__)."/log/entry/$dirlist[$i]");
for($i2=0;$i2<sizeof($Log);$i2++){
$line=explode("<>",$Log[$i2]);
if($line[3]==2){

if( $haba < 10 ){

$sid=$line[0];
$name=$line[1];
$base=$line[2];
$status=$line[3];
$comment=$line[4];
$trackback=$line[5];
$datetime=$line[6];
$year=$line[7];
$base=base64_decode($base);

$cLog = 0;
$tLog = 0;
$Log1 = file(dirname(__FILE__)."/log/comment/$year.cgi");
for($c=0;$c<sizeof($Log1);$c++){
$cline=explode("<>",$Log1[$c]);
if($cline[1]==$sid){
$cLog++;
}
}
$Log2 = file(dirname(__FILE__)."/log/trackback/$year.cgi");
for($t=0;$t<sizeof($Log2);$t++){
$tline=explode("<>",$Log2[$t]);
if($tline[1]==$sid){
$tLog++;
}
}

if($comment==1){
$acomment = "&nbsp;|&nbsp;<a href=\"?sid=$sid#comments\">Comment($cLog)</a>";
}
else{
$acomment = "";
}
if($trackback==1){
$atrackback = "&nbsp;|&nbsp;<a href=\"?sid=$sid#trackback\">TrackBack($tLog)</a>";
}
else{
$atrackback = "";
}

$table2 = "
<div class=\"blogbody\">
<div class=\"title\"><a href=\"?sid=$sid\"><b>$name</b></a></div>
<div class=\"text\">$base</div>
<div class=\"posted\">
$datetime
$acomment
$atrackback
</div>
</div>
";

$table .= $table2;
}
$haba++;
}
}

if( $haba == 10 ){
break;
}
}

}
?>
<?php
if($_GET['sid']){
$Log=@file(dirname(__FILE__)."/log/basic.cgi");
$line=explode(",",$Log[0]);
$httphost=$line[1];
$sid = $_GET['sid'];
$year = substr($sid, -4, 4);
$Log=@file(dirname(__FILE__)."/log/entry/$year.cgi");
for($i=0;$i<sizeof($Log);$i++){
$line=explode("<>",$Log[$i]);
if(($line[0]==$sid)&&($line[3]==2)){
$name=$line[1];
$base=$line[2];
$status=$line[3];
$comment=$line[4];
$trackback=$line[5];
$datetime=$line[6];
$year=$line[7];
$track=$line[8];
$base=base64_decode($base);

$cLog = 0;
$tLog = 0;
$Log1 = file(dirname(__FILE__)."/log/comment/$year.cgi");
for($c=0;$c<sizeof($Log1);$c++){
$cline=explode("<>",$Log1[$c]);
if($cline[1]==$sid){
$cLog++;
}
}
$Log2 = file(dirname(__FILE__)."/log/trackback/$year.cgi");
for($t=0;$t<sizeof($Log2);$t++){
$tline=explode("<>",$Log2[$t]);
if($tline[1]==$sid){
$tLog++;
}
}

if($comment==1){
$acomment = "&nbsp;|&nbsp;<a href=\"?sid=$sid#comments\">Comment($cLog)</a>";
}
else{
$acomment = "";
}
if($trackback==1){
$atrackback = "&nbsp;|&nbsp;<a href=\"?sid=$sid#trackback\">TrackBack($tLog)</a>";
}
else{
$atrackback = "";
}

$table2 = "
<div class=\"blogbody\">
<div class=\"title\"><a href=\"?sid=$sid\"><b>$name</b></a></div>
<div class=\"text\">$base</div>
<div class=\"posted\">
$datetime
$acomment
$atrackback
</div>
</div>
";
$tab2 .= $table2;

$table3 = "
<div id=\"comments\">

</div>
";
$tab3 .= $table3;

$cLog=file(dirname(__FILE__)."/log/comment/$year.cgi");
for($c=0;$c<sizeof($cLog);$c++){
$cline=explode("<>",$cLog[$c]);
if($cline[1]==$sid){

$cView=$cline[3];
$cName=$cline[4];
$cEmail=$cline[5];
$cLink=$cline[6];
$cText=$cline[7];

if($cEmail){
$Namelist = "<a href=\"mailto:$cEmail\">$cName</a>";
}
if(!$cEmail){
$Namelist = "$cName";
}
if($cLink){
$Linklist = "<a href=\"$cLink\" target=\"_blank\" rel=\"nofollow\">URL</a>";
}
if(!$cLink){
$Linklist = "URL";
}

$table4 = "
<br/><div class=\"comments-body\">
$cText
</div>
<div class=\"comments-posted\">
$cView&nbsp;|&nbsp;$Namelist&nbsp;[&nbsp;$Linklist&nbsp;]
</div>
";

$tab4 .= $table4;
}
}

$Log2=@file(dirname(__FILE__)."/log/basic2.cgi");
$line2=explode(",",$Log2[0]);
$commentname=$line2[2];
$commentemail=$line2[3];
$commentlink=$line2[4];
$commenttext=$line2[5];

if($commentname==1){
$hName="*";
}
if($commentemail==1){
$hEmail="*";
}
if($commentlink==1){
$hLink="*";
}
if($commenttext==1){
$hText="*";
}

$table5 = "
<br/><SCRIPT TYPE=\"text/javascript\" SRC=\"".$httphost."form.js\"></SCRIPT>
<div id=\"result\"></div><br/>
<div id=\"comments\">Post a comment</div>
<form action=\"\" method=\"POST\" name=\"opinion\">
<input type=\"hidden\" name=\"url\" value=\"".$httphost."form.php\">
<input type=\"hidden\" name=\"sid\" value=\"$sid\">
<div class=\"comments-body\">
Name:$hName<br>
<input type='text' name='name' size='30' value=''><br>
E-mail:$hEmail<br>
<input type='text' name='email' size='30' value=''><br>
URL:$hLink<br>
<input type='text' name='link' size='30' value=''><br>
Body:$hText<br>
<textarea name='text' cols='30' rows='5'></textarea>
<br><br>
<input type=\"button\" value=\"Confirm\" onclick=\"preview()\" class=\"submit\">&nbsp;<input type=\"button\" value=\"Send\" onclick=\"sub()\" class=\"submit\"></form>
</div>
";

$tab5 .= $table5;

$tLog=file(dirname(__FILE__)."/log/trackback/$year.cgi");
for($t=0;$t<sizeof($tLog);$t++){
$tline=explode("<>",$tLog[$t]);
if($tline[1]==$sid){

$tView=$tline[3];
$tName=$tline[4];
$tTitle=$tline[5];
$tLink=$tline[6];
$tText=$tline[7];

$table6 = "
<div class=\"trackback-body\">
<a href=\"$tLink\" target=\"_blank\" rel=\"nofollow\">$tTitle</a>&nbsp;from&nbsp;<span style=\"font-size:x-small;\">$tName</span><br/>
$tText<br/>
</div>
<div class=\"trackback-posted\">Posted: $tView</div>
";

$tab6 .= $table6;
}
}
$table7 = '
<div id="trackback">
Trackbacks<br/>
<p>'.$httphost.'trackback.php?id='.$sid.'</p>
'.$tab6.'
</div>
';
$tab7 .= $table7;


$table=$tab2.$tab3.$tab4.$tab5.$tab7;
}
}

}
?>
<?php
if($_GET['id']){
$ym = $_GET['id'];
$year = substr($ym, 0, 4);
$Log=@file(dirname(__FILE__)."/log/entry/$year.cgi");
for($i2=0;$i2<sizeof($Log);$i2++){
$line=explode("<>",$Log[$i2]);
if(($line[8]==$ym)&&($line[3]==2)){
$sid=$line[0];
$name=$line[1];
$base=$line[2];
$status=$line[3];
$comment=$line[4];
$trackback=$line[5];
$datetime=$line[6];

$base=base64_decode($base);
$dump = strlen($base);
if( $dump > 100 ){
$base = substr($base, 0, 100);
$base = substr($base , 0, strrpos($base , " "));
$base .="...";
}

$cLog = 0;
$tLog = 0;
$Log1 = file(dirname(__FILE__)."/log/comment/$year.cgi");
for($c=0;$c<sizeof($Log1);$c++){
$cline=explode("<>",$Log1[$c]);
if($cline[1]==$sid){
$cLog++;
}
}
$Log2 = file(dirname(__FILE__)."/log/trackback/$year.cgi");
for($t=0;$t<sizeof($Log2);$t++){
$tline=explode("<>",$Log2[$t]);
if($tline[1]==$sid){
$tLog++;
}
}

if($comment==1){
$acomment = "&nbsp;|&nbsp;<a href=\"?sid=$sid#comments\">Comment($cLog)</a>";
}
else{
$acomment = "";
}
if($trackback==1){
$atrackback = "&nbsp;|&nbsp;<a href=\"?sid=$sid#trackback\">TrackBack($tLog)</a>";
}
else{
$atrackback = "";
}

$table2 = "
<div class=\"blogbody\">
<div class=\"title\"><a href=\"?sid=$sid\"><b>$name</b></a></div>
<div class=\"text\">$base</div>
<div class=\"posted\">
$datetime
$acomment
$atrackback
</div>
</div>
";

$table .= $table2;
}

}

}
$freeblog="<br /><hr><a href=\"http://b.sdnex.com/\">free blog</a><br />";
?>
<?=$table.$freeblog?>
Return current item: Free Blog Creator