These forums are provided for community interactions only. For official support please submit a support ticket.
You are not logged in.
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
*Bump* If anyone has any suggestions, I'm still stuck on this!
Offline
why are you doing an sql call and not using the Director API?
Offline
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
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