# photonic/2.43/Lightboxes/Fancybox3.php

Photonic Gallery &amp; Lightbox for Flickr, SmugMug &amp; Others, version 2.43. 35 lines.

- Page: https://pluginprobe.com/plugins/photonic/2.43/code/Lightboxes/Fancybox3.php
- Raw: https://pluginprobe.com/plugins/photonic/2.43/raw/Lightboxes/Fancybox3.php
- Modified: 2020-05-12T15:39:52+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/photonic/2.43/code/Lightboxes/Fancybox3.php#L10-L20`.

```php
<?php
namespace Photonic_Plugin\Lightboxes;

use Photonic_Plugin\Modules\Core;

require_once('Lightbox.php');

class Fancybox3 extends Lightbox {
	protected function __construct() {
		$this->library = 'fancybox3';
		parent::__construct();
	}

	/**
	 * @param $rel_id
	 * @param Core $module
	 * @return array
	 */
	function get_gallery_attributes($rel_id, $module) {
		return [
			'class' => $this->class = ['photonic-launch-gallery', 'launch-gallery-fancybox', 'fancybox'],
			'rel' => ['lightbox-photonic-'.$module->provider.'-stream-'.(empty($rel_id) ? $module->gallery_index : $rel_id)],
			'specific' => [
				'data-fancybox' => ['lightbox-photonic-'.$module->provider.'-stream-'.(empty($rel_id) ? $module->gallery_index : $rel_id)]
			],
		];
	}

	function get_photo_attributes($photo_data, $module) {
		if (in_array($module->provider, ['google', 'flickr'])) {
			return !empty($photo_data['video']) ? ' data-html5-href="'.$photo_data['video'].'" ': '';
		}
		return '';
	}
}
```
