<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Schnipsel - Code Schnipsel (Snippets) zu Wordpress, PHP, HTML, CSS, jQuery</title>
	<atom:link href="http://schnipsel.davidhellmann.com/feed" rel="self" type="application/rss+xml" />
	<link>http://schnipsel.davidhellmann.com</link>
	<description>Code Schnipsel (Snippets) zu Wordpress, PHP, HTML, CSS, jQuery</description>
	<lastBuildDate>Tue, 08 Mar 2011 00:20:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Little Snapper Bookmarklet</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/little-snapper-bookmarklet/70</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/little-snapper-bookmarklet/70#comments</comments>
		<pubDate>Thu, 08 Oct 2009 07:36:12 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[little snapper]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=70</guid>
		<description><![CDATA[Praktisch und gut! Einfach per klick Screenshots in Little Snapper erstellen. 1 javascript:location.href='littlesnapper://snap/'+location.href;]]></description>
			<content:encoded><![CDATA[<p>Praktisch und gut! Einfach per klick Screenshots in <a href="http://realmacsoftware.com/littlesnapper/">Little Snapper</a> erstellen.</p>
<span id="more-70"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">javascript<span style="color: #339933;">:</span>location<span style="color: #339933;">.</span>href<span style="color: #339933;">=</span><span style="color: #0000ff;">'littlesnapper://snap/'</span><span style="color: #339933;">+</span>location<span style="color: #339933;">.</span>href<span style="color: #339933;">;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/little-snapper-bookmarklet/70/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Tweet This mit WordPress</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/tweet-this-mit-wordpress/69</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/tweet-this-mit-wordpress/69#comments</comments>
		<pubDate>Wed, 07 Oct 2009 14:37:15 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=69</guid>
		<description><![CDATA[Twitter ist &#252;berall! Hier ein kleiner Schnipsel zum einfachen einbinden in WordPress. Das ganze kommt von Frank Bueltge und von René. Die Funktion kommt einfach in die functions.php im Themeordner. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 /** * get a short/tiny url * @author: [...]]]></description>
			<content:encoded><![CDATA[<p>
Twitter ist &#252;berall! Hier ein kleiner Schnipsel zum einfachen einbinden in WordPress. Das ganze kommt von <a href="http://bueltge.de/tweet-this-mit-wordpress/875/">Frank Bueltge</a> und von <a href="http://www.rene-ade.de/inhalte/php-code-zum-erstellen-einer-tinyurl-ueber-tinyurl-com-api.html">René</a>.
</p>
<span id="more-69"></span>
<p>Die Funktion kommt einfach in die <strong>functions.php</strong> im <strong>Themeordner</strong>.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * get a short/tiny url
 * @author: René Ade
 * @link: http://www.rene-ade.de/inhalte/php-code-zum-erstellen-einer-tinyurl-ueber-tinyurl-com-api.html
 */</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fb_gettinyurl'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> fb_gettinyurl<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$url</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'http://tinyurl.com/api-create.php?url='</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$fp</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$tinyurl</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$fp</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$tinyurl</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tinyurl</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$tinyurl</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$fp</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$url</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>



<p>Eingebunden an der jeweiligen Wunschstelle der Seite wird es dann wie folgt:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;a class=&quot;tweetthis&quot; href=&quot;http://twitter.com/home?status=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Lohnenswert: '</span> <span style="color: #339933;">.</span> get_the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> fb_gettinyurl<span style="color: #009900;">&#40;</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Tweet this&quot;&gt;
	&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stylesheet_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/layout/tweetthis.jpg&quot; border=&quot;0&quot; /&gt;
&lt;/a&gt;</pre></td></tr></table></div>



<p>Bei Twitter erscheint dann das hier: <strong>Lohnenswert: Titel des Beitrags http://tinyurl...</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/tweet-this-mit-wordpress/69/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Eine Seite ausgeben</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/wordpress-eine-seite-ausgeben/68</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/wordpress-eine-seite-ausgeben/68#comments</comments>
		<pubDate>Wed, 12 Aug 2009 05:46:11 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[pages]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=68</guid>
		<description><![CDATA[Will man sich zum Beispiel eigene Landingpages bauen oder auch nur die Startseite individuell gestalten braucht man hin und wieder einzelne Seiten die man einf&#252;gen m&#246;chte. Zum Beispiel einen kleinen About Text auf der Startseite oder &#228;hnliches. Mit dem folgenden Code kann man ganz einfach an Hand der Seiten ID diese anzeigen lassen. 1 2 [...]]]></description>
			<content:encoded><![CDATA[<p>
Will man sich zum Beispiel eigene Landingpages bauen oder auch nur die Startseite individuell gestalten braucht man hin und wieder einzelne Seiten die man einf&#252;gen m&#246;chte. Zum Beispiel einen kleinen About Text auf der Startseite oder &#228;hnliches. Mit dem folgenden Code kann man ganz einfach an Hand der Seiten ID diese anzeigen lassen.
</p>
<span id="more-68"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #666666; font-style: italic;">// retrieve one post with an ID of 5</span>
	query_posts<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'page_id=9'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$more</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// set $more to 0 in order to only get the first part of the post</span>
	<span style="color: #000088;">$more</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h2&gt;
  	<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Read the full post »'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/wordpress-eine-seite-ausgeben/68/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>AS3 eigene Events</title>
		<link>http://schnipsel.davidhellmann.com/actionscript/as3-eigene-events/61</link>
		<comments>http://schnipsel.davidhellmann.com/actionscript/as3-eigene-events/61#comments</comments>
		<pubDate>Mon, 13 Jul 2009 19:27:34 +0000</pubDate>
		<dc:creator>Thomas Aull</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=61</guid>
		<description><![CDATA[Wenn die normalen Events von AS3 nicht ausreichen, kann man sich auch eigene schreiben. Wie das geht erkl&#228;re ich in meinem Blog, die Klasse f&#252;r eigene Events gibts auch hier: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 &#160; package &#123; // Import [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn die normalen Events von AS3 nicht ausreichen, kann man sich auch eigene schreiben. Wie das geht erkl&#228;re ich in meinem <a href="http://www.thomas-aull.de/2009/07/as3-eigene-events-verwenden/">Blog</a>, die Klasse f&#252;r eigene Events gibts auch hier:</p>
<span id="more-61"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #009900; font-style: italic;">// Import der Flash Eventklasse</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> MeinEvent <span style="color: #0033ff; font-weight: bold;">extends</span> <span style="color: #004993;">Event</span> <span style="color: #000000;">&#123;</span>
&nbsp;
                <span style="color: #009900; font-style: italic;">// Eventarten, bekanntes Beispiel: MouseEvent.CLICK</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> static const MEIN_EREIGNIS<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;MEIN_EREIGNIS&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
                <span style="color: #009900; font-style: italic;">// Variable in denen wir zusätzliche Eventdaten speichern können</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
                <span style="color: #009900; font-style: italic;">// Der Konstruktor</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MeinEvent<span style="color: #000000;">&#40;</span><span style="color: #004993;">type</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">data</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">type</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span> = <span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>




<p>Und anschlie&#223;end noch <b>EventListener</b> und <b>Dispatcher</b>:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #009900; font-style: italic;">// EventListener</span>
<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>MeinEvent<span style="color: #000066; font-weight: bold;">.</span>MEIN_EREIGNIS<span style="color: #000066; font-weight: bold;">,</span> machWas<span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Dispatcher mit Eventdaten füttern...</span>
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Object</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span> = <span style="color: #990000;">&quot;Max Mustermann&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span>alter = <span style="color: #000000; font-weight:bold;">21</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #009900; font-style: italic;">// ...und abfeuern</span>
<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> MeinEvent<span style="color: #000000;">&#40;</span>MeinEvent<span style="color: #000066; font-weight: bold;">.</span>MEIN_EREIGNIS<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">data</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Eventfunktion: Daten auslesen</span>
<span style="color: #339966; font-weight: bold;">function</span> machWas<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span>MeinEvent<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span>alter<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/actionscript/as3-eigene-events/61/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS &#8211; mit wenig Klassen auskommen</title>
		<link>http://schnipsel.davidhellmann.com/css/css-mit-wenig-klassen-auskommen/67</link>
		<comments>http://schnipsel.davidhellmann.com/css/css-mit-wenig-klassen-auskommen/67#comments</comments>
		<pubDate>Wed, 08 Jul 2009 08:13:23 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=67</guid>
		<description><![CDATA[Wenn man sein CSS gut schreibt dann kann man sich viele klasse sparen. Wenn man zum Beispiel verschiende Abs&#228;tze- oder Headlineformatierungen haben m&#246;chte kann man &#252;ber das Elternelement leicht auf das Kind zugreifen und muss daf&#252;r nicht extra eine Klasse vergeben. Folgendes Beispiel soll das zeigen. Wir haben folgendes HTML 1 2 3 4 5 [...]]]></description>
			<content:encoded><![CDATA[<p>
Wenn man sein CSS gut schreibt dann kann man sich viele klasse sparen. Wenn man zum Beispiel verschiende Abs&#228;tze- oder Headlineformatierungen haben m&#246;chte kann man &#252;ber das Elternelement leicht auf das Kind zugreifen und muss daf&#252;r nicht extra eine Klasse vergeben. Folgendes Beispiel soll das zeigen.
</p>
<span id="more-67"></span>
<h3>Wir haben folgendes HTML</h3>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;content&quot;&gt;
	&lt;!-- Sticky Post --&gt;
	&lt;div class=&quot;stickypost&quot;&gt;
		&lt;h2&gt;Headline for sticky Post here&lt;/h2&gt;
		&lt;p&gt;
			Content here
		&lt;/p&gt;
	&lt;/div&gt;
&nbsp;
	&lt;!-- Normal Post --&gt;
	&lt;div class=&quot;post&quot;&gt;
		&lt;h2&gt;Headline for normal Post here&lt;/h2&gt;
		&lt;p&gt;
			Content here
		&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>



<h3>Dazu folgendes CSS</h3>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#content</span> <span style="color: #6666ff;">.stickypost</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#content</span> <span style="color: #6666ff;">.post</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">500px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">dotted</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span>	<span style="color: #00AA00;">;</span>
	etc...	
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.stickypost</span> h2<span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.post</span> h2 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span> <span style="color: #933;">18px</span>/<span style="color: #933;">23px</span> Arial<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>
	etc...
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.stickypost</span> h2 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#d40000</span><span style="color: #00AA00;">;</span>
	etc...
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.stickypost</span> p<span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.post</span> p <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span> <span style="color: #933;">13px</span>/<span style="color: #933;">18px</span> Arial<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#444</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	etc...
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.stickypost</span> p <span style="color: #00AA00;">&#123;</span>	
	<span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span> <span style="color: #933;">15px</span>/<span style="color: #933;">20px</span> Arial<span style="color: #00AA00;">;</span>
	etc...
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>



<h3>Ergebnis</h3>
<p>
Man hat ohne irgendwelche Klassen zu vergeben trotzdem genug Einfluss auf die Elemente. 
</p>]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/css/css-mit-wenig-klassen-auskommen/67/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Simple PHP Schleife</title>
		<link>http://schnipsel.davidhellmann.com/php/simple-php-schleife/66</link>
		<comments>http://schnipsel.davidhellmann.com/php/simple-php-schleife/66#comments</comments>
		<pubDate>Thu, 02 Jul 2009 13:20:31 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[schleife]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/php/simple-php-schleife/66</guid>
		<description><![CDATA[Kann man oft gebrauchen wenn man kleine Sachen schnell &#246;fters darstellen will. 1 2 3 &#60;?php for&#40;$i = 0; $i &#60; 10; $i++&#41; &#123; ?&#62; html code oder sonst was hier &#60;?php &#125; ?&#62;]]></description>
			<content:encoded><![CDATA[<p>
Kann man oft gebrauchen wenn man kleine Sachen schnell &#246;fters darstellen will.
</p>
<span id="more-66"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	html code oder sonst was hier
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/php/simple-php-schleife/66/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Shortcodes erstellen</title>
		<link>http://schnipsel.davidhellmann.com/wordpress/wordpress-shortcodes-erstellen/64</link>
		<comments>http://schnipsel.davidhellmann.com/wordpress/wordpress-shortcodes-erstellen/64#comments</comments>
		<pubDate>Tue, 30 Jun 2009 06:38:23 +0000</pubDate>
		<dc:creator>David Hellmann</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Shortcodes]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=64</guid>
		<description><![CDATA[Wenn man zum Beispiel einen oft wiederkehrende Zeichenfolge hat und man diese nicht immer schreiben m&#246;chte von Hand k&#246;nnte man die mit Shortcodes machen. 1 2 3 4 5 6 &#60;?php function makebetterwebsites&#40;&#41; &#123; return 'Make Better Websites - Webseitengallery f&#252;r wundersch&#246;ner und eindrucksvolle Webseiten.'; &#125; &#160; add_shortcode&#40;'mbw', 'makebetterwebsites'&#41;; ?&#62; Jetzt m&#252;sste man in WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn man zum Beispiel einen oft wiederkehrende Zeichenfolge hat und man diese nicht immer schreiben m&#246;chte von Hand k&#246;nnte man die mit Shortcodes machen.
</p>
<span id="more-64"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000000; font-weight: bold;">function</span> makebetterwebsites<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'Make Better Websites - Webseitengallery für wunderschöner und eindrucksvolle Webseiten.'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mbw'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'makebetterwebsites'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>



<p>
Jetzt m&#252;sste man in WordPress bei einem Artikel (HTML Editor) einfach [mbw] einsetzen und es w&#252;rde der Text: "Make Better Websites - Webseitengallery f&#252;r wundersch&#246;ner und eindrucksvolle Webseiten." erscheinen. 
</p>
<p>
Da kommt mir gerade die Idee, ob es so vielleicht m&#246;glich w&#228;re ganze Codeschnipsel die man oft braucht (z. B. Letzte Artikel ausgeben) einfach in solche Shortcodes packen k&#246;nnte und somit in den Templates relativ wenig code hat. Wer kann was dazu sagen?
<br /><br />
<strong>***UPDATE***</strong><br />
Ein kurzer plausch mit <a href="http://www.bueltge.de">Frank</a> und es kam raus das das so nicht m&#246;glich w&#228;re aber er hat mich auf eine andere Sache gesto&#223;en die im grunde &#228;hnlich einfach ist :)
</p>]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/wordpress/wordpress-shortcodes-erstellen/64/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Javascript &#8211; public / private Methoden</title>
		<link>http://schnipsel.davidhellmann.com/html/javascript-public-private-methoden/62</link>
		<comments>http://schnipsel.davidhellmann.com/html/javascript-public-private-methoden/62#comments</comments>
		<pubDate>Tue, 23 Jun 2009 07:45:50 +0000</pubDate>
		<dc:creator>Bastian Winkler</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Sonstiges]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=62</guid>
		<description><![CDATA[Hier ein Workarround f&#252;r public und private Methoden mit objektorientiertem (OOP) Javascript 1 2 3 4 5 6 7 8 9 10 11 function bla &#40;&#41; &#123; var priv = &#34;privat&#34;; this.publicMethod = function &#40;&#41; &#123; privateMethode&#40;&#41;; &#125; privateMethode = function &#40;&#41; &#123; alert&#40;priv + &#34; &#34; + this.publ&#41;; &#125; &#125; var objekt = new [...]]]></description>
			<content:encoded><![CDATA[<p>
Hier ein Workarround f&#252;r public und private Methoden mit objektorientiertem (OOP) Javascript
</p>
<br />
<br />
<span id="more-62"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> bla <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">var</span> priv  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;privat&quot;</span><span style="color: #339933;">;</span>
  this<span style="color: #339933;">.</span>publicMethod <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    privateMethode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  privateMethode <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>   <span style="color: #009900;">&#123;</span>
    alert<span style="color: #009900;">&#40;</span>priv <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; &quot;</span> <span style="color: #339933;">+</span> this<span style="color: #339933;">.</span>publ<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">var</span> objekt <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> bla<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
objekt<span style="color: #339933;">.</span>publicMethod<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/html/javascript-public-private-methoden/62/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS3 FlashVars auslesen</title>
		<link>http://schnipsel.davidhellmann.com/actionscript/as3-flashvars-auslesen/60</link>
		<comments>http://schnipsel.davidhellmann.com/actionscript/as3-flashvars-auslesen/60#comments</comments>
		<pubDate>Sun, 14 Jun 2009 22:06:43 +0000</pubDate>
		<dc:creator>Thomas Aull</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=60</guid>
		<description><![CDATA[Beim Einbetten eines Flash-Films hat man die M&#246;glichkeit Variablen zu hinterlegen, die dann im Flashfilm weiterverwendet werden k&#246;nnen. Mit ActionScript 3 hat sich das Auslesen etwas ge&#228;ndert, an die Variablen kommt man jetzt so: 1 var pfad = root.loaderInfo.parameters.pfad;]]></description>
			<content:encoded><![CDATA[<p>Beim Einbetten eines Flash-Films hat man die M&#246;glichkeit Variablen zu hinterlegen, die dann im Flashfilm weiterverwendet werden k&#246;nnen. Mit ActionScript 3 hat sich das Auslesen etwas ge&#228;ndert, an die Variablen kommt man jetzt so:</p>
<span id="more-60"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> pfad = <span style="color: #004993;">root</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">loaderInfo</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">parameters</span><span style="color: #000066; font-weight: bold;">.</span>pfad<span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/actionscript/as3-flashvars-auslesen/60/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Aufruf ohne www auf Adresse mit www umleiten</title>
		<link>http://schnipsel.davidhellmann.com/sonstiges/aufruf-ohne-www-auf-adresse-mit-www-umleiten/59</link>
		<comments>http://schnipsel.davidhellmann.com/sonstiges/aufruf-ohne-www-auf-adresse-mit-www-umleiten/59#comments</comments>
		<pubDate>Tue, 09 Jun 2009 06:45:54 +0000</pubDate>
		<dc:creator>Thomas Aull</dc:creator>
				<category><![CDATA[Sonstiges]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[umleitung]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=59</guid>
		<description><![CDATA[Google stuft eine Website schlechter ein wenn sie mit www. und ohne aufgerufen werden kann (doppelter Content). Deshalb sollte man alle Aufrufe ohne www. auf die URL mit www umleiten (oder umgekehrt). Das geht ganz einfach mit einer .htaccess Datei. 1 2 3 RewriteEngine On RewriteCond %&#123;HTTP_HOST&#125; ^deinedomain\.com$ &#91;NC&#93; RewriteRule ^&#40;.*&#41;$ http://www.deinedomain.com/$1 [R=301,L]]]></description>
			<content:encoded><![CDATA[<p>Google stuft eine Website schlechter ein wenn sie mit www. und ohne aufgerufen werden kann (doppelter Content). Deshalb sollte man alle Aufrufe ohne www. auf die URL mit www umleiten (oder umgekehrt). Das geht ganz einfach mit einer .htaccess Datei.</p>
<span id="more-59"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">RewriteEngine On
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>HTTP_HOST<span style="color: #009900;">&#125;</span> ^deinedomain\<span style="color: #339933;">.</span>com$ <span style="color: #009900;">&#91;</span>NC<span style="color: #009900;">&#93;</span>
RewriteRule ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$ http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.deinedomain.com/$1 [R=301,L]</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/sonstiges/aufruf-ohne-www-auf-adresse-mit-www-umleiten/59/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

