Skip to content

Instantly share code, notes, and snippets.

@kasimi
kasimi / route.php
Last active April 5, 2019 07:35
Get phpBB route with parameter placeholders
<?php
/**
* Required services: @config, @path_helper, @router
*
* @param string $route_name
* @return string
*/
public function get_raw_route($route_name)
{
@kasimi
kasimi / attrs2html.py
Created July 4, 2018 10:16
Convert attributes to HTML tags
class Element():
closable = True
mergeable = True
class Italic(Element):
tag = 'i'
class Bold(Element):
tag = 'b'
@kasimi
kasimi / magicogp.js
Last active November 29, 2017 22:39
Making Magic OGP Parser compatible with mChat for phpBB 3.2
(function ($) {
"use strict";
function parseOgp($container) {
$container.find('.postlink').each(function() {
var ogpdata = $(this).data('ogp');
if (ogpdata.title !== undefined) {
var block = '<div class="ogpblock">';
if (ogpdata.image !== undefined) {
@kasimi
kasimi / migrations.php
Created October 11, 2017 16:29
phpBB 3.2.1 revert migrations
<?php
class m1_initial_schema extends \phpbb\db\migration\migration
{
public function update_schema()
{
return array(
'add_tables' => array(
$this->table_prefix . 'test_table' => array(
'COLUMNS' => array(
@kasimi
kasimi / phpbb_foes.user.js
Last active February 15, 2020 11:27
Greasemonkey script for phpBB boards that hides posts of certain users
// ==UserScript==
// @name phpBB foes
// @namespace https://kasimi.net
// @description Hides foes' posts
// @include https://www.phpbb.com/community/viewtopic.php*
// @version 2
// @grant none
// ==/UserScript==
(function() {