Skip to content

Instantly share code, notes, and snippets.

@alrnz
alrnz / rte.css
Last active April 15, 2016 14:47
Add classes to RTE for span/div/p
.product{
color: #00964f;
}
div.product{
color: #00964f;
}
span.product{
color: #00964f;
}
p.product{
@alrnz
alrnz / rte.ts
Created April 15, 2016 15:12
Add special custom format to TYPO3 RTE
RTE.default.userElements {
10 = Hoch und Tief
10 {
1 = Hochgestellt
1.description = Potenz hochgestellt
1.mode = wrap
1.content = <sup>|<sup>
2 = Index
@alrnz
alrnz / TwitterTextViewHelper.php
Created April 26, 2016 14:21
TwitterTextViewHelper
<?php
namespace Sunzinet\SzNewsroom\ViewHelpers;
/**
* This file is part of the TYPO3 CMS project.
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
@alrnz
alrnz / TextlinkViewHelper.php
Created April 26, 2016 14:21
TextlinkViewHelper
<?php
namespace Sunzinet\SzNewsroom\ViewHelpers;
/**
* This file is part of the TYPO3 CMS project.
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
@alrnz
alrnz / .htaccess
Last active August 10, 2016 15:42
Redirect http to https without checking HTTPS != on
# ----------------------------------------------------------------------
# | Forcing `https://` |
# ----------------------------------------------------------------------
# Redirect from the `http://` to the `https://` version of the URL.
# On my Server the %{HTTPS} !=on does not work and always redirects
# (infinite redirect loop with the "Too many redirects"-error)
<IfModule mod_rewrite.c>
RewriteEngine On
@alrnz
alrnz / .htaccess
Created September 21, 2016 16:16 — forked from brichards/.htaccess
Tell Apache to serve missing images from a remote server. Props http://stackoverflow.com/questions/5130410/modrewrite-to-another-server-if-file-image-is-not-found
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.*\.(js|css|png|jpe?g|gif|ico)) http://example.com/$1 [NC,L]
</IfModule>
$(window).scroll(function() {
var height = $(window).scrollTop();
if(height > some_number) {
// do something
}
});
@alrnz
alrnz / parse.php
Created December 7, 2016 11:03
TYPO3 RTE (and link) parser in PHP
<?php
// parse all rte tags
$output = $this->pi_RTEcssText($text);
// parse only br and a tags
$output = strip_tags($this->pi_RTEcssText($text, '<br><a>');
// parse only links (link-Tag in the RTE)
$this->htmlParser = t3lib_div::makeInstance("t3lib_parsehtml_proc");
@alrnz
alrnz / tt_content.ts
Created January 9, 2017 12:02
TYPO3 TypoScript HTML in Bildunterschriften erlauben TYPO3 TypoScript allow HTML in image caption
tt_content.image.20.caption.1.1.htmlSpecialChars = 0
@alrnz
alrnz / auto_core_update_email.php
Last active January 12, 2017 09:53 — forked from annalinneajohansson/auto_core_update_email.php
Change the recipient email for auto_core_update_email
<?php
// change email of auto update notification
function filter_change_auto_update_email( $email ) {
$email['to'] = 'username@example.com';
return $email;
}
add_filter( 'auto_core_update_email', 'filter_change_auto_update_email', 1 );