Yeah, that shouldn't be too problematic. I believe the best solution would be to add a new column to the posts and topics tables that sets whether a post is "approved" or not.

I'll add it to the TODO list for PunBB 1.2.

I'm blushing :)

Open up include/parser.php and look up:

$message = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.$smiley_text[$i].'">$2', $message);

It's on line 258. Replace it with:

$message = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" alt="'.$smiley_text[$i].'">$2', $message);

6,604

(14 replies, posted in PunBB 1.2 troubleshooting)

Well, I'll be damned :) I'm gonna have to have a look at that tomorrow. I have no idea why that happens.

6,605

(14 replies, posted in PunBB 1.2 troubleshooting)

But that would lead to a parse error and not "There is no valid language pack 'en' installed".

6,606

(0 replies, posted in News)

Alexander Sheiko has submitted an updated Russian language pack. Enjoy.

6,607

(14 replies, posted in PunBB 1.2 troubleshooting)

Maybe. I'm not sure I know what you mean though. Could you send me the language pack?

6,608

(12 replies, posted in PunBB 1.2 troubleshooting)

Ok, great. I appreciate any help I can get to track down the problem.

6,609

(12 replies, posted in PunBB 1.2 troubleshooting)

Hmm, that's odd. When someone registers, their registered date and last visit date is set to "now", so that shouldn't happen.

6,610

(12 replies, posted in PunBB 1.2 troubleshooting)

When do you get that error?

Might I ask why you want to display the topic ID and the number of posts in that topic on the front page?

6,612

(14 replies, posted in PunBB 1.2 troubleshooting)

No, you shouldn't edit anything in the language files. I'm sorry, but I have no idea what might be wrong. If you like, I can probably help you out, but then I will need to have a look at your files. Drop me an e-mail and I'm sure we can work something out.

6,613

(4 replies, posted in PunBB 1.2 troubleshooting)

True. However, why would you ever have a smiley without a whitespace characters in front of it?

Also, the only other forum I know that converts smilies without leading whitespace is vBulletin. All other (that I know of) work like PunBB.

6,614

(14 replies, posted in PunBB 1.2 troubleshooting)

The file config.php should not be in those directories. It's the one in the forum root directory.

Yes. Change

$topic_id = 3160;

to

$topic_id = '3160, 1222, 1446';

and

$result = $db->query('SELECT num_replies+1 FROM '.$db->prefix.'topics WHERE id='.$topic_id) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());

to

$result = $db->query('SELECT num_replies+1 FROM '.$db->prefix.'topics WHERE id IN('.$topic_id.')') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());

Then just edit $topic_id. It's a comma-separeted list of topic IDs.

6,616

(10 replies, posted in PunBB 1.2 troubleshooting)

Glad to hear it worked out :)

Do this. Include the following piece of code at the very top of your page (before <html> and all that).

<?php

$topic_id = 3160;

$pun_root = './forums/';
require $pun_root.'include/common.php';

$result = $db->query('SELECT num_replies+1 FROM '.$db->prefix.'topics WHERE id='.$topic_id) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
$num_posts = intval($db->result($result, 0));

?>

Then, when you want to display the text, just include this code:

<?php echo('Topic has '.$num_posts.' posts.'); ?>

Here's an example of how you could do it:

<?php

$topic_id = 3160;

$pun_root = './forums/';
require $pun_root.'include/common.php';

$result = $db->query('SELECT num_replies+1 FROM '.$db->prefix.'topics WHERE id='.$topic_id) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
$num_posts = intval($db->result($result, 0));

exit('Topic has '.$num_posts.' posts.');

?>

Just replace the value 3160 with the ID for the topic.

Yes, both those functions are used in a lot of PHP scripts, so I would recommend that you do that if it's possible.

Aha. I guess your ISP has disabled that function. Try putting a @ just before ini_set.

Edit: Wait a minuter. There already is a @ before that function call, so you shouldn't see an error message.

Have you installed a lot of mods or made a lot of change to the code? If not, I really recommend that you upgrade to the latest version (1.1.1 as we speak). I've included a script in 1.1.1 that synchronizes the topics and forums after something like that has happened. In 1.2, I will make it easier to get rid of massive spam like that.

Edit. If you do decide to upgrade, please remember that you must do it in steps. First 1.1 and then 1.1.1. You can skip 1.0.1.

6,622

(14 replies, posted in PunBB 1.2 troubleshooting)

Well, that shouldn't happen. The only reason the error message "There is no valid language pack 'en' installed." would appear is if $language is in fact set to 'en' in config.php. Are you absolutely sure you've changed it? You couldn't just have edited the wrong config.php or forgotten to upload it or something?

6,623

(11 replies, posted in PunBB 1.2 discussion)

Ah, ok :)

The reason I added RSS support was so that people could use an RSS feed reader to "keep up" with the forums without actually having to check them. Oh, well. With XML, just about anything is possible :)

6,624

(1 replies, posted in PunBB 1.2 troubleshooting)

Have a look at line 693. There a look that adds quotes and runs escape() (i.e. addslashes()) on all elements in $_POST['form']. Then look at the UPDATE queries on lines 723 and 736 and look for implode(',', $temp).

6,625

(11 replies, posted in PunBB 1.2 discussion)

Hmm, that's not an RSS feed?

Here are the RSS feeds for these forums:

- New topics
- Recently active topics