Skip to content

Instantly share code, notes, and snippets.

View tbaddade's full-sized avatar

Thomas Blum tbaddade

  • @yakamara Media GmbH & Co. KG
  • Dresden, Germany
View GitHub Profile
@tbaddade
tbaddade / .htaccess
Created October 12, 2021 07:07 — forked from danferth/.htaccess
My standard htaccess file
# ######################################################################
# This below is extracted from the HTML5 boilerplate htaccess file. #
# ######################################################################
#
# Apache Server Configs v3.0.0 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
# access to the main server configuration file (which is usually called
# `httpd.conf`), you should add this logic there.
@tbaddade
tbaddade / slices_sort.php
Last active July 30, 2020 14:09
REDAXO :: sortieren der Slices eines Artikels
<?php
// -------------------------------- Einstellungen
$article_id = 2; // Artikel Id
$clang = false; // Sprachen Id --------- false = aktuelle Sprache
$ctype = 0; // Ctype Id ------------ 0 = alle Ctypes
$slices_amount = 2; // Anzahl der Slices --- 0 = alle Slices
/*
Sprachnavigation innerhalb einer XForm Tabelle
Das nachfolgende HTML mit dem Value "html" anlegen.
Felder müssen mit einem Prefix "_CLANG-ID" angelegt werden
Bsp.:
Clang | Sprache | Feldname
0 | de | name_0
<?php
if (!function_exists('pr')) {
function pr()
{
array_map(function ($x) {
echo '<pre>'; print_r($x); echo '</pre>';
}, func_get_args()); die;
}
@tbaddade
tbaddade / articles_of_category_recursive.php
Created June 6, 2013 09:46
REDAXO :: Alle Artikel einer Kategorie inklusive die Artikel deren Kinder (rekursiv)
<?php
$root_id = REX_CATEGORY_ID;
$ignore_offline = true;
function getArticles ($id, $ignore_offline) {
$return = array();
if ($id > 0) {
$cats = OOCategory::getChildrenById($id, $ignore_offline);
foreach ($cats as $cat) {
@tbaddade
tbaddade / ctypes_sort_r4.php
Last active July 30, 2020 14:03
REDAXO - Ctypes sortieren
<?php
/*
REDAXO 4.5 - Ctypes sortieren
Sortierung erfolgt mit vorangestellter Zahl beim Ctypenamen im Template.
Bspl:
01 - Inhalt
02 - rechte Spalte
<?php
/*
Erstellt ein <select> mit einem zusätzlichen <option> Element
Ergebnis
<select name="region">
<option value="0">-</option> // keine Einschränkung
<option value="-1">Alle Regionen</option> // Alle Regionen berücksichtigen
<option value="1">Hamburg</option> // nur Region Hamburg berücksichtigen
@tbaddade
tbaddade / responsive_images.html
Created July 22, 2020 05:50 — forked from fahdi/responsive_images.html
Maintaining Image Aspect Ratios in Responsive Web Design. Forked from http://cssdeck.com/labs/rwd-image-aspect-ratio
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Maintain Image Aspect Ratios in RWD</title>
<meta name="robots" content="noindex, nofollow">
<link href="style.css" rel="stylesheet" media="screen">
@tbaddade
tbaddade / propel_creating_xml_schema.md
Last active December 14, 2015 06:19
Propel: Creating an XML Schema from a DB Structure under Mac OS 10.8. and Mamp