Skip to content

Instantly share code, notes, and snippets.

View akroii's full-sized avatar

Andreas Kroll akroii

  • Proverbs 6,6-8
  • 17:43 (UTC +02:00)
View GitHub Profile
$id = $arrItem['raw']['id'];
$alias = $arrItem['text']['alias'];
$db = Database::getInstance();
$stmt = $db->prepare("SELECT id,alias FROM mm_mitarbeiterliste WHERE alias='$alias'");
$res = $stmt->execute();
while($res->next()){
var_dump($res);
}
<?php echo \Controller::getFrontendModule();?>
<?php echo \Controller::getContentElement() ?>
<?php echo $this->replaceInsertTags();?>
<meta charset="utf-8">
<!--[if !HTML5]><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"><![endif]-->
<meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport">
<title></title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Open Graph data -->
<meta content="website" property="og:type">
@akroii
akroii / .htaccess
Created November 16, 2016 12:24 — forked from ludo237/.htaccess
The ultimate .htaccess file. Please feel free to fork it, edit it and let me know what do you think about it.
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
# This is the free sample of .htaccess from 6GO s.r.l.
# @author Claudio Ludovico Panetta (@Ludo237)
@akroii
akroii / gist:8218d9465d3271d2137f311158b8b7dd
Last active April 25, 2017 13:31
body class extended
<body id="top" class="{{ua::class}} {{page::pageTitle|standardize|strtolower}} {{page::parentAlias|standardize|strtolower}} <?php echo ($this->replaceInsertTags('{{page::alias}}') != "index" ? "sub" : "main");?><?php if ($this->class) echo ' ' . $this->class; ?>"<?php if ($this->onload): ?> onload="<?= $this->onload ?>"<?php endif; ?>>
<picture>
<!--[if IE 9]><video style="display: none;"><![endif]-->
<source srcset="" media="(max-width: 550px)">
<source srcset="" media="(max-width: 767px)">
<source srcset="">
<!--[if IE 9]></video><![endif]-->
<img src="" alt="" title="">
</picture>
$this->parseDate('Y/m/d H:i:s',strtotime($this->value))
@akroii
akroii / gist:4dfd6b41eadfd8c99c742231c016a403
Created February 2, 2017 09:56
php date calculation for jquery for contao
<?php $finalRawDate = $this->parseDate('Y/m/d H:i:s',strtotime($this->value));?>
<?php $finalDateC = date('c', strtotime($finalRawDate));?>
<?php $finalDateStr = date('Y-m-d', strtotime($finalRawDate));?>
<?php $finalDate = date('Y-m-d\TH:i', strtotime($finalRawDate));?>
<?php $passedRawDate = date("Y-m-d H:i:s", strtotime($finalRawDate . "+240 minutes"));?>
<?php $passedDateC = date('c', strtotime($passedRawDate));?>
<?php $passedDate = date('Y-m-d\TH:i', strtotime($passedRawDate));?>
<?php
$timestamp = strtotime("'.$finalDateStr.'");// your launch date '2020-07-30'
$difference = $timestamp + time();
<?php if (count(array_keys($this->body["row_0 row_first row_last even"])) > 3):?>
@akroii
akroii / .htaccess
Created May 24, 2017 12:50
million dollar htaccess
RewriteBase /
RewriteCond %{THE_REQUEST} \.html
RewriteRule ^(.*)\.html$ /$1 [R=301,L]