Location: PHPKode > scripts > GRAND FlAGallery > flash-album-gallery/admin/banner-sort.php

function flag_b_playlist_order($playlist = 'deprecated'){
	global $wpdb;
	//this is the url without any presort variable
	$base_url = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
	$flag_options = get_option('flag_options');
	$playlistPath = $flag_options['galleryPath'].'playlists/banner/'.urlencode($_GET['playlist']).'.xml';
	$playlist = get_b_playlist_data(ABSPATH.$playlistPath);
	$items_a = $playlist['items'];
	$items = implode(',',$playlist['items']);
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
<div class="wrap">
			<h2><?php _e('Sort Gallery', 'flag'); ?></h2>

	<div class="alignright tablenav" style="margin-bottom: -36px;">
		<a href="<?php echo esc_url($base_url.'&playlist='.urlencode($_GET['playlist']).'&mode=edit'); ?>" class="button-secondary action"><?php _e('Back to playlist', 'flag'); ?></a>
	<form id="sortPlaylist" method="POST" action="<?php echo esc_url($base_url.'&playlist='.urlencode($_GET['playlist']).'&mode=edit'); ?>" accept-charset="utf-8">
		<div class="alignleft tablenav">
			<?php wp_nonce_field('flag_updatesortorder'); ?>
			<input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flag'); ?>" />
		<br clear="all" />
		<input type="hidden" name="playlist_title" value="<?php echo esc_html(stripslashes($playlist['title'])); ?>" />
		<input type="hidden" name="skinname" value="<?php echo $playlist['skin']; ?>" />
		<input type="hidden" name="skinaction" value="<?php echo $playlist['skin']; ?>" />
		<textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html(stripslashes($playlist['description'])); ?></textarea>
<script type="text/javascript">
jQuery(document).ready(function($) {
    // Initialise the table
      onDragClass: "myDragClass",
	  	onDrop: function() {
				jQuery("#listitems tr:even").addClass('alternate');
				jQuery("#listitems tr:odd").removeClass('alternate');
        // pass the headers argument and assing a object 
        headers: { 
            // assign the secound column (we start counting zero) 
            1: { 
                // disable it by setting the property sorter to false 
                sorter: false 
		$("#flag-listitems").bind("sortEnd",function() { 
				jQuery("#listitems tr:even").addClass('alternate');
				jQuery("#listitems tr:odd").removeClass('alternate');

<table id="flag-listitems" class="widefat fixed" cellspacing="0" >

			<th class="header" width="54"><p style="margin-right:-10px;"><?php _e('ID', 'flag'); ?></p></th>
			<th width="50"><div><?php _e('Thumb', 'flag'); ?></div></th>
			<th class="header"><p><?php _e('Filename', 'flag'); ?></p></th>
			<th class="header"><p><?php _e('Title', 'flag'); ?></p></th>
			<th><?php _e('ID', 'flag'); ?></th>
			<th><?php _e('Thumb', 'flag'); ?></th>
			<th><?php _e('Filename', 'flag'); ?></th>
			<th><?php _e('Title', 'flag'); ?></th>
	<tbody id="listitems">
if(count($items_a)) {
	$counter	= 0;
	foreach($items_a as $item) {
		$ban = get_post($item);
        $thumb = get_post_meta($item, 'thumbnail', true);
        if(empty($thumb)) {
          $thumb = wp_get_attachment_thumb_url($ban->ID);
		$alternate = ( !isset($alternate) || $alternate == 'alternate' ) ? '' : 'alternate';	
		$bg = ( !isset($alternate) || $alternate == 'alternate' ) ? 'f9f9f9' : 'ffffff';
		$url = wp_get_attachment_url($ban->ID);
		<tr id="$ban-<?php echo $ban->ID; ?>" class="<?php echo $alternate; ?> iedit"  valign="top">
				<td scope="row"><input type="hidden" name="item_a[<?php echo $ban->ID; ?>][ID]" value="<?php echo $ban->ID; ?>" /><strong><?php echo $ban->ID; ?></strong></td>
				<td width="50"><a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo $url; ?>"><img id="thumb-<?php echo $ban->ID; ?>" src="<?php echo $thumb; ?>" width="40" height="40" alt="" /></a></td>
				<td><?php echo basename($url); ?></td>
				<td><?php echo esc_html(stripslashes($ban->post_title)); ?></td>
} else {
	echo '<tr><td colspan="4" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
	<p class="actions"><input type="submit" class="button-primary action"  name="updatePlaylist" value="<?php _e('Update Sort Order', 'flag'); ?>" /></p>
<br class="clear"/>
</div><!-- /#wrap -->

Return current item: GRAND FlAGallery