SMILEYS

ADD SMILEY

'; echo'
Icon-Upload:
Smiley Name:
Pattern:
(f.e: ":smileyname:")
'; } elseif($_GET["action"]=="edit") { $ds=mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."smileys WHERE smileyID='".$_GET["smileyID"]."'")); $pic=''.$ds['alt'].''; echo'

SMILEYS

EDIT SMILEY - '.$ds['alt'].'

'; echo'
Present Icon: '.$pic.'
Icon-Upload:
Smiley Name:
Pattern:
(e.g. ":smileyname:")
'; } elseif($_POST["save"]) { $icon=$_FILES["icon"]; $alt=$_POST["alt"]; $pattern=$_POST["pattern"]; echo'

SMILEYS

NEW SMILEY

'; if($pattern) { $file_ext=strtolower(substr($icon[name], strrpos($icon[name], "."))); if($file_ext==".gif") { if($icon[name] != "") { move_uploaded_file($icon[tmp_name], $filepath.$icon[name]); @chmod($filepath.$icon[name], 0755); $file=$alt.$file_ext; rename($filepath.$icon[name], $filepath.$file); safe_query("INSERT INTO ".PREFIX."smileys (smileyID, name, alt, pattern) values('', '".$file."', '".$alt."', '".$pattern."')"); redirect('admincenter.php?site=smileys','Successful!'); } } else echo'The format of the icon was incorrect. Please upload only icons in *.gif format.

« back'; } else echo'Please fill in the form correctly.

« back'; } elseif($_POST["saveedit"]) { $icon=$_FILES["icon"]; $alt=$_POST["alt"]; $pattern=$_POST['pattern']; echo'

SMILEYS

EDIT SMILEY

'; if($pattern) { if($icon[name]=="") { if(safe_query("UPDATE ".PREFIX."smileys SET alt='".$alt."', pattern='".$pattern."' WHERE smileyID='".$_POST["smileyID"]."'")) redirect('admincenter.php?site=smileys','Successful!'); } else { $file_ext=strtolower(substr($icon[name], strrpos($icon[name], "."))); if($file_ext==".gif") { move_uploaded_file($icon[tmp_name], $filepath.$icon[name]); @chmod($filepath.$icon[name], 0755); $file=$short.$file_ext; rename($filepath.$icon[name], $filepath.$file); if(safe_query("UPDATE ".PREFIX."smiley SET name='".$icon[name]."', alt='".$alt."', pattern='".$pattern."' WHERE smileyID='".$_POST["smileyID"]."'")) { redirect('admincenter.php?site=smileys','Successful!'); } } else echo'The format of the icon was incorrect. Please upload only icons in *.gif format.

« back'; } } else echo'Please fill in the form correctly.

« back'; } elseif($_GET["delete"]) { safe_query("DELETE FROM ".PREFIX."smileys WHERE smileyID='".$_GET["smileyID"]."'"); redirect('admincenter.php?site=smileys','Successful!'); } else { echo'

SMILEYS

existing smileys

'; $ds=safe_query("SELECT * FROM ".PREFIX."smileys"); $anz=mysql_num_rows($ds); if($anz) { while($smileys = mysql_fetch_array($ds)) { $pic=''.$smileys['alt'].''; if($smileys['alt']=="") $smileys['alt']=$smileys['name']; echo' '; } } else echo''; echo '
Icon: Name: Prefix: Actions:
'.$pic.' '.$smileys['alt'].' '.$smileys['pattern'].'
no entries
'; } ?>