Lychee-v3 icon indicating copy to clipboard operation
Lychee-v3 copied to clipboard

Meta (Facebook sharing) for albums

Open roblandry opened this issue 6 years ago • 0 comments

As discussed on Gitter I would like to incorporate the meta data for albums, specifically i would like the info to show up for facebook shares, but when fb works, they all should.

As i understand, the meta for photos work, due to a view.php. However, albums use pure js.

I have made a workaround in getGraphHeader.php that works great, but getting the album to display via query string, is going to require some js tweaks.

function getGraphHeader($theID,$getType) {

	// allow album data
	if ($getType == 'album'){
		$query  = Database::prepare(Database::get(), "SELECT id FROM ? WHERE album = '?' LIMIT 1", array(LYCHEE_TABLE_PHOTOS, $theID));
		$result = Database::execute(Database::get(), $query, __METHOD__, __LINE__);
		if ($result===false) return false;
		$row = $result->fetch_object();
		$photoID = $row->id;
	} else {
		$photoID = $theID;
	}

	$photo = new Photo($photoID);
        // continue code

Additionally, using a query string and js clutters the address bar when navigating.

roblandry avatar Jan 31 '19 01:01 roblandry