summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-09 13:28:10 +0300
committerAndrew Dolgov <[email protected]>2010-11-09 13:28:10 +0300
commitc00907f2ed4880a6ec8f06edfd21ee4b12c50c94 (patch)
tree7fcbd13bbfd0ba459d718c8c8a10671b1c15bf54 /functions.php
parent10249c41b763a373926d9b1f78b7b8cef68e411b (diff)
properly handle on-the-fly adding of categories
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/functions.php b/functions.php
index f9de0622f..d9754a2f7 100644
--- a/functions.php
+++ b/functions.php
@@ -3047,17 +3047,19 @@
WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
if (db_num_rows($result) > 0 && $include_all_cats) {
- print "<option disabled>--------</option>";
+ print "<option disabled=\"1\">--------</option>";
}
while ($line = db_fetch_assoc($result)) {
if ($line["id"] == $default_id) {
$is_selected = "selected=\"1\"";
} else {
- $is_selected = "";
+ $is_selected = "";
}
- printf("<option $is_selected value='%d'>%s</option>",
- $line["id"], htmlspecialchars($line["title"]));
+
+ if ($line["title"])
+ printf("<option $is_selected value='%d'>%s</option>",
+ $line["id"], htmlspecialchars($line["title"]));
}
print "<option value=\"ADD_CAT\">" .__("Add category...") . "</option>";
@@ -6609,6 +6611,9 @@
}
function add_feed_category($link, $feed_cat) {
+
+ if (!$feed_cat) return false;
+
db_query($link, "BEGIN");
$result = db_query($link,