Skip to content

Instantly share code, notes, and snippets.

View joachimdoerr's full-sized avatar

Joachim Dörr joachimdoerr

  • Germany
View GitHub Profile
@dajoho
dajoho / gn2 oxid autoload shim
Last active August 29, 2015 14:06
Prevents OXID throwing a whitepage/redirect if a module exists in the database (aModules) that doesn't exist in the filesystem.
<?php
/* Put this in modules/functions.php */
require_once __DIR__.'/../core/oxfunctions.php';
function gn2_autoload_shim($class) { (substr($class, -7) == "_parent") ? eval('class '.$class.' {}') : ""; }
spl_autoload_register('gn2_autoload_shim');
?>
@jm42
jm42 / GroupIterator.php
Created October 26, 2014 20:32
PHP `itertools.groupby` implementation
<?php
class GroupIterator implements Iterator
{
protected $keyfunc;
protected $iter;
protected $key = null;
protected $value = null;
@skerbis
skerbis / getaslice_ausgabe.php
Last active April 3, 2020 13:35
redaxo 5 - get a slice
<?php
if( "REX_VALUE[2]" != "" )
{
// Im Backend den Link zur Quelle anzeigen
if(rex::isBackend())
{
$master = rex_article::get(REX_LINK[id=1 output=id]);
@tommydunn
tommydunn / index.html
Last active December 23, 2024 06:06
Slick Slider with auto play YouTube, Vimeo and HTML5 video
<header>
<h1>SITE TITLE</h1>
<nav>
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">ABOUT</a></li>
<li><a href="#">SERVICES</a></li>
<li><a href="#">CONTACT</a></li>
</ul>
</nav>
@staabm
staabm / navigation_iterator.php
Last active July 30, 2020 14:07
redaxo navigation iterator
<?php
/**
* Klasse zum Erstellen von Navigationen, v0.1.
*
* benötigt PHP7!
*
* @package redaxo\structure
*/
<?php
// Function zur Generierung eines Navigationsarrays
// Benötigt für den Aufruf werden nur $start,$depth und $ignoreoffline
// Alle weiteren Angaben dienen der internen Verarbeitung
// Alle weiteren Informationen aus rex_structure fintet man in catObject
// DEMO siehe unten
if (!function_exists('structureArray')) {
function structureArray($start = 0, $depth = 0, $ignoreoffline = true, $depth_saved = 0, $level = 0, $id = 0)
{
$result = array();
@skerbis
skerbis / boot.php
Last active May 15, 2023 13:39
REDAXO CKE5 Uikit-Helper // rewrite images to responsive or Lightbox
<?php
if (rex::isFrontend() || rex_be_controller::getCurrentPage() == 'content/edit' && rex_request('function','string')!=='edit'){
rex_extension::register('OUTPUT_FILTER', static function ($ep) {
$html = $ep->getSubject();
$pattern = '/(<figure[^>]*class="[^"]*image[^"]*"[^>]*style="[^"]*width:)(\d+)(%;[^"]*">)(.*?)(<\/figure>)/s';
$new_html = preg_replace_callback($pattern, function ($matches) {
$width_map = [
'100' => 'uk-width-1-1',