Today I'm releasing my RevCMS Catalog/Shop Category Editor.
Note: You need to know the category ID.
Add this anywhere you want it in your hk:
Big thanks to wesley66101 for improving the code (and making a screen)!
Screen (not translated):
OLD!
Have fun with this
Note: You need to know the category ID.
Add this anywhere you want it in your hk:
PHP:
<?php
if(isset($_POST['update'])) {
mysql_query("UPDATE catalog_pages SET id = '" . mysql_real_escape_string($_POST['id']) . "', parent_id = '" . mysql_real_escape_string($_POST['parent_id']) . "', caption = '" . mysql_real_escape_string($_POST['caption']) . "', visible = '" . mysql_real_escape_string($_POST['visible']) . "', enabled = '" . mysql_real_escape_string($_POST['enabled']) . "', min_rank = '" . mysql_real_escape_string($_POST['min_rank']) . "', page_layout = '" . mysql_real_escape_string($_POST['page_layout']) . "', page_headline = '" . mysql_real_escape_string($_POST['page_headline']) . "' WHERE id = '" . mysql_real_escape_string($_POST['id_current']) . "'") or die(mysql_error());
echo "<center>Category <b>" . htmlspecialchars($_POST['id_current']) . "</b> successfully updated!</center>";
}
if(isset($_POST['lookup'])) {
if(mysql_num_rows(mysql_query("SELECT * FROM catalog_pages WHERE id = '". ($_POST['l_id']) ."'")) == 0) { echo "<center>Not found!</center>"; }
else {
$two = mysql_fetch_assoc(mysql_query("SELECT * FROM catalog_pages WHERE id = '" . mysql_real_escape_string($_POST['l_id']) . "'"));
?>
<form method='post'>
<input type="hidden" name="id_current" value="<?php echo htmlspecialchars($_POST['l_id']); ?>" />
<table style="width: 100%;">
<tr>
<td>ID</td>
<td><input type="text" name="id" value="<?php echo htmlspecialchars($_POST['l_id']); ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Parent ID</td>
<td><input type="text" name="parent_id" value="<?php echo htmlspecialchars($two['parent_id']); ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="caption" value="<?php echo htmlspecialchars($two['caption']); ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Visible</td>
<td><input type="text" name="visible" value="<?php echo htmlspecialchars($two['visible']); ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Enabled</td>
<td><input type="text" name="enabled" value="<?php echo htmlspecialchars($two['enabled']); ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Min. Rang</td>
<td><input type="text" name="min_rank" value="<?php echo htmlspecialchars($two['min_rank']); ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Layout</td>
<td><input type="text" name="page_layout" value="<?php echo htmlspecialchars($two['page_layout']); ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Headline</td>
<td><input type="text" name="page_headline" value="<?php echo htmlspecialchars($two['page_headline']); ?>" style="width: 95%" /></td>
</tr>
</table>
<input type="submit" class="input button" value="Update/safe" name="update"/>
</form>
<?php
}
}
?>
<form method='post' align="center">
<input type="text" name="l_id" class="input text" placeholder="ID"><br>
<input type="submit" class="input button" value="Search category" name="lookup" style="margin-top: 5px;" />
</form>
Screen (not translated):
OLD!
PHP:
<?php
if(isset($_POST['update'])) {
mysql_query("UPDATE catalog_pages SET id = '" . ($_POST['id']) . "', parent_id = '" . ($_POST['parent_id']) . "', caption = '" . ($_POST['caption']) . "', visible = '" . ($_POST['visible']) . "', enabled = '" . ($_POST['enabled']) . "', min_rank = '" . ($_POST['min_rank']) . "', page_layout = '" . ($_POST['page_layout']) . "', page_headline = '" . ($_POST['page_headline']) . "' WHERE id = '" . ($_POST['id_current']) . "'") or die(mysql_error());
echo "<center>Category " . $_POST['id_current'] . " updated succesfully!</center>";
}
if(isset($_POST['lookup'])) {
if(mysql_num_rows(mysql_query("SELECT * FROM catalog_pages WHERE id = '". ($_POST['l_id']) ."'")) == 0) { echo "<center>Not found!</center>"; }
else {
$two = mysql_fetch_assoc(mysql_query("SELECT * FROM catalog_pages WHERE id = '" . ($_POST['l_id']) . "'"));
?>
<form method='post'>
<input type="hidden" name="id_current" value="<?php echo $_POST['l_id']; ?>" />
<table style="width: 100%;">
<tr>
<td>ID</td>
<td><input type="text" name="id" value="<?php echo $_POST['l_id']; ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Parent ID</td>
<td><input type="text" name="parent_id" value="<?php echo $two['parent_id']; ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="caption" value="<?php echo $two['caption']; ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Visible</td>
<td><input type="text" name="visible" value="<?php echo $two['visible']; ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Enabled</td>
<td><input type="text" name="enabled" value="<?php echo $two['enabled']; ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Min. Rang</td>
<td><input type="text" name="min_rank" value="<?php echo $two['min_rank']; ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Layout</td>
<td><input type="text" name="page_layout" value="<?php echo $two['page_layout']; ?>" style="width: 95%" /></td>
</tr>
<tr>
<td>Headline</td>
<td><input type="text" name="page_headline" value="<?php echo $two['page_headline']; ?>" style="width: 95%" /></td>
</tr>
</table>
<input type="submit" class="input button" value="Update/Safe" name="update"/>
</form>
<?php
}
}
?>
<form method='post' align="center">
<input type="text" name="l_id" class="input text" placeholder="ID"><br>
<input type="submit" class="input button" value="Search" name="lookup" style="margin-top: 5px;" />
</form>
Have fun with this
Attachments
You must be registered for see attachments list
Last edited: