fix photo prvnxt after all the changes yesterday
This commit is contained in:
		| @@ -773,7 +773,7 @@ class Photos extends \Zotlabs\Web\Controller { | |||||||
| 				$o .= replace_macros($tpl, array( | 				$o .= replace_macros($tpl, array( | ||||||
| 					'$photos' => $photos, | 					'$photos' => $photos, | ||||||
| 					'$album' => $album, | 					'$album' => $album, | ||||||
| 					'$album_id' => $datum), | 					'$album_id' => $datum, | ||||||
| 					'$album_edit' => array(t('Edit Album'), $album_edit), | 					'$album_edit' => array(t('Edit Album'), $album_edit), | ||||||
| 					'$can_post' => $can_post, | 					'$can_post' => $can_post, | ||||||
| 					'$upload' => array(t('Upload'), z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/upload/' . $datum), | 					'$upload' => array(t('Upload'), z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/upload/' . $datum), | ||||||
| @@ -841,7 +841,6 @@ class Photos extends \Zotlabs\Web\Controller { | |||||||
| 				$order = 'DESC'; | 				$order = 'DESC'; | ||||||
| 	 | 	 | ||||||
|  |  | ||||||
|  |  | ||||||
| 			$prvnxt = q("SELECT hash FROM attach WHERE folder = '%s' AND uid = %d AND is_photo = 1 | 			$prvnxt = q("SELECT hash FROM attach WHERE folder = '%s' AND uid = %d AND is_photo = 1 | ||||||
| 				$sql_attach ORDER BY created $order ", | 				$sql_attach ORDER BY created $order ", | ||||||
| 				dbesc($x[0]['folder']), | 				dbesc($x[0]['folder']), | ||||||
| @@ -850,7 +849,7 @@ class Photos extends \Zotlabs\Web\Controller { | |||||||
|  |  | ||||||
| 			if(count($prvnxt)) { | 			if(count($prvnxt)) { | ||||||
| 				for($z = 0; $z < count($prvnxt); $z++) { | 				for($z = 0; $z < count($prvnxt); $z++) { | ||||||
| 					if($prvnxt[$z]['hash'] == $ph[0]['hash']) { | 					if($prvnxt[$z]['hash'] == $ph[0]['resource_id']) { | ||||||
| 						$prv = $z - 1; | 						$prv = $z - 1; | ||||||
| 						$nxt = $z + 1; | 						$nxt = $z + 1; | ||||||
| 						if($prv < 0) | 						if($prv < 0) | ||||||
| @@ -861,8 +860,8 @@ class Photos extends \Zotlabs\Web\Controller { | |||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 	 | 	 | ||||||
| 				$prevlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); | 				$prevlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['hash'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); | ||||||
| 				$nextlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); | 				$nextlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['hash'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); | ||||||
| 	 		} | 	 		} | ||||||
| 	 | 	 | ||||||
| 	 | 	 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user