INNER JOIN `user` ON `user`.`uid` = `photo`.`uid` WHERE `resource-id` IN
(SELECT `resource-id` FROM `photo` WHERE `id` = ?) AND `photo`.`uid` = ?
ORDER BY `photo`.`width` DESC LIMIT 2", $id, api_user()));
-
+
if (!empty($media)) {
$ressources[] = $media[0]['resource-id'];
$phototypes = Images::supportedTypes();
$ext = $phototypes[$media[0]['type']];
-
+
$attachment = ['type' => Post\Media::IMAGE, 'mimetype' => $media[0]['type'],
'url' => DI::baseUrl() . '/photo/' . $media[0]['resource-id'] . '-' . $media[0]['scale'] . '.' . $ext,
'size' => $media[0]['datasize'],
'description' => $media[0]['desc'] ?? '',
'width' => $media[0]['width'],
'height' => $media[0]['height']];
-
+
if (count($media) > 1) {
$attachment['preview'] = DI::baseUrl() . '/photo/' . $media[1]['resource-id'] . '-' . $media[1]['scale'] . '.' . $ext;
$attachment['preview-width'] = $media[1]['width'];
$detailed_notif = (($_POST['detailed_notif'] == 1) ? 1 : 0);
$notify_ignored = (($_POST['notify_ignored'] == 1) ? 1 : 0);
-
+
$notify = 0;
if (!empty($_POST['notify1'])) {
}
DI::baseUrl()->redirect($return_path);
-}
\ No newline at end of file
+}
$text = notes_content($a, $profile_uid);
System::htmlUpdateExit($text);
-}
\ No newline at end of file
+}
private static function tagCalc(array $arr)
{
$tags = [];
- $min = 1e9;
- $max = -1e9;
+ $min = 1000000000.0;
+ $max = -1000000000.0;
$x = 0;
if (!$arr) {
}
usort($tags, 'self::tagsSort');
- $range = max(.01, $max - $min) * 1.0001;
+ $range = max(0.01, $max - $min) * 1.0001;
for ($x = 0; $x < count($tags); $x ++) {
$tags[$x][2] = 1 + floor(9 * ($tags[$x][1] - $min) / $range);
// @TODO: Replace with parameter from router
$item_id = intval($a->argv[1]);
-
+
// Check for existence
$item = MAttach::exists(['id' => $item_id]);
if ($item === false) {
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function get(string $url, array $opts = [], int &$redirects = 0)
+ public function get(string $url, array $opts = [], &$redirects = 0)
{
$stamp1 = microtime(true);
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function post(string $url, $params, array $headers = [], int $timeout = 0, int &$redirects = 0)
+ public function post(string $url, $params, array $headers = [], int $timeout = 0, &$redirects = 0)
{
$stamp1 = microtime(true);
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function fetch(string $url, int $timeout = 0, string $accept_content = '', string $cookiejar = '', int &$redirects = 0)
+ public function fetch(string $url, int $timeout = 0, string $accept_content = '', string $cookiejar = '', &$redirects = 0)
{
$ret = $this->fetchFull($url, $timeout, $accept_content, $cookiejar, $redirects);
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function fetchFull(string $url, int $timeout = 0, string $accept_content = '', string $cookiejar = '', int &$redirects = 0)
+ public function fetchFull(string $url, int $timeout = 0, string $accept_content = '', string $cookiejar = '', &$redirects = 0)
{
return $this->get(
$url,
$this->visibility = $visibility[$item['private']];
$languages = json_decode($item['language'], true);
- $this->language = is_array($languages) ? array_key_first($languages) : null;
+ reset($languages);
+ $this->language = is_array($languages) ? key($languages) : null;
$this->uri = $item['uri'];
$this->url = $item['plink'] ?? null;