<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — extern and include question]]></title>
		<link>https://punbb.informer.com/forums/topic/17514/extern-and-include-question/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/17514/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in extern and include question.]]></description>
		<lastBuildDate>Sat, 17 Nov 2007 14:55:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103835/#p103835</link>
			<description><![CDATA[<p>or u can go to <a href="http://punlancer.com">http://punlancer.com</a> and lookin the forum i explain how i did the portal.tpl and a index page with a side navbar and i give my index.php in there as well!</p><p>Q</p>]]></description>
			<author><![CDATA[null@example.com (quaker)]]></author>
			<pubDate>Sat, 17 Nov 2007 14:55:09 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103835/#p103835</guid>
		</item>
		<item>
			<title><![CDATA[Re: extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103826/#p103826</link>
			<description><![CDATA[<p>If you do a search for Quaker and Bingiman&#039;s frontpage index mod, that includes subject/message truncation and all the other gubbins.</p>]]></description>
			<author><![CDATA[null@example.com (MattF)]]></author>
			<pubDate>Sat, 17 Nov 2007 11:20:17 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103826/#p103826</guid>
		</item>
		<item>
			<title><![CDATA[Re: extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103825/#p103825</link>
			<description><![CDATA[<div class="quotebox"><cite>quaker wrote:</cite><blockquote><p>here you go..</p><p>place this in a php file in the include/user folder<br />mine called test5.php<br />now go to the main.tpl and add the pun_tag.<br /></p><div class="codebox"><pre><code>&lt;div class=&quot;block&quot;&gt;
        &lt;h2 class=&quot;block2&quot;&gt;Recent Post&lt;/h2&gt;
        &lt;div class=&quot;box&quot;&gt;
            &lt;div class=&quot;inbox&quot;&gt;
             &lt;pun_include &quot;test5.php&quot;&gt;       
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;</code></pre></div><div class="codebox"><pre><code>&lt;?php

showRecent(10); // Set amount of posts to be displayed here

function showRecent($show=5) {
    global $lang_common, $db, $pun_config, $db_prefix;

    $order_by = &#039;t.last_post&#039;;
    $forum_sql = &#039;&#039;;

//$show = isset($_GET[&#039;show&#039;]) ? intval($_GET[&#039;show&#039;]) : 5;
        //if ($show &lt; 1 || $show &gt; 50) $show = 5;

$trunc_len = 30; // Set amount of text to be displayed in subject.

// Fetch $show topics
    $result = $db-&gt;query(&#039;SELECT t.id, t.poster, t.subject, t.posted, t.last_post FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL&#039;.$forum_sql.&#039; ORDER BY &#039;.$order_by.&#039; DESC LIMIT &#039;.$show) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());


    
    
            while ($cur_topic = $db-&gt;fetch_assoc($result)) {
        if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)
     $cur_topic[&#039;subject&#039;] = censor_words($cur_topic[&#039;subject&#039;]);
    $subject_truncated = pun_htmlspecialchars($cur_topic[&#039;subject&#039;]);
 



    echo &#039;&lt;li&gt;  »&lt;a href=&quot;&#039;.$pun_config[&#039;o_base_url&#039;].&#039;/viewtopic.php?id=&#039;.$cur_topic[&#039;id&#039;].&#039;&amp;action=new&quot; title=&quot;&#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&quot;&gt;&#039;.substr($cur_topic[&#039;subject&#039;], 0, $trunc_len).&#039;&lt;/a&gt;...&#039;.&quot;\n&quot;;
    }
    echo &#039;&lt;/li&gt;&#039;;
    return;
}
?&gt;</code></pre></div></blockquote></div><p>GREAT! Works fine!</p><br /><p>Just wonder.. How do I add the time when its posted &lt;?php echo format_time($cur_post[&#039;posted&#039;]) ?&gt;?? </p><br /><p>Is it possible to add something like this:?</p><p>if post &lt; 20 chars add ... after the line.</p>]]></description>
			<author><![CDATA[null@example.com (staffanl)]]></author>
			<pubDate>Sat, 17 Nov 2007 11:08:11 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103825/#p103825</guid>
		</item>
		<item>
			<title><![CDATA[Re: extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103754/#p103754</link>
			<description><![CDATA[<p>here you go..</p><p>place this in a php file in the include/user folder<br />mine called test5.php<br />now go to the main.tpl and add the pun_tag.<br /></p><div class="codebox"><pre><code>&lt;div class=&quot;block&quot;&gt;
        &lt;h2 class=&quot;block2&quot;&gt;Recent Post&lt;/h2&gt;
        &lt;div class=&quot;box&quot;&gt;
            &lt;div class=&quot;inbox&quot;&gt;
             &lt;pun_include &quot;test5.php&quot;&gt;       
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;</code></pre></div><div class="codebox"><pre><code>&lt;?php

showRecent(10); // Set amount of posts to be displayed here

function showRecent($show=5) {
    global $lang_common, $db, $pun_config, $db_prefix;

    $order_by = &#039;t.last_post&#039;;
    $forum_sql = &#039;&#039;;

//$show = isset($_GET[&#039;show&#039;]) ? intval($_GET[&#039;show&#039;]) : 5;
        //if ($show &lt; 1 || $show &gt; 50) $show = 5;

$trunc_len = 30; // Set amount of text to be displayed in subject.

// Fetch $show topics
    $result = $db-&gt;query(&#039;SELECT t.id, t.poster, t.subject, t.posted, t.last_post FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL&#039;.$forum_sql.&#039; ORDER BY &#039;.$order_by.&#039; DESC LIMIT &#039;.$show) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());


    
    
            while ($cur_topic = $db-&gt;fetch_assoc($result)) {
        if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)
     $cur_topic[&#039;subject&#039;] = censor_words($cur_topic[&#039;subject&#039;]);
    $subject_truncated = pun_htmlspecialchars($cur_topic[&#039;subject&#039;]);
 



    echo &#039;&lt;li&gt;  »&lt;a href=&quot;&#039;.$pun_config[&#039;o_base_url&#039;].&#039;/viewtopic.php?id=&#039;.$cur_topic[&#039;id&#039;].&#039;&amp;action=new&quot; title=&quot;&#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&quot;&gt;&#039;.substr($cur_topic[&#039;subject&#039;], 0, $trunc_len).&#039;&lt;/a&gt;...&#039;.&quot;\n&quot;;
    }
    echo &#039;&lt;/li&gt;&#039;;
    return;
}
?&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (quaker)]]></author>
			<pubDate>Fri, 16 Nov 2007 13:31:06 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103754/#p103754</guid>
		</item>
		<item>
			<title><![CDATA[Re: extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103753/#p103753</link>
			<description><![CDATA[<p>do u want that code for recent topics? but it does not use extern.php!</p><br /><br /><p>Q</p>]]></description>
			<author><![CDATA[null@example.com (quaker)]]></author>
			<pubDate>Fri, 16 Nov 2007 13:28:01 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103753/#p103753</guid>
		</item>
		<item>
			<title><![CDATA[Re: extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103745/#p103745</link>
			<description><![CDATA[<p>no one knows?</p>]]></description>
			<author><![CDATA[null@example.com (staffanl)]]></author>
			<pubDate>Fri, 16 Nov 2007 08:28:22 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103745/#p103745</guid>
		</item>
		<item>
			<title><![CDATA[Re: extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103638/#p103638</link>
			<description><![CDATA[<div class="quotebox"><cite>quaker wrote:</cite><blockquote><p>do u want something like this.</p><p><a href="http://punlancer.com/index.php">http://punlancer.com/index.php</a></p><p>Q</p></blockquote></div><p>check the left sidebar!</p><p><a href="http://bunpai.com/index.php">http://bunpai.com/index.php</a></p>]]></description>
			<author><![CDATA[null@example.com (staffanl)]]></author>
			<pubDate>Wed, 14 Nov 2007 07:40:35 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103638/#p103638</guid>
		</item>
		<item>
			<title><![CDATA[Re: extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103613/#p103613</link>
			<description><![CDATA[<p>I want it to be displayed in the sidebar of my miniportal. </p><br /><div class="quotebox"><cite>quaker wrote:</cite><blockquote><p>do u want something like this.</p><p><a href="http://punlancer.com/index.php">http://punlancer.com/index.php</a></p><p>Q</p></blockquote></div><p>I want to put the recent topics, posts etc in a box under your &quot;links&quot; for example. I only want the recent topics to be displayed under each other like your links. I think u have used the mod_active_topics_1.2 and that script works fine for me. But thats not what I need here, only the headlines of each topic.</p><div class="quotebox"><cite>pedrotuga wrote:</cite><blockquote><p>Yes, you can query them directly them from the database using sql, and display them yourself.</p><p>But maybe if you post more information about your problem somebody can tell you how to fix it. What exactly happens?</p></blockquote></div><p>I have done this:<br /></p><div class="codebox"><pre><code>//in main.tpl
&lt;pun_include &quot;active_topics.php&quot;&gt;</code></pre></div><div class="codebox"><pre><code>// in include/user/active_topics.php
&lt;?php
include(&#039;http://127.0.0.1/extern.php?action=new&amp;show=10&amp;fid=1&#039;);
?&gt;</code></pre></div><p>What happens is that I get an error:</p><div class="codebox"><pre><code>Warning: include() [function.include]: URL file-access is disabled in the server configuration in ...

Warning: include(http://127.0.0.1/extern.php?action=new&amp;show=10&amp;fid=1) [function.include]: failed to open stream: no suitable wrapper could be found in

Failed opening &#039;http://127.0.0.1/extern.php?action=new&amp;show=10&amp;fid=1&#039; for inclusion (include_path=....</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (staffanl)]]></author>
			<pubDate>Tue, 13 Nov 2007 18:51:05 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103613/#p103613</guid>
		</item>
		<item>
			<title><![CDATA[Re: extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103605/#p103605</link>
			<description><![CDATA[<div class="quotebox"><cite>staffanl wrote:</cite><blockquote><p>Hi!</p><p>I dont get the extern and include to work. Just getting alot of errors. A while a go I had php4 on the server and now I got php5 and it doenst seem to work anymore. </p><p>Is there an other way to get the last topics, posts etc without using the extern.php?</p></blockquote></div><p>Yes, you can query them directly them from the database using sql, and display them yourself.</p><p>But maybe if you post more information about your problem somebody can tell you how to fix it. What exactly happens?</p>]]></description>
			<author><![CDATA[null@example.com (pedrotuga)]]></author>
			<pubDate>Tue, 13 Nov 2007 16:39:40 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103605/#p103605</guid>
		</item>
		<item>
			<title><![CDATA[Re: extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103600/#p103600</link>
			<description><![CDATA[<p>do u want something like this.</p><p><a href="http://punlancer.com/index.php">http://punlancer.com/index.php</a></p><p>Q</p>]]></description>
			<author><![CDATA[null@example.com (quaker)]]></author>
			<pubDate>Tue, 13 Nov 2007 14:59:46 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103600/#p103600</guid>
		</item>
		<item>
			<title><![CDATA[extern and include question]]></title>
			<link>https://punbb.informer.com/forums/post/103598/#p103598</link>
			<description><![CDATA[<p>Hi!</p><p>I dont get the extern and include to work. Just getting alot of errors. A while a go I had php4 on the server and now I got php5 and it doenst seem to work anymore. </p><p>Is there an other way to get the last topics, posts etc without using the extern.php?</p>]]></description>
			<author><![CDATA[null@example.com (staffanl)]]></author>
			<pubDate>Tue, 13 Nov 2007 14:15:36 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103598/#p103598</guid>
		</item>
	</channel>
</rss>
