Skip to content

Instantly share code, notes, and snippets.

Avatar

Fuxia Scholz thefuxia

View GitHub Profile
View functionreal_lastmod.php
<?php
/**
* Gibt den Zeitpunkt der letzten Änderung aller verwendeten
* Dateien als UNIX-Timestamp zurück.
* @return integer
*/
function real_lastmod()
{
$arr_all_files = get_included_files();
if ( !array_key_exists(1, $arr_all_files) )
View function.is_local.php
<?php
function is_local()
{
return ( '127.0.0.1' == $_SERVER["REMOTE_ADDR"]) ? TRUE : FALSE;
}
View function.is_ascii.php
<?php
function is_ascii ($str)
{
return preg_match("/[\\000-\\126]/", $str);
}
@thefuxia
thefuxia / class.singleton.php
Created Oct 8, 2009
Template for a singleton.
View class.singleton.php
<?php
/**
* Description
*
* Aufruf nur durch
<code>{NAME}::getInstance()</code>
* @author Thomas Scholz <info@toscho.de>
*/
class {NAME} {
@thefuxia
thefuxia / class.View_All_Posts.php
Created Jun 24, 2010
Adds a view all posts page to any archive.
View class.View_All_Posts.php
<?php
/**
* Adds a view all posts page to any archive.
*
* @author Thomas Scholz http://toscho.de
* @version 1.1
* @license: GPL2
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@thefuxia
thefuxia / Wordpress-feed-desc-fulltext.php
Created Jul 22, 2010
Print full text in feed description
View Wordpress-feed-desc-fulltext.php
<?php
add_filter('the_excerpt_rss', 'my_fulltext_desc');
function my_fulltext_desc($excerpt)
{
if ( ! is_feed() )
{
return $excerpt;
}
return apply_filters('the_content', get_the_content() );
@thefuxia
thefuxia / post-cats-to-css-classes.php
Created Jul 24, 2010
Converts post categories into CSS classes
View post-cats-to-css-classes.php
<?php
function categories_to_classes()
{
$out = '';
$cats = get_the_category();
foreach ( $cats as $cat_object )
{
$out .= $cat_object->slug . ' ';
}
@thefuxia
thefuxia / class.Toscho_Language_Filter.php
Created Aug 2, 2010
Change language declarations in WordPress.
View class.Toscho_Language_Filter.php
<?php
/**
* Adjust the public visible language declarations.
*
* @author "Thomas Scholz" http://toscho.de
* @version 1.0
*/
class Toscho_Language_Filter
{
/**
@thefuxia
thefuxia / class.TTT_Comment_Form.php
Created Sep 5, 2010
Handler for filters and actions for the comment form.
View class.TTT_Comment_Form.php
<?php
/**
* Handler for filters and actions for the comment form.
*
* comment_form(); in the theme’s comments.php and WP 3+ is required.
*
* @author "Thomas Scholz" http://toscho.de
* @version 1.2
*
*/
@thefuxia
thefuxia / consolas.css
Created Sep 8, 2010
Opera User Stylesheet for monospace elements
View consolas.css
@charset "utf-8";
/* Name: monospace: Consolas */
pre, code, samp, var,
.code, .pre,
textarea
{
font-family: Consolas,
/* make unicode characters work: */
'Lucida Sans Unicode',
'Arial Unicode MS'
You can’t perform that action at this time.