With this mod you can edit your snip, and change the category also!!
File "snips_edit.php"
In line 53 replace from
echo '<input type=hidden name=cats value='.$_GET['cats'].'>';
to
echo '<input type=hidden name=old_cats value='.$_GET['cats'].'>';
In line 47 AFTER
echo '<table width="600" border="0"><tr><td class="fr1">';
INSERT:
echo '<table width="600" border="0"><tr><td class="fr1">';
echo '<b>Select category:</b> <select name="cats">';
foreach($all_cats as $cat) {
if(strlen($cat) >1) {
echo "<option value=$cat>$cat</option>\n";
}
}
echo '</select></td></tr><tr><td class="fr2">';
In line 22 replace from
if(file_delete($_POST['cats'],$_POST['old_snip'])) {
to
if(file_delete($_POST['old_cats'],$_POST['old_snip'])) {
ENJOY
Normando
Sugestion: Any one can make a mod to include SUBcategories?
Logged In: YES
user_id=781149
Originator: YES
In the mod of line 47 change the foreach loop to:
foreach($all_cats as $cat) {
if(strlen($cat) >1) {
if($_GET['cats']==$cat) {
echo "<option value=$cat selected>$cat</option>\n";
}else{
echo "<option value=$cat>$cat</option>\n";
}
}
}
to get the snips category preselected in the menu box.
Enjoy again.
Normando
Logged In: NO
Thanks for sharing, you forgot one important thing, add it as following:
change:
foreach($all_cats as $cat) {
if(strlen($cat) > 1) {
echo "<option value=$cat>$cat</option>\n";
}
}
To:
foreach($all_cats as $cat) {
if(strlen($cat) > 1) {
$selected = ($_GET['cats'] && $_GET['cats'] == $cat) ? "selected" : "";
echo "<option value=$cat $selected>$cat</option>\n";
}
}
Otherwise the category will be changed to the first option everytime a snippet is edited, and we don't want that.
enjoj