Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. public function do_insert_process($mpx_id, $account, $set_priority, $add_anyways) {
  2. $this->total++;
  3. //var_dump($medias);
  4. if (!$this->dba->ckMediaExists($mpx_id)) {
  5. $medias = $this->getMPXInfoFromMPXId($mpx_id, $account);
  6.  
  7. if ($medias['response']['entryCount'] == 0) {
  8. $this->not_found_mpx++;
  9. $res['msg'] = "media id: ".$mpx_id." no ha sido encontrada en MPX!";
  10.  
  11. if ($add_anyways == 1) {
  12. $this->ingresados++;
  13. $this->dba->insertEmptyTitle($mpx_id, $account, $set_priority);
  14. $res['msg'] .= " Se agregó a la DB! ";
  15. }
  16. return $res;
  17. }
  18.  
  19. var_dump($medias['response']['entries'][0]);
  20. $mpx = $this->mpx_data($medias['response']['entries'][0]);
  21. $mpx['account'] = $account;
  22.  
  23. if ($set_priority == 1){
  24. $lastID = $this->dba->insertTitleNewly($mpx);
  25. } else {
  26. $lastID = $this->dba->insertTitle($mpx);
  27. }
  28.  
  29. if ($lastID){
  30. $res['msg'] = 'OK';
  31. unset($medias['response']['entries'][0]['content']);
  32. $res['entry'] = $medias['response']['entries'][0];
  33. }
  34. } else {
  35. $res['msg'] = "media id: ".$mpx_id." ya existe en la base de datos!";
  36. $this->repetidos++;
  37. if ($set_priority == 1) {
  38. $this->dba->setPriority('mpx_id', $mpx_id, 1);
  39. $res['msg'] .= ' Se marcó como prioridad';
  40. }
  41.  
  42. }
  43.  
  44. return $res;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement