Location: PHPKode > projects > Free Blog Creator > freeblog/trbck.php
<?php
require("header.php");
?>
<SCRIPT TYPE="text/javascript" SRC="list.js"></SCRIPT>

Menu &gt; Manage Trackbacks<br><br><br>

<?php
if($_POST["ip"]){
$ip = $_POST["ip"];
$values = explode(':',$ip);
$IP = strip_tags($values[0]);
$lid = $values[1];
$year = $values[2];

$Log=@file("./log/basic2.cgi");
$line=explode(",",$Log[0]);
$delivfree=$line[0];
$delivmail=$line[1];
$commentname=$line[2];
$commentemail=$line[3];
$commentlink=$line[4];
$commenttext=$line[5];
$tblink=$line[6];
$arrip=$line[7];
$text=$line[8];

$arrip = $arrip."<br />".$IP;

$lines=array("$delivfree","$delivmail","$commentname","$commentemail","$commentlink","$commenttext","$tblink","$arrip","$text","1");
$lines=implode(",",$lines);
$lines=$lines."\n";

$fp=fopen("./log/basic2.cgi","w");
fputs($fp,$lines);	
fclose($fp);


$Log=file("./log/trackback/$year.cgi");
for($i=0;$i<sizeof($Log);$i++){
$line=explode("<>",$Log[$i]);
if($line[0]==$lid){
$lid=$line[0];
$sid=$line[1];
$year=$line[2];
$view=$line[3];
$name=$line[4];
$title=$line[5];
$link=$line[6];
$text=$line[7];
$ip=$line[8];
break;
}
}
$lines=array("$lid","$sid","$year","$view","$name","$title","$link","$text","$ip","1","1");
$lines=implode("<>",$lines);
$lines=$lines."\n";
$Log=file("./log/trackback/$year.cgi");
for($i=0;$i<sizeof($Log);$i++){
$line=explode(",",$Log[$i]);
if($line[0]==$lid){

array_splice($Log,$i,1,$lines);

}
}
$fp=fopen("./log/trackback/$year.cgi","w");
flock($fp, LOCK_EX);
foreach($Log as $line)fputs($fp,$line);	
fclose($fp);

}
?>

<?php
if(($_POST["Remove"]) && ($_POST["flag"])){

$flag = $_POST["flag"];


foreach ($flag as $value){

$val=explode(":",$value);

$Log=@file("./log/trackback/$val[1].cgi");
for($i=0;$i<sizeof($Log);$i++){
$line=explode("<>",$Log[$i]);
if($line[0]==$val[0]){
array_splice($Log,$i,1);
}

}
$fp=fopen("./log/trackback/$val[1].cgi","w");
flock($fp, LOCK_EX);
foreach($Log as $line)fputs($fp,$line);	
fclose($fp);
}

}
?>

<?php
$httphost= str_replace(basename(__FILE__),"",'http://'.$_SERVER["HTTP_HOST"].$_SERVER[PHP_SELF])."";
$updir = "./log/comment/";
$dir_file = opendir( $updir );
while (false !== ($file_name = readdir($dir_file))) {
if(is_file("$updir/$file_name") && $file_name != "." && $file_name != ".."){

$dirlist[]=str_replace(".cgi","",$file_name);

}        
}
closedir( $dir_file );
?>




<table width="880">
<tr><td>
<form name="Select" action="#">
<?php
echo "<select name='selectMenu' onchange='hope()' style='width:120px;'>";
for($i=sizeof($dirlist)-1;$i>=0;$i--){

$Selected="";

if($_GET["hopetime"]==$dirlist[$i]){
$Selected="selected";
}

echo "<option value='?hopetime=$dirlist[$i]' $Selected>$dirlist[$i]</option>";
}
echo "</select>";
?>
</form>
</td>
</tr>
</table>

<form action="" method="POST" name="form_list"><table width="475">
<td><input type="button" value="Check All" id="keyh1" onClick="BoxChecked(true);"><input type="reset" value="Uncheck All" id="keyh1" onClick="BoxChecked(false);"></td>
<td align='right'><input type="hidden" name="Remove" value="">With selected: <a href="javascript:document.form_list.submit();" onclick="document.form_list.Remove.value='Remove';">Delete</a>&nbsp;&nbsp;&nbsp;</td>
</table>
<?php
echo "<table width='475' border='0' cellspacing='1' bgcolor='#BBBBBB'>";
echo "<tr><td bgcolor='#ffffff' nowrap width='1%'></td><td align='center' bgcolor='#ffffff' nowrap width='8%'>Date</td><td align='center' bgcolor='#ffffff' nowrap width='10%'>Sender</td><td align='center' bgcolor='#ffffff' nowrap width='10%'>Content</td><td align='center' bgcolor='#ffffff' nowrap width='10%'>IP</td><td align='center' bgcolor='#ffffff' nowrap width='10%'>Title</td></tr>";
$Rows=10;
if($_POST['p']){
$P=$_POST["p"];
}
else{
$P=0;
}
$num = $P * $Rows;

if(!$_GET["hopetime"]){
$year = $dirlist[sizeof($dirlist)-1];
}
if($_GET["hopetime"]){
$year = $_GET["hopetime"];
}

if($year){
$log = @file("./log/comment/$year.cgi");

$start = sizeof($log)-$num-1;
$end = $start - $Rows;

for($i=sizeof($log);$i>=0;$i--){

if($i > $start) continue;
if($i <= $end)  break;

$line=explode("<>",$log[$i]);
$lid=$line[0];
$sid=$line[1];
$year=$line[2];
$view=$line[3];
$name=$line[4];
$title=$line[5];
$link=$line[6];
$text=$line[7];
$ip=$line[8];
$spam=$line[9];


$dump = strlen($title);
if( $dump > 12 ){
$title = substr($title, 0, 12);
$title = substr($title , 0, strrpos($title , " "));
$title .="...";
}
$Log2=@file("./log/entry/$year.cgi");
for($i2=0;$i2<sizeof($Log2);$i2++){
$line2=explode("<>",$Log2[$i2]);
if($line2[0]==$sid){
$name1=$line2[1];
}
}
$dump = strlen($name1);
if( $dump > 10 ){
$name1 = substr($name1, 0, 10);
$name1 = substr($name1 , 0, strrpos($name1 , " "));
$name1 .="...";
}
if($spam){
$spamtext = "Deny";
}
else{
$spamtext = "Allow";
}
?>
<tr><td bgcolor='#ffffff' nowrap width='1%'><input type='checkbox' name='flag[]' value='<?=$lid?>:<?=$sid?>:<?=$year?>'></td><td align='center' bgcolor='#ffffff' nowrap><?=$view?></td><td bgcolor='#ffffff' nowrap>&nbsp;<a href='<?=$link?>' target="_blank" STYLE="color: blue;"><?=$name?></a></td><td bgcolor='#ffffff' nowrap>&nbsp;<a href='trbcklist.php?lid=<?=$lid?>&year=<?=$year?>'><?=$title?></a></td><td bgcolor='#ffffff' nowrap><?=$ip?><br/><a href="javascript:document.form_list.submit();" onclick="document.form_list.ip.value='<?=$ip[$i]?>:<?=$lid[$i]?>:<?=$year?>';" STYLE="color: blue;"><?=$spamtext?></a></td><td bgcolor='#ffffff' nowrap>&nbsp;<a href='<?=$httphost?>?id=<?=$sid?>#trackback' target="_blank" STYLE="color: blue;"><?=$name1?></a></td></tr>
<?php
}
}
?>
<input type="hidden" name="ip" value="">
</table></FORM>
<table>
<?php
        if($P>0){
                $Prev=$P-1;
                $PrevPage="<td><form action='' method='POST'><INPUT type='hidden' name='rows' value='$Rows'><INPUT type='hidden' name='p' value='{$Prev}'><input type='submit' name='back' value='BACK'></form></td>";
        }

$Size=sizeof($log);
        if($Size/$Rows-1>$P){
                $Next=$P+1;
                $NextPage="<td><form action='' method='POST'><INPUT type='hidden' name='rows' value='$Rows'><INPUT type='hidden' name='p' value='{$Next}'><input type='submit' name='next' value='NEXT'></form></td>";
        }


echo "$PrevPage $NextPage";
?>
</table>






<?php
require("footer.php");
?>
Return current item: Free Blog Creator