Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
fixes:
- "/phpBB3/phpBB/ext/vse/lightbox/::"
- "/phpBB3/phpBB/ext/phpbb/lightbox/::"
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Extension tests
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
with:
EXTNAME: vse/lightbox # Your extension vendor/package name
EXTNAME: phpbb/lightbox # Your extension vendor/package name
CODECOV: 1 # Run code coverage via codecov? 1 or 0
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Do not change this
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
## Changelog
# Changelog

## phpBB 4.x Releases (phpbb/lightbox)

### 3.0.0-dev

- Fork of vse/lightbox rebranded as an official phpBB extension for phpBB 4

## phpBB 3.x Releases (vse/lightbox)

### 2.0.4 - 2022-06-16

Expand Down
24 changes: 5 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
# Lightbox extension for phpBB
# phpBB Image Lightbox for phpBB 4

This extension adds the [Lightbox 2](http://lokeshdhakar.com/projects/lightbox2/) jQuery plugin to phpBB. It will resize posted images to a maximum set width and/or height and display them full-screen in a Lightbox overlay effect.

[![Build Status](https://github.com/iMattPro/lightbox/actions/workflows/tests.yml/badge.svg)](https://github.com/iMattPro/lightbox/actions)
[![codecov](https://codecov.io/gh/iMattPro/lightbox/branch/master/graph/badge.svg?token=YnBuha7JFN)](https://codecov.io/gh/iMattPro/lightbox)
[![Latest Stable Version](https://poser.pugx.org/vse/lightbox/v/stable)](https://www.phpbb.com/customise/db/extension/lightbox/)
[![Build Status](https://github.com/phpbb-extensions/lightbox/actions/workflows/tests.yml/badge.svg)](https://github.com/phpbb-extensions/lightbox/actions)
[![codecov](https://codecov.io/gh/phpbb-extensions/lightbox/branch/master/graph/badge.svg?token=YnBuha7JFN)](https://codecov.io/gh/phpbb-extensions/lightbox)

## Minimum Requirements
* phpBB 3.2.0
* PHP 5.4

## Install
1. [Download the latest release](https://www.phpbb.com/customise/db/extension/lightbox/) and unzip it.
2. Unzip the downloaded release and copy it to the `ext` directory of your phpBB board.
3. Navigate in the ACP to `Customise -> Manage extensions`.
4. Look for `Lightbox` under the Disabled Extensions list and click its `Enable` link.
* phpBB 4.0.0
* PHP 8.1

## Usage
1. Navigate in the ACP to `Post settings -> Lightbox image resizing`.
2. Set the `Maximum image width in pixel` to your desired resize width.
3. Click `Submit`.

## Uninstall
1. Navigate in the ACP to `Customise -> Manage extensions`.
2. Click the `Disable` link for Lightbox.
3. To permanently uninstall, click `Delete Data`, then delete the `lightbox` folder from `phpBB/ext/vse/`.

## License
[GNU General Public License v2](https://opensource.org/licenses/GPL-2.0)

© 2014 - Matt Friedman
4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Lightbox" description="Builds an extension.zip from a git repository" default="all">
<property name="vendor-name" value="vse" />
<project name="phpBB Image Lightbox" description="Builds an extension.zip from a git repository" default="all">
<property name="vendor-name" value="phpbb" />
<property name="extension-name" value="lightbox" />
<!--
Only set this to "true" if you have dependencies in the composer.json,
Expand Down
14 changes: 4 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "vse/lightbox",
"name": "phpbb/lightbox",
"type": "phpbb-extension",
"description": "Lightbox for phpBB can resize posted images to a maximum set height/width and display them full-screen in an elegant Lightbox overlay effect.",
"homepage": "https://github.com/iMattPro/lightbox",
"version": "2.1.0-dev",
"homepage": "https://www.phpbb.com/",
"version": "3.0.0-dev",
"keywords": ["phpbb", "extension", "lightbox", "image", "resizer"],
"license": "GPL-2.0-only",
"authors": [
Expand All @@ -18,16 +18,10 @@
"composer/installers": "^1.0 || ^2.0"
},
"extra": {
"display-name": "Lightbox",
"display-name": "phpBB Image Lightbox",
"soft-require": {
"phpbb/phpbb": ">=4.0.0@dev"
},
"version-check": {
"host": "www.phpbb.com",
"directory": "/customise/db/extension/lightbox",
"filename": "version_check",
"ssl": true
},
"branch-alias": {
"dev-dev/4.0": "2.1.x-dev"
}
Expand Down
4 changes: 2 additions & 2 deletions config/services.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
vse.lightbox.listener:
class: vse\lightbox\event\listener
phpbb.lightbox.listener:
class: phpbb\lightbox\event\listener
arguments:
- '@config'
- '@language'
Expand Down
8 changes: 4 additions & 4 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*
* Lightbox extension for the phpBB Forum Software package.
*
* @copyright (c) 2014 Matt Friedman
* @copyright (c) 2014 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

namespace vse\lightbox\event;
namespace phpbb\lightbox\event;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;

Expand Down Expand Up @@ -69,7 +69,7 @@ public static function getSubscribedEvents()
*/
public function set_lightbox_tpl_data()
{
$this->language->add_lang('common', 'vse/lightbox');
$this->language->add_lang('common', 'phpbb/lightbox');
$this->template->assign_vars([
'LIGHTBOX_RESIZE_WIDTH' => (int) $this->config['lightbox_max_width'],
'LIGHTBOX_RESIZE_HEIGHT' => (int) $this->config['lightbox_max_height'],
Expand All @@ -92,7 +92,7 @@ public function add_lightbox_acp_config($event)
{
if ($event['mode'] === 'post' && array_key_exists('legend3', $event['display_vars']['vars']))
{
$this->language->add_lang('lightbox', 'vse/lightbox');
$this->language->add_lang('lightbox', 'phpbb/lightbox');

$max_width = $this->min_not_null($this->config['img_max_width'], (!empty($this->config['img_create_thumbnail']) ? $this->config['img_max_thumb_width'] : 0));
$l_append = $max_width ? $this->language->lang('LIGHTBOX_MAX_WIDTH_APPEND', $max_width) : '';
Expand Down
30 changes: 27 additions & 3 deletions ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*
* Lightbox extension for the phpBB Forum Software package.
*
* @copyright (c) 2018 Matt Friedman
* @copyright (c) 2025 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

namespace vse\lightbox;
namespace phpbb\lightbox;

/**
* Extension class for custom enable/disable/purge actions
Expand All @@ -23,6 +23,30 @@ class ext extends \phpbb\extension\base
*/
public function is_enableable()
{
return phpbb_version_compare(PHPBB_VERSION, self::PHPBB_MIN_VERSION, '>=');
$errors = [];

if (phpbb_version_compare(PHPBB_VERSION, self::PHPBB_MIN_VERSION, '<'))
{
$errors[] = 'PHPBB_VERSION_ERROR';
}

if ($this->container->get('ext.manager')->is_enabled('vse/lightbox'))
{
$errors[] = 'VSE_LIGHTBOX_ERROR';
}

if (empty($errors))
{
return true;
}

if (phpbb_version_compare(PHPBB_VERSION, '3.3.0-b1', '>='))
{
$language = $this->container->get('language');
$language->add_lang('install', 'phpbb/lightbox');
return array_map([$language, 'lang'], $errors);
}

return false;
}
}
2 changes: 1 addition & 1 deletion language/ar/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Arabic] Translated By : Bassel Taha Alhitary <https://www.alhitary.net>
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/ar/lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Arabic] Translated By : Bassel Taha Alhitary <https://www.alhitary.net>
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/cs/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Czech]
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/cs/lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Czech]
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/de/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Gernman]
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/de/lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Gernman]
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [English]
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
43 changes: 43 additions & 0 deletions language/en/install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
*
* Lightbox extension for the phpBB Forum Software package.
*
* @copyright (c) 2025 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = [];
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, [
'PHPBB_VERSION_ERROR' => 'Your board appears to be using an older version of phpBB. phpBB ' . \phpbb\lightbox\ext::PHPBB_MIN_VERSION . ' or newer is required to use this extension.',
'VSE_LIGHTBOX_ERROR' => 'We detected the vse/lightbox extension. phpBB’s official Lightbox extension can not be installed until you disable, purge and delete all files related to the vse/lightbox extension.',
]);
2 changes: 1 addition & 1 deletion language/en/lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [English]
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/es/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Spanish] Translation by phpbb-es
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/es/lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Spanish] Translation by phpbb-es
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/fr/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [French] translation by Galixte (http://www.galixte.com)
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/fr/lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [French] translation by Galixte (http://www.galixte.com)
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/it/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Italian] Translation by Mauron and alex75 https://phpbb-store.it
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/it/lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Italian] Translation by Mauron and alex75 https://phpbb-store.it
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/ja/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Japanese] Translation by momo-i.
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/ja/lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Japanese] Translation by momo-i.
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/nl/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Dutch] Translation by Derky <http://www.derky.nl>
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
2 changes: 1 addition & 1 deletion language/nl/lightbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lightbox extension for the phpBB Forum Software package.
* [Dutch] translated by Dutch Translators (https://github.com/dutch-translators)
*
* @copyright (c) 2015 Matt Friedman
* @copyright (c) 2015 Matt Friedman, phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
Expand Down
Loading
Loading