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?
Like:

bans
      username
      ip
      email
      message

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?

3

(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.
ect...


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?

utf8_swedish_ci
ucs2_swedish_ci
swe7_bin
swe7_swedish_ci
latin1_swedish_ci

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:


a
b
c
.
.
.
z
A
B
C
..
Z



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!

9

(2 replies, posted in PunBB 1.2 troubleshooting)

How do I change the height of topics?

http://img227.imageshack.us/img227/7845/picjh9.jpg

10

(1 replies, posted in PunBB 1.2 troubleshooting)

Hi

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..

tall?

12

(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">       
            </div>
        </div>
    </div>
<?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.id, t.poster, t.subject, t.posted, t.last_post 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=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>';
    return;
}
?>

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 f.id != 1

And if I want 1,2 and 3?

AND f.id != 1
AND f.id != 2
AND f.id != 3

Or is there and other better way?

14

(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.

<?php
/*

PunBB Active Topics

Copyright 2004-2005 Alex King, http://www.alexking.org/

This is a mod for PunBB, http://www.punbb.org/
PunBB is Copyright (C) 2002, 2003, 2004  Rickard Andersson (rickard@punbb.org)

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

-------------------------------

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

  http://www.usetasks.com/forums/


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

  include('mod_active_topics_1.2.php');

*/

$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 
    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
    ) 
    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">
            <thead>
                <tr>
                    <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>
                </tr>
            </thead>
            <tbody>
<?php
// 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>';
        else
            $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>';
        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';
        }

        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>';
        }
        else
            $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;
            else
                $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']).' ]';
        else
            $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" ?>
                            </div>
                        </div>
                    </td>
                    <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>
                </tr>
<?php

    }
}
else
{

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

}

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

16

(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.

19

(10 replies, posted in PunBB 1.2 troubleshooting)

quaker wrote:

do u want something like this.

http://punlancer.com/index.php

Q

check the left sidebar!

http://bunpai.com/index.php

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?

22

(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.

http://punlancer.com/index.php

Q

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
<?php
include('http://127.0.0.1/extern.php?action=new&show=10&fid=1');
?>

What happens is that I get an error:

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&show=10&fid=1) [function.include]: failed to open stream: no suitable wrapper could be found in

Failed opening 'http://127.0.0.1/extern.php?action=new&show=10&fid=1' for inclusion (include_path=....

Hi!

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?