Location: PHPKode > projects > NewsP > coments.inc.php
<?php include("auth.php");
$writer = $_SESSION['username'];
echo "<H2>$lg[nav07]</H2><P>";


$speicher = "../coms/meldung.txt";
if(file_exists($speicher))
{
$zaehlfile = fopen("$speicher","r"); 
$inhalt_zaehlfile = fgets($zaehlfile);  
fclose($zaehlfile); 
$meldungen = unserialize($inhalt_zaehlfile);

$zufile = "zuordnung.txt";
@$zaehlzu = fopen("$zufile","r"); 
@$inhalt_zufile = fgets($zaehlzu);  
@fclose($zaehlzu); 
$zuord = unserialize($inhalt_zufile);

$gnc = $HTTP_POST_VARS["gerds_nc"]; 
$aktion = $HTTP_POST_VARS["aktion"]; 
$nid = $meldungen[$gnc][nid];
##############################################
if($aktion == "freischalten" || $aktion == "editiert")
{
$n_store = "../coms/nid_$nid.txt";
if(file_exists($n_store)){
$n_file = fopen("$n_store","r+");}else{$n_tfile = fopen("$n_store","w+"); }
@$inhalt_n_file = fgets($n_file);  
@fclose($n_file); 
$coms = unserialize($inhalt_n_file);
$coms[$gerds_nc][date] =$meldungen[$gnc][date];
$coms[$gerds_nc][ori_writer] =$meldungen[$gnc][ori_writer];
$coms[$gerds_nc][gerds_nc] =$meldungen[$gnc][gerds_nc];
if($aktion == "freischalten"){
$coms[$gerds_nc][writer] =$meldungen[$gnc][writer];
$coms[$gerds_nc][kommentar] =$meldungen[$gnc][kommentar];
}else{
$coms[$gerds_nc][writer] =urlencode($HTTP_POST_VARS["schreiber"]); 
$nachricht= $HTTP_POST_VARS[kommentar];
	foreach($checks as $ch){
	$pos = strpos($nachricht, $ch);
	if($pos !="" && $gefunden == "")
		{
		$nachricht = htmlentities($nachricht);
		$gefunden ="ja";
		}
	}
$coms[$gerds_nc][kommentar] =$nachricht;
$aktion = "freischalten"; 
}
$loglink = serialize($coms);
$loglinkfile = "$n_store";
$logger = fopen("$loglinkfile","w"); 
fputs($logger, $loglink); 
fclose($logger); 
}
###################################################
if($aktion == 'freischalten' || $aktion == 'loeschen')
{
unset($meldungen[$gnc][date],$meldungen[$gnc][writer],$meldungen[$gnc][kommentar],$meldungen[$gnc][ori_writer],$meldungen[$gnc][gerds_nc],$meldungen[$gnc][nid],$meldungen[$gnc]);
$neu = $meldungen;
$loglink2 = serialize($neu);
$loglinkfile2 = "$speicher";
$logger2 = fopen("$loglinkfile2","w"); 
fputs($logger2, $loglink2); 
fclose($logger2); 

$zaehlfile = fopen("$speicher","r"); 
$inhalt_zaehlfile = fgets($zaehlfile);  
fclose($zaehlfile); 
$meldungen = unserialize($inhalt_zaehlfile);
}
##############################################
$fb=2;
if($aktion == "edit")
{
$nid = $meldungen[$gnc][nid]; 
$schreiber = $meldungen[$gnc][writer]; 
$kommentar = $meldungen[$gnc][kommentar];
$kommentar = str_replace("%0D%0A", "<br>", $kommentar);
$kommentar = urldecode($kommentar);
$kommentar = stripcslashes($kommentar);
echo"rtr $nid schr: $schreiber";
$datum_ag= strftime($domains[outform_time] , $meldungen[$gnc][date]);
echo"<CENTER><TABLE width=\"860\"  cellpadding=\"3\" cellspacing=\"0\">";?>
<TR>
	<TD class=td_l<? echo "$fb";?>>
					<TABLE width="100%" cellpadding="3" cellspacing="3">
					<TR>
						<TD colspan="2"><? echo "<A HREF=\"../$zuord[$nid]\" TARGET=\"_blank\"><B>$zuord[$nid]</B></A>";?> </TD>
					</TR>
					<TR>
						<TD class=td_l>
<? echo"$lg[p1_009]:";?> <form name="freischalten" method="post" action="" enctype="multipart/form-data"><input type="text" size="15" name="schreiber" value="<? echo "$schreiber";?>"></TD>
						<TD class=td_r><? echo "<B><I>$datum_ag</I></B>"?> </TD>
					</TR>
					<TR>
						<TD colspan="2"><textarea id="textarea1" name="nachricht" style="width:800px;height:200px;"><? echo "$kommentar";?></textarea>
<TABLE>
<TR>
	<TD valign="top"> 
<? echo"<input type=\"hidden\" name=\"gerds_nc\" value=\"$gnc\"><input type=\"hidden\" name=\"aktion\" value=\"editiert\"><input type=\"image\" name=\"edit\" src=\"../templates/ok.gif\" /></form> ";?>
</TD>
	<TD> 
<? echo"<form name=\"loeschen\" method=\"post\" action=\"\" enctype=\"multipart/form-data\"><input type=\"hidden\" name=\"gerds_nc\" value=\"$gnc\"><input type=\"hidden\" name=\"aktion\" value=\"loeschen\"><input type=\"image\" onClick=\"if(confirm('$lg[q_010] &quot;$key[writer]&quot; $lg[q_011]')) this.form.submit(); else return false;\" name=\"edit\" src=\"../templates/delete.gif\" /></form> "; ?>
</TD>
</TR>
</TABLE>

					</TD>
					</TR>
					</TABLE>
	</TD>
</TR>
<?
}else{
$was_gibts = count($meldungen);
if($was_gibts < 1){
echo"$lg[com001]";}else{
echo"<CENTER><TABLE width=\"860\"  cellpadding=\"3\" cellspacing=\"0\">";

foreach($meldungen as $key){

if ($fb > 2){$fb = 1;}
$ori_writer=$key[ori_writer];
	if ($writer == "Admin" || $writer == $ori_writer){
$nid = $key[nid]; 
$datum_ag= strftime($domains[outform_time] , $key[date]);

$kommentar = $key[kommentar];
$kommentar = str_replace("%0D%0A", "<br>", $kommentar);
$kommentar = urldecode($kommentar);
$kommentar = stripcslashes($kommentar);
?>
<TR>
	<TD class=td_l<? echo "$fb";?>>


					<TABLE width="100%" cellpadding="3" cellspacing="3">
					<TR>
						<TD colspan="2"><? echo "<A HREF=\"../$zuord[$nid]\" TARGET=\"_blank\"><B>$zuord[$nid]</B></A>";?> </TD>
					</TR>
					<TR>
						<TD class=td_l><I><B><? echo"$key[writer]";?> </B></I> </TD>
						<TD class=td_r><? echo "<B><I>$datum_ag</I></B>"?> </TD>
					</TR>
					<TR>
						<TD colspan="2"><? echo "$kommentar <P>"; ?>
<TABLE>
<TR>
	<TD> 
<? echo"<form name=\"freischalten\" method=\"post\" action=\"\" enctype=\"multipart/form-data\"><input type=\"hidden\" name=\"gerds_nc\" value=\"$key[gerds_nc]\"><input type=\"hidden\" name=\"aktion\" value=\"freischalten\"><input type=\"image\" name=\"edit\" src=\"../templates/ok.gif\" /></form> ";?>
</TD>
	<TD> 
<? echo"<form name=\"edit\" method=\"post\" action=\"\" enctype=\"multipart/form-data\"><input type=\"hidden\" name=\"gerds_nc\" value=\"$key[gerds_nc]\"><input type=\"hidden\" name=\"aktion\" value=\"edit\"><input type=\"hidden\" name=\"call_eddi\" value=\"ja\"><input type=\"image\" name=\"edit\" src=\"../templates/edit.gif\" /></form> "; ?>
</TD>
	<TD> 
<? echo"<form name=\"loeschen\" method=\"post\" action=\"\" enctype=\"multipart/form-data\"><input type=\"hidden\" name=\"gerds_nc\" value=\"$key[gerds_nc]\"><input type=\"hidden\" name=\"aktion\" value=\"loeschen\"><input type=\"image\" onClick=\"if(confirm('$lg[q_010] &quot;$key[writer]&quot; $lg[q_011]')) this.form.submit(); else return false;\" name=\"edit\" src=\"../templates/delete.gif\" /></form> "; ?>
</TD>
</TR>
</TABLE>
					</TD>
					</TR>
					</TABLE>
	</TD>
</TR>
<?
$fb++;
}}}}}else{
echo "$lg[com001]";
}
?>
</TABLE></CENTER>
Return current item: NewsP