'category_parent', 'id' => 'cat_ID'); //TODO: decouple this
function start_el($output, $category, $depth, $args) {
$pad = str_repeat(' ', $depth * 3);
$cat_name = apply_filters('list_cats', $category->cat_name, $category);
$output .= "\t\n";
return $output;
}
}
function post_notification_admin_sub(){
global $wpdb;
$t_emails = $wpdb->prefix . 'post_notification_emails';
$t_cats = $wpdb->prefix . 'post_notification_cats';
if($_GET['action'] == 'remove_email') $remove=true; else $remove = false;
echo '
' . __('List of addresses:', 'post_notification') . '
';
if (isset($_POST['removeEmailChecked'])) {
if ($_POST['removeEmail'] == "") {
echo '' . __('No address checked!', 'post_notification') . '
';
} else {
echo __('The following addresses were deleted:', 'post_notification') . '
';
foreach ($_POST['removeEmail'] as $removeAddress) {
//Multiple table delete only works with mysql 4.0 or 4.1
$wpdb->query("DELETE $t_cats, $t_emails
FROM $t_emails LEFT JOIN $t_cats USING (id)
WHERE email_addr = '$removeAddress'");
echo "$removeAddress
";
}
}
} else {
if(isset($_POST['email']))
$email = $_POST['email'];
else
$email = '*';
if(isset($_POST['cats']))
$sel_cats = $_POST['cats'];
else
$sel_cats = '';
if (!is_array($sel_cats)) $sel_cats = array();
if(isset($_POST['limit']))
$limit= $_POST['limit'];
else
$limit = 50;
if(!is_numeric($limit)) $limit= 50;
if($limit< 1) $limit= 1;
if(isset($_POST['start']))
$start = $_POST['start'];
else
$start = '';
if(!is_numeric($start)) $start = 0;
if(isset($_POST['next'])) $start += $limit;
if(isset($_POST['perv'])) $start -= $limit;
if($start < 0) $start = 0;
if(isset($_POST['sortby'])) {
$sortby = $_POST['sortby'];
} else {
$sortby = 'id';
}
if(isset($_POST['sortorder'])) {
$sortorder = $_POST['sortorder'];
} else {
$sortorder = 'ASC';
}
$sortsrt = " $sortby $sortorder ";
$show_id = isset($_POST['show_id']);
$show_list = isset($_POST['show_list']);
$show_unconf = isset($_POST['show_unconf']);
echo '';
}
}
}
?>