Skip to content

Instantly share code, notes, and snippets.

@fritids
fritids / convert-avatars.php
Created September 23, 2015 01:00 — forked from tierra/convert-avatars.php
phpBB 3.1 script that fetches all remote avatars, and converts them to uploaded avatars hosted locally.
<?php
/**
* Converts all phpBB 3.1 remote avatars to uploaded avatars.
*
* To use this script:
*
* 1. Copy this file into the root of your phpBB installation.
* 2. Run the script from the command line: php convert-avatars.php
*
* Any avatar will be skipped if any errors come up, like these:
@fritids
fritids / gist:01ba1aaf9b76081afb75
Last active September 21, 2015 23:52 — forked from Danielx64/gist:7519092
Create wordpress account if needed
<?php
/**
* Database auth plug-in for phpBB3
*
* Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.
*
* This is for authentication via the integrated user table
*
* @package login
* @version $Id$
@fritids
fritids / latest_posts.php
Last active September 21, 2015 23:48 — forked from Rivkah/latest_posts.php
Latest Posts for phpBB 3
<?php
//Config for Connection and Reporting Limit
$Config['Host'] = 'localhost'; // MySQL Host
$Config['User'] = 'root'; // MySQL Username
$Config['Pass'] = ''; // MySQL Password
$Config['Data'] = 'forums'; // MySQL Forum Database
$Config['Pfix'] = 'phpbb_'; // Prefix of the forums tables (Default: phpbb_)
$Config['LimN'] = 5; // Maximum Report Limit
$Config['Link'] = '../../forums'; // Folder where the forums are
$Config['Date'] = 'M j, Y @ g:i a'; // Default: 'M j, Y @ g:i a'
(function( $ ) {
$.widget( "ui.combobox", {
_create: function() {
var self = this,
select = this.element.hide(),
selected = select.children( ":selected" ),
value = selected.val() ? selected.text() : "";
var input = this.input = $( "<input>" )
.insertAfter( select )
.val( value )
<?php
array(
array('id' => 1, 'title' => _('Afghane')),
array('id' => 2, 'title' => _('Albanaise')),
array('id' => 3, 'title' => _('Algerienne')),
array('id' => 4, 'title' => _('Allemande')),
array('id' => 5, 'title' => _('Americaine')),
array('id' => 6, 'title' => _('Andorrane')),
array('id' => 7, 'title' => _('Angolaise')),
array('id' => 8, 'title' => _('Antiguaise et barbudienne')),
add_action('user_register', 'my_new_member');
function my_new_member($user_id) {
global $wpdb;
//Example of how to get the fields submitted via the form
if (isset($_POST['first_name'])) {
$firstname = $_POST['first_name'];
}
else {
$firstname = '';
<?php
error_reporting(E_ALL);
$data = array();
$data[] = serialize( array( 1, 2, 3, array( 'een', 'twee', 'tree' ) ) );
$data[] = 'a:4:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;a:3:{i:0;s:3:"een";i:1;s:4:"twee";i:2;s:4:"tree";}}';
$data[] = 'a:{i0;i1;i1;i2;i2;i3;i3;a:{i0;s:"een";i1;s:"twee";i2;s:"tree";}}';
$data[] = serialize( 'blah' );
$data[] = 'blah';
<?php
namespace ShowMemberSince;
add_action( 'plugins_loaded', 'ShowMemberSince\init' );
/**
* Adding needed action hooks
*/
function init(){
Files/functions where wp_mail() is used
=======================================
retrieve_password() in wp-login.php
subject filter: 'retrieve_password_title'
content filter: 'retrieve_password_message' (content, key)
disable with: 'allow_password_reset' filter (boolean)
wp-admin/ms-delete-site.php
subject filter: none
<?php
/**
* WordPress User Page
*
* Handles authentication, registering, resetting passwords, forgot password,
* and other user handling.
*
* @package WordPress
*/