[FX.php List] Re: FX.php_List Digest, Vol 31, Issue 30
Lindal, Mark
mlindal at pfc.forestry.ca
Mon Feb 19 16:20:54 MST 2007
Here is my code for selecting three random publications for an array:
$groupSize=3;
$search=new FX($serverIP,$webCompanionPort);
$search->SetDBData('PUB_Publication_.fp5','ForPHP',$groupSize);
$search->AddDBParam('BookStore_DateAdded_Find', $newdate2 , 'gte');
$search->AddSortParam('BookStore_DateAdded_Find','descend');
$searchResult=$search->FMFind();
//looking for new network tag "hot"
$tagHot=new FX($serverIP,$webCompanionPort);
$tagHot->SetDBData('PUB_Publication_.fp5','ForPHP');
$tagHot->AddDBParam("ResearchNetworkIDs", "RN018");
//Rn018 is our code for hot publications
$tagHotResult=$tagHot->FMFind();
$i=0;
foreach($tagHotResult['data'] as $key2=>$tagHotData)
{$temparray[$i] .= $tagHotData['CatalogNumber'][0];
$i = $i + 1 ;
}
$randomHot = array_rand($temparray, 3);
// This picks 3 pubs randomly from those marked hot in the database.
$hotsearch=new FX($serverIP,$webCompanionPort);
$hotsearch->SetDBData('PUB_Publication_.fp5','ForPHP', $groupSize);
$hotsearch->AddDBParam("CatalogNumber", $temparray[$randomHot[0]]);
$hotsearch->AddDBParam("CatalogNumber", $temparray[$randomHot[1]]);
$hotsearch->AddDBParam("CatalogNumber", $temparray[$randomHot[2]]);
$hotsearch->AddDBParam("-lop", "or");
$hotsearchResult=$hotsearch->FMFind();
> Your mail to 'FX.php_List' with the subject
>
> Re: FX.php_List Digest, Vol 31, Issue 30
>
> Is being held until the list moderator can review it for approval.
>
> The reason it is being held:
>
> Post by non-member to a members-only list
>
> Either the message will get posted to the list, or you will receive
> notification of the moderator's decision. If you would like to cancel
> this posting, please visit the following URL:
>
>
> http://www.iviking.org/mailman/confirm/fx.php_list/e9474d63274af34c2ad807036de
> a4ce73a80ae56
>
------------------------------
Mark Lindal
Publications Technician / Technicien, publications
Canadian Forest Service / Service canadien des forêts
Natural Resources Canada / Ressources naturelles Canada
Government of Canada / Gouvernement du Canada
506 West Burnside Road / 506, chemin Burnside ouest
Victoria, BC V8Z 1M5 / Victoria (C.-B.) V8Z 1M5
mlindal at pfc.forestry.ca
250-363-0603
------------------------------
Mark Lindal
Publications Technician / Technicien, publications
Canadian Forest Service / Service canadien des forêts
Natural Resources Canada / Ressources naturelles Canada
Government of Canada / Gouvernement du Canada
506 West Burnside Road / 506, chemin Burnside ouest
Victoria, BC V8Z 1M5 / Victoria (C.-B.) V8Z 1M5
mlindal at pfc.forestry.ca
250-363-0603
More information about the FX.php_List
mailing list