public static function getCodeFromId($id) { $parts = explode('_', $id); $id = $parts[0]; $alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'; $shortenedId = ''; while ($id > 0) { $remainder = $id % 64; $id = ($id - $remainder) / 64; $shortenedId = $alphabet[$remainder] . $shortenedId; } return $shortenedId; }
public static function getMediaCommentsById($mediaId, $count = 10, $maxId = null) { $code = Media::getCodeFromId($mediaId); return self::getMediaCommentsByCode($code, $count, $maxId); }