Advertisement
Guest User

Untitled

a guest
Jun 21st, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. $profile->getphotos($profile->id);
  2.  
  3. $results = $profile->rows;
  4.  
  5. if ($results)
  6. {
  7. foreach ($results as $result)
  8. {
  9. $profile->getimage($profile->id);
  10.  
  11. $tz = new DateTimeZone($result->timezone);
  12. $date = new DateTime('now');
  13. $date->setTimeZone($tz);
  14.  
  15. list($name, $extension) = explode('.', $result->file);
  16.  
  17. $file_1 = root_path.$photos_map.$name.'_1.'.$extension;
  18. $file_2 = root_path.$photos_map.$name.'_2.'.$extension;
  19.  
  20. list($width, $height) = getimagesize($file_2);
  21.  
  22. $template->newBlock('show_file');
  23. $template->assign(array(
  24. 'id' => $result->id,
  25. 'profileid' => $profile->id,
  26. 'file_height' => $height,
  27. 'file_small' => $file_1,
  28. 'file' => $file_2,
  29. 'image_small' => $profile->image_small,
  30. 'name' => $profile->name,
  31. 'date' => humanizeDateDiffference(strtotime($date->format('Y-m-d H:i:s')), strtotime($result->added))
  32. ));
  33.  
  34. if ($result->file_text)
  35. {
  36. $template->newBlock('photo_file_text');
  37. $template->assign('file_text', utf8_encode($result->file_text));
  38. }
  39.  
  40. $profile->getcomments($result->id);
  41.  
  42. $aresults = $profile->aresults;
  43.  
  44. if ($aresults)
  45. {
  46. foreach ($aresults as $aresult)
  47. {
  48. $template->newBlock('comment_list');
  49.  
  50. $profile->getimage($aresult['fromprofileid']);
  51.  
  52. $tz = new DateTimeZone($aresult['timezone']);
  53. $date = new DateTime('now');
  54. $date->setTimeZone($tz);
  55.  
  56. $template->assign(array(
  57. 'image_small' => $profile->image_small,
  58. 'comment_name' => $aresult['name'],
  59. 'comment' => $aresult['text'],
  60. 'comment_data' => humanizeDateDiffference(strtotime($date->format('Y-m-d H:i:s')), strtotime($aresult['added']))
  61. ));
  62. }
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement