The fix for me was to clear the main forum. once it got up to around 15K topics/160K posts it was taking forever, you can prune that back or I just hide the forum and swap in a new empty forum with the same name, that way the old posts can be recalled if needed by me. I was told that the database has to sort all those posts each request by a user (post/refresh) and my people use my board like a chat, lots of posts and quick moving topics. Anyway as soon as I hit 15k topics I have to hide or prune. if you close but leave it viewable you get the same problem.

The point being made there is that viewforum.php has to load all of the topics in a forum, sort them, and then output the specific subset that is asked for. When you have 15,000 entries, doing so can be slow.

barrowfc: If the issue happens again, I would suggesting seeing if you can pinpoint which queries are hanging. Since you're on  a VPS, you can just log in to MySQL as a user with SUPER privileges and type "SHOW PROCESSLIST", which should list the current connections (and any queries they're executing). If you post them here, I can analyze that a bit and suggest ways to deal with it.

152

(11 replies, posted in PunBB 1.2 show off)

It's fairly simple, well-written code that you need to audit once and forget it. And it's probably the easiest way to get a fancy typeface dynamically.

Moved to Modifications, since PMs are a modification

154

(20 replies, posted in PunBB 1.2 troubleshooting)

artoodetoo: It's hard to understand a problem when the only given information on it is "there's a problem. you won't understand it." wink

155

(3 replies, posted in Feature requests)

It doesn't work, at least not well enough: I've tested it on the Bug Reports form for this site and I have a friend who has used it on his site. Some spam bots are smarter than others. wink
And that particular implementation is poor, since as Jérémie pointed out some users will end up seeing the field. There should be a note next to it (also hidden) telling people not to fill it out.
As an extension for 1.3? Certainly possible

Short answer: Yes.

157

(11 replies, posted in PunBB 1.2 show off)

sirena: That's what the alt attribute is for: search engines and people without images see plain text instead. wink
And looking at the dynatext stuff, it's essentially loading static images: the text that's generated is cached.

158

(11 replies, posted in PunBB 1.2 show off)

sirena: Invalid CSS doesn't cause inconsistencies (except maybe between browsers), and anyway, his CSS is valid. wink

159

(11 replies, posted in PunBB 1.2 show off)

Moved to Show Off

Hmm, I like the whole style a lot.
The ad placement is interesting, personally I think it looks less prominent/better on the right.

161

(4 replies, posted in PunBB 1.3 extensions)

PM extension and poll extension are going to be official extensions

Yup, search/replace is hard tongue
I'll fix it later today

163

(2 replies, posted in PunBB 1.2 troubleshooting)

PunBB was built to support the SQLite PHP extension, which I believe supports SQLite 2, as opposed to the PDO extension.

164

(9 replies, posted in PunBB 1.3 troubleshooting)

And here's an untested version which should hopefully work.

<?php
/**
 * PunBB auth backend
 *
 * Uses external Trust mechanism to check against PunBB's
 * user cookie. PunBB's PUN_ROOT must be defined correctly.
 *
 * @author    Andreas Gohr <andi@splitbrain.org>
 */

if(!defined('PUN_ROOT')) define('PUN_ROOT', DOKU_INC.'../forum/');
if(get_magic_quotes_gpc()){
  nice_die('Sorry the punbb auth backend requires the PHP option
  <a href="http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc">magic_quotes_gpc</a>
  to be disabled for proper operation. Either setup your PHP install accordingly or
  choose a different auth backend.');
}

require_once PUN_ROOT.'include/common.php';
require_once DOKU_INC.'inc/auth/mysql.class.php';

#dbg($GLOBALS);
#dbg($pun_user);

class auth_punbb extends auth_mysql {

  /**
   * Constructor.
   *
   * Sets additional capabilities and config strings
   */
  function auth_punbb(){
    global $conf;
    $this->cando['external'] = true;
    $this->cando['logoff']   = true;

    // make sure we use a crypt understood by punbb
    if(function_exists('sha1')){
      $conf['passcrypt'] = 'sha1';
    }else{
      $conf['passcrypt'] = 'md5';
    }

    // get global vars from PunBB config
    global $db_host;
    global $db_name;
    global $db_username;
    global $db_password;
    global $db_prefix;

    // now set up the mysql config strings
    $conf['auth']['mysql']['server']   = $db_host;
    $conf['auth']['mysql']['user']     = $db_username;
    $conf['auth']['mysql']['password'] = $db_password;
    $conf['auth']['mysql']['database'] = $db_name;

    $conf['auth']['mysql']['checkPass']   = "SELECT u.password AS pass
                                               FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
                                              WHERE u.group_id = g.g_id
                                                AND u.username = '%{user}'
                                                AND g.g_title   != 'Guest'";
    $conf['auth']['mysql']['getUserInfo'] = "SELECT password AS pass, realname AS name, email AS mail,
                                                    id, g_title as `group`
                                               FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
                                              WHERE u.group_id = g.g_id
                                                AND u.username = '%{user}'";
    $conf['auth']['mysql']['getGroups']   = "SELECT g.g_title as `group`
                                               FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
                                              WHERE u.group_id = g.g_id
                                                AND u.username = '%{user}'";
    $conf['auth']['mysql']['getUsers']    = "SELECT DISTINCT u.username AS user
                                               FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
                                              WHERE u.group_id = g.g_id";
    $conf['auth']['mysql']['FilterLogin'] = "u.username LIKE '%{user}'";
    $conf['auth']['mysql']['FilterName']  = "u.realname LIKE '%{name}'";
    $conf['auth']['mysql']['FilterEmail'] = "u.email    LIKE '%{email}'";
    $conf['auth']['mysql']['FilterGroup'] = "g.g_title    LIKE '%{group}'";
    $conf['auth']['mysql']['SortOrder']   = "ORDER BY u.username";
    $conf['auth']['mysql']['addUser']     = "INSERT INTO ${db_prefix}users
                                                    (username, password, email, realname)
                                             VALUES ('%{user}', '%{pass}', '%{email}', '%{name}')";
    $conf['auth']['mysql']['addGroup']    = "INSERT INTO ${db_prefix}groups (g_title) VALUES ('%{group}')";
    $conf['auth']['mysql']['addUserGroup']= "UPDATE ${db_prefix}users
                                                SET group_id=%{gid}
                                              WHERE id='%{uid}'";
    $conf['auth']['mysql']['delGroup']    = "DELETE FROM ${db_prefix}groups WHERE g_id='%{gid}'";
    $conf['auth']['mysql']['getUserID']   = "SELECT id FROM ${db_prefix}users WHERE username='%{user}'";
    $conf['auth']['mysql']['updateUser']  = "UPDATE ${db_prefix}users SET";
    $conf['auth']['mysql']['UpdateLogin'] = "username='%{user}'";
    $conf['auth']['mysql']['UpdatePass']  = "password='%{pass}'";
    $conf['auth']['mysql']['UpdateEmail'] = "email='%{email}'";
    $conf['auth']['mysql']['UpdateName']  = "realname='%{name}'";
    $conf['auth']['mysql']['UpdateTarget']= "WHERE id=%{uid}";
    $conf['auth']['mysql']['delUserGroup']= "UPDATE ${db_prefix}users SET g_id=4 WHERE id=%{uid}";
    $conf['auth']['mysql']['getGroupID']  = "SELECT g_id AS id FROM ${db_prefix}groups WHERE g_title='%{group}'";

    $conf['auth']['mysql']['TablesToLock']= array("${db_prefix}users", "${db_prefix}users AS u",
                                                  "${db_prefix}groups", "${db_prefix}groups AS g");

    $conf['auth']['mysql']['debug'] = 1;
    // call mysql constructor
    $this->auth_mysql();
  }

  /**
   * Just checks against the $pun_user variable
   */
  function trustExternal($user,$pass,$sticky=false){
    global $USERINFO;
    global $conf;
    global $lang;
    global $pun_user;
    global $pun_config;
    global $cookie_name;
    $sticky ? $sticky = true : $sticky = false; //sanity check

    // someone used the login form
    if(!empty($user)){
      authenticate_user($user, $pass);
      if (!$pun_user['is_guest']){
        $expire = ($pun_user['save_pass'] == '1') ? time() + 31536000 : 0;
        pun_setcookie($cookie_name, base64_encode($pun_user['id'].'|'.$pun_user['password']), $expire);
      }else{
        //invalid credentials - log off
        msg($lang['badlogin'],-1);
        auth_logoff();
        return false;
      }
    }

    if(isset($pun_user) && !$pun_user['is_guest']){
      // okay we're logged in - set the globals
      $USERINFO['pass'] = $pun_user['password'];
      $USERINFO['name'] = $pun_user['realname'];
      $USERINFO['mail'] = $pun_user['email'];
      $USERINFO['grps'] = array($pun_user['g_title']);

      $_SERVER['REMOTE_USER'] = $pun_user['username'];
      $_SESSION[DOKU_COOKIE]['auth']['user'] = $pun_user['username'];
      $_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO;
      return true;
    }

    // to be sure
    auth_logoff();
    return false;
  }

  /**
   * remove punbb cookie on logout
   */
  function logOff(){
    global $pun_user;
    global $cookie_name;
    $pun_user = array();
    $pun_user['is_guest'] = true;
    pun_setcookie($cookie_name, base64_encode('1|'.random_key(8, true)), time() + 31536000);
  }
}
//Setup VIM: ex: et ts=2 enc=utf-8 :

This code can probably be greatly shortened: I think I removed the dependency on the MySQL auth class, since the script includes common.php anyway, which means the PunBB database connection already exists/

165

(8 replies, posted in PunBB 1.2 troubleshooting)

All the links are relative, all you need to do is move the files and change the base URL.

166

(8 replies, posted in PunBB 1.2 troubleshooting)

If your site is in http://example.com/forum/ and you want to move it to http://example.com, you need to move the files down one level. PunBB doesn't move itself, the base URL should be simply a reflection of where it is in the site.

167

(9 replies, posted in PunBB 1.3 troubleshooting)

If you email me/post the auth class dokuwiki uses for 1.2, I can modify it to work with 1.3

168

(17 replies, posted in PunBB 1.3 troubleshooting)

daris wrote:

After looking into cache/cache_hooks.php i see lots of $ext_info variables big_smile Maybe there is the problem wink

Did you try removing this file?

Yes, they're automatically added by PunBB in cache_hooks.php. The question is why they're not set: that shouldn't be possible unless an extension unsets the variable and a later extension tries to use it.

169

(17 replies, posted in PunBB 1.3 troubleshooting)

well you could just ask the list of extensions .. not give me a lecture .. i am not a kid you know... i was busy ... just told u about the error ... didnt had time for arguments with you .. as i know what would be the result ...

A. That's not what I asked for, and the reason I "lectured" you is because of your posts. You said, essentially "There's an error, I don't know where it's coming from, help!" and when I told you where to look, you said "OK, can anyone tell me where the error is." As I said, it's YOUR setup and YOU have control over it.
B. What part of "YOU need to be the one to enable/disable extensions to figure out which one (or combination of ones) is failing" did you not understand? This is a beta: if something is going wrong with your setup, especially if it's with third party code, you need to at least attempt to diagnose the cause of the problem.

You should not include common.php or functions.php twice (or try including both: including common.php includes functions.php).

171

(17 replies, posted in PunBB 1.3 troubleshooting)

Of course we do, because we're magic and know exactly what extensions you have installed and how they're interacting. roll
Seriously, you can not expect people to do everything for you. You are the one who knows your setup best and you are the one who has control over your site. YOU need to be the one to enable/disable extensions to figure out which one (or combination of ones) is failing. smile

172

(17 replies, posted in PunBB 1.3 troubleshooting)

That's caused by an extension.

Are you talking about the PunBB index.php? smile

Yes

I'm not sure if this would work, given the fact that it's "include once" instead of "require" and I'm also not sure if I have to remove the 'forum/' in the same line (sorry, I'm a big n00b with PunBB coding). Also, do I have to include the code in the link you gave me multiple times for multiple PHP-includes? (this one)

common.php should be included/required once in a page, you should not be prepending forum to your path since PUN_ROOT already takes care of that (that's just basic concatenation of strings). smile

Goldex: You can rename your index.php to whatever you want, you just have to search through all the files for references to index.php and update them as well.
The first script you posted is wrong, please review http://punbb.org/docs/dev.html#integration
The second script is a huge security risk and allows an attacker to execute arbitrary PHP on your site.

Well, my testing has discovered a method by which it might be possible to use associative keys. Sweet! big_smile