1
morris
Image Manager > sorting of files
  • 2004/1/1 15:28

  • morris

  • Just popping in

  • Posts: 54

  • Since: 2003/9/25


Hi,
When I insert an image in a news story, it would be nice if the images I can choose from the ImageManager are sorted on name istead of ID# Can this be done and where/what should I change?

Morris

2
morris
Re: Image Manager > sorting of files
  • 2004/1/2 21:11

  • morris

  • Just popping in

  • Posts: 54

  • Since: 2003/9/25


I found it already. I had to change the image.php file in the kernel directory. Now my images are sorted on image_nicename instead of image_id.

Unfortunately, since I use Chapi News Wysiwyg Patch (see more info here), this sorting is not working in the news module.

The following code is used to list the pictures, but I do not know what to add/edit to have the images sorted on image_nicename. Can someone help me with this.

$result = $xoopsDB->query("SELECT imgcat_name, imgcat_id, imgcat_storetype FROM ".$xoopsDB->prefix(imagecategory)." ORDER BY imgcat_name ASC");
$i=0;

while($imgcat = $xoopsDB->fetcharray($result)){

$spaw_imglibs[$i]["value"] = 'uploads/';
$spaw_imglibs[$i]["text"] = $imgcat["imgcat_name"];
$spaw_imglibs[$i]["catID"] = $imgcat["imgcat_id"];
$spaw_imglibs[$i]["storetype"] = $imgcat["imgcat_storetype"];
$spaw_imglibs[$i]["autoID"] = $i;

$i++;
}

3
slyss
Re: Image Manager > sorting of files
  • 2007/1/3 12:10

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


in kernel/image.php

around the line 214 you can see:

$sql .= ' ORDER BY '.$sort.' '.$criteria->getOrder();


ok, now modify the line like this:


$sql .= ' ORDER BY image_id DESC ';


that's all
[size=x-large]2008 Xoops Book[/size]

4
martyboy
Re: Image Manager > sorting of files
  • 2007/1/3 16:03

  • martyboy

  • Quite a regular

  • Posts: 256

  • Since: 2004/5/25


I am interested in this topic, a few months ago i had created a new category for news images in the image manager, it was fine any new images uploaded where being displayed at the top (page 1) so it was easy to find newly uploaded images, all of a sudden though new uploaded images are being put into page 4 or 5 ( round about the middle) which means i have to go throuhg a few pages to find images.

I have alot of images so i dont bother with adding weight to uploaded images, is there a change to the code so I could make uploaded images sort by upload date i.e so new images are at the top of page 1.

Thanks.
Michael Jackson = King Of Pop

Xoops = King Of CMS

5
elpaksu
Re: Image Manager > sorting of files
  • 2007/4/13 18:16

  • elpaksu

  • Just popping in

  • Posts: 10

  • Since: 2006/2/9 1


Finaly it's works


THANX THANX THANX THANX

Login

Who's Online

257 user(s) are online (165 user(s) are browsing Support Forums)


Members: 0


Guests: 257


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits