$val) { if(preg_match('/^tcb([0-9]+)$/', $key, $match)) { if(($id = (int) $_REQUEST[$key]) > 0) { $ids[] = $id; } } } if(count($ids) > 0) { $sql = "delete from " . getTable("tag") . " where id in (".implode(',', $ids) . ")"; rss_query($sql); $sql = "delete from " . getTable("metatag") . " where tid in (".implode(',', $ids) . ")"; rss_query($sql); rss_invalidate_cache(); } } } else { list($tname) = rss_fetch_row(rss_query("select tag from " .getTable("tag") ." where id = $tid")); echo "
\n" ."

"; printf(__("Are you sure you wish to delete '%s'?"),$tname); echo "

\n" ."

\n" ."\n" ."\n" ."\n" ."\n" ."

\n
\n"; $ret__ = CST_ADMIN_DOMAIN_NONE; } break; case CST_ADMIN_SUBMIT_EDIT: // TBD $new_label = preg_replace(ALLOWED_TAGS_REGEXP,'', $_REQUEST['t_name']); // also replace whitespaces $new_label = str_replace(' ','',$new_label); if (is_numeric($tid) && strlen($new_label) > 0) { $res = rss_query("select count(*) as cnt from " . getTable("tag") ." where binary tag='".rss_real_escape_string($new_label)."'"); list($cnt) = rss_fetch_row($res); if ($cnt > 0) { rss_error(sprintf(__("You can't rename this item '%s' because such an item already exists."),$new_label), RSS_ERROR_ERROR,true); break; } rss_query("update " .getTable("tag") ." set tag='".rss_real_escape_string($new_label)."' where id=$tid"); rss_invalidate_cache(); } break; default: break; } echo "\n"; echo "
\n" ."

".__('Tags')."

\n" ."
" ."\n" ."\n" ."\t\n" ."\t\n" ."\t\n" ."\n"; $sql = sprintf("select id, tag from %s t left join %s m on (t.id = m.tid) where m.ttype = 'item'", getTable("tag"), getTable("metatag")); $res = rss_query($sql); $cntr = 0; while (list($id, $tag) = rss_fetch_row($res)) { $class_ = (($cntr++ % 2 == 0)?"even":"odd"); echo "\n" ."\t\n" ."\t\n" ."\t\n" ."\n"; } echo "
". __('Tags') ."". __('Action') ."
" . __('edit') ."\n" ."|" . __('delete') ."\n" ."|" . __('view') ."\n" ."
\n"; echo "
\n" ."".__('Selected')."...\n" ."

\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."

\n" ."\n" ."
\n"; } function tag_edit($tid){ $sql = "select id, tag from " . getTable("tag") ." where id=$tid"; $res = rss_query($sql); list ($id, $tag) = rss_fetch_row($res); echo "
\n" ."

".ucfirst(__('edit'))." '$tag'

\n" ."
\n" ."
\n" ."\n" ."\n" ."\n" ."\n" ."
" ."
\n"; }