C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\zomplog\admin\editor.php


1
<?/* Written by Gerben Schmidt, http://scripts.zomp.nl */include('config.php');include('session.php');include('header.php');include("../language/$language");if(!$_POST["submit"]){$query mysql_query("SELECT * FROM $table WHERE (id = $_GET[id])");while($row mysql_fetch_array($query)) {$id $row['id'];$title $row['title'];$text $row['text'];$extended $row['extended'];$file $row['image'];$catid $row['catid'];$date $row['date'];$query8 mysql_query("SELECT * FROM $table_cat WHERE id = $catid");while($row mysql_fetch_array($query8)) { $name $row['name'];}echo "<form ENCTYPE='multipart/form-data' name='input' method='post' action='editor.php?id=$id'>";echo "<table width='600' border='0' cellspacing='0' class='admin'>";echo "<tr>";echo "<td>&nbsp;</td>";echo "</tr>";echo "<tr>";echo "<td class='admin_title'>$lang_editentry</td>";echo "</tr>";echo "<tr>";echo "<td>&nbsp;</td>";echo "</tr>";echo "<tr><td class='admin' width='150' valign='top'>$lang_title</td></tr><tr><td class='admin'><input name='title' type='text' value='$title'></td></tr>";echo "<tr>";echo "<td>&nbsp;</td>";echo "</tr>";echo "<tr><td class='admin' valign='top'>$lang_entry</td></tr><tr><td class='admin'><textarea name='text' rows='15' id='text_update' cols='65'>$text</textarea></td></tr>";echo "<tr>";echo "<td>&nbsp;</td>";echo "</tr>";echo "<tr><td class='admin' valign='top'>$lang_extendedentry</td></tr><tr><td class='admin'><textarea name='extended' rows='15' id='extended_update' cols='65'>$extended</textarea></td></tr>";echo "<tr>";echo "<td>&nbsp;</td>";echo "</tr>";echo "<tr>";echo "<td class='admin'>";if($file){echo "$lang_replace";}else{echo "$lang_upload";}echo "</td>";echo "</tr>";echo "<tr>";echo "<td class='admin'><INPUT TYPE='file' NAME='userfile'></td>";echo "</tr>";echo "<tr>";echo "<td>&nbsp;</td>";echo "</tr>";if($file){echo "<tr>";echo "<td class='admin'>";echo "<img src='../upload/thumbnail.php?gd=2&src=$file&maxw=200'><br /><br />";"</td>";echo "</tr>";}echo "<tr>";echo "<td class='admin'>$lang_select_cat</td>";echo "</tr>";echo "<tr><td class='admin' width='200'>";?><select name="catid" style="width: 140px"><?if(!$catid){echo "<option selected value='0'>$lang_no_cat</option>";}else{echo "<option selected value='$catid'>$name</option>";}// group permissions$username $_SESSION['login'];$query2 mysql_query("SELECT * FROM $table_users WHERE (login = '$username')"); while ($row mysql_fetch_array ($query2)) {$admin $row['permissions'];$userid $row['id'];}if($admin!=0){$query mysql_query("SELECT * FROM $table_cat WHERE (id != $catid) ORDER BY id ASC");while($row mysql_fetch_array($query)) { echo '<option value="'.$row["id"].'">'.$row["name"]; }}else {$query3 mysql_query("SELECT * FROM $table_cat WHERE (permissions = '0') AND (id != $catid) ORDER BY id ASC");while($row mysql_fetch_array($query3)) { echo '<option value="'.$row["id"].'">'.$row["name"];}}if($catid){echo "<option value='0'>$lang_no_cat</option>";}echo "</select>";echo "</td></tr>";echo "<tr>"; echo "<td class='admin'>&nbsp;</td>";echo "</tr>";echo "<tr>";echo "<td>&nbsp;</td>";echo "</tr>";echo "<tr><td class='admin' valign='top'><input type='submit' name='submit' value='submit'></td></tr>";echo "<tr>";echo "<td>&nbsp;</td>";echo "</tr>";echo "</form></table>";}}if($_POST["submit"]){if(!$_POST["title"]) {$error "$providetitle $back <a href='$_SERVER[HTTP_REFERER]'>$prevpage</a>";}elseif(!$_POST["text"]) {$error "$providearticle $back <a href='$_SERVER[HTTP_REFERER]'>$prevpage</a>";}else {if($userfile){include('upload.php');$image $HTTP_POST_FILES['userfile']['name'];}else{$query mysql_query("SELECT * FROM $table WHERE (id = $_GET[id])");while($row mysql_fetch_array($query)) {$file $row['image'];$image $file;}}$query mysql_query("UPDATE $table SET title = '$_POST[title]', text = '$_POST[text]', extended = '$_POST[extended]', image = '$image', catid = '$_POST[catid]' WHERE (id = $_GET[id])");$error "$data_added $backmembersarea";}}DisplayError($error);include('footer.php');?>