<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[PunBB Forums - own clickable links]]></title>
	<link rel="self" href="http://punbb.informer.com/forums/feed/atom/topic/20431/"/>
	<updated>2008-12-06T14:12:04Z</updated>
	<generator>PunBB</generator>
	<id>http://punbb.informer.com/forums/topic/20431/own-clickable-links/</id>
		<entry>
			<title type="html"><![CDATA[Re: own clickable links]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/120497/#p120497"/>
			<content type="html"><![CDATA[<p>You need to do this:<br />1) Replace pattern as you wrote:<br /></p><div class="codebox"><pre><code>$text = preg_replace(&#039;#(?&lt;=[\s\]\)])(&lt;)?(\[)?(\()?([\&#039;&quot;]?)(https?|ftp|news|kommute){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^\s\[]*[^\s.,?!\[;:-])?)\4(?(3)(\)))(?(2)(\]))(?(1)(&gt;))(?![^\s]*\[/(?:url|img)\])#ie&#039;, &#039;stripslashes(\&#039;$1$2$3$4\&#039;).handle_url_tag(\&#039;$5://$6\&#039;, \&#039;$5://$6\&#039;, true).stripslashes(\&#039;$4$10$11$12\&#039;)&#039;, $text);</code></pre></div><p>2) In function &quot;handle_url_tag&quot; change condition from</p><div class="codebox"><pre><code>if (!preg_match(&#039;#^([a-z0-9]{3,6})://#&#039;, $url))</code></pre></div><p>to</p><div class="codebox"><pre><code>if (!preg_match(&#039;#^([a-z0-9]{3,7})://#&#039;, $url))</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Slavok]]></name>
				<uri>http://punbb.informer.com/forums/user/13265/</uri>
			</author>
			<updated>2008-12-06T14:12:04Z</updated>
			<id>http://punbb.informer.com/forums/post/120497/#p120497</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[own clickable links]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/120282/#p120282"/>
			<content type="html"><![CDATA[<p>hi</p><p>i have set forclickable kommte:// link in parser.php<br />but this not make a sence mean not work.</p><div class="codebox"><pre><code>    $text = preg_replace(&#039;#(?&lt;=[\s\]\)])(&lt;)?(\[)?(\()?([\&#039;&quot;]?)(https?|ftp|news|kommute){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^\s\[]*[^\s.,?!\[;:-])?)\4(?(3)(\)))(?(2)(\]))(?(1)(&gt;))(?![^\s]*\[/(?:url|img)\])#ie&#039;, &#039;stripslashes(\&#039;$1$2$3$4\&#039;).handle_url_tag(\&#039;$5://$6\&#039;, \&#039;$5://$6\&#039;, true).stripslashes(\&#039;$4$10$11$12\&#039;)&#039;, $text);</code></pre></div><p>but it will not clickable i must use to get clickable?</p><p>or i must rewrite handle_url_tag ?</p><div class="codebox"><pre><code>    $full_url = str_replace(array(&#039; &#039;, &#039;\&#039;&#039;, &#039;`&#039;, &#039;&quot;&#039;), array(&#039;%20&#039;, &#039;&#039;, &#039;&#039;, &#039;&#039;), $url);
    if (strpos($url, &#039;www.&#039;) === 0)            // If it starts with www, we add http://
        $full_url = &#039;http://&#039;.$full_url;
    else if (strpos($url, &#039;ftp.&#039;) === 0)    // Else if it starts with ftp, we add ftp://
        $full_url = &#039;ftp://&#039;.$full_url;
    else if (!preg_match(&#039;#^([a-z0-9]{3,6})://#&#039;, $url))     // Else if it doesn&#039;t start with abcdef://, we add http://
        $full_url = &#039;http://&#039;.$full_url;</code></pre></div><p>But this it will add 2 &quot;kommute://&quot;<br /></p><div class="codebox"><pre><code>    else if (strpos($url, &#039;kommute://&#039;) === 0)    
        $full_url =kommute://&#039;.$full_url;</code></pre></div><p>how must it look to get work?</p>]]></content>
			<author>
				<name><![CDATA[clunky]]></name>
				<uri>http://punbb.informer.com/forums/user/14238/</uri>
			</author>
			<updated>2008-12-01T15:24:11Z</updated>
			<id>http://punbb.informer.com/forums/post/120282/#p120282</id>
		</entry>
</feed>
