Пример #1
0
                 } else {
                     if (filesize($theFile) == 0) {
                         file_put_contents($theFile, base64_decode($extendedprofile->picture));
                     }
                 }
                 $object->profilepicture = HOST . "slir/w100/snapchat/includes/webservices/images/extendedprofiles/" . $extendedprofile->id . ".jpg";
             } else {
                 $object->profilepicture = "http://i.imgur.com/tmqV1Vo.png";
             }
         }
     }
     $response = $objects;
 } else {
     if ($_GET['object'] == "wallpostcomment") {
         $sql = "SELECT * FROM " . T_WALLPOSTCOMMENTS . " WHERE wallpostid = " . $_GET['wallpostid'] . " ORDER BY id DESC";
         $objects = WallPostComment::get_by_sql($sql);
         if (count($objects) > 0) {
             foreach ($objects as $object) {
                 // EXTENDED PROFILE PICTURE
                 $extendedprofile = ExtendedProfile::get_by_username($object->username);
                 if ($extendedprofile && $extendedprofile->picture) {
                     $theFile = "images/extendedprofiles/" . $extendedprofile->id . ".jpg";
                     if (!file_exists($theFile)) {
                         file_put_contents($theFile, base64_decode($extendedprofile->picture));
                     } else {
                         if (filesize($theFile) == 0) {
                             file_put_contents($theFile, base64_decode($extendedprofile->picture));
                         }
                     }
                     $object->profilepicture = HOST . "slir/w100/snapchat/includes/webservices/images/extendedprofiles/" . $extendedprofile->id . ".jpg";
                 } else {