<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — Display first post]]></title>
		<link>https://punbb.informer.com/forums/topic/12423/display-first-post/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/12423/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Display first post.]]></description>
		<lastBuildDate>Tue, 18 Jul 2006 20:47:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Display first post]]></title>
			<link>https://punbb.informer.com/forums/post/73168/#p73168</link>
			<description><![CDATA[<p>Good damn you are the king elbekko :-) If i have not been so tired i would tryed that one already. Makes that error all the time</p><p>thanx and thanx again</p>]]></description>
			<author><![CDATA[null@example.com (lhffan)]]></author>
			<pubDate>Tue, 18 Jul 2006 20:47:52 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/73168/#p73168</guid>
		</item>
		<item>
			<title><![CDATA[Re: Display first post]]></title>
			<link>https://punbb.informer.com/forums/post/73165/#p73165</link>
			<description><![CDATA[<div class="codebox"><pre><code>$cur_post = $db-&gt;fetch_assoc($result)</code></pre></div><p>should be<br /></p><div class="codebox"><pre><code>$cur_post = $db-&gt;fetch_assoc($result);</code></pre></div><p>Silly me.</p>]]></description>
			<author><![CDATA[null@example.com (elbekko)]]></author>
			<pubDate>Tue, 18 Jul 2006 20:40:41 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/73165/#p73165</guid>
		</item>
		<item>
			<title><![CDATA[Re: Display first post]]></title>
			<link>https://punbb.informer.com/forums/post/73164/#p73164</link>
			<description><![CDATA[<p>ahh still troubles, think it must be something else wrong</p><p>Parse error: parse error, unexpected T_VARIABLE in /customers/httpd.www/test.php on line 189</p><br /><p>Made these changes</p><div class="codebox"><pre><code>// Retrieve the posts (and their respective poster/online status)
$result = $db-&gt;query(&#039;SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM &#039;.$db-&gt;prefix.&#039;posts AS p INNER JOIN &#039;.$db-&gt;prefix.&#039;users AS u ON u.id=p.poster_id INNER JOIN &#039;.$db-&gt;prefix.&#039;groups AS g ON g.g_id=u.group_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=&#039;.$id.&#039; ORDER BY p.id LIMIT &#039;.$start_from.&#039;,&#039;.$pun_user[&#039;disp_posts&#039;], true) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());
$cur_post = $db-&gt;fetch_assoc($result)
    $post_count++;
    $user_avatar = &#039;&#039;;
    $user_info = array();
    $user_contacts = array();
    $post_actions = array();
    $is_online = &#039;&#039;;
    $signature = &#039;&#039;;</code></pre></div><p>and near the end i remove the other one completely</p>]]></description>
			<author><![CDATA[null@example.com (lhffan)]]></author>
			<pubDate>Tue, 18 Jul 2006 20:36:13 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/73164/#p73164</guid>
		</item>
		<item>
			<title><![CDATA[Re: Display first post]]></title>
			<link>https://punbb.informer.com/forums/post/73160/#p73160</link>
			<description><![CDATA[<p>hehe will trye again</p>]]></description>
			<author><![CDATA[null@example.com (lhffan)]]></author>
			<pubDate>Tue, 18 Jul 2006 19:49:54 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/73160/#p73160</guid>
		</item>
		<item>
			<title><![CDATA[Re: Display first post]]></title>
			<link>https://punbb.informer.com/forums/post/73159/#p73159</link>
			<description><![CDATA[<p>The first change is somewhere in the middle, the last one near the end of the file <img src="https://punbb.informer.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (elbekko)]]></author>
			<pubDate>Tue, 18 Jul 2006 19:40:20 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/73159/#p73159</guid>
		</item>
		<item>
			<title><![CDATA[Re: Display first post]]></title>
			<link>https://punbb.informer.com/forums/post/73158/#p73158</link>
			<description><![CDATA[<p>Wont get it to work. I think i changes the code wrongly</p>]]></description>
			<author><![CDATA[null@example.com (lhffan)]]></author>
			<pubDate>Tue, 18 Jul 2006 19:30:42 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/73158/#p73158</guid>
		</item>
		<item>
			<title><![CDATA[Re: Display first post]]></title>
			<link>https://punbb.informer.com/forums/post/73157/#p73157</link>
			<description><![CDATA[<p>Change<br /></p><div class="codebox"><pre><code>while ($cur_post = $db-&gt;fetch_assoc($result))
{</code></pre></div><p>to<br /></p><div class="codebox"><pre><code>$cur_post = $db-&gt;fetch_assoc($result)</code></pre></div><p>and remove<br /></p><div class="codebox"><pre><code>&lt;?php

}

?&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (elbekko)]]></author>
			<pubDate>Tue, 18 Jul 2006 19:16:50 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/73157/#p73157</guid>
		</item>
		<item>
			<title><![CDATA[Display first post]]></title>
			<link>https://punbb.informer.com/forums/post/73156/#p73156</link>
			<description><![CDATA[<p>Partialy edited viewtopic.php, now i want to change so only the first post is shown. And i do not want to disable write acess to my users in the admin section. How can i change the code below to only post the first topic.</p><div class="codebox"><pre><code>&lt;?php
/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/


define(&#039;PUN_ROOT&#039;, &#039;./&#039;);
define(&#039;SHOW_NEWS&#039;, 1);
require PUN_ROOT.&#039;include/common.php&#039;;


if ($pun_user[&#039;g_read_board&#039;] == &#039;0&#039;)
    message($lang_common[&#039;No view&#039;]);


$action = isset($_GET[&#039;action&#039;]) ? $_GET[&#039;action&#039;] : null;
$id = isset($_GET[&#039;id&#039;]) ? intval($_GET[&#039;id&#039;]) : 0;
$pid = isset($_GET[&#039;pid&#039;]) ? intval($_GET[&#039;pid&#039;]) : 0;
if ($id &lt; 1 &amp;&amp; $pid &lt; 1)
    message($lang_common[&#039;Bad request&#039;]);

// Load the viewtopic.php language file
require PUN_ROOT.&#039;lang/&#039;.$pun_user[&#039;language&#039;].&#039;/topic.php&#039;;


// If a post ID is specified we determine topic ID and page number so we can redirect to the correct message
if ($pid)
{
    $result = $db-&gt;query(&#039;SELECT topic_id FROM &#039;.$db-&gt;prefix.&#039;posts WHERE id=&#039;.$pid) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());
    if (!$db-&gt;num_rows($result))
        message($lang_common[&#039;Bad request&#039;]);

    $id = $db-&gt;result($result);

    // Determine on what page the post is located (depending on $pun_user[&#039;disp_posts&#039;])
    $result = $db-&gt;query(&#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$id.&#039; ORDER BY posted&#039;) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());
    $num_posts = $db-&gt;num_rows($result);

    for ($i = 0; $i &lt; $num_posts; ++$i)
    {
        $cur_id = $db-&gt;result($result, $i);
        if ($cur_id == $pid)
            break;
    }
    ++$i;    // we started at 0

    $_GET[&#039;p&#039;] = ceil($i / $pun_user[&#039;disp_posts&#039;]);
}

// If action=new, we redirect to the first new post (if any)
else if ($action == &#039;new&#039; &amp;&amp; !$pun_user[&#039;is_guest&#039;])
{
    $result = $db-&gt;query(&#039;SELECT MIN(id) FROM &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$id.&#039; AND posted&gt;&#039;.$pun_user[&#039;last_visit&#039;]) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());
    $first_new_post_id = $db-&gt;result($result);

    if ($first_new_post_id)
        header(&#039;Location: viewtopic.php?pid=&#039;.$first_new_post_id.&#039;#p&#039;.$first_new_post_id);
    else    // If there is no new post, we go to the last post
        header(&#039;Location: viewtopic.php?id=&#039;.$id.&#039;&amp;action=last&#039;);

    exit;
}

// If action=last, we redirect to the last post
else if ($action == &#039;last&#039;)
{
    $result = $db-&gt;query(&#039;SELECT MAX(id) FROM &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$id) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());
    $last_post_id = $db-&gt;result($result);

    if ($last_post_id)
    {
        header(&#039;Location: viewtopic.php?pid=&#039;.$last_post_id.&#039;#p&#039;.$last_post_id);
        exit;
    }
}


// Fetch some info about the topic
if (!$pun_user[&#039;is_guest&#039;])
    $result = $db-&gt;query(&#039;SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed 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;subscriptions AS s ON (t.id=s.topic_id AND s.user_id=&#039;.$pun_user[&#039;id&#039;].&#039;) LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=&#039;.$id.&#039; AND t.moved_to IS NULL&#039;) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());
else
    $result = $db-&gt;query(&#039;SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 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=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=&#039;.$id.&#039; AND t.moved_to IS NULL&#039;) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());

if (!$db-&gt;num_rows($result))
    message($lang_common[&#039;Bad request&#039;]);

$cur_topic = $db-&gt;fetch_assoc($result);

// Sort out who the moderators are and if we are currently a moderator (or an admin)
$mods_array = ($cur_topic[&#039;moderators&#039;] != &#039;&#039;) ? unserialize($cur_topic[&#039;moderators&#039;]) : array();
$is_admmod = ($pun_user[&#039;g_id&#039;] == PUN_ADMIN || ($pun_user[&#039;g_id&#039;] == PUN_MOD &amp;&amp; array_key_exists($pun_user[&#039;username&#039;], $mods_array))) ? true : false;

// Can we or can we not post replies?
if ($cur_topic[&#039;closed&#039;] == &#039;0&#039;)
{
    if (($cur_topic[&#039;post_replies&#039;] == &#039;&#039; &amp;&amp; $pun_user[&#039;g_post_replies&#039;] == &#039;1&#039;) || $cur_topic[&#039;post_replies&#039;] == &#039;1&#039; || $is_admmod)
        $post_link = &#039;&lt;a href=&quot;post.php?tid=&#039;.$id.&#039;&quot;&gt;&#039;.$lang_topic[&#039;Post reply&#039;].&#039;&lt;/a&gt;&#039;;
    else
        $post_link = &#039; &#039;;
}
else
{
    $post_link = $lang_topic[&#039;Topic closed&#039;];

    if ($is_admmod)
        $post_link .= &#039; / &lt;a href=&quot;post.php?tid=&#039;.$id.&#039;&quot;&gt;&#039;.$lang_topic[&#039;Post reply&#039;].&#039;&lt;/a&gt;&#039;;
}


// Determine the post offset (based on $_GET[&#039;p&#039;])
$num_pages = ceil(($cur_topic[&#039;num_replies&#039;] + 1) / $pun_user[&#039;disp_posts&#039;]);

$p = (!isset($_GET[&#039;p&#039;]) || $_GET[&#039;p&#039;] &lt;= 1 || $_GET[&#039;p&#039;] &gt; $num_pages) ? 1 : $_GET[&#039;p&#039;];
$start_from = $pun_user[&#039;disp_posts&#039;] * ($p - 1);

// Generate paging links
$paging_links = $lang_common[&#039;Pages&#039;].&#039;: &#039;.paginate($num_pages, $p, &#039;viewtopic.php?id=&#039;.$id);


if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)
    $cur_topic[&#039;subject&#039;] = censor_words($cur_topic[&#039;subject&#039;]);


$quickpost = false;
if ($pun_config[&#039;o_quickpost&#039;] == &#039;1&#039; &amp;&amp;
    !$pun_user[&#039;is_guest&#039;] &amp;&amp;
    ($cur_topic[&#039;post_replies&#039;] == &#039;1&#039; || ($cur_topic[&#039;post_replies&#039;] == &#039;&#039; &amp;&amp; $pun_user[&#039;g_post_replies&#039;] == &#039;1&#039;)) &amp;&amp;
    ($cur_topic[&#039;closed&#039;] == &#039;0&#039; || $is_admmod))
{
    $required_fields = array(&#039;req_message&#039; =&gt; $lang_common[&#039;Message&#039;]);
    $quickpost = true;
}

if (!$pun_user[&#039;is_guest&#039;] &amp;&amp; $pun_config[&#039;o_subscriptions&#039;] == &#039;1&#039;)
{
    if ($cur_topic[&#039;is_subscribed&#039;])
        // I apologize for the variable naming here. It&#039;s a mix of subscription and action I guess :-)
        $subscraction = &#039;&lt;p class=&quot;subscribelink clearb&quot;&gt;&#039;.$lang_topic[&#039;Is subscribed&#039;].&#039; - &lt;a href=&quot;misc.php?unsubscribe=&#039;.$id.&#039;&quot;&gt;&#039;.$lang_topic[&#039;Unsubscribe&#039;].&#039;&lt;/a&gt;&lt;/p&gt;&#039;.&quot;\n&quot;;
    else
        $subscraction = &#039;&lt;p class=&quot;subscribelink clearb&quot;&gt;&lt;a href=&quot;misc.php?subscribe=&#039;.$id.&#039;&quot;&gt;&#039;.$lang_topic[&#039;Subscribe&#039;].&#039;&lt;/a&gt;&lt;/p&gt;&#039;.&quot;\n&quot;;
}
else
    $subscraction = &#039;&lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;&#039;.&quot;\n&quot;;

$page_title = pun_htmlspecialchars($pun_config[&#039;o_board_title&#039;].&#039; / &#039;.$cur_topic[&#039;subject&#039;]);
define(&#039;PUN_ALLOW_INDEX&#039;, 1);
require PUN_ROOT.&#039;header.php&#039;;

?&gt;
&lt;div class=&quot;linkst&quot;&gt;
    &lt;div class=&quot;inbox&quot;&gt;
        &lt;p class=&quot;pagelink conl&quot;&gt;&lt;?php //echo $paging_links ?&gt;&lt;/p&gt;
        &lt;p class=&quot;postlink conr&quot;&gt;&lt;?php //echo $post_link ?&gt;&lt;/p&gt;
        &lt;ul&gt;&lt;li&gt;&lt;a href=&quot;forum.php&quot;&gt;&lt;?php //echo $lang_common[&#039;Index&#039;] ?&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; &lt;!--» --&gt; &lt;a href=&quot;viewforum.php?id=&lt;?php //echo $cur_topic[&#039;forum_id&#039;] ?&gt;&quot;&gt;&lt;?php //echo pun_htmlspecialchars($cur_topic[&#039;forum_name&#039;]) ?&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; &lt;!--» --&gt; &lt;?php echo pun_htmlspecialchars($cur_topic[&#039;subject&#039;]) ?&gt;&lt;/li&gt;&lt;/ul&gt;
        &lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;?php


require PUN_ROOT.&#039;include/parser.php&#039;;

$bg_switch = true;    // Used for switching background color in posts
$post_count = 0;    // Keep track of post numbers

// Retrieve the posts (and their respective poster/online status)
$result = $db-&gt;query(&#039;SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM &#039;.$db-&gt;prefix.&#039;posts AS p INNER JOIN &#039;.$db-&gt;prefix.&#039;users AS u ON u.id=p.poster_id INNER JOIN &#039;.$db-&gt;prefix.&#039;groups AS g ON g.g_id=u.group_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=&#039;.$id.&#039; ORDER BY p.id LIMIT &#039;.$start_from.&#039;,&#039;.$pun_user[&#039;disp_posts&#039;], true) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());
while ($cur_post = $db-&gt;fetch_assoc($result))
{
    $post_count++;
    $user_avatar = &#039;&#039;;
    $user_info = array();
    $user_contacts = array();
    $post_actions = array();
    $is_online = &#039;&#039;;
    $signature = &#039;&#039;;

    // If the poster is a registered user.
    if ($cur_post[&#039;poster_id&#039;] &gt; 1)
    {
        $username = &#039;&lt;a href=&quot;profile.php?id=&#039;.$cur_post[&#039;poster_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_post[&#039;username&#039;]).&#039;&lt;/a&gt;&#039;;
        $user_title = get_title($cur_post);

        if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)
            $user_title = censor_words($user_title);

        // Format the online indicator
        $is_online = ($cur_post[&#039;is_online&#039;] == $cur_post[&#039;poster_id&#039;]) ? &#039;&lt;strong&gt;&#039;.$lang_topic[&#039;Online&#039;].&#039;&lt;/strong&gt;&#039; : $lang_topic[&#039;Offline&#039;];

        if ($pun_config[&#039;o_avatars&#039;] == &#039;1&#039; &amp;&amp; $cur_post[&#039;use_avatar&#039;] == &#039;1&#039; &amp;&amp; $pun_user[&#039;show_avatars&#039;] != &#039;0&#039;)
        {
            if ($img_size = @getimagesize($pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.gif&#039;))
                $user_avatar = &#039;&lt;img src=&quot;&#039;.$pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.gif&quot; &#039;.$img_size[3].&#039; alt=&quot;&quot; /&gt;&#039;;
            else if ($img_size = @getimagesize($pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.jpg&#039;))
                $user_avatar = &#039;&lt;img src=&quot;&#039;.$pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.jpg&quot; &#039;.$img_size[3].&#039; alt=&quot;&quot; /&gt;&#039;;
            else if ($img_size = @getimagesize($pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.png&#039;))
                $user_avatar = &#039;&lt;img src=&quot;&#039;.$pun_config[&#039;o_avatars_dir&#039;].&#039;/&#039;.$cur_post[&#039;poster_id&#039;].&#039;.png&quot; &#039;.$img_size[3].&#039; alt=&quot;&quot; /&gt;&#039;;
        }
        else
            $user_avatar = &#039;&#039;;

        // We only show location, register date, post count and the contact links if &quot;Show user info&quot; is enabled
        if ($pun_config[&#039;o_show_user_info&#039;] == &#039;1&#039;)
        {
            if ($cur_post[&#039;location&#039;] != &#039;&#039;)
            {
                if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)
                    $cur_post[&#039;location&#039;] = censor_words($cur_post[&#039;location&#039;]);

                $user_info[] = &#039;&lt;dd&gt;&#039;.$lang_topic[&#039;From&#039;].&#039;: &#039;.pun_htmlspecialchars($cur_post[&#039;location&#039;]);
            }

            $user_info[] = &#039;&lt;dd&gt;&#039;.$lang_common[&#039;Registered&#039;].&#039;: &#039;.date($pun_config[&#039;o_date_format&#039;], $cur_post[&#039;registered&#039;]);

            if ($pun_config[&#039;o_show_post_count&#039;] == &#039;1&#039; || $pun_user[&#039;g_id&#039;] &lt; PUN_GUEST)
                $user_info[] = &#039;&lt;dd&gt;&#039;.$lang_common[&#039;Posts&#039;].&#039;: &#039;.$cur_post[&#039;num_posts&#039;];

            // Now let&#039;s deal with the contact links (E-mail and URL)
            if (($cur_post[&#039;email_setting&#039;] == &#039;0&#039; &amp;&amp; !$pun_user[&#039;is_guest&#039;]) || $pun_user[&#039;g_id&#039;] &lt; PUN_GUEST)
                $user_contacts[] = &#039;&lt;a href=&quot;mailto:&#039;.$cur_post[&#039;email&#039;].&#039;&quot;&gt;&#039;.$lang_common[&#039;E-mail&#039;].&#039;&lt;/a&gt;&#039;;
            else if ($cur_post[&#039;email_setting&#039;] == &#039;1&#039; &amp;&amp; !$pun_user[&#039;is_guest&#039;])
                $user_contacts[] = &#039;&lt;a href=&quot;misc.php?email=&#039;.$cur_post[&#039;poster_id&#039;].&#039;&quot;&gt;&#039;.$lang_common[&#039;E-mail&#039;].&#039;&lt;/a&gt;&#039;;

            if ($cur_post[&#039;url&#039;] != &#039;&#039;)
                $user_contacts[] = &#039;&lt;a href=&quot;&#039;.pun_htmlspecialchars($cur_post[&#039;url&#039;]).&#039;&quot;&gt;&#039;.$lang_topic[&#039;Website&#039;].&#039;&lt;/a&gt;&#039;;
        }

        if ($pun_user[&#039;g_id&#039;] &lt; PUN_GUEST)
        {
            $user_info[] = &#039;&lt;dd&gt;IP: &lt;a href=&quot;moderate.php?get_host=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$cur_post[&#039;poster_ip&#039;].&#039;&lt;/a&gt;&#039;;

            if ($cur_post[&#039;admin_note&#039;] != &#039;&#039;)
                $user_info[] = &#039;&lt;dd&gt;&#039;.$lang_topic[&#039;Note&#039;].&#039;: &lt;strong&gt;&#039;.pun_htmlspecialchars($cur_post[&#039;admin_note&#039;]).&#039;&lt;/strong&gt;&#039;;
        }
    }
    // If the poster is a guest (or a user that has been deleted)
    else
    {
        $username = pun_htmlspecialchars($cur_post[&#039;username&#039;]);
        $user_title = get_title($cur_post);

        if ($pun_user[&#039;g_id&#039;] &lt; PUN_GUEST)
            $user_info[] = &#039;&lt;dd&gt;IP: &lt;a href=&quot;moderate.php?get_host=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$cur_post[&#039;poster_ip&#039;].&#039;&lt;/a&gt;&#039;;

        if ($pun_config[&#039;o_show_user_info&#039;] == &#039;1&#039; &amp;&amp; $cur_post[&#039;poster_email&#039;] != &#039;&#039; &amp;&amp; !$pun_user[&#039;is_guest&#039;])
            $user_contacts[] = &#039;&lt;a href=&quot;mailto:&#039;.$cur_post[&#039;poster_email&#039;].&#039;&quot;&gt;&#039;.$lang_common[&#039;E-mail&#039;].&#039;&lt;/a&gt;&#039;;
    }

    // Generation post action array (quote, edit, delete etc.)
    if (!$is_admmod)
    {
        if (!$pun_user[&#039;is_guest&#039;])
            $post_actions[] = &#039;&lt;li class=&quot;postreport&quot;&gt;&lt;a href=&quot;misc.php?report=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Report&#039;].&#039;&lt;/a&gt;&#039;;

        if ($cur_topic[&#039;closed&#039;] == &#039;0&#039;)
        {
            if ($cur_post[&#039;poster_id&#039;] == $pun_user[&#039;id&#039;])
            {
                if ((($start_from + $post_count) == 1 &amp;&amp; $pun_user[&#039;g_delete_topics&#039;] == &#039;1&#039;) || (($start_from + $post_count) &gt; 1 &amp;&amp; $pun_user[&#039;g_delete_posts&#039;] == &#039;1&#039;))
                    $post_actions[] = &#039;&lt;li class=&quot;postdelete&quot;&gt;&lt;a href=&quot;delete.php?id=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Delete&#039;].&#039;&lt;/a&gt;&#039;;
                if ($pun_user[&#039;g_edit_posts&#039;] == &#039;1&#039;)
                    $post_actions[] = &#039;&lt;li class=&quot;postedit&quot;&gt;&lt;a href=&quot;edit.php?id=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Edit&#039;].&#039;&lt;/a&gt;&#039;;
            }

            if (($cur_topic[&#039;post_replies&#039;] == &#039;&#039; &amp;&amp; $pun_user[&#039;g_post_replies&#039;] == &#039;1&#039;) || $cur_topic[&#039;post_replies&#039;] == &#039;1&#039;)
                $post_actions[] = &#039;&lt;li class=&quot;postquote&quot;&gt;&lt;a href=&quot;post.php?tid=&#039;.$id.&#039;&amp;qid=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Quote&#039;].&#039;&lt;/a&gt;&#039;;
        }
    }
    else
        $post_actions[] = &#039;&lt;li class=&quot;postreport&quot;&gt;&lt;a href=&quot;misc.php?report=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Report&#039;].&#039;&lt;/a&gt;&#039;.$lang_topic[&#039;Link separator&#039;].&#039;&lt;/li&gt;&lt;li class=&quot;postdelete&quot;&gt;&lt;a href=&quot;delete.php?id=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Delete&#039;].&#039;&lt;/a&gt;&#039;.$lang_topic[&#039;Link separator&#039;].&#039;&lt;/li&gt;&lt;li class=&quot;postedit&quot;&gt;&lt;a href=&quot;edit.php?id=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Edit&#039;].&#039;&lt;/a&gt;&#039;.$lang_topic[&#039;Link separator&#039;].&#039;&lt;/li&gt;&lt;li class=&quot;postquote&quot;&gt;&lt;a href=&quot;post.php?tid=&#039;.$id.&#039;&amp;qid=&#039;.$cur_post[&#039;id&#039;].&#039;&quot;&gt;&#039;.$lang_topic[&#039;Quote&#039;].&#039;&lt;/a&gt;&#039;;


    // Switch the background color for every message.
    $bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
    $vtbg = ($bg_switch) ? &#039; roweven&#039; : &#039; rowodd&#039;;


    // Perform the main parsing of the message (BBCode, smilies, censor words etc)
    $cur_post[&#039;message&#039;] = parse_message($cur_post[&#039;message&#039;], $cur_post[&#039;hide_smilies&#039;]);

    // Do signature parsing/caching
    if ($cur_post[&#039;signature&#039;] != &#039;&#039; &amp;&amp; $pun_user[&#039;show_sig&#039;] != &#039;0&#039;)
    {
        if (isset($signature_cache[$cur_post[&#039;poster_id&#039;]]))
            $signature = $signature_cache[$cur_post[&#039;poster_id&#039;]];
        else
        {
            $signature = parse_signature($cur_post[&#039;signature&#039;]);
            $signature_cache[$cur_post[&#039;poster_id&#039;]] = $signature;
        }
    }

?&gt;
&lt;div id=&quot;p&lt;?php echo $cur_post[&#039;id&#039;] ?&gt;&quot; class=&quot;blockpost&lt;?php echo $vtbg ?&gt;&lt;?php if (($post_count + $start_from) == 1) echo &#039; firstpost&#039;; ?&gt;&quot;&gt;
    &lt;h2&gt;&lt;span&gt;&lt;span class=&quot;conr&quot;&gt;#&lt;?php echo ($start_from + $post_count) ?&gt; &lt;/span&gt;&lt;a href=&quot;viewtopic.php?pid=&lt;?php echo $cur_post[&#039;id&#039;].&#039;#p&#039;.$cur_post[&#039;id&#039;] ?&gt;&quot;&gt;&lt;?php //echo format_time($cur_post[&#039;posted&#039;]) ?&gt;DISKUTERA&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;
    &lt;div class=&quot;box&quot;&gt;
        &lt;div class=&quot;inbox&quot;&gt;
        &lt;!--    &lt;div class=&quot;postleft&quot;&gt;
                &lt;dl&gt;
                    &lt;dt&gt;&lt;strong&gt;&lt;?php echo $username ?&gt;&lt;/strong&gt;&lt;/dt&gt;
                    &lt;dd class=&quot;usertitle&quot;&gt;&lt;strong&gt;&lt;?php echo $user_title ?&gt;&lt;/strong&gt;&lt;/dd&gt;
                    &lt;dd class=&quot;postavatar&quot;&gt;&lt;?php echo $user_avatar ?&gt;&lt;/dd&gt;
&lt;?php if (count($user_info)) echo &quot;\t\t\t\t\t&quot;.implode(&#039;&lt;/dd&gt;&#039;.&quot;\n\t\t\t\t\t&quot;, $user_info).&#039;&lt;/dd&gt;&#039;.&quot;\n&quot;; ?&gt;
&lt;?php if (count($user_contacts)) echo &quot;\t\t\t\t\t&quot;.&#039;&lt;dd class=&quot;usercontacts&quot;&gt;&#039;.implode(&#039;  &#039;, $user_contacts).&#039;&lt;/dd&gt;&#039;.&quot;\n&quot;; ?&gt;
                &lt;/dl&gt;
            &lt;/div&gt; --&gt;
            &lt;div class=&quot;postright&quot;&gt;
                &lt;h3&gt;&lt;?php if (($post_count + $start_from) &gt; 1) echo &#039; Re: &#039;; ?&gt;&lt;?php echo pun_htmlspecialchars($cur_topic[&#039;subject&#039;]) ?&gt;&lt;/h3&gt;
                &lt;div class=&quot;postmsg&quot;&gt;
                    &lt;?php echo $cur_post[&#039;message&#039;].&quot;\n&quot; ?&gt;
&lt;?php if ($cur_post[&#039;edited&#039;] != &#039;&#039;) echo &quot;\t\t\t\t\t&quot;.&#039;&lt;p class=&quot;postedit&quot;&gt;&lt;em&gt;&#039;.$lang_topic[&#039;Last edit&#039;].&#039; &#039;.pun_htmlspecialchars($cur_post[&#039;edited_by&#039;]).&#039; (&#039;.format_time($cur_post[&#039;edited&#039;]).&#039;)&lt;/em&gt;&lt;/p&gt;&#039;.&quot;\n&quot;; ?&gt;
                &lt;/div&gt;
&lt;?php if ($signature != &#039;&#039;) echo &quot;\t\t\t\t&quot;.&#039;&lt;div class=&quot;postsignature&quot;&gt;&lt;hr /&gt;&#039;.$signature.&#039;&lt;/div&gt;&#039;.&quot;\n&quot;; ?&gt;
            &lt;/div&gt;
            &lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;
    &lt;!--        &lt;div class=&quot;postfootleft&quot;&gt;&lt;?php if ($cur_post[&#039;poster_id&#039;] &gt; 1) echo &#039;&lt;p&gt;&#039;.$is_online.&#039;&lt;/p&gt;&#039;; ?&gt;&lt;/div&gt; --&gt;
            &lt;div class=&quot;postfootright&quot;&gt;&lt;?php echo (count($post_actions)) ? &#039;&lt;ul&gt;&#039;.implode($lang_topic[&#039;Link separator&#039;].&#039;&lt;/li&gt;&#039;, $post_actions).&#039;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&#039;.&quot;\n&quot; : &#039;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&#039;.&quot;\n&quot; ?&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;?php

}

?&gt;
&lt;div class=&quot;postlinksb&quot;&gt;
    &lt;div class=&quot;inbox&quot;&gt;
        &lt;p class=&quot;postlink conr&quot;&gt;&lt;?php //echo $post_link ?&gt;&lt;/p&gt;
        &lt;p class=&quot;pagelink conl&quot;&gt;&lt;?php //echo $paging_links ?&gt;&lt;/p&gt;
    &lt;!--    &lt;ul&gt;&lt;li&gt;&lt;a href=&quot;forum.php&quot;&gt;&lt;?php echo $lang_common[&#039;Index&#039;] ?&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; » &lt;a href=&quot;viewforum.php?id=&lt;?php echo $cur_topic[&#039;forum_id&#039;] ?&gt;&quot;&gt;&lt;?php echo pun_htmlspecialchars($cur_topic[&#039;forum_name&#039;]) ?&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt; » &lt;?php echo pun_htmlspecialchars($cur_topic[&#039;subject&#039;]) ?&gt;&lt;/li&gt;&lt;/ul&gt; --&gt;
        &lt;?php //echo $subscraction ?&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;?php

// Display quick post if enabled
if ($quickpost)
{

?&gt;
&lt;!--
&lt;div class=&quot;blockform&quot;&gt;
    &lt;h2&gt;&lt;span&gt;&lt;?php echo $lang_topic[&#039;Quick post&#039;] ?&gt;&lt;/span&gt;&lt;/h2&gt;
    &lt;div class=&quot;box&quot;&gt;
        &lt;form method=&quot;post&quot; action=&quot;post.php?tid=&lt;?php echo $id ?&gt;&quot; onsubmit=&quot;this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}&quot;&gt;
            &lt;div class=&quot;inform&quot;&gt;
                &lt;fieldset&gt;
                    &lt;legend&gt;&lt;?php //echo $lang_common[&#039;Write message legend&#039;] ?&gt;&lt;/legend&gt;
                    &lt;div class=&quot;infldset txtarea&quot;&gt;
                        &lt;input type=&quot;hidden&quot; name=&quot;form_sent&quot; value=&quot;1&quot; /&gt;
                        &lt;input type=&quot;hidden&quot; name=&quot;form_user&quot; value=&quot;&lt;?php echo (!$pun_user[&#039;is_guest&#039;]) ? pun_htmlspecialchars($pun_user[&#039;username&#039;]) : &#039;Guest&#039;; ?&gt;&quot; /&gt;
                        &lt;label&gt;&lt;textarea name=&quot;req_message&quot; rows=&quot;7&quot; cols=&quot;75&quot; tabindex=&quot;1&quot;&gt;&lt;/textarea&gt;&lt;/label&gt;
                        &lt;ul class=&quot;bblinks&quot;&gt;
                        &lt;li&gt;&lt;a href=&quot;help.php#bbcode&quot; onclick=&quot;window.open(this.href); return false;&quot;&gt;&lt;?php echo $lang_common[&#039;BBCode&#039;] ?&gt;&lt;/a&gt;: &lt;?php echo ($pun_config[&#039;p_message_bbcode&#039;] == &#039;1&#039;) ? $lang_common[&#039;on&#039;] : $lang_common[&#039;off&#039;]; ?&gt;&lt;/li&gt;
                            &lt;li&gt;&lt;a href=&quot;help.php#img&quot; onclick=&quot;window.open(this.href); return false;&quot;&gt;&lt;?php echo $lang_common[&#039;img tag&#039;] ?&gt;&lt;/a&gt;: &lt;?php echo ($pun_config[&#039;p_message_img_tag&#039;] == &#039;1&#039;) ? $lang_common[&#039;on&#039;] : $lang_common[&#039;off&#039;]; ?&gt;&lt;/li&gt;
                            &lt;li&gt;&lt;a href=&quot;help.php#smilies&quot; onclick=&quot;window.open(this.href); return false;&quot;&gt;&lt;?php echo $lang_common[&#039;Smilies&#039;] ?&gt;&lt;/a&gt;: &lt;?php echo ($pun_config[&#039;o_smilies&#039;] == &#039;1&#039;) ? $lang_common[&#039;on&#039;] : $lang_common[&#039;off&#039;]; ?&gt;&lt;/li&gt;
                        &lt;/ul&gt; 
                    &lt;/div&gt;
                &lt;/fieldset&gt;
            &lt;/div&gt;
            &lt;p&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; tabindex=&quot;2&quot; value=&quot;&lt;?php echo $lang_common[&#039;Submit&#039;] ?&gt;&quot; accesskey=&quot;s&quot; /&gt;&lt;/p&gt;
        &lt;/form&gt;
    &lt;/div&gt;
&lt;/div&gt;
--&gt;
&lt;?php

}

// Increment &quot;num_views&quot; for topic
$low_prio = ($db_type == &#039;mysql&#039;) ? &#039;LOW_PRIORITY &#039; : &#039;&#039;;
$db-&gt;query(&#039;UPDATE &#039;.$low_prio.$db-&gt;prefix.&#039;topics SET num_views=num_views+1 WHERE id=&#039;.$id) or error(&#039;Unable to update topic&#039;, __FILE__, __LINE__, $db-&gt;error());

$forum_id = $cur_topic[&#039;forum_id&#039;];
//$footer_style = &#039;index&#039;;
require PUN_ROOT.&#039;footer.php&#039;;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (lhffan)]]></author>
			<pubDate>Tue, 18 Jul 2006 19:10:59 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/73156/#p73156</guid>
		</item>
	</channel>
</rss>
