Skip to content
Merged
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
14 changes: 0 additions & 14 deletions .github/FUNDING.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint

# PHP syntax check on the lowest PHP version this extension supports and the
# newest one phpBB 3.3 supports. tests.yml covers PHP 8.2 with phpBB's own
# checks (code sniffer, EPV).
on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read

jobs:
lint:
name: PHP ${{ matrix.php }} lint
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.4']
steps:
- uses: actions/checkout@v4

- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer:v2

- name: PHP syntax check
run: find . -name '*.php' -not -path './.git/*' -not -path './vendor/*' -print0 | xargs -0 -n1 php -l

- name: Validate composer.json
run: composer validate --no-check-all --no-check-publish
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Tests

env:
EXTNAME: rmcgirr83/contactadmin # Your extension vendor/package name
EXTNAME: phpbbmodders/contactadmin # Your extension vendor/package name
SNIFF: 1 # Run code sniffer on your code? 1 or 0
IMAGE_ICC: 1 # Run icc profile sniffer on your images? 1 or 0
EPV: 1 # Run EPV (Extension Pre Validator) on your code? 1 or 0
Expand Down
26 changes: 0 additions & 26 deletions README.MD

This file was deleted.

59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Contact Admin

[![Tests](https://github.com/phpbbmodders/contactadmin/actions/workflows/tests.yml/badge.svg)](https://github.com/phpbbmodders/contactadmin/actions/workflows/tests.yml) [![Lint](https://github.com/phpbbmodders/contactadmin/actions/workflows/lint.yml/badge.svg)](https://github.com/phpbbmodders/contactadmin/actions/workflows/lint.yml)

A contact form that lets guests and members reach the board administrators by email, private message or forum post.

## Features

- Replaces phpBB's built-in contact page and links to it from the header, the footer, failed logins and the registration page.
- Messages go out by email, as a private message, or as a post in a forum you choose. Send to all administrators, the board founder or the board's default email address.
- Optional list of contact reasons for the sender to pick from.
- Private messages and posts can come from a "contact bot" user, for guests only or for everyone.
- Optional CAPTCHA (for everyone or guests only, with an attempt limit), attachments, a privacy-policy checkbox, and checks that stop guests from using a registered member's username or email address.
- Settings under **ACP → Extensions → Contact Admin**.
- Works with [Stop Forum Spam](https://github.com/phpbbmodders/stopforumspam), which can check messages sent through the form.

## Requirements

- phpBB 3.3.19 or later
- PHP 7.4 or later

## Installation

1. Copy the extension to `/ext/phpbbmodders/contactadmin`
2. In the Administration Control Panel, go to **Customise → Manage extensions**
3. Enable the **Contact Admin** extension
4. Choose the settings under **ACP → Extensions → Contact Admin**

### Upgrading from `rmcgirr83/contactadmin`

This extension used to be installed as `rmcgirr83/contactadmin`. Your settings carry over:

1. Disable the old **Contact Admin** extension in the ACP. Do **not** delete its data.
2. Upload this version to `/ext/phpbbmodders/contactadmin` and enable it. The old install's migration history and ACP module are moved to the new name automatically.
3. Delete the `/ext/rmcgirr83/contactadmin` folder and purge the board cache.

If you use [Stop Forum Spam](https://github.com/phpbbmodders/stopforumspam), update it as well so it keeps checking the contact form.

If you disable the old extension from the command line (`bin/phpbbcli.php`) instead of the ACP, run `bin/phpbbcli.php cache:purge` before enabling the new one; the command-line disable doesn't clear the cache.

## Contributing

Contributions are welcome!

- **Bug reports**: [Open an issue](https://github.com/phpbbmodders/contactadmin/issues).
- **Everything else** (questions, feature requests, ideas, general discussion): [Use Discussions](https://github.com/orgs/phpbbmodders/discussions), or the [community forum](https://www.phpbbmodders.com/community/).
- Pull requests are welcome for bug fixes or discussed features.

## Acknowledgments

- A port of the phpBB 3.0 **Contact Board Administration** MOD.
- Extension by Rich McGirr ([RMcGirr83](https://github.com/rmcgirr83)).
- Code review, bug fixes, and documentation assisted by [Claude](https://www.anthropic.com/claude).

## License

This extension is licensed under the **GNU General Public License v2.0**.

See [license.txt](license.txt) for more information.
21 changes: 11 additions & 10 deletions acp/contactadmin_info.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<?php
/**
*
* Contact admin extension for the phpBB Forum Software package.
*
* @copyright 2016 Rich McGirr (RMcGirr83)
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
namespace rmcgirr83\contactadmin\acp;
*
* Contact Admin extension for the phpBB Forum Software package
*
* @copyright 2016 Rich McGirr (RMcGirr83)
* @copyright (c) 2026, phpBB Modders, https://www.phpbbmodders.com/
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
namespace phpbbmodders\contactadmin\acp;

class contactadmin_info
{
function module()
{
return [
'filename' => '\rmcgirr83\contactadmin\acp\contactadmin_module',
'filename' => '\phpbbmodders\contactadmin\acp\contactadmin_module',
'title' => 'ACP_CAT_CONTACTADMIN',
'version' => '1.0.0',
'modes' => [
'configuration' => ['title' => 'ACP_CONTACTADMIN_CONFIG', 'auth' => 'ext_rmcgirr83/contactadmin && acl_a_board', 'cat' => ['ACP_CAT_CONTACTADMIN']],
'configuration' => ['title' => 'ACP_CONTACTADMIN_CONFIG', 'auth' => 'ext_phpbbmodders/contactadmin && acl_a_board', 'cat' => ['ACP_CAT_CONTACTADMIN']],
],
];
}
Expand Down
19 changes: 10 additions & 9 deletions acp/contactadmin_module.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php
/**
*
* Contact Admin extension for the phpBB Forum Software package.
*
* @copyright 2016 Rich McGirr (RMcGirr83)
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
*
* Contact Admin extension for the phpBB Forum Software package
*
* @copyright 2016 Rich McGirr (RMcGirr83)
* @copyright (c) 2026, phpBB Modders, https://www.phpbbmodders.com/
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

namespace rmcgirr83\contactadmin\acp;
namespace phpbbmodders\contactadmin\acp;

class contactadmin_module
{
Expand All @@ -22,7 +23,7 @@ function main($id, $mode)
$this->page_title = $phpbb_container->get('language')->lang('ACP_CAT_CONTACTADMIN');

// Get an instance of the admin controller
$admin_controller = $phpbb_container->get('rmcgirr83.contactadmin.admin.controller');
$admin_controller = $phpbb_container->get('phpbbmodders.contactadmin.admin.controller');

// Make the $u_action url available in the admin controller
$admin_controller->set_page_url($this->u_action);
Expand Down
7 changes: 0 additions & 7 deletions adm/style/acp_contactadmin.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
var imageTag = false;
</script>
<h1>{{ lang('ACP_CAT_CONTACTADMIN') }}</h1>
<fieldset>
<legend>{{ lang('BUY_ME_A_BEER') }}</legend>
<dl>
<dt><label>{{ lang('BUY_ME_A_BEER_SHORT') ~ lang('COLON') }}</label><br><span>{{ lang('BUY_ME_A_BEER_EXPLAIN') }}</span></dt>
<dd><a href="{{ lang('BUY_ME_A_BEER_URL') }}" target="_blank" rel="noreferrer noopener"><img src="{{ lang('PAYPAL_IMAGE_URL') }}" alt="{{ lang('PAYPAL_ALT') }}" style="cursor: pointer; margin-top: 15px;"></a></dd>
</dl>
</fieldset>
{% if CONTACT_ERROR %}
<div class="errorbox"><h3>{{ lang('WARNING') }}</h3>
<p>{{ CONTACT_ERROR }}</p>
Expand Down
21 changes: 14 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
{
"name": "rmcgirr83/contactadmin",
"name": "phpbbmodders/contactadmin",
"type": "phpbb-extension",
"description": "This form allows guests and/or registered users to either send an email to admins or to either send a PM or make a Post in a designated forum. It also overrides the default contact admin link found on the forum. A port of the phpBB 3.0.x mod “Contact Board Adminnistration”",
"homepage": "https://github.com/rmcgirr83/contactadmin",
"description": "A contact form that lets guests and members reach the board administrators by email, private message or forum post.",
"homepage": "https://www.phpbbmodders.com/",
"version": "1.4.4",
"time": "2025-01-15",
"keywords": [
"phpbb",
"extension",
"contact admin"
"contact admin",
"contact-form"
],
"license": "GPL-2.0-only",
"authors": [
{
"name": "phpBB Modders",
"email": "board@phpbbmodders.com",
"homepage": "https://www.phpbbmodders.com/",
"role": "Extension Developer"
},
{
"name": "Rich McGirr",
"role": "Developer"
"role": "Past Developer"
}
],
"require": {
"php": ">=7.4",
"phpbb/phpbb": ">=3.3",
"phpbb/phpbb": ">=3.3.19",
"composer/installers": "^1.0 || ^2.0"
},
"require-dev": {
Expand All @@ -28,7 +35,7 @@
"extra": {
"display-name": "Contact Admin",
"soft-require": {
"phpbb/phpbb": ">=3.3"
"phpbb/phpbb": ">=3.3.19,<4.0.0@dev"
},
"version-check": {
"host": "www.phpbb.com",
Expand Down
8 changes: 4 additions & 4 deletions config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
rmcgirr83_contactadmin_displayform:
phpbbmodders_contactadmin_displayform:
path: /contactadmin
defaults: { _controller: rmcgirr83.contactadmin.main.controller:displayform }
defaults: { _controller: phpbbmodders.contactadmin.main.controller:displayform }

rmcgirr83_contactadmin_botuserinfo:
phpbbmodders_contactadmin_botuserinfo:
path: /contact_bot_info/{user_id}
defaults: { _controller: rmcgirr83.contactadmin.core:bot_user_info }
defaults: { _controller: phpbbmodders.contactadmin.core:bot_user_info }
requirements:
user_id: \d+
20 changes: 10 additions & 10 deletions config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ imports:
- {resource: contact_constants.yml}

services:
rmcgirr83.contactadmin.admin.controller:
class: rmcgirr83\contactadmin\controller\admin_controller
phpbbmodders.contactadmin.admin.controller:
class: phpbbmodders\contactadmin\controller\admin_controller
arguments:
- '@auth'
- '@config'
Expand All @@ -15,13 +15,13 @@ services:
- '@request'
- '@template'
- '@user'
- '@rmcgirr83.contactadmin.core'
- '@phpbbmodders.contactadmin.core'
- '%core.root_path%'
- '%core.php_ext%'
- '%contact_constants%'

rmcgirr83.contactadmin.main.controller:
class: rmcgirr83\contactadmin\controller\main_controller
phpbbmodders.contactadmin.main.controller:
class: phpbbmodders\contactadmin\controller\main_controller
arguments:
- '@auth'
- '@config'
Expand All @@ -34,14 +34,14 @@ services:
- '@request'
- '@template'
- '@user'
- '@rmcgirr83.contactadmin.core'
- '@phpbbmodders.contactadmin.core'
- '@captcha.factory'
- '%core.root_path%'
- '%core.php_ext%'
- '%contact_constants%'

rmcgirr83.contactadmin.listener:
class: rmcgirr83\contactadmin\event\listener
phpbbmodders.contactadmin.listener:
class: phpbbmodders\contactadmin\event\listener
arguments:
- '@config'
- '@controller.helper'
Expand All @@ -51,8 +51,8 @@ services:
tags:
- { name: event.listener }

rmcgirr83.contactadmin.core:
class: rmcgirr83\contactadmin\core\contactadmin
phpbbmodders.contactadmin.core:
class: phpbbmodders\contactadmin\core\contactadmin
arguments:
- '@auth'
- '@cache'
Expand Down
Loading
Loading