Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
About It:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

Admin Panel Image Sorting

Yay for being able to sort!


Depending on your textpattern installation you could download the following files, renaming the one that corresponds to your install as txp_image.php and uploading to yourtxpinstall/include/

The directions below apply only for Textpattern 4.01/4.02 However, it wouldn’t be difficult to apply the changes to previous or future versions with minor adjustments

  • After global $txpcfg,$extensions,$img_dir; around line 33 add the following:


// From Manfre's Mod File
$sort = gps('sort');
$dir = gps('dir');
$sort = ($sort) ? $sort : 'id';
$dir = ($dir) ? $dir : 'asc';
if ($dir == "asc") { $dir = "desc"; } else { $dir = "asc"; }
// End

  • Find, around line 58, the following code, and either delete it or comment it out:


hCell(ucfirst(gTxt('name'))) .
hCell(gTxt('image_category')) .
hCell(gTxt('tags')) .
hCell(gTxt('author')) .
hCell(gTxt('thumbnail')) .
hCell()

  • In the place of the aforementioned code, place the following:


column_head('Id','id','image',1,$dir).
column_head('Name','name','image',1,$dir).
column_head('image_category','category','image',1,$dir).
td(gTxt('tags')).
column_head('Author','author','image',1,$dir).
hCell(gTxt('thumbnail')).
hCell()

  • Find, around line 83

$rs = safe_rows_start("*", "txp_image", "1 order by category,name limit $offset,$limit");

  • Replace the aforementioned code with:

$rs = safe_rows_start("*", "txp_image", "1 order by $sort $dir limit $offset,$limit");

  • Find, around line 105, the following code:

td($elink).td($category).td($txtilelink.' / '.$txplink.' / '.$xhtmlink).

  • In front of td($elink) add the following:

td($id). Please notice the ’.’

Article Request Count:
Initially released:
November 8, 2005
Posted here:
30 Mar 2006
Article modified:
03 Apr 2006

If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (8)

I think, this is a wonderful extention.

Any plans to use this as a patch for the core?
This is very helpful. Have you considered submitting a patch to the dev team?
I’ll try to have a look on the issue this weekend.
Good stuff! Thanks! Works like a charms and helps me immensly.

Another huge improvement would be the same search feature as exists on the articles page. (Though admittedly that would be a good chunk of coding)
Would you mind submitting a patch to the dev team?
Great !!!! I was just looking for something like that. Thanks a lot.
This is perfect. I was looking for a plugin that extended the image admin, and this does exactly what I’d hoped. Nice one! Thanks!

This is now deprecated as it is a “feature” of 4.0.4 . Yay!

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

Would you care to write a comment or visit the forum discussion?

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern