Thanks! It works now.. The only row that I cant change is search_words/word

ALTER TABLE `search_words` CHANGE `word` `word` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL

MySQL: Documentation
#1062 - Duplicate entry 'prevoyance' for key 1
Jérémie wrote:

and then the same for every table, like
ALTER TABLE `pun13_categories`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
And then, maybe row by row (where it's useful).

Is it enought to do this command or do I have to do this command for the tables under also?


Jérémie wrote:

Much simpler to set it up at the database level, then install PunBB.

Which means?

Jérémie wrote:

If your forum is in Farsi, Swedish, French, Spanish, or others, the collation isn't the same. Look at the utf8_ collate available, if your language isn't one of them utf8_general_ci is probably the best one for you.

Ok I understand. My forum is in Swedish, is latin1_swedish_ci a good choice or shall I use utf8_swedish_ci?


(2 replies, posted in PunBB 1.2 troubleshooting)

1. pick the right theme in the admin option.
2. clear the cache folder.

Hi my collation in the database in right now at UTF-8_bin. This cause my big problem because the forum cant se the different in BIG and small letters. Thats means serveral things dont work.

People cant log in with    "Staffan" if there username is "staffan"
Author search do not work,  you cant search for peoples topic if the got a big letter in there name.

So if Im right the best collation to use is utf8_general_ci..

How do I change my tables in the database to utf8_general_ci instead of UTF-8_bin?

ok but are there some way to change all the tables at the same time?

Oh I see the Collation is wrong!

How do I change all tables to the right one?

one more thing:  Im using utf8_bin now.

change to?


Smartys wrote:

Sounds like you changed the users table to have a case sensitive collation.

which means?

My userlist doesent work as it shuld.

Now its sorts the members like this:


first the small and the the large

If I want the find the member John and search at a name for example:       john             , The search resault gets nothing..

I must search and log in with the exact right name to get it to work!


(2 replies, posted in PunBB 1.2 troubleshooting)

How do I change the height of topics?


(1 replies, posted in PunBB 1.2 troubleshooting)


I need to find the code for the the "Info" page.

That means the page that tells me that I have uploaded the wrong password, tells me that the avatar is to big etc..



(10 replies, posted in PunBB 1.2 troubleshooting)

quaker wrote:

here you go..

place this in a php file in the include/user folder
mine called test5.php
now go to the main.tpl and add the pun_tag.

<div class="block">
        <h2 class="block2">Recent Post</h2>
        <div class="box">
            <div class="inbox">
             <pun_include "test5.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 = 't.last_post';
    $forum_sql = '';

//$show = isset($_GET['show']) ? intval($_GET['show']) : 5;
        //if ($show < 1 || $show > 50) $show = 5;

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

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

            while ($cur_topic = $db->fetch_assoc($result)) {
        if ($pun_config['o_censoring'] == '1')
     $cur_topic['subject'] = censor_words($cur_topic['subject']);
    $subject_truncated = pun_htmlspecialchars($cur_topic['subject']);

    echo '<li>  »<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.substr($cur_topic['subject'], 0, $trunc_len).'</a>...'."\n";
    echo '</li>';

GREAT! Works fine!

Just wonder.. How do I add the time when its posted <?php echo format_time($cur_post['posted']) ?>??

Is it possible to add something like this:?

if post < 20 chars add ... after the line.

AND != 1

And if I want 1,2 and 3?

AND != 1
AND != 2
AND != 3

Or is there and other better way?


(10 replies, posted in PunBB 1.2 troubleshooting)

no one knows?

Is it possible to remove some forums in mod_active_topics_1.2?         I dont want forum id=1 to be displayed for example.


PunBB Active Topics

Copyright 2004-2005 Alex King,

This is a mod for PunBB,
PunBB is Copyright (C) 2002, 2003, 2004  Rickard Andersson (

This file is based on the viewtopic.php file in PunBB.


You can see this in action at the Use Tasks forums:

To install, include this file below the forums list in your index.php file:



$ak_limit = 25; // 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 
    LEFT JOIN '.$db->prefix.'forum_perms AS fp 
    ON ( 
        AND fp.group_id='.$pun_user['g_id'].'
    WHERE (
        fp.read_forum IS NULL 
        OR fp.read_forum=1
    ORDER BY t.last_post DESC
    LIMIT '.$ak_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">
                    <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
                    <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
                    <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
                    <th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
// If there are topics in this forum.
if ($db->num_rows($result))
    while ($cur_topic = $db->fetch_assoc($result))
        $icon_text = $lang_common['Normal icon'];
        $item_status = '';
        $icon_type = 'icon';

        if ($cur_topic['moved_to'] == null)
            $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
            $last_post = ' ';

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

        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>';
            $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';

        if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && $cur_topic['moved_to'] == null)
            $icon_text .= ' '.$lang_common['New icon'];
            $item_status .= ' inew';
            $icon_type = 'icon inew';
            $subject = '<strong>'.$subject.'</strong>';
            $subject_new_posts = '<span class="newtext">[ <a href="viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]</span>';
            $subject_new_posts = null;

        // Should we display the dot or not? :)
        if (1 == 0 && !$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1')
            if ($cur_topic['has_posted'] == $pun_user['id'])
                $subject = '<strong>·</strong> '.$subject;
                $subject = '  '.$subject;

        if ($cur_topic['sticky'] == '1')
            $subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
            $item_status .= ' isticky';
            $icon_text .= ' '.$lang_forum['Sticky'];

        $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);

        if ($num_pages_topic > 1)
            $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
            $subject_multipage = null;

        // Should we show the "New posts" and/or the multipage links?
        if (!empty($subject_new_posts) || !empty($subject_multipage))
            $subject .= '  '.(!empty($subject_new_posts) ? $subject_new_posts : '');
            $subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';

                <tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
                    <td class="tcl">
                        <div class="intd">
                            <div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
                            <div class="tclcon">
                                <?php echo $subject."\n" ?>
                    <td class="tc2"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_replies'] : ' ' ?></td>
                    <td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : ' ' ?></td>
                    <td class="tcr"><?php echo $last_post ?></td>


                    <td class="tcl" colspan="4"><?php echo $lang_forum['Empty forum'] ?></td>




(11 replies, posted in PunBB 1.2 troubleshooting)

remove     <pun_title> and <pun_desc> in main.tpl

Dont let your users pic there own password. You can change that function in admin options.

Never mind. Modified a bit.


(10 replies, posted in PunBB 1.2 troubleshooting)

quaker wrote:

do u want something like this.


check the left sidebar!

Is there any more advanced contact form out there. I mean with spamprotection and foreces fields, example: you have to write a topic.

Can you upload the old version again?


(10 replies, posted in PunBB 1.2 troubleshooting)

I want it to be displayed in the sidebar of my miniportal.

quaker wrote:

do u want something like this.


I want to put the recent topics, posts etc in a box under your "links" 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.

pedrotuga wrote:

Yes, you can query them directly them from the database using sql, and display them yourself.

But maybe if you post more information about your problem somebody can tell you how to fix it. What exactly happens?

I have done this:

//in main.tpl
<pun_include "active_topics.php">
// in include/user/active_topics.php

What happens is that I get an error:

Warning: include() [function.include]: URL file-access is disabled in the server configuration in ...

Warning: include( [function.include]: failed to open stream: no suitable wrapper could be found in

Failed opening '' for inclusion (include_path=....


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.

Is there an other way to get the last topics, posts etc without using the extern.php?