<?xml version="1.0" encoding="ISO-8859-1"?><!-- generator="wordpress/2.0.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Poste om hva? Spørreundersøkelse</title>
	<link>http://mikaelb.net/2007/poste-om-hva-sporreundersokelse/</link>
	<description>PHP, MySQL, CSS, XHTML, JavaScript</description>
	<pubDate>Wed, 19 Nov 2008 04:08:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.3</generator>

	<item>
		<title>by: Mikael Brevik</title>
		<link>http://mikaelb.net/2007/poste-om-hva-sporreundersokelse/#comment-2485</link>
		<pubDate>Sun, 08 Apr 2007 12:45:43 +0000</pubDate>
		<guid>http://mikaelb.net/2007/poste-om-hva-sporreundersokelse/#comment-2485</guid>
					<description>Om du tenker til wordpress, er det bare å søke etter &lt;a href=&quot;http://blog.igeek.info/wp-plugins/igsyntax-hiliter/&quot; rel=&quot;nofollow&quot;&gt;iG:Syntax Highligter&lt;/a&gt;. Det er ikke vits i å lage en wordpress plugin på ny som gjør dette, da det allerede finnes en. Om du vil ha utenom, er det bare å gjøre noe ála dette:

[php]
&lt; ?php
function highlight ($str)
{
	$str = highlight_string($str, true);

	$arr = explode(&quot;&lt;br /&gt;&quot;, $str);
	$out = '&lt;code&gt;&lt;ol class=&quot;php-highlight&quot; style=&quot;&quot;&gt;';
	$i = 1;
	foreach ($arr as $line =&gt; $syntax) {
		if($line == 0 &amp;#124;&amp;#124; $line == count($arr)-1) continue;
		$out .= &quot;\t&lt;li&gt;$syntax&lt;/li&gt;\n&quot;;
	}

	return $out .&quot;&lt;/ol&gt;&lt;/code&gt;\n&quot;;
}


function bbkode ($str)
{
	return preg_replace('/\[code\](.*)\[\/code\]/esi', &quot;highlight('\\1')&quot;, $str);
}
?&gt;
[/php]

Værre enn det er det egentlig ikke. Nå har jeg ikke testet det ovenfor, men det skal være OK.</description>
		<content:encoded><![CDATA[<p>Om du tenker til wordpress, er det bare å søke etter <a href="http://blog.igeek.info/wp-plugins/igsyntax-hiliter/" rel="nofollow">iG:Syntax Highligter</a>. Det er ikke vits i å lage en wordpress plugin på ny som gjør dette, da det allerede finnes en. Om du vil ha utenom, er det bare å gjøre noe ála dette:</p>
<p>
<div class="syntax_hilite">
<div id="php-1">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600;">&lt;?php</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/function"><span style="color:#0000FF;">function</span></a> highlight <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: red;">$str</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: red;">$str</span> = <a href="http://www.php.net/highlight_string"><span style="color:#0000FF;">highlight_string</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: red;">$str</span>, <span style="color:#006600;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&lt;/p&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;p&gt;&nbsp;<span style="color: red;">$arr</span> = <a href="http://www.php.net/explode"><span style="color:#0000FF;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"&lt;br /&gt;"</span>, <span style="color: red;">$str</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: red;">$out</span> = <span style="color:#CC0000;">'&lt;code&gt;&lt;/p&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&lt;ol class=&quot;php-highlight&quot; style=&quot;&quot;&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: red;">$i</span> = <span style="color:#FF0000;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#03B903;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: red;">$arr</span> <span style="color:#03B903;">as</span> <span style="color: red;">$line</span> =&gt; <span style="color: red;">$syntax</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#03B903;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: red;">$line</span> == <span style="color:#FF0000;color:#800000;">0</span> || <span style="color: red;">$line</span> == <a href="http://www.php.net/count"><span style="color:#0000FF;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: red;">$arr</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#FF0000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#03B903;">continue</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: red;">$out</span> .= <span style="color:#CC0000;">"<span style="color:#CC0000; font-weight:bold;">\t</span>&lt;/p&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&lt;li&gt;$syntax&lt;/li&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&lt;p&gt;<span style="color:#CC0000; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>&lt;/p&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;p&gt;&nbsp;<span style="color:#03B903;">return</span> <span style="color: red;">$out</span> .<span style="color:#CC0000;">"&lt;/ol&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&lt;p&gt;&lt;/code&gt;<span style="color:#CC0000; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>&lt;/p&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;p&gt;function bbkode <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: red;">$str</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#03B903;">return</span> <a href="http://www.php.net/preg_replace"><span style="color:#0000FF;">preg_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'/<span style="color:#CC0000; font-weight:bold;">\[</span>code<span style="color:#CC0000; font-weight:bold;">\]</span>(.*)<span style="color:#CC0000; font-weight:bold;">\[</span><span style="color:#CC0000; font-weight:bold;">\/</span>code<span style="color:#CC0000; font-weight:bold;">\]</span>/esi'</span>, <span style="color:#CC0000;">"highlight('<span style="color:#CC0000; font-weight:bold;">\\</span>1')"</span>, <span style="color: red;">$str</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Værre enn det er det egentlig ikke. Nå har jeg ikke testet det ovenfor, men det skal være OK.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Magnus Gule</title>
		<link>http://mikaelb.net/2007/poste-om-hva-sporreundersokelse/#comment-2467</link>
		<pubDate>Sat, 07 Apr 2007 20:24:53 +0000</pubDate>
		<guid>http://mikaelb.net/2007/poste-om-hva-sporreundersokelse/#comment-2467</guid>
					<description>Hvordan man ordner CSS/legger til plugins for å få strukturert og farget tekst for forskjellige språk som MySQL, PHP og HTML m.m. i rute har jeg ønsket meg lenge. Mulig dette er en enkelt plugin siden jeg ennå ikke har undersøkt det nøye nok. Ser du har en fin en på siden, og at det er vanlig å ha det på phpBB forum rundt om...</description>
		<content:encoded><![CDATA[<p>Hvordan man ordner <acronym title="Cascading Style Sheets">CSS</acronym>/legger til plugins for å få strukturert og farget tekst for forskjellige språk som MySQL, <acronym title="Pre-Hypertext Processing">PHP</acronym> og <acronym title="HyperText Markup Language">HTML</acronym> m.m. i rute har jeg ønsket meg lenge. Mulig dette er en enkelt plugin siden jeg ennå ikke har undersøkt det nøye nok. Ser du har en fin en på siden, og at det er vanlig å ha det på phpBB forum rundt om...
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
