1

(114 replies, posted in Programming)

PSPad
very useful editor

PhpDesigner is really good too, but still not support unicode

in mod_topicpreview.php

Find:

echo '<font color="#FF9900"><strong>›</strong></font> '.$last_post.' <span class="byuser">» '.pun_htmlspecialchars($cur_topic['last_poster']).' » '.$lang_common['Replies'].': '.$cur_topic['num_replies'].' » '.$lang_forum['Views'].': '.$cur_topic['num_views'].' » '.format_time($cur_topic['last_post']).'</span>';

Replace:

echo '<font color="#FF9900"><strong>›</strong></font> '.$last_post.' <span class="byuser">» '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';

Nice, please integrate Attachment mod

4

(15 replies, posted in General discussion)

excuse me, how do you get number of forums use punbb?

move the include row to below line that call 'header.php'

ex.:

require PUN_ROOT.'header.php';
include('mod_active_topics.php');

6

(3 replies, posted in PunBB 1.2 discussion)

Try mod active topic
If need preview, try my mod wink

I've a litte Modification for Easy BBcode and a mod of af3 in this thread. A button for smileyadd

Preview:
http://img215.imageshack.us/img215/9641/clipboard010uj.png

##
##
##        Mod title:  Smiley Add
##
##      Mod version:  1.0
##   Works on PunBB:  1.2.x
##     Release date:  2006-03-22
##           Author:  Quoc Viet (v[at]s[dot]vnn[dot]vn)
##
##      Description:  Smilies dropdown for Mod Easy BBcode (Rickard Andersson)
##
##      Requirement:  Mod Easy BBcode installed
##
##   Affected files:  mod_easy_bbcode.php
##
##       Affects DB:  No
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup all applicable files before proceeding.
##
##


#
#---------[ 1. OPEN ]-------------------------------------------------------
#

mod_easy_bbcode.php

#
#---------[ 2. FIND (line: 77) ]---------------------------------------------
#

                        </div>
                        <div style="padding-top: 4px">
<?php

#
#---------[ 3. REPLACE WITH ]-------------------------------------------------
#

                            <input type="button" value=":)" name="smileyadd" onclick="document.getElementById('smileyadd').style.visibility='visible';document.getElementById('smileyadd').focus()" />
                            <a href="javascript:;" id="smileyadd" style="visibility:hidden;position:absolute;text-decoration:none;text-align:center;background-color:#ffffff;border:1px solid silver;width:200px;padding:5px;" onblur="this.style.visibility='hidden'" onclick="this.style.visibility='hidden'">
<?php

#
#---------[ 4. FIND (line: 93) ]---------------------------------------------
#

        echo "\t\t\t\t\t\t\t".'<a href="javascript:insert_text(\''.$smiley_text[$i].'\', \'\');"><img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.$smiley_text[$i].'" /></a>'."\n";

#
#---------[ 5. REPLACE WITH ]-------------------------------------------------
#

        echo "\t\t\t\t\t\t\t\t".'<img src="img/smilies/'.$smiley_img[$i].'" alt="'.$smiley_text[$i].'" onclick="javascript:insert_text(\''.$smiley_text[$i].'\', \'\');" />'."\n";

#
#---------[ 6. FIND (line: 98) ]---------------------------------------------
#

?>
                        </div>

#
#---------[ 7. REPLACE WITH ]-------------------------------------------------
#

?>
                            </a>
                        </div>

#
#---------[ 8. SAVE/UPLOAD ]--------------------------------------------------
#

I've tried with the div tag but it not focus to in Firefox when click Smileyadd button.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Untitled Document</title> 
</head> 
<body> 
<style> 
body {margin: 0; padding: 0} 

.eps TABLE, .eps DIV, .eps FORM, .eps P, .eps H1, .eps H2, .eps H3, 
.eps H4, .eps PRE, .eps BLOCKQUOTE, .eps UL, .eps OL, .eps LI, .eps DL, 
.eps DT, .eps DD, .eps TH, .eps TD, .eps FIELDSET, .eps IMG { 
   margin: 0px; 
   padding: 0px; 
   font-weight: normal; 
   list-style: none 
} 
.eps INPUT, .eps SELECT, .eps TEXTAREA, .eps OPTGROUP {margin: 0} 

* HTML .eps, * HTML .eps_inmain, * HTML .inform {height: 1px} 

.eps, .eps TABLE, .eps INPUT, .eps SELECT, .eps TEXTAREA {font: 11px Verdana,Tahoma} 
.eps INPUT, .eps SELECT, .eps TEXTAREA, .eps OPTGROUP {margin: 0} 


#eps_wrap { 
   background: #ffffff; 
   color: #303030; 
   width: 100%; 
   margin: 10px; 
   padding: 10px 
} 
#eps_header, #eps_footer {clear: both; height: 1px} 
#eps_header {height: 100px} 
#eps_footer {padding: 20px} 

#eps_main { 
   margin: 0 0 10px 20px 
} 

#eps_header, #eps_left, #eps_right, .eps fieldset, .eps .inform { 
   margin-bottom: 10px 
} 
.eps .pagination, .eps .text, .eps .infieldset { 
   margin-bottom: 5px; 
} 

.eps .infieldset, .eps .inbox, .eps .box_header {padding: 5px} 

DIV.txtinput {WIDTH: 90%} 
DIV.txtinput TEXTAREA, INPUT.longinput {WIDTH: 100%} 

.inform p {margin: 0.5em} 
.inform p input {margin: 0 5px} 
.eps label {display: block; margin: 5px} 

#eps_wrap, #page_footer, #page_header, .eps .box, 
.eps fieldset, .eps input, .eps select, .eps textarea, .eps checkbox { 
   border: 1px solid #000000 
} 

</style> 
<div id="eps_wrap" class="eps"> 
   <div id="page_header">Header</div> 

   <div id="eps_main"> 
      <div id="eps_main_content" class="eps_inmain"> 
         <div class="title"><h2>Dang tin tuc</h2></div> 
        <div class="post"> 
           <form id="postnews" method="post" action="" onsubmit=""> 
              <div class="inform"> 
                 <fieldset> 
                     <legend>dddd</legend> 
                     <div class="infieldset txtinput"> 
                        <label><strong>daaaaaaaaaaaaaa</strong><br /><input class="longinput" type="text" name="req_title" value="fgh" size="50" maxlength="70" /><br /></label> 
                        <label><strong>Error</strong><br /> 
                           <textarea name="req_content" rows="20">Typing some words here</textarea> 
                        </label> 
                     </div> 
                  </fieldset> 
                  <fieldset> 
                     <legend>Error here</legend> 
                     <div class="infieldset txtinput"> 
                     <label><strong>Typing some words here</strong><br /><input type="text" name="imgurl" class="longinput" maxlength="200" value="" /><br /></label> 
                     </div> 
                  </fieldset> 
                  <p><input type="submit" name="submit" value="Submit"><a href="javascript:history.go(-1)">Go back</a></p> 
               </div> 
           </form> 
         </div> 
      </div> 
   </div> 

   <div id="page_footer">sdfgdfg</div> 

</div> 
</body> 
</html>

I write it like punbb but have problem when typing some words in textarea and .longinput:
+ Textarea expand
+ Div moving.

Thanks for your support.
It's work fine with table now. But the same problem with FIELDSET when i try set width INPUT and TEXTAREA or FIELDSET to 100%

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<style>
body {font: 11px Verdana,Tahoma;margin: 0;padding: 0;}
#body_wrap {padding: 10px;}
#page_header {clear: both;}
#page_footer {clear: both;}
#main_left {clear: left;float: left; width: 170px;}
#main_right {float: right;width: 150px;}
#main_content {margin: 0 160px 10px 180px;}
#page_header, #main_left, #main_right {margin-bottom: 10px;}
#main_left .box, #main_right .box {margin-bottom: 20px;}
#body_wrap, #page_footer, #page_header, #main_content, .box, .tbl {border: 1px solid #000000;}


.classlist {padding: 5px; height: auto; height: 1%}
#body_wrap table, #body_wrap fieldset {font-size: 1em; width: 100%;}
.txtarea, .txtin {width: 100%}

.tbl th {background-color: #dff1f1;}
.tbl th, .tbl td {border-left: 1px solid #000000;padding: 4px 6px;}
.tbl .coll {border-left: none;}
.title {color: #658655;font: bold 1.6em Tahoma;margin: 0.5em;}
</style>
<div id="body_wrap">
    <div id="page_header">Header</div>

    <div id="main_left">
        <div id="l_menu">
        <ul>
            <li><a href=#>Item1</a></li>
            <li><a href=#>Item1</a></li>
            <li><a href=#>Item1</a></li>
            <li><a href=#>Item1</a></li>
        </ul>
        </div>
    </div>

    <div id="main_right">
        <div id="r_recenttopic" class="box">
            <div class="box_header">asasf</div>
            <div class="box_content">adfas</div>
        </div>
        <div id="r_recenttopic" class="box">
            <div class="box_header">asasf</div>
            <div class="box_content">adfas</div>
        </div>
        <div id="r_recenttopic" class="box">
            <div class="box_header">asasf</div>
            <div class="box_content">adfas</div>
        </div>
        <div id="r_recenttopic" class="box">
            <div class="box_header">asasf</div>
            <div class="box_content">adfas</div>
        </div>
    </div>

  <div id="main_content">
      <div class="title">Danh sach lop</div>
      <div class="classlist">
                  <fieldset>
                        <legend>aaaa</legend>
                        <label>bbbb<br /><input class="txtin" type="text" name="req_subject" value="" size="60" maxlength="70" tabindex="1" /><br /></label>
                        <label>cccc<br />
                        <textarea class="txtarea" name="req_message" rows="20" cols="60" tabindex="2"></textarea><br /></label>
                    </fieldset>
                    <fieldset>
                        <legend>Tuy chon</legend>
                        <label>Loai tin<br /><input name="n_type" type="radio" value="1" checked />Tin chinh <input name="n_type" type="radio" value="2" />Tin van</label>
                        <label>image<br /><input class="txtin" type="text" name="req_subject" value="" size="50" maxlength="70" tabindex="3" /><br /></label>
                    </fieldset>
        </div>
    </div>

<div id="page_footer">footer</div>

</div>
</body>
</html>

http://img366.imageshack.us/img366/7813/018vw.th.gif

Release Version 1.1
Changes:
  Add: Show last post
  Add: Include Mod Active Topic Lite
  Add: Config, Language
  Minor changes

nice mod but i have a problem with ie explorer with the combobox of footer.

ok, but don't know why big_smile

Thanks, but it not works sad except i change 100% to "auto"
In punbb i saw:

/* Begin IEWin Fix \*/
* HTML .inbox, * HTML .inform, * HTML .pun, * HTML .intd, * HTML .tclcon {HEIGHT: 1px}
* HTML .inbox DIV.postmsg {WIDTH: 98%}
/* End of IEWin Fix */

it fix this problem?

My test.htm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<style>
body {font: 11px Verdana,Tahoma;margin: 0;padding: 0;}
#body_wrap {padding: 10px;}
#page_header {clear: both;}
#page_footer {clear: both;}
#main_left {clear: left;float: left;    width: 170px;}
#main_right {float: right;width: 150px;}
#main_content {margin: 0 160px 10px 180px;}
#page_header, #main_left, #main_right {margin-bottom: 10px;}
#main_left .box, #main_right .box {margin-bottom: 20px;}
.classlist {padding: 5px;}
#body_wrap, #page_footer, #page_header, #main_content, .box, .tbl {border: 1px solid #000000;}
#body_wrap table {font-size: 1em;width: 100%;}
.classlist {vertical-align: top;}
.tbl th {background-color: #dff1f1;}
.tbl th, .tbl td {border-left: 1px solid #000000;padding: 4px 6px;}
.tbl .coll {border-left: none;}
.title {color: #658655;font: bold 1.6em Tahoma;margin: 0.5em;}
</style>
<div id="body_wrap">
    <div id="page_header">Header</div>

    <div id="main_left">
        <div id="l_menu">
        <ul>
            <li><a href=#>Item1</a></li>
            <li><a href=#>Item1</a></li>
            <li><a href=#>Item1</a></li>
            <li><a href=#>Item1</a></li>
        </ul>
        </div>
    </div>

    <div id="main_right">
        <div id="r_recenttopic" class="box">
            <div class="box_header">asasf</div>
            <div class="box_content">adfas</div>
        </div>
        <div id="r_recenttopic" class="box">
            <div class="box_header">asasf</div>
            <div class="box_content">adfas</div>
        </div>
        <div id="r_recenttopic" class="box">
            <div class="box_header">asasf</div>
            <div class="box_content">adfas</div>
        </div>
        <div id="r_recenttopic" class="box">
            <div class="box_header">asasf</div>
            <div class="box_content">adfas</div>
        </div>
    </div>

  <div id="main_content">
      <div class="title">Danh sach lop</div>
      <div class="classlist">
      <table class="tbl" cellspacing="0">
            <thead>
                <tr>
                    <th class="coll" scope="col">STT</th>
                    <th scope="col">Ten</th>
                    <th scope="col">Ngay sinh</th>
                    <th scope="col">lop</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="coll">asdas</td>
                    <td>asdasd</td>
                    <td>dasdsa</td>
                    <td>assad</td>
                </tr>
                <tr class="evenrow">
                    <td class="coll">asdas</td>
                    <td>asdasd</td>
                    <td>dasdsa</td>
                    <td>assad</td>
                </tr>
                <tr>
                    <td class="coll">asdas</td>
                    <td>asdasd</td>
                    <td>dasdsa</td>
                    <td>assad</td>
                </tr>
                <tr class="evenrow">
                    <td class="coll">asdas</td>
                    <td>asdasd</td>
                    <td>dasdsa</td>
                    <td>assad</td>
                </tr>
                <tr>
                    <td class="coll">asdas</td>
                    <td>asdasd</td>
                    <td>dasdsa</td>
                    <td>assad</td>
                </tr>
                <tr class="evenrow">
                    <td class="coll">asdas</td>
                    <td>asdasd</td>
                    <td>dasdsa</td>
                    <td>assad</td>
                </tr>
                <tr>
                    <td class="coll">asdas</td>
                    <td>asdasd</td>
                    <td>dasdsa</td>
                    <td>assad</td>
                </tr>
            </tbody>
      </table>
        </div>
    </div>

<div id="page_footer">footer</div>

</div>
</body>
</html>

There's a space above the table
http://img394.imageshack.us/img394/2911/019jr.gif

big_smile I'm only amateur (and bad English sad )

After which point do you have the post truncated?

if (strlen($cur_tp)>256)

Punbb not have column "first post" in the database. I tried with the topic query (at "// Without the dot" & "// With the dot") but there a problem with "Moved topic". So I get first post outside.
I think there are some bugs in my project.

Apologies for my bad english again.

##
##
##       Mod title: PunBB Topic Preview (with Mod Active Topic Lite)
##
##     Mod version: 1.1 Build 051220 
##  Works on PunBB: 1.2, 1.2.10
##          Author: Quoc Viet (aFeLiOn) e-mail: v[at]s[dot]vnn[dot]vn
##
##     Description: Show first 256 characters in first post or last post
##                  of topic on the Forum view and on Active Topic
##
##  Affected files: viewforum.php
##                  index.php (if using Mod Active Topic Lite)
##
##      Affects DB: No
##
##    Author notes: You can change Language, Config in file "mod_topicpreview.php".
##                  Mod Active Topic Lite is based on "Mod Active Topics" of Alex King.
##                  The Javascript is from Dynamic Drive DHTML code library.
##                  The Mod can't show last post on moved topic and the tooltip show
##                  behind combobox in IE.
##                  * Change from v1.0rc1:
##                    Add: Show last post
##                    Add: Include Mod Active Topic Lite
##                    Add: Config, Language
##                    Minor changes
##
##      Disclaimer: Please note that "mods" are not officially supported by
##                  PunBB. Installation of this modification is done at your
##                  own risk. Backup all applicable files before proceeding.
##
##
 
 
#
#---------[ 1. UPLOAD ]---------
#
include/mod_topicpreview.js to /include/
include/mod_topicpreview.php to /include/
#
#---------[ 2. OPEN ]---------
#
viewforum.php
#
#---------[ 3. FIND ]---------
#
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
#
#---------[ 4. AFTER, ADD ]---------
#
require PUN_ROOT.'include/mod_topicpreview.php'; // [1] Mod Topic Preview
#
#---------[ 5. FIND ]---------
#
// Fetch list of topics to display on this page
if ($pun_user['is_guest'] || $pun_config['o_show_dot'] == '0')
{
#
#---------[ 6. BEFORE, ADD ]---------
#
// [2-] mod Topic Preview
$sql = 'SELECT p.message AS fpost, p.id AS fpost_id, v.message AS lpost, v.id AS lpost_id, t.id, t.moved_to, t.last_post_id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON (t.id=p.topic_id OR t.moved_to=p.topic_id) LEFT JOIN '.$db->prefix.'posts AS v ON (t.last_post_id=v.id AND t.moved_to IS NULL) WHERE t.forum_id='.$id.' GROUP BY t.id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
$result = $db->query($sql) or error('Unable to fetch first posts', __FILE__, __LINE__, $db->error());
$topic_preview = array();
while ($mod_tp = $db->fetch_assoc($result))
{
    switch ($mtp_show)
    {
        case 1: $mtp_fp = ($mod_tp['lpost']!='') ? $mtp_lang['lastpost'].'<br />'.mtp_trim($mod_tp['lpost']) : ''; break;
        case 2: $mtp_fp = $mtp_lang['firstpost'].'<br />'.mtp_trim($mod_tp['fpost']);
                if ($mod_tp['moved_to'] == 0 && $mod_tp['fpost_id'] != $mod_tp['lpost_id'])
                {
                    $mtp_fp .= '<br />'.$mtp_lang['lastpost'].'<br />'.mtp_trim($mod_tp['lpost']);
                }
                break;
        case 0:
        default: $mtp_fp = mtp_trim($mod_tp['fpost']); break;
    }
    if ($mod_tp['moved_to'] != 0 && $mtp_showmoved)
        $topic_preview[$mod_tp['moved_to']] = $mtp_fp;
    else
        $topic_preview[$mod_tp['id']] = $mtp_fp;
}
// [-2] mod Topic Preview

#
#---------[ 7. FIND ]---------
#
        if ($cur_topic['moved_to'] != 0)
            $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        else if ($cur_topic['closed'] == '0')
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        else
        {
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
            $icon_text = $lang_common['Closed icon'];
            $item_status = 'iclosed';
        }
#
#---------[ 8. REPLACE WITH ]---------
#
        // [3-] mod Topic Preview
        if ($cur_topic['moved_to'] != 0)
            $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'" onmouseover="ddrivetip(\''.$topic_preview[$cur_topic['moved_to']].'\')" onmouseout="hideddrivetip()">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        else if ($cur_topic['closed'] == '0')
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'" onmouseover="ddrivetip(\''.$topic_preview[$cur_topic['id']].'\')" onmouseout="hideddrivetip()">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        else
        {
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'" onmouseover="ddrivetip(\''.$topic_preview[$cur_topic['id']].'\')" onmouseout="hideddrivetip()">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
            $icon_text = $lang_common['Closed icon'];
            $item_status = 'iclosed';
        }
        // [-3] mod Topic Preview
#
#---------[ 9. ONLY IF USING MOD ACTIVE TOPIC LITE ]---------
#
    #
    #---------[ 9a. OPEN ]---------
    #
    index.php
    #
    #---------[ 9b. FIND ]---------
    #
    define('PUN_ALLOW_INDEX', 1);
    require PUN_ROOT.'header.php';
    
    #
    #---------[ 9c. AFTER, ADD ]---------
    #
    require PUN_ROOT.'include/mod_topicpreview.php';
    mtp_showactopic();    // Mod Topic Preview with Active Topic Lite
#
#---------[ 10. SAVE/UPLOAD ]---------
#

Preview:
http://img205.imageshack.us/img205/606/punbbmodtopicpreview3gl.gif
http://img517.imageshack.us/img517/347/punbbmtp026td.gif
Download here

15

(2 replies, posted in PunBB 1.2 discussion)

Anyone help me...

smile like vbulletin:
My forum

<?php
/*
PunBB Active Topics Lite by aFeLiOn
Based on "Mod Active Topics" of Alex King, http://www.alexking.org/
This is a mod for PunBB, http://punbb.org/
PunBB is Copyright (C) 2005  Rickard Andersson (rickard@punbb.org)
-------------------------------
To install, include this file below the forums list in your index.php file:
  include('mod_active_topics.php');
  (Before line: '$result = $db->query('SELECT c.id AS cid...' or anywhere you want)
*/

$active_topic_limit = 7; // change this to the number of active topics you want to display.
$result = $db->query('SELECT t.* FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY t.last_post DESC    LIMIT '.$active_topic_limit) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';

?>
<div id="vf" class="blocktable">
    <h2><span>Active Topics</span></h2>
    <div class="box">
        <div class="inbox">
            <table cellspacing="0">
            <tbody>
<?php
// If there are topics in this forum.
if ($db->num_rows($result))
{
    echo '<tr><td class="tcl">';
    while ($cur_topic = $db->fetch_assoc($result))
    {
        $item_status = '';

        if ($pun_config['o_censoring'] == '1')
            $cur_topic['subject'] = censor_words($cur_topic['subject']);

        $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a>';

        if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'])
        {
            $item_status .= ' inew';
            $last_post = '<strong>'.$last_post.'</strong>';
        }

        if ($cur_topic['sticky'] == '1')
        {
            $last_post = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$last_post;
            $item_status .= ' isticky';
        }
?>
            <div<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
                    <div class="intd">
                            <div class="tclcon">
                                <?php
                                 echo '<font color="#FF9900"><strong>›</strong></font> '.$last_post.' <span class="byuser">» '.pun_htmlspecialchars($cur_topic['last_poster']).' » '.$lang_common['Replies'].': '.$cur_topic['num_replies'].' » '.$lang_forum['Views'].': '.$cur_topic['num_views'].' » '.format_time($cur_topic['last_post']).'</span>';
                                ?>
                            </div>
                        </div>
                    </div>
<?php
    }
    echo '</td></tr>';
}
else
{
?>
                <tr>
                    <td class="tcl" colspan="4"><?php echo '*EMPTY*' ?></td>
                </tr>
<?php

}
?>
            </tbody>
            </table>
        </div>
    </div>
</div>

JS Quicktags big_smile

Fine, in phpmyadmin, it stored in utf-8 encode.
But when i view source of my forum (from ie):

    <li id="navindex"><a href="index.php">Diá»?n Ä?Ã n</a> | </li>
    <li id="navuserlist"><a href="userlist.php">Danh sách ngưỠi dùng</a> | </li>
    <li id="navsearch"><a href="search.php">Tìm kiếm</a> | </li>
    <li id="navprofile"><a href="profile.php?id=2">Xác lập cá nhân</a> | </li>
    <li id="navadmin"><a href="admin_index.php">Quản lý diá»?n Ä?à n</a> | </li>
    <li id="navlogout"><a href="login.php?action=out&id=2">Thoát</a></li>

Does it show like in phpmyadmin?

I mod my punbb to show topic content when move mouse over on Forum view.

    // Without "the dot"
    $sql = 'SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];

to:

    // Without "the dot"
    $sql = 'SELECT p.message, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id = p.topic_id WHERE t.forum_id='.$id.' GROUP BY t.id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];

but I don't know how to change this to get only first topic content.

af3 wrote:

Done. Using EasyBBCode + Smiley plugin + some javascript.

How did you do that?

<ping></pong> sad
How to query to mysql: set charset = utf-8 after select database in PunBB
like:
$Sql = mysql_connect("localhost","root","") or die ("error");
mysql_select_db("xyz",$Sql) or die ("error");
mysql_query("SET NAMES 'utf8'", $Sql);

vnpenguin wrote:

Hmm, i don't think so. VnOSS forum runs with MySQL 4.1.10 without any problem. No special configuration of MySQL was made in our server.

And your PHP version?

I use WindowsXP sp2, ISS 5.1, php 5.0.4(zip), mySql 4.1.12a(exe), punBB 1.2.6 is tested on localhost.
Use Vietnamese.zip from punBB-download.

please read this article:
http://www.phpbb.com/kb/article.php?article_id=308;
->How to  set name or character set = utf8 after select database in "Mighty punBB" smile

thanks.
punBB show exactly Vietnamese form file lang.
My problem is when i try to to post a topic and punBB save it to Mysql.
There're an error appears:
"An error was encountered
Error: Unable to fetch search index words."
but the topic is posted with wrong character.

http://www.offsiteimages.com/thumb/33595.gif

I think the reason is MySQL 4.1.

@vnpenguin:
minh khong tim thay van de nay tren trang cua ban.
Ban co the giup minh ko, minh moi dung PunBB.

I have problem with some utf 8 charater in punBB.
when I try to post "?i?n", it become "?i?n", or "h?c" -> "H?c"...
I can't read in phpMyadmin, because all like "C�ng hoà xã h�i"

I got the same error with my post-page when save to mysql.
However I fixed it by add "mysql_query("SET NAMES 'utf8'", $Sql);"
after select mydatabase:

//
$Sql = mysql_connect("localhost","root","") or die ("error");
mysql_select_db("xyz",$Sql) or die ("error");
mysql_query("SET NAMES 'utf8'", $Sql);
//

My post-page works fine, and in phpMyadmin all nice.
So, anyone help me about this.
---
Apologies for my bad english.