Skip to content

Instantly share code, notes, and snippets.

💭
😜 Buried by a certain volume of code 🤓

3Di 3D-I

💭
😜 Buried by a certain volume of code 🤓
Block or report user

Report or block 3D-I

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View remove_bom.php
<?php
// hexa code: EF BB BF
// displayed in browsers with:  - UTF8 files
static function remove_bom($str = '')
{
if (substr($str, 0, 3) == pack('CCC', 0xef, 0xbb, 0xbf))
{
$str = substr($str, 3);
}
View chunck_size.php
<?php
/**
* Change get_chunk_size() calculation to correctly calculate limits without
* letting a zero "unlimited" value always win. Also ensure get_chunk_size()
* can only return zero if all of the limits were in fact set to unlimited.
*/
$max = 0;
$limits = [100, 200, 300];
@3D-I
3D-I / modission_reset_325.php
Last active Aug 29, 2019
phpBB 3.2.5 ONLY! - Delete Non-standard Modules and Permissions, and AutoMOD.
View modission_reset_325.php
<?php
/***
* Usage: Download and unzip the file, upload it to your Board's root (i.e.: www.mydomain.com/phpBB3/)
* Point your browser to i.e.: www.mydomain.com/phpBB3/modission_reset_325.php)
* and follow instructions.
*
* Version 3.0.4 by 3Di in 10-Feb-2019 for phpBB 3.2.5 - (Oyabun1 2015 for 3.1.x)
*
* This script is free software. It comes without any warranty.
* license http://opensource.org/licenses/GPL-2.0 GNU General Public License v2.
@3D-I
3D-I / modission_reset_3111.php
Last active Jun 3, 2019
Reset modules and permissions to the standard set for phpBB 3.1.x. May be useful if upgrading from 3.0.x and there is an error about a missing module, or language keys, such as, ACP_SOME_MOD, are visible in a control panel. Does not remove all database changes from MODs, it is not a database cleaner, it just removes non standard permissions and…
View modission_reset_3111.php
<?php
/***
* Usage: Download and unzip the file, upload it to your Board's root (i.e.: www.mydomain.com/phpBB3/)
* Point your browser to i.e.: www.mydomain.com/phpBB3/modission_reset_3111.php) and follow instructions.
*
* Version 2.2.6 (3Di in 17-Jul-2017 for phpBB 3.1.11) - Oyabun1 2015
*
* This script is free software. It comes without any warranty.
* license http://opensource.org/licenses/GPL-2.0 GNU General Public License v2.
*
@3D-I
3D-I / sos_admin.php
Last active May 31, 2019
For phpBB [3.1][3.2] - Gives a SOS admin account in order to fix some things.
View sos_admin.php
<?php
/**
* Usage: --> make sure you have a backup of your Database before to run this tool!
* Download and/or unzip the file, upload it to your Board's root (i.e.: www.mydomain.com/phpBB3/)
* Point your browser to i.e.: www.mydomain.com/phpBB3/sos_admin.php), it auto-destroys itself once ran.
*
* This file will create an admin user named Admin1 with a password of admin. From that point you should be
* able to get into the ACP.
* As soon as you have done this, use the temporary admin account to change the details on the original admin
* account, then delete the temporary account.
@3D-I
3D-I / .htaccess
Created Apr 12, 2017
phpBB 3.2.0 .htaccess (original) plus HTTPS redirection
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
#
# Uncomment the statement below if URL rewriting doesn't
# work properly. If you installed phpBB in a subdirectory
# of your site, properly set the argument for the statement.
# e.g.: if your domain is test.com and you installed phpBB
@3D-I
3D-I / maintenance503.php
Last active Sep 25, 2018
HTTP/1.1 503 header for sites maintenance, your site will be not indexed while doing maintenance or the likes.
View maintenance503.php
<?php
/**
* Usage:
* Download and unzip the file then RENAME it to index.php
* Into the code find "your site name goes here" and put your Board's/Site's name in there.
* SAVE this file.
*
* Rename your (i.e.: www.mydomain.com/phpBB3/index.php) to something else you like (as a backup)
* Upload THIS renamed file to your Board's root (i.e.: www.mydomain.com/phpBB3/)
* Point your browser to i.e.: www.mydomain.com/phpBB3/index.php), once finished delete this
@3D-I
3D-I / right_install.php
Last active Aug 3, 2018
Mini Support Tool Kit for phpBB [3.0][3.1][3.2]
View right_install.php
<?php
/***
* Usage:
* Download and unzip the file, upload it to your Board's root (i.e.: www.mydomain.com/phpBB3/)
* Point your browser to i.e.: www.mydomain.com/phpBB3/right_install.php) and follow instructions.
*
* @package - right_install.php 2.0.0-b4 (true versions comparison and more)
* @copyright (c) 2016, 2017 3Di (Marco T.) 21-08-2017
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
@3D-I
3D-I / fix-left-right-ids.php
Created Jul 4, 2018
MAKE A BACKUP FIRST! Repairs the tree structure of the forums and modules for phpBB 3.2.x
View fix-left-right-ids.php
<?php
/**
* Use at your own risk! Do a DB backup first!
*.
* This file is released as is, no warraties OF ANY SORT.
*
* -------------------------------------------------------
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
View CSS for <sup> and <sub>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
You can’t perform that action at this time.