These forums are provided for community interactions only. For official support please submit a support ticket.

You are not logged in.

  • Index
  •  »  / API
  •  » DirectorPHP not returning all content

#1 2012-04-29 06:29:20

schad
Member
From: New York
Registered: 2006-03-15
Posts: 46
Website

DirectorPHP not returning all content

I am finding that I get more results making a SQL call than if I use DirectorPHP to retrieve the same information.


As an example:
http://samchadwickphoto.com/search/

The tag cloud there is generated by a SQL call to SSP Director. 
$result = mysql_query("SELECT * FROM ssp_images");

If you hover over the word "monk" for example, you will see that 14 images are tagged with monk (and this is correct).

However, if you click on the word monk, which makes the DirectorPHP call
$contents = $director->content->all(array('tags' => $ssptags));
(where $ssptags = "monk" passed via the URL)

only 3 images are returned.

One further thing I noticed.  If I move one of the missing monk images into the album where the one monk image that is displayed, the image now shows.  I checked the album settings and the album with the missing monk images is marked as active, so too are the images themselves.

I am wondering if there is a limitation on the maximum number of images DirectorPHP will cycle through before it gives up?

Any suggestions welcomed.

Last edited by schad (2012-06-18 14:13:31)

Offline

 

#2 2012-06-18 14:11:49

schad
Member
From: New York
Registered: 2006-03-15
Posts: 46
Website

Re: DirectorPHP not returning all content

*Bump*  If anyone has any suggestions, I'm still stuck on this!

Offline

 

#3 2012-06-18 22:35:43

brandonguy
Veteran Member
Registered: 2008-02-07
Posts: 210

Re: DirectorPHP not returning all content

why are you doing an sql call and not using the Director API?

Offline

 

#4 2012-06-20 11:48:46

schad
Member
From: New York
Registered: 2006-03-15
Posts: 46
Website

Re: DirectorPHP not returning all content

I am using the API.  Extract of code below.

<?php

include('blah.com/directorphp/classes/DirectorPHP.php');
$director = new Director('APIkey', 'locationURL');

$director->format->add(array('name' => 'thumb', 'width' => '90', 'height' => '90', 'crop' => 1, 'quality' => 75, 'sharpening' => 1));

$tags = urlencode($_GET['tags']);
$tags = str_replace('+', ',', $tags);
$ssptags = array($tags, 'one');
$contents = $director->content->all(array('tags' => $ssptags));

?>

The problem is that the $contents array doesn't include all of the images in Director that have the tags.  But if I use SQL I get the full set of results.  Do you know what I have done wrong here?

Offline

 

#5 2012-06-20 16:43:14

brandonguy
Veteran Member
Registered: 2008-02-07
Posts: 210

Re: DirectorPHP not returning all content

I hacked Director into pieces when it comes to tags as thought it is really stupid to have spaces as the exploding trigger (and not a comma) so can't help you.  A comma makesmuch more sense, as many stock images and pro photogs like to make a tag list with Lightroom with commas.

Offline

 
  • Index
  •  »  / API
  •  » DirectorPHP not returning all content

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson