Guest User

Untitled

a guest
Feb 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2. function xarpages_funcapi_jobstesting($args)
  3. {
  4. $arts = xarModAPIFunc('articles','user','getall',array('ptid' => 14, 'fields' => array('aid','cids','summary'),'sort' => 'summary', 'status' => array(2,3)));
  5. $locations = xarmodapifunc('dynamicdata','user','getitems',array('module' => 182, 'itemtype' => 3));
  6. $artsdd = xarmodapifunc('dynamicdata','user','getitems',array('module' => 151, 'itemtype' => 14));
  7.  
  8. foreach ($arts as $a => $art) {
  9. foreach ($artsdd as $d => $artdd) {
  10. if ($d == $art['aid']) {
  11. $newarts[] = $artdd + $art;
  12. }
  13. }
  14. }
  15. foreach ($newarts as $n => $newart) {
  16. if (!empty($newart['location'])) {
  17. foreach ($locations as $l => $location) {
  18. if ($newart['location'] == $l) {
  19. $finalarts[$n] = $newart + $location;
  20. }
  21. }
  22. } else {
  23. $finalarts[$n] = $newart;
  24. }
  25. }
  26.  
  27.  
  28. $args['custom']['arts'] = $finalarts;
  29. //$args['custom']['locations'] = $locations;
  30. //$args['custom']['artsdd'] = $artsdd;
  31. return $args;
  32. //print_r($hmm);die;
  33. }
  34. ?>
Add Comment
Please, Sign In to add comment