Main Menu
Daily Lucky Numbers:
6
9
24
34
47
49
Message
Author
Board
Date
January 18, 2025, 01:56:06 AM
January 18, 2025, 12:31:57 AM
January 15, 2025, 10:10:06 PM
January 11, 2025, 01:01:33 PM
January 09, 2025, 11:59:16 PM

Recent posts

#21
Site Discussion / Re: IPV4
Last post by Chen Zhen - January 08, 2025, 11:48:54 PM
For example, you can use something like this:

Note: requires PHP 8.2+
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {   
    $ipv4 = hexdec(substr($ip, 0, 2)) . '.' . hexdec(substr($ip, 2, 2)) . '.' . hexdec(substr($ip, 5, 2)) . '.' . hexdec(substr($ip, 7, 2));
    $ip = $ip == '::1' ? '127.0.0.1' : (inet_ntop(inet_pton($ip)) == '::1' ? '127.0.0.1' : (filter_var($ipv4, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? $ipv4 : $ip));       
}
elseif (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
    // invalid IP ~ do not allow login process
    $ip = '';
}
if (!empty($ip) && !filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_GLOBAL_RANGE)) {
    // invalid IP range ~ do not allow login process unless using loopback
    $ip = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE) ? '' : $ip;
}

Like I said, this is really a bogus IP but it will generate the same corresponding IPv4 address.
#22
Site Discussion / Re: IPV4
Last post by Chen Zhen - January 08, 2025, 11:08:53 PM
Yes but I don't think it's a real IP address for you.
There is likely some script that generates it from your IPv6 address so it will always show as the same but it's not legit.
Your ISP has assigned you a IPv6 which may be dynamic & assigned when your modem/router powers up & connects to your ISP's network or it may be static & always the same from the day you signed up for your ISP service.
IPv4's ran out in 2019 where some ISP's have a pool of them that they use.

There is a PHP script that can convert IPv6 to IPv4 which will always be the same when using the same IPv6 digits but like I said, it's not really a legit IPv4 address. There is at least a 1 in 4,294,967,296 chance that it will be a duplicate of a legit IPv4 but even higher odds for your site because how many of those IP's are going to visit? I suppose it's not hugely important to be legit because of mainly dynamic use of them by ISP's so you can use a script to change it without any problem. 
#23
Site Discussion / Re: IPV4
Last post by Duban Black - January 08, 2025, 07:24:04 PM
Yes, it's curious, because in all SMF forums my ip always shows the ipv6 version, but here it shows me the ipv4, which I prefer to see and I wanted to replicate it in my forum.
If you find the necessary setting please let me know.
#24
Site Discussion / Re: IPV4
Last post by Chen Zhen - January 08, 2025, 12:17:06 PM

There isn't any modification installed to alter the IP address.
It might have something to do with the network my host provides or possibly because I haven't configured something properly.
Thanks for the report, I will look into it.
#25
Site Discussion / IPV4
Last post by Duban Black - January 08, 2025, 08:46:44 AM
This forum uses some mod to always show ipv4? in most SMF forums the ip is shown in ipv6.
#26
SMF Arcade Support + Plugins / Re: Troubleshooting tips for S...
Last post by Chen Zhen - January 07, 2025, 02:02:16 AM
I want to stress this point from the original post:

Server config file may be necessary (ensure it exists after creation): Admin -> Arcade Maintenance -> Server Config

For anyone that has a problem with HTML5 or some IBP games saving scores, try this option to see if it fixes the problem.
Anyone using LiteSpeed can use the Apache option from that maintenance page since both use .htaccess files with the same syntax.
#27
Zhen Mailer / Zhen Mailer Removal Tool
Last post by Chen Zhen - January 07, 2025, 01:46:56 AM
SMF 2.1.X branch:

Zhen Mailer Removal Tool

Notations:
Only use this tool if you intend to remove any trace of Zhen Mailer from your SMF installation.

This will attempt to remove any ZhenMailer rogue file edits and/or files for a botched uninstall.
It may not be able to remove some file parsing that has been displaced by another modification or manual editing.

Instructions:

Simply install the tool & then uninstall it which will attempt to removal all database entries & files related to ZhenMailer.
This tool is provided for those that have somehow botched their ZhenMailer installation.
It will also remove any ZhenMailer files from your packages directory.


Download -> Zhen Mailer Removal Tool
#28
Zhen Mailer / Zhen Mailer version 2.0.1
Last post by Chen Zhen - January 07, 2025, 01:16:38 AM
SMF 2.1.X branch:
Adds utilities for your SMF outbound email.

Zhen Mailer

Notations:

ZhenMailer now adds the ability to customize email templates.

Navigate to:  Admin -> Maintenance -> Mail  to adjust any ZhenMailer settings.

PHP Mail Users:

Mail server software such as Postfix have a message size limit setting.
If you have a large database and are using the DB backup option you may need to increase this limit to a rather large number.
The setting is usually in Bytes and is based on the decompressed size of each file.
Even though files are compressed, your email program will decompress them to send the data.
This setting should be available in your Control Panel or you can manually adjust a config file if you have that option available.

Postfix reference example

Zhen Mailer is no longer restricted to SMTP email usage.
People using regular PHP mail may now take advantage of this utility.
If you operate a VPS or dedicated server and need help installing any of the requirements, please feel free to leave a post in the forum.



SMF 2.1.4 does not currently have the appropriate hooks and flexibility to allow overriding SMF email without file parsing.
Unfortunately this modification must make file edits for that task and the optional custom email templates.



Zhen Mailer Admin Setting ~ Admin/User ID To Send DB Dumps
Be careful when adding an additional user email address to the sent database and/or attachment emails.
Ensure that the extra email address is one that should be receiving those emails (ie. an admin)


This installation process will add the following:

-> Database dumps that are forwarded to the webmaster email and/or an additional admin email.
-> Attachment backups to the webmaster email and/or an additional admin email as they are posted
-> Options to encrypt any email attachments as compressed zip archives (requires PHP 7.2+ & ZipArchive)
-> Option to use Zhen Mailer for all outbound PHP email (raw HTML).
-> Custom email templates including precursory & signature (header/footer)

Compatibility notes:
- PHP version 7.4 with the openssl PHP extension enabled is the minimum requirement for STARTTLS-SMTP compatibility
- ZipArchive extension is required for compression of any attachment backups

PHP version 7.4+, ZipArchive & cURL extensions are recommended to make full use of this modification.

Updated CA certificates are required for your forum to communicate with email providers using the STARTTLS SMTP extension.
Example settings for your php.ini file may be:
openssl.cafile = /etc/ssl/cacert.pem
curl.cainfo = /etc/ssl/cacert.pem

You can download the latest cacert.pem file here:
https://curl.haxx.se/ca/cacert.pem

Other Notes:
Although it is not mandatory, a mail user named "members" should be created for BCC bulk emails.
SMTP port 587 is recommended.

Zhen Mailer for Simple Machines Forum
c/o Chen Zhen @ web-develop.ca
@license  http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
@copyright 2025 Chen Zhen

3rd Party Usage:
PHPMailer - PHP email creation and transport class.
@license  http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
@author    Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
@copyright 2012 - 2017 Marcus Bointon

Shuttle-Export c/o 2createStudio
PHP based MySQL dump library
@license  http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
@copyright 2015 - 2017 2createStudio

Distributed under the GNU Lesser General Public License -> https://www.gnu.org/licenses/lgpl.html
#29
Post Hyperlink Filter / Re: Re: Restricting hyperlinks...
Last post by Skhilled - January 06, 2025, 07:41:09 PM
Thank you, Sir Underdog! ;)
#30
Post Hyperlink Filter / Re: Restricting hyperlinks fro...
Last post by Chen Zhen - January 05, 2025, 03:20:14 PM

Done.

The new version is available in the download section.