'', 'status' => 'ok'); if ( isset($_POST['tag_action']) ) { check_admin_referer('nggallery_admin_tags'); if ( $_POST['tag_action'] == 'renametag' ) { $oldtag = (isset($_POST['renametag_old'])) ? $_POST['renametag_old'] : ''; $newtag = (isset($_POST['renametag_new'])) ? $_POST['renametag_new'] : ''; $action_status = nggTags::rename_tags( $oldtag, $newtag ); } elseif ( $_POST['tag_action'] == 'deletetag' ) { $todelete = (isset($_POST['deletetag_name'])) ? $_POST['deletetag_name'] : ''; $action_status = nggTags::delete_tags( $todelete ); } elseif ( $_POST['tag_action'] == 'editslug' ) { $matchtag = (isset($_POST['tagname_match'])) ? $_POST['tagname_match'] : ''; $newslug = (isset($_POST['tagslug_new'])) ? $_POST['tagslug_new'] : ''; $action_status = nggTags::edit_tag_slug( $matchtag, $newslug ); } } // Som useful variables $admin_base_url = admin_url() . 'admin.php?page=nggallery-tags'; $nb_tags = 50; // Number of tags to show on a single page // Manage URL $sort_order = ( isset($_GET['tag_sortorder']) ) ? esc_attr( stripslashes($_GET['tag_sortorder']) ) : 'desc'; $search_url = ( isset($_GET['search']) ) ? '&search=' . esc_attr ( stripslashes($_GET['search']) ) : ''; $action_url = $admin_base_url . '&tag_sortorder=' . $sort_order. $search_url; // Tags Filters $order_array = array( 'desc' => __('Most popular', 'nggallery'), 'asc' => __('Least used', 'nggallery'), 'natural' => __('Alphabetical', 'nggallery')); // Build Tags Param $param = 'hide_empty=false'; switch ($sort_order) { case 'natural' : $param .= '&number='.$nb_tags.'&orderby=name&order=asc'; break; case 'asc' : $param .= '&number='.$nb_tags.'&orderby=count&order=asc'; break; default : $param .= '&number='.$nb_tags.'&orderby=count&order=desc'; break; } // Search if ( !empty($_GET['search']) ) { $search = stripslashes($_GET['search']); $param .= '&name__like=' . $search; } // Offset if ( !empty($_GET['offset']) ) { $param .= '&offset=' . intval( $_GET['offset'] ); } // Navigation urls if ( empty($_GET['offset']) ) { $offset = 0; } else { $offset = intval( $_GET['offset'] ); } $tag_count = (int)wp_count_terms('ngg_tag', 'ignore_empty=true'); if ($offset + $nb_tags < $tag_count) { $next_offset = '' . min($offset + $nb_tags, $tag_count - $nb_tags); } else { $next_offset = ''; } if ($nb_tags < $tag_count && $offset>0) { $prev_offset = '' . max($offset - $nb_tags, 0); } else { $prev_offset = ''; } ?>


$title ) { $output[] = ($sort == $sort_order) ? ''.$title.'' : ''.$title.''; } echo implode('
', $output); $output = array(); unset($output); ?>
    ' . $tag->name . ' ('.$tag->count.')'."\n"; echo '
  • ' . esc_html( $tag->name ). ' '.'('. esc_html( $tag->count ).')
  • '."\n"; } unset($tags); ?>

.

Slug definition', 'nggallery'); ?>