case "goXferAI": $ids = $_POST['ids']; $ids = split(",",$ids); $pIDs = $_POST['pIDs']; $pIDs = split(",",$pIDs); $pageID = $_POST['pID']; $ec = count($pIDs); $errs = array(); if(!empty($pIDs)){ if($pageID == $pIDs[$ec-1]){ // ok we are x'fering images to the last page // first have to get the count of images on // that page. $sID = $pIDs[$ec-1]; $iCount = $tenMM->imageCount($sID); if($iCount[0]){ $iCount = $iCount[1]; }else{ $iCount = 0; } $startSort = $ec*12; $endSort = $startSort; $endSort = $endSort + $iCount; for($i=0;$iupSort($ids[$i],$endSort); if(!$upSort[0]){ $errs[] = $upSort[1]; } } if(empty($errs)){ // ok we re-addressed the sort value of the images // we now need to reset the rest of the images $goReset = $tenMM->resetAIsort(); if($goReset[0]){ // al set header("Content-type: text/xml"); echo ''; echo ''; echo '1'; echo ''; }else{ // error with reseting sort header("Content-type: text/xml"); echo ''; echo ''; echo '0'; echo ' Error with reseting sort '; echo ''; } } }else{ // ok we are not xfering to last page. // we will need to go ahead and get setup // get our IDs of the 12 pictures on that // page $imgIDs = $tenMM->getIIDS($pageID,$tenMM->imageGID,12); if($imgIDs[0]){ // ok we have our image IDs // now we need to subtract the count // of our images being xfered from the // count of image ids // we also need to get the IDs of the pictures // after the last image we are updating // so we count the iamges and get those ids // starting w/ last id of img ids $imgIDs = $imgIDs[1]; $ec2 = count($imgIDs) - count($ids); $oldIDs = $tenMM->getIIDs($imgIDs[$ec2],$tenMM->imageGID,count($ids)); if($oldIDs[0]){ $oldIDs = $oldIDs[1]; }else{ $errs += $oldIDs[1]; header("Content-type: text/xml"); echo ''; echo ''; echo '0'; for($i=0;$i' . $errs[$i] . ''; } echo ''; } if(empty($errs)){ $startCount = count($imgIDs)- count($ids); $startID = $imgIDs[$startCount]; // ok we now have our start ID we need to now // find out the sort value for this ID $startSort = $tenMM->getISort($startID); if($startSort[0]){ $startSort = $startSort[1]; }else{ header("Content-type: text/xml"); echo ''; echo ''; echo '0'; echo '' . $startSort[1] . ''; echo ''; } // ok we now have our start sort, we need to update our sort values // of our image ids started w. $startSort--; for($i=0;$iupSort($ids[$i],$startSort); if(!$upSort[0]){ $errs[] = $upSort[1]; } } } if(empty($errs)){ // ok now that we have succesfully updated our ids with // there new sort value. We need to update our old ones // to there new value starting with the end of startSort // sine we are reseting the sort values after this we // will simply add in decimal values $sam = .01; for($i=0;$iupSort($oldIDs[$i],$newSort); if(!$upSort[0]){ $errs[] = $upSort[1]; } $sam = $sam + .01; } // ok we have no updated that /// now we have to make sure there was no errors if(empty($errs)){ // ok there was none, time to reset the image's sort. $goReset = $tenMM->resetAIsort(); if($goReset[0]){ // al set header("Content-type: text/xml"); echo ''; echo ''; echo '1'; echo ''; }else{ // error with reseting sort header("Content-type: text/xml"); echo ''; echo ''; echo '0'; echo ' Error with reseting sort '; echo ''; } }else{ // ok error header("Content-type: text/xml"); echo ''; echo ''; echo '0'; for($i=0;$i' . $errs[$i] . ''; } echo ''; } }else{ // ok error header("Content-type: text/xml"); echo ''; echo ''; echo '0'; for($i=0;$i' . $errs[$i] . ''; } echo ''; } }else{ // error with getting image IDs header("Content-type: text/xml"); echo ''; echo ''; echo '0'; echo '' . $imgIDs[1] . ''; echo ''; } } } break;