Skip to content

Commit

Permalink
Версия 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pmezhuev committed Sep 10, 2023
1 parent 4531881 commit 93bf09d
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Requirements
* phpBB 3.2+
* PHP 5.4+
* PHP 7.1+
* curl

## Install
1. [Download latest release](https://github.com/LordBeaver/phpbb_chevereto/releases).
1. [Download latest release](https://github.com/pmezhuev/phpbb_chevereto/releases).
2. Unzip to the `ext` directory of your phpBB board.
3. Navigate in the ACP to `Customise -> Manage extensions`.
4. Look for `Chevereto API` under the `Disabled Extensions` list and click its `Enable` link.
Expand Down
7 changes: 4 additions & 3 deletions acp/chevereto_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ public function __construct()
$this->language = $this->container->get('language');
$this->request = $this->container->get('request');
$this->template = $this->container->get('template');

$this->language->add_lang('acp', 'lordbeaver/chevereto');
}

public function main($id, $mode)
public function main()
{
$this->language->add_lang('acp', 'lordbeaver/chevereto');
$this->tpl_name = 'chevereto';
$this->page_title = $this->language->lang('ACP_CHV_TITLE');
$form_key = 'acp_chevereto';
Expand All @@ -65,6 +64,7 @@ public function main($id, $mode)
$this->config->set('chevereto_https', $this->request->variable('chv_https', 0));
$this->config->set('chevereto_pup_color', $this->request->variable('chv_pup_color', 'default'));
$this->config->set('chevereto_pup_enable', $this->request->variable('chv_pup_enable', 0));
$this->config->set('chevereto_pup_lang', $this->request->variable('chv_pup_lang', 'auto'));
$this->config->set('chevereto_pup_mode', $this->request->variable('chv_pup_mode', 'default'));
$this->config->set('chevereto_subdomain', $this->request->variable('chv_subdomain', 1));
$this->config->set('chevereto_type_img', $this->request->variable('chv_type_img', 'bbcode-embed'));
Expand All @@ -84,6 +84,7 @@ public function main($id, $mode)
'CHV_NO_CURL' => @extension_loaded('curl') ? false : true,
'CHV_PUP_COLOR' => $this->config['chevereto_pup_color'],
'CHV_PUP_ENABLE' => $this->config['chevereto_pup_enable'] ? true : false,
'CHV_PUP_LANG' => $this->config['chevereto_pup_lang'],
'CHV_PUP_MODE' => $this->config['chevereto_pup_mode'],
'CHV_SUBDOMAIN' => $this->config['chevereto_subdomain'] ? true : false,
'CHV_TYPE_IMG' => $this->config['chevereto_type_img'],
Expand Down
10 changes: 10 additions & 0 deletions adm/style/chevereto.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ <h3>{{ lang('WARNING') }}</h3>
<label><input type="radio" class="radio" name="chv_pup_mode" value="phpbb" {% if not CHV_PUP_MODE == "phpbb" %}checked="checked"{% endif %} /> {{ lang('ACP_CHV_PUP_MODE_PHPBB') }}</label>
</dd>
</dl>
<dl>
<dt><label for="chv_pup_lang">{{ lang('ACP_CHV_PUP_LANG') ~ lang('COLON') }}</label></dt>
<dd>
<select name="chv_pup_lang" id="chv_pup_lang">
<option value="default"{% if CHV_PUP_LANG == "auto" %} selected="selected"{% endif %}>{{ lang('ACP_CHV_PUP_LANG_AUTO') }}</option>
<option value="en"{% if CHV_PUP_LANG == "en" %} selected="selected"{% endif %}>{{ lang('ACP_CHV_PUP_LANG_EN') }}</option>
<option value="ru"{% if CHV_PUP_LANG == "ru" %} selected="selected"{% endif %}>{{ lang('ACP_CHV_PUP_LANG_RU') }}</option>
</select>
</dd>
</dl>
<dl>
<dt><label for="chv_pup_color">{{ lang('ACP_CHV_PLUGIN_COLOR') ~ lang('COLON') }}</label></dt>
<dd>
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "Chevereto API and popup upload plugin (PUP).",
"homepage": "https://onlystorage.org/page/phpbb",
"version": "0.5.0",
"time": "2023-01-22",
"version": "0.5.1",
"time": "2023-09-10",
"license": "GPL-2.0-only",
"authors": [
{
Expand All @@ -14,7 +14,7 @@
}
],
"require": {
"php": ">=5.4",
"php": ">=7.1",
"ext-curl": "*"
},
"require-dev": {
Expand All @@ -29,7 +29,7 @@
"host": "onlystorage.org",
"directory": "/content/pages",
"filename": "version.json",
"sss": true
"ssl": true
}
}
}
1 change: 1 addition & 0 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ public function template($event)
'CHV_PUP_COLOR' => $this->config['chevereto_pup_color'],
'CHV_PUP_ENABLE' => $this->config['chevereto_pup_enable'] ? true : false,
'CHV_PUP_HOST' => $this->host(),
'CHV_PUP_LANG' => $this->config['chevereto_pup_lang'],
'CHV_PUP_MODE' => $this->config['chevereto_pup_mode'],
'CHV_PUP_TYPE' => $this->config['allow_post_links'] ? $this->config['chevereto_type_pup'] : 'bbcode-embed',
));
Expand Down
4 changes: 4 additions & 0 deletions language/en/acp.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
'ACP_CHV_PUP_COLOR_TURQUOISE' => 'Turquoise',
'ACP_CHV_PUP_COLOR_YELLOW' => 'Yellow',
'ACP_CHV_PUP_ENABLE' => 'Allow "Plugin"',
'ACP_CHV_PUP_LANG' => 'Button language',
'ACP_CHV_PUP_LANG_AUTO' => 'Auto',
'ACP_CHV_PUP_LANG_EN' => 'English',
'ACP_CHV_PUP_LANG_RU' => 'Русский',
'ACP_CHV_PUP_MODE' => 'Plugin mode',
'ACP_CHV_PUP_MODE_DEFAULT' => 'General',
'ACP_CHV_PUP_MODE_PHPBB' => 'phpBB',
Expand Down
4 changes: 4 additions & 0 deletions language/ru/acp.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
'ACP_CHV_PUP_COLOR_TURQUOISE' => 'Бирюзовый',
'ACP_CHV_PUP_COLOR_YELLOW' => 'Жёлтый',
'ACP_CHV_PUP_ENABLE' => 'Разрешить «Плагин»',
'ACP_CHV_PUP_LANG' => 'Язык кнопки',
'ACP_CHV_PUP_LANG_AUTO' => 'Автоматически',
'ACP_CHV_PUP_LANG_EN' => 'English',
'ACP_CHV_PUP_LANG_RU' => 'Русский',
'ACP_CHV_PUP_MODE' => 'Режим плагина',
'ACP_CHV_PUP_MODE_DEFAULT' => 'Универсальный',
'ACP_CHV_PUP_MODE_PHPBB' => 'phpBB',
Expand Down
33 changes: 33 additions & 0 deletions migrations/chevereto_0_5_1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
*
* Chevereto API
*
* @copyright © 2023 Lord Beaver
* @license https://opensource.org/licenses/GPL-2.0 GNU General Public License version 2
*
*/

namespace lordbeaver\chevereto\migrations;

class chevereto_0_5_1 extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
return isset($this->config['chevereto_version']) && version_compare($this->config['chevereto_version'], '0.5.1', '>=');
}

public static function depends_on()
{
return array('\lordbeaver\chevereto\migrations\chevereto_0_5_0');
}

public function update_data()
{
return array(
array('config.add', array('chevereto_pup_lang', 'auto')),
array('config.update', array('chevereto_version', '0.5.1')),
);
}
}
2 changes: 1 addition & 1 deletion styles/all/template/event/overall_header_head_append.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% if CHV_PUP_ENABLE and (S_VIEWTOPIC or S_POST_ACTION) %}
<script async src="//{{ CHV_PUP_HOST }}/sdk/pup.js" data-url="https://{{ CHV_PUP_HOST }}/upload" data-palette="{{ CHV_PUP_COLOR }}" data-auto-insert="{{ CHV_PUP_TYPE }}" data-vendor="{{ CHV_PUP_MODE }}"></script>
<script async src="//{{ CHV_PUP_HOST }}/sdk/pup.js" data-url="https://{{ CHV_PUP_HOST }}/upload" data-palette="{{ CHV_PUP_COLOR }}" data-auto-insert="{{ CHV_PUP_TYPE }}" data-vendor="{{ CHV_PUP_MODE }}" data-lang="{{ CHV_PUP_LANG }}"></script>
{% endif %}

0 comments on commit 93bf09d

Please sign in to comment.