Location: PHPKode > projects > Soraxdesign PHP Guestbook > admin/settings_main.bilder.inc.php
<?php
if($session_id==$sess_id and $session_id!="" and $sess_id!="")
{
	
	if($do=="neuerSmily")
	{
		$nl=chr(13).chr(10);
		$fp=fopen("../Data/smilies.dat","a");
		fputs($fp,$nl."|§#§|nopic.gif|§#§||§#§|1");
		fclose($fp);
	}
	
	if($do=="nachUnten")
	{
		$file=file("../Data/smilies.dat");
		$gesamt=count($file);
		$pos=$_GET['pos'];
	
		for($a=0;$a<$gesamt;$a++)
		{
			if($a==$pos && $a<$gesamt-1)
			{
				$temp=$file[$a+1];
				$file[$a+1]=$file[$pos];
				$file[$pos]=$temp;
				break;
			}
		}
		
		$fp=fopen("../Data/smilies.dat","w");
		$nl=chr(13).chr(10);
		
		for($c=0;$c<$gesamt;$c++)
		{
		$file[$c]=trim($file[$c]);
				if($c==count($file)-1)
				{
				fputs($fp,$file[$c]);
				}
				else
				{
				fputs($fp,$file[$c]."$nl");
				}
		}
		fclose($fp);
	}
	
	if($do=="nachOben")
	{
		$file=file("../Data/smilies.dat");
		$gesamt=count($file);
		$pos=$_GET['pos'];
	
		for($a=0;$a<$gesamt;$a++)
		{
			if($a==$pos && $a>0)
			{
				$temp=$file[$a-1];
				$file[$a-1]=$file[$pos];
				$file[$pos]=$temp;
				break;
			}
		}
		
		$fp=fopen("../Data/smilies.dat","w");
		$nl=chr(13).chr(10);
		
		for($c=0;$c<$gesamt;$c++)
		{
		$file[$c]=trim($file[$c]);
				if($c==count($file)-1)
				{
				fputs($fp,$file[$c]);
				}
				else
				{
				fputs($fp,$file[$c]."$nl");
				}
		}
		fclose($fp);
	}
	
	if($do=="saveBilder")
	{
		$file=file("../Data/smilies.dat");
		$gesamt=count($file);
		
	
		for($a=0;$a<$gesamt;$a++)
		{
			$daten=explode("|§#§|",$file[$a]);
		
			if($_POST['delete_'.$a]==1)
			{
			unset($file[$a]);
			unlink("../smilies/$daten[1]");
			}
			else
			{
				if($_POST['ausblenden_'.$a]==0)
				{
				$daten[3]=0;
				}
				
				if($_POST['ausblenden_'.$a]=="")
				{
				$daten[3]=1;
				}
				
					if($_FILES['bild']['tmp_name'][$a]!="")
					{
						$size=getimagesize($_FILES['bild']['tmp_name'][$a]);
						$breite=$size[0];
						$hoehe=$size[1];
						
						if($daten[1]=="nopic.gif" || $daten[1]=="")
							$daten[1]=$_FILES['bild']['name'][$a];
							
						move_uploaded_file($_FILES['bild']['tmp_name'][$a],"../smilies/$daten[1]");
					}
					
				if($_POST['tag_'.$a]!="")
					$daten[0]=$_POST['tag_'.$a];
					
				if($_POST['beschreibung_'.$a]!="")
					$daten[2]=$_POST['beschreibung_'.$a];
					
				$file[$a]=str_replace("$file[$a]","$daten[0]|§#§|$daten[1]|§#§|$daten[2]|§#§|$daten[3]",$file[$a]);
			}
		}
		$fp=fopen("../Data/smilies.dat","w");
		$nl=chr(13).chr(10);
		
		for($c=0;$c<count($file);$c++)
		{
		$file[$c]=trim($file[$c]);
		
			if($file[$c]!="")
			{
				if($c==count($file)-1)
				{
				fputs($fp,$file[$c]);
				}
				else
				{
				fputs($fp,$file[$c]."$nl");
				}
			}
		}
		fclose($fp);
	}
	
	if($do=="saveIcons")
	{
		for($a=0;$a<17;$a++)
		{
			if($_FILES['bild']['tmp_name'][$a]!="")
			{
				if($_FILES['bild']['type'][$a]!="image/gif")
				{
				$size=getimagesize($_FILES['bild']['tmp_name'][$a]);
				$breite=$size[0];
				$hoehe=$size[1];
				
					if($_FILES['bild']['type'][$a]=="image/jpeg")
						$altesBild=ImageCreateFromJPEG($_FILES['bild']['tmp_name'][$a]);
					if($_FILES['bild']['type'][$a]=="image/png")
						$altesBild=ImageCreateFromPNG($_FILES['bild']['tmp_name'][$a]);
						
				$neuesBild=ImageCreateTrueColor($breite,$hoehe);
				ImageCopyResized($neuesBild,$altesBild,0,0,0,0,$breite,$hoehe,$breite,$hoehe);
				ImageGIF($neuesBild,"../images/".$_POST['pfad'][$a]);
				}
				else
					move_uploaded_file($_FILES['bild']['tmp_name'][$a],"../images/".$_POST['pfad'][$a]);
			}
		}
	}
	
	
	$fileSmilies=file("../Data/smilies.dat");
	
	?>
	<div id="grundeinstellungen" style="position:absolute;width:800px;margin:0px;overflow:auto;height:407px">
		<div>
		<form name="form1" method="post" enctype="multipart/form-data" action="admin.php?action=login&go=1&session_id=<?php echo $sess_id ?>&show=bilder&do=saveBilder" style="margin:0px;padding:0px">
				<div class="titeldiv" style="background-color:#FFFFFF;border:1px solid #D2AF84">
					<span class="SortierungsTitel">
					Smilies
					</span>
				</div>
				<?php
				
				$c=0;
				foreach($fileSmilies as $smily)
				{
					$smilyDaten=explode("|§#§|",$smily);
					
					if(!file_exists("../smilies/$smilyDaten[1]"))
						$smilyDaten[1]="nopic.gif";
				?>
				<a name="<?php echo $c ?>"></a>
				<div class="titeldiv">
						<div align="center" style="float:left;width:150px">
							<img src="../smilies/<?php echo $smilyDaten[1] ?>" border="0">
						</div>
						<div style="float:left;width:200px">
							<p style="margin:0px;padding:0px;padding-bottom:5px">
								<?php echo $sprache[166] ?>
							</p>
							<input type="text" size="10" maxlength="10" value="<?php echo $smilyDaten[0] ?>" name="tag_<?php echo $c ?>" style="font-family:verdana;font-size:10px;background-color:#FFFFFF;border:1px solid #000000">
						</div>
						<div style="float:left;width:400px">
							<p style="margin:0px;padding:0px;padding-bottom:5px">
								<?php echo $sprache[167] ?>
							</p>
							<input type="text" size="30" maxlength="30" value="<?php echo $smilyDaten[2] ?>" name="beschreibung_<?php echo $c ?>" style="font-family:verdana;font-size:10px;background-color:#FFFFFF;border:1px solid #000000">
						</div>
						<div style="clear:both"></div>
				</div>
				<div class="subtitelgrundeinstellungen">
					<div style="float:left">
						<input type="file" size="30" name="bild[]" style="font-family:verdana;font-size:10px;background-color:#FFFFFF;border:1px solid #000000">
					</div>
					<div style="float:right">
					<?php
						if(trim($smilyDaten[3])==0)
							$checkedAusgeblendet="checked";
						else
							$checkedAusgeblendet="";
					
					?>
						<input type="checkbox" <?php echo $checkedAusgeblendet ?> name="ausblenden_<?php echo $c ?>" value="0"> <?php echo $sprache[158] ?> <input type="checkbox" name="delete_<?php echo $c ?>" value="1"> <?php echo $sprache[140] ?> <a href="admin.php?action=login&go=1&session_id=<?php echo $sess_id ?>&show=bilder&do=saveBilder&do=nachUnten&pos=<?php echo $c ?>#<?php echo $c ?>"><img src="images/images/einstellungen/arrow_down.gif" alt="<?php echo $sprache[170] ?>" title="<?php echo $sprache[170] ?>" border="0"></a> <a href="admin.php?action=login&go=1&session_id=<?php echo $sess_id ?>&show=bilder&do=saveBilder&do=nachOben&pos=<?php echo $c ?>#<?php echo $c ?>"><img alt="<?php echo $sprache[171] ?>" title="<?php echo $sprache[171] ?>" src="images/images/einstellungen/arrow_up.gif" border="0"></a>
					</div>
					<div style="clear:both"></div>
				</div>
				<?php
				$c++;
				}
				?>
				<div style="float:right;margin:0px;padding-top:10px;padding-right:30px;padding-bottom:10px">
				<a href="admin.php?action=login&go=1&session_id=<?php echo $sess_id ?>&show=bilder&do=saveBilder&do=neuerSmily" class="menu"><?php echo $sprache[168] ?></a> | <a href="javascript:document.form1.submit()" class="menu"><?php echo $sprache[169] ?></a>
				</div>
				<div style="clear:both"></div>
			</form>
			</div>
			<div>
			<form name="form2" method="post" enctype="multipart/form-data" action="admin.php?action=login&go=1&session_id=<?php echo $sess_id ?>&show=bilder&do=saveIcons" style="margin:0px;padding:0px">
				<div class="titeldiv" style="background-color:#FFFFFF;border:1px solid #D2AF84">
					<span class="SortierungsTitel">
					<?php echo $sprache[172] ?>
					</span>
				</div>
				<?php
				$arrayIcons=array("buttons/bewertung_norm.gif","buttons/bewertung_hover.gif","captcha/norm.gif","captcha/punkt.gif","formular/fehler.gif","beitrag/homepage.gif","beitrag/email.gif","beitrag/icq.gif","beitrag/msn.gif","beitrag/yahoo.gif","beitrag/aim.gif","beitrag/bewertung.gif","beitrag/quote.gif","beitrag/nachoben.gif","beitrag/zoom_in.gif","beitrag/zoom_out.gif","beitrag/printer.gif");
				
				$c=0;
				foreach($arrayIcons as $icons)
				{
					$iconDaten=explode("/",$icons);
				?>
				<a name="<?php echo $c ?>"></a>
				<div class="titeldiv">
						<div align="center" style="float:left;width:150px">
							<img src="../images/<?php echo $icons ?>" border="0">
						</div>
						<div style="float:left;width:600px">
							<input type="file" size="50" name="bild[]" style="font-family:verdana;font-size:10px;background-color:#FFFFFF;border:1px solid #000000">
							<input type="hidden" name="pfad[]" value="<?php echo $icons ?>">
						</div>
						<div style="clear:both"></div>
				</div>
				<?php
				$c++;
				}
				?>
				<div style="float:right;margin:0px;padding-top:10px;padding-right:30px;padding-bottom:10px">
				<a href="javascript:document.form2.submit()" class="menu"><?php echo $sprache[173] ?></a>
				</div>
			</form>
			</div>
		</div>
		<div id="menu_unten" style="position:absolute;margin-top:407px;width:800px;height:25px;background-image:url('images/symbolleisten/menu_back_unten.jpg')">
			<div style="float:left;height:25px;background-image:url('images/symbolleisten/menu_back_unten_button.jpg');border-right:1px solid #83ACCA">
				<div style="margin-left:10px;margin-top:7px;margin-right:10px">
				<a href="admin.php?action=login&go=1&session_id=<?php echo $session_id ?>" class="menu"><?php echo $sprache[95] ?></a>
				</div>
			</div>
		</div>
	<?php
}
else
{
echo"<meta http-equiv=\"refresh\" content=\"0; URL=error.php\" target=\"_top\">";
}
?>
Return current item: Soraxdesign PHP Guestbook