Visual Index main ordering

danhaskett / 2012-02-13 17:19:39   

Hi there,

I'm using the visual index main plugin on a website here -

Webpage

I'd really like to be able to order the sections but can't work it out. I've been looking through the forum and have tried the timthumb plugin without much luck. Has anyone had any success at modifying this plug in to be able to order the exhibits?

Also, is it possible to limit the number of exhibits in one row? So that it's only 4 thumbnails per row for instance...

Thanks for any help,

Dan

rickykappa / 2012-02-14 03:29:05   

despite I've asked that in the forum I was never able myself to give arbitrary order to the exhibits, I could make it only chronological... besides there are too many versions of this exhibit/plugin, hard to give proper answers that apply to everybody.
your 2nd question: I guess you can calculate and apply a width to the row in order to force it give room to as many thumbs as you want

ivank123 / 2012-02-28 07:56:59   

Hi there. I have the same problem. I'm in the middle of a project where ordering sections is requested by my client, so I'm in trouble...!

ivank123 / 2012-02-28 08:15:53   

I've found in this page:
http://www.indexhibit.org/forum/thread/10821
a version of the plugin posted by

ps - ISRAEL - 2010-11-08 16:29:34

where it seems that this is solved, but the link to the files takes you to a page where you must pay to download... And as it's a quite old file, I don't feel like paying just to see if it's there. But it's good to know that somebody could solve this.

ivank123 / 2012-03-01 05:24:31   

Here are the links of the Visual Index modified by ps (Phil), posted below in that same post (http://www.indexhibit.org/forum/thread/10821/2/):

Visual Index Section

Visual Index Main

I installed the Section one but sadly I only get a blank screen... :(

Any hint of what may be causing troubles there?

ivank123 / 2012-03-05 07:57:36   

I'm happy to say that I have the solution for this issue!
What I did was to take a 'code paragraph' from the "visual_index_mansonary_timthumb_linked" plugin, in which it orders the images, to replace a very similar paragraph from the original Visual Index Section plugin.

  1. So, all you need to do is to replace this lines:
  2.     $pages = $OBJ->db->fetchArray("SELECT media_file, url, title, media_order 
  3.         FROM ".PX."media, ".PX."objects 
  4.         WHERE id = media_ref_id 
  5.         AND media_order = (SELECT MIN(media_order) FROM ".PX."media WHERE media_ref_id = id) 
  6.         AND section_id = '$rs[section_id]'");
  1. with these ones:
  2. $pages = $OBJ->db->fetchArray("SELECT media_file, media_x, media_y, url, ord, title, status, media_order 
  3.         FROM ".PX."media, ".PX."objects 
  4.         WHERE id = media_ref_id 
  5.         AND status = 1
  6.         AND media_order = (SELECT MIN(media_order) FROM ".PX."media WHERE media_ref_id = id) 
  7.         AND section_id = '$rs[section_id]' ORDER BY ord ASC");

That's all!

rickykappa / 2012-03-05 09:11:00   

great!! thankyou :-)

pernin / 2012-03-06 02:28:12   

good catch Ivan!

let's refine this a bit, as people with little sql may have a bit of a problem understanding what they're doing

What you need is the field 'ord' in the SELECT statement, and the ORDER BY clause at the end (ASC for ascending and DESC for descending), so you're telling the script to get the values of ord from the database, and then order the records ascending according to these values

If we take Ivank123 example, as the original visual index section already selects the correct tables, you just need to add the field ord to the statement:

$pages = $OBJ->db->fetchArray("SELECT media_file, url, title, media_order, ord

and then add the order by clause at the end:

AND section_id = '$rs[section_id]' ORDER BY ord ASC");

This thread has been closed, thank you.