mirror of
https://github.com/helenclx/BellaBuffs-PHPMailer.git
synced 2025-04-02 12:40:51 +00:00
Compare commits
7 Commits
v2.2-PHPMa
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
11dd56d7a6 | ||
|
5be90cee4d | ||
|
52b29f5a14 | ||
|
624d2f6760 | ||
|
6c41e2a011 | ||
|
f49011daf6 | ||
|
3c7ad7f319 |
17
README.md
17
README.md
@ -4,22 +4,25 @@ This is a fork of the fanlisting PHP script [BullaBuffs](https://github.com/jemj
|
||||
|
||||
## Description
|
||||
|
||||
BellaBuffs includes the optional features to email new members after submitting the join form, email the fanlisting admin when a new member joins or email new members when their applications were approved. The original BellaBuffs script achieved this by using PHP's built-in `mail()` feature.
|
||||
BellaBuffs includes the optional features to email new members after submitting the join form, email the fanlisting admin when a new member joins or email new members when their applications were approved. The original BellaBuffs script achieved this by using PHP's built-in `mail()` function.
|
||||
|
||||
This fork replaces the PHP `mail()` functions from BellaBuffs with PHPMailer, allowing a fanlisting to send out emails with SMTP, provided the fanlisting owner chooses to enable them, even if the hosting server does not support the PHP `mail()` function.
|
||||
|
||||
The PHPMailer script that is incorporated in this fork is based on [InfinityFree](https://www.infinityfree.com/)'s [PHPMailer contact form script](https://github.com/InfinityFreeHosting/contactform). As InfinityFree's free hosting plan [does not support PHP `mail()` function](https://forum.infinityfree.com/t/sending-email-from-your-website-php-mail/49242), InfinityFree has provided their contact form script as an alternative.
|
||||
|
||||
This BellaBuffs fork has been tested with PHP 8.2 on InfinityFree's free hosting.
|
||||
This BellaBuffs fork has been tested with PHP 8.2 on InfinityFree's free hosting and PHP 8.3 on Hostinger's Premium Shared Hosting.
|
||||
|
||||
## New Features
|
||||
* Integrate PHPMailer for the email sending features, should the fanlisting owner enables these features
|
||||
* Email sending features are enabled by default, but can be disabled in `prefs.php`
|
||||
* HTML5 form validation, including E-mail and URL input types and the `required` attribute
|
||||
* Update list of countries
|
||||
* Add a buttons folder (with a placeholder file to enable the folder to be pushed via Git), so users do not need to manually create the folder to store uploaded buttons
|
||||
* Integrate PHPMailer for the email sending features, should the fanlisting owner enables these features.
|
||||
* Email sending features are enabled by default, but can be disabled in `prefs.php`.
|
||||
* HTML5 form validation, including E-mail and URL input types and the `required` attribute.
|
||||
* Update list of countries.
|
||||
* Add a buttons folder (with a placeholder file to enable the folder to be pushed via Git), so users do not need to manually create the folder to store uploaded buttons.
|
||||
* Allows fanlisting members to change their favourites with the update form if the favourites field is enabled.
|
||||
* Check for `https://` in addition to `http://` for potential spam in the comment fields.
|
||||
|
||||
## Usage Instructions
|
||||
1. Download the [latest release pf BellaBuffs-PHPMailer](https://github.com/helenclx/BellaBuffs-PHPMailer/releases/latest) from the GitHub repository.
|
||||
1. Customise your preferences in `prefs.php`
|
||||
1. Configure your email SMTP settings in `contactform/config.php`
|
||||
1. Upload all files of this fork to a directory where you want your fanlisting to be located
|
||||
|
@ -24,7 +24,11 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||
)
|
||||
$points += 2;
|
||||
|
||||
if (strpos($_POST['comments'], "http://") !== false || strpos($_POST['comments'], "www.") !== false)
|
||||
if (
|
||||
strpos($_POST['comments'], "https://") !== false ||
|
||||
strpos($_POST['comments'], "http://") !== false ||
|
||||
strpos($_POST['comments'], "www.") !== false
|
||||
)
|
||||
$points += 2;
|
||||
if (isset($_POST['nojs']))
|
||||
$points += 1;
|
||||
|
7
join.php
7
join.php
@ -34,7 +34,10 @@ if (isset($_POST['submit'])) {
|
||||
if (isBot() !== false)
|
||||
$error_msg .= "No bots please! UA reported as: ".$_SERVER['HTTP_USER_AGENT'] . "\r\n";
|
||||
|
||||
if (substr_count($_POST['comments'], 'http://') > 1)
|
||||
if (
|
||||
substr_count($_POST['comments'], 'https://') > 1 ||
|
||||
substr_count($_POST['comments'], 'http://') > 1
|
||||
)
|
||||
$error_msg .= "Too many URLs; we've assumed you're spam and 'lost' your application. Please try again without any extra URLs if you're a geniune person :)\r\n";
|
||||
|
||||
$exploits = "/(content-type|bcc:|cc:|document.cookie|onclick|onload|javascript|alert)/i";
|
||||
@ -194,7 +197,7 @@ if (!isset($_POST['submit']) || $show_form == true) {
|
||||
<label>Display E-mail?</label><br />
|
||||
<input type="radio" id="dispemailyes" name="dispemail" value="yes" checked="checked" /> Yes
|
||||
<input type="radio" id="dispemailno" name="dispemail" value="no" /> No<br />
|
||||
<label>Website</label><br /> <input type="url" id="url" name="url" value="<?php get_data("url"); ?>" /> <br />
|
||||
<label>Website</label><br /> <input type="url" id="url" name="url" placeholder="https://" value="<?php get_data("url"); ?>" /> <br />
|
||||
<label>Country *</label><br /> <select name="country" id="country" required><option value="null">Please select a country:</option><?php get_countries($country); ?></select> <br />
|
||||
<?php
|
||||
if (isset($favefield) && $favefield == "yes") {
|
||||
|
21
update.php
21
update.php
@ -40,7 +40,10 @@ if (isset($_POST['submit'])) {
|
||||
if (isBot() !== false)
|
||||
$error_msg .= "No bots please! UA reported as: ".$_SERVER['HTTP_USER_AGENT'] . "\r\n";
|
||||
|
||||
if (substr_count($_POST['comments'], 'http://') > 1)
|
||||
if (
|
||||
substr_count($_POST['comments'], 'https://') > 1 ||
|
||||
substr_count($_POST['comments'], 'http://') > 1
|
||||
)
|
||||
$error_msg .= "Too many URLs; we've assumed you're spam and 'lost' your application. Please try again without any extra URLs if you're a geniune person :)\r\n";
|
||||
|
||||
$exploits = "/(content-type|bcc:|cc:|document.cookie|onclick|onload|javascript|alert)/i";
|
||||
@ -67,8 +70,8 @@ if (isset($_POST['submit'])) {
|
||||
if (empty($clean['dispemail']))
|
||||
$clean['dispemail'] = "no";
|
||||
|
||||
if (!isset($favefield) || $favefield == "no" || !isset($clean['fave']))
|
||||
$clean['fave'] = NULL;
|
||||
if (!isset($favefield) || $favefield == "no" || !isset($clean['newfave']))
|
||||
$clean['newfave'] = NULL;
|
||||
|
||||
// let's do some security and spam checks
|
||||
if (empty($clean['name']) || empty($clean['email']) || empty($clean['country']))
|
||||
@ -77,7 +80,7 @@ if (isset($_POST['submit'])) {
|
||||
$error_msg .= "That name is not valid. Your name must contain letters only, and must be less than 15 characters. \r\n";
|
||||
if ($clean['dispemail'] != "yes" && $clean['dispemail'] != "no")
|
||||
$error_msg .= "You didn't choose whether or not you'd like to show your e-mail address on the member list. \r\n";
|
||||
if ($clean['fave'] != "" && (!preg_match("/^[a-zA-Z0-9-'\s]*$/", $clean['fave']) || strlen($clean['fave']) > 20))
|
||||
if ($clean['newfave'] != "" && (!preg_match("/^[a-zA-Z0-9-'\s]*$/", $clean['newfave']) || strlen($clean['newfave']) > 20))
|
||||
$error_msg .= "Your chosen \"favourite\" is not valid. It must contain letters and numbers only, and must be less than 20 characters. \r\n";
|
||||
if (!preg_match('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+' . '(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i', strtolower($clean['email'])))
|
||||
$error_msg .= "The email address you have used is not valid. \r\n";
|
||||
@ -117,6 +120,9 @@ if (isset($_POST['submit'])) {
|
||||
$mail->Body .= "New Email: {$clean['newemail']} \n";
|
||||
$mail->Body .= "New URL: {$clean['newurl']} \n";
|
||||
$mail->Body .= "Country: {$clean['country']} \n";
|
||||
if (isset($favefield) && $favefield == "yes") {
|
||||
$mail->Body .= "New $favetext: {$clean['newfave']} \n";
|
||||
}
|
||||
$mail->Body .= "Comments: {$clean['comments']} \n";
|
||||
$mail->Body .= "IP: {$_SERVER['REMOTE_ADDR']} \n\n";
|
||||
|
||||
@ -158,9 +164,14 @@ if (!isset($_POST['submit']) || $show_form == true) {
|
||||
<label>Display E-mail?</label><br />
|
||||
<input type="radio" id="dispemailyes" name="dispemail" value="yes" checked="checked" /> Yes
|
||||
<input type="radio" id="dispemailno" name="dispemail" value="no" /> No<br />
|
||||
<label>New Website?</label><br /> <input type="url" id="newurl" name="newurl" value="http://" /> <br />
|
||||
<label>New Website?</label><br /> <input type="url" id="newurl" name="newurl" placeholder="http://" /> <br />
|
||||
<label>Country *</label><br /> <select name="country" id="country" required><option value="null">Please select a country:</option><?php get_countries("null"); ?></select> <br />
|
||||
<?php
|
||||
if (isset($favefield) && $favefield == "yes") {
|
||||
?>
|
||||
<label><?php echo $favetext; ?></label><br /> <input type="text" id="newfave" name="newfave" value="<?php get_data("newfave"); ?>" /> <br />
|
||||
<?php
|
||||
}
|
||||
if (isset($captcha) && $captcha == "yes") {
|
||||
?>
|
||||
<img src="captcha.php" alt="" /><br />
|
||||
|
Loading…
x
Reference in New Issue
Block a user