Content last modified Tuesday 24 August 2021
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

You know you want to visit the Archives.
Published with Textpattern