(4 replies, posted in PunBB 1.3 troubleshooting)

Yeah, I just recreated it by setting the fid to a non existent forum.

How's this for a crappy bug report. All I can say is:

PHP Notice:  Undefined offset:  0 in removed/forum/extern.php on line 153

I can't even find the request and get variables that caused the notice.

Can't you use pun_link or whatever it is to generate the link for the current page from the id, title, etc and then compare it to the request_uri?

What about when fancy URLs are on and yet stuff is still accessible through links like viewtopic.php?id=1?

I think if a page works but it wasn't accessed using the current url scheme then it should 301 redirect to the same page but using the correct url. This will also prevent people losing rank if they ever turn fancy urls on or off and so on.

Wouldn't this be easier by just putting some rewrite rules in htaccess rather than writing a whole plugin? Plus it should be a 301 redirect and not send any 404.

For example, some stuff to get started with redirecting phpbb to punbb (you need more rules for profiles etc):

RewriteEngine on
RewriteBase /forum #change this to your forum folder

RewriteCond %{QUERY_STRING} f=([0-9]*) [NC]
RewriteRule viewforum\.php viewforum\.php?id=%1 [R=301,L,NC]

RewriteCond %{QUERY_STRING} t=([0-9]*) [NC]
RewriteRule viewtopic\.php viewtopic\.php?id=%1 [R=301,L,NC]

Eventually search engines will follow the 301 redirects and update their search results as well, so you don't lose any pagerank or whatever it is these days.

EDIT: Here's some to get started with VB and maybe more examples will help you understand how it works as well:

RewriteEngine on
RewriteBase /forum #change this to your forum folder

RewriteCond %{QUERY_STRING} showforum=([0-9]*) [NC]
RewriteRule index\.php viewforum\.php?id=%1 [R=301,L,NC]

RewriteCond %{QUERY_STRING} showtopic=([0-9]*) [NC]
RewriteRule index\.php viewtopic\.php?id=%1 [R=301,L,NC]

An extension could create its own hooks right though? Then you could extend an extension, which would be good for big ones like PMs etc.

It could do with an ability to set dependencies in the manifest.xml although your own install script could detect them.

<b>, <i> and <tt> are gone in XHTML 2.0.

b, i, s, etc really don't make sense if the point is to describe the document which is why they're deprecated.


(151 replies, posted in PunBB 1.3 extensions)

There's a vf_table_header_after_num_views and vf_table_contents_after_num_views, why not some for before num_views?

Wouldn't all the columns (including headers) be much more malleable if they were stored in an ordered numbered array rather than as associative array?

And here's another one.

If you use uppercase BBCode like [url], when you click preview it will not work in the the preview area. However it will be a lowercase [url]in the textarea so clicking preview a second time works. There must be a strtolower() happening too late.

A post like this with a double line space inside BBCode:

[color=orange]My first line

My second line[/color]

Will come out like:

<p><span style="color: orange">My first line

</p><p>My second line</span></p>

Which isn't valid.

I'm testing on localhost so I get this message when I go to the register page:

This reCAPTCHA key isn't authorized for the given domain. More info

Then if I actually click register I get this error:

Notice: Undefined index: recaptcha_challenge_field in C:\www\punbb-1.3-dev\register.php(108) : eval()'d code on line 7

Notice: Undefined index: recaptcha_response_field in C:\www\punbb-1.3-dev\register.php(108) : eval()'d code on line 7

I think the key not being authorized for the domain and the error message are probably related.

I thought that might be the case. Is the plan some kind of warning or javascript popup or something?

I thought I remembered something but I went back 3 pages looking for it hmm

As the title says. Just put an & in the forum description and watch.


(1 replies, posted in PunBB 1.3 troubleshooting)

I don't think you made it clear in your post, but duplicate content will lose you marks in a search engines eyes which makes it a pretty important thing to sort out.

What I'd do is have one of the URLs 301 redirect to the desired one.

I was just working on my phpbb2 to punbb1.3 script and even with my tiny database (only about 38k posts) it would take a dump while trying to convert everything. In short it'd hit the 32MB limit pretty quickly. Now I could just up the limit but in some places you don't have that control and at what point do you stop upping it?

So ... I think these changes work but can someone please confirm against some proper non-UTF8 content?

Change these lines:

$str = preg_replace_callback('/&#([0-9]+);/', create_function('$s', 'return dcr2utf8($s[1]);'), $str);
$str = preg_replace_callback('/&#x([a-f0-9]+);/i', create_function('$s', 'return dcr2utf8(hexdec($s[1]));'), $str);


$str = preg_replace_callback('/&#([0-9]+);/', 'callback1', $str);
$str = preg_replace_callback('/&#x([a-f0-9]+);/i', 'callback2', $str);

and add these two functions:

function callback1($matches) {
    return dcr2utf8($matches[1]);

function callback2($matches) {
    return dcr2utf8(hexdec($matches[1]));

And now I can convert my whole phpbb2 database in one go (no stupid page refreshing) in about 30 seconds without going over 1MB of memory.

create_function() creates an anonymous function, which of course it was doing 152,000 times for the posts table alone. Making a proper function for it makes things much better.