1

(1 replies, posted in PunBB 1.3 troubleshooting)

Took a while, but I figured it out, so n/m.  There aren't very many people on this forum, are there?   Shame...

2

(2 replies, posted in PunBB 1.3 troubleshooting)

Hi Jo,

It would appear that MySQL isn't running.  Try typing in terminal window:

RedHat (Fedora/CentOS)
/etc/init.d/mysqld start

Ubuntu:
/etc/init.d/mysql start

And then give the setup another whirl.

Looks like it's not able to access the stylesheets, or it's looking in the wrong folder for the CSS files.  Double check your config.php and make sure the base URL is correctly set.

Ideally, the tag would probably trim whitespace from the ends, and substitute the rest of the spaces with %20.  Clearly, it doesn't do that, as it would be difficult to differentiate where your URL beings and ends, unless you specifically encapsulate it in the URL tags.  For example, if you had:  My website www.foo.bar/ajax/ is having a problem with the /index.html file.  How would the BBS know, unless explicitly encapsulated with the URL tags, that you don't mean:  "www.foo.bar/ajax/ is having a problem with the /index.html" with an actual folder name " is having a problem with the " containing the index.html?

So, just use %20 in place of spaces if required.

www.someplace.com/this%20is%20a%20url.html

If you're using Safari web browser and click on the above link, you'll see the %20 show up as spaces in the URL bar.

Hey All,

I'm working on an extension that adds dice rolling and validation functionality for the numerous play-by-post games run on my forum.  My original code was embedded in PunBB 1.2.x, and so I've been in the process of porting it to the newer (and OMG, much nicer...) extension format.

Anyway, I'm getting erroneous results from my query, and I'm not sure why.  The query:

$query = array(
                'SELECT'    => 'rolls',
                'FROM'        => 'dice_rolls',
                'WHERE'        => 'id='.$pid.' AND topic_id='.$id.' AND top=1'
            );
            
            $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);

The result I'm getting is, "Resource id #<some number>" instead of the expected values from the `rolls` field.

(VERY old bump, I know, but this is a problem I've run into as well, and I dunno if it's been addressed yet or understood what the problem is.)

Warhaven wrote:
PHPLizardo wrote:

Yes it doesn't neutral

[Category 1]
(Private Thread for Group A)
(Private Thread for Group B)
(Public Thread A)
(Public Thread B)

[Category 2]
(Public Thread A)
(Public Thread B)

...

On my forum, we have several play-by-post games running where each game is only visible to the players participating in that game.  It is not uncommon, however, to have users participate in multiple games.  Since PunBB only allows one group per person, it's not practical to create a new group for every combination of categories and/or threads a user might be privy to viewing:

View Categories 1
View Categories 2
View Categories 3
View Categories 4
View Categories 1, 2
View Categories 1, 3
View Categories 1, 4
View Categories 2, 3
View Categories 2, 4
View Categories 3, 4
View Categories 1, 2, 3
View Categories 1, 2, 4
...

It would very quickly get out of hand with only three or four categories and couple private threads, not to mention applying all those different combinations of groups to each and every category and private thread.  It would be easiest if User A, who is participating in games in [Category 1] and [Category 2] to simply be a member of groups View Category 1 and View Category 2.

It would greatly simply permissions management.

PHPLizardo wrote:

Yes it doesn't neutral

[Category 1]
(Private Thread for Group A)
(Private Thread for Group B)
(Public Thread A)
(Public Thread B)

[Category 2]
(Public Thread A)
(Public Thread B)

...

On my forum, we have several play-by-post games running where each game is only visible to the players participating in that game.  It is not uncommon, however, to have users participate in multiple games.  Since PunBB only allows one group per person, it's not practical to create a new group for every combination of categories and/or threads a user might be privy to viewing:

View Categories 1
View Categories 2
View Categories 3
View Categories 4
View Categories 1, 2
View Categories 1, 3
View Categories 1, 4
View Categories 2, 3
View Categories 2, 4
View Categories 3, 4
View Categories 1, 2, 3
View Categories 1, 2, 4
...

It would very quickly get out of hand with only three or four categories and couple private threads, not to mention applying all those different combinations of groups to each and every category and private thread.  It would be easiest if User A, who is participating in games in [Category 1] and [Category 2] to simply be a member of groups View Category 1 and View Category 2.

It would greatly simply permissions management.

8

(4 replies, posted in PunBB 1.2 troubleshooting)

Okay, I figured out what I was doing wrong.  For those of you who may have been wondering...:

Add the e flag to your regex pattern.  It'll tell preg_replace to treat your replacement text as code instead of a simple string substitution.

$pattern = '#\[nilbog\](.*?)\[/nilbog\]#e');  // <-- e flag here.
$replace = 'do_nilbog(\'$1\')';  // <-- function here
$text = "[nilbog]Hello![/nilbog]";
preg_match($pattern, $replace, $text);  // $text is now "!olleH"

9

(4 replies, posted in PunBB 1.2 troubleshooting)

Let me rephrase my question:

How is the handle_url_tag() function being called in the parser.php file from within a string?

$replace = array('<strong>$1</strong>',
'<em>$1</em>',
'<span class="bbu">$1</span>',
'handle_url_tag(\'$1\')',
'handle_url_tag(\'$1\', \'$2\')',
'<a href="mailto:$1">$1</a>',
'<a href="mailto:$1">$2</a>',
'<span style="color: $1">$2</span>');

I'm a little confused because the function stored in a string, but somehow being called and properly replacing ubbCode with html tags.

10

(4 replies, posted in PunBB 1.2 troubleshooting)

I have a simple UBB tag I'm attempting to implement, but it's been less than successful.

Added my simple tag here:

$pattern = array('#\[b\](.*?)\[/b\]#s',
'#\[i\](.*?)\[/i\]#s',
'#\[u\](.*?)\[/u\]#s',
'#\[url\]([^\[<]*?)\[/url\]#e',
'#\[url=([^\[<]*?)\](.*?)\[/url\]#e',
'#\[email\]([^\[<]*?)\[/email\]#',
'#\[email=([^\[<]*?)\](.*?)\[/email\]#',
'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
'#\[nilbog\](.*?)\[/nilbog\]#s');

And my preg_replace here, which is a call to function do_nilbog:

$replace = array('<strong>$1</strong>',
'<em>$1</em>',
'<span class="bbu">$1</span>',
'handle_url_tag(\'$1\')',
'handle_url_tag(\'$1\', \'$2\')',
'<a href="mailto:$1">$1</a>',
'<a href="mailto:$1">$2</a>',
'<span style="color: $1">$2</span>',
'do_nilbog(\'$1\')');

Now, my PHP is a little fuzzy, but can I call a function within a string literal?  I see it being done here with handle_url_rag, but in my case, it's not calling the function, only (and expected) the variable is being used.

11

(3 replies, posted in PunBB 1.2 discussion)

I've spent about an hour trying to find directions for installing a style, and haven't found anything.  I'm using PunBB 1.3 under OS X Leopard.  I generated a style using Spink and followed the directions, but Oxygen is the only option that comes up.  Attempted to look in the wiki "documentation" for answers, but 75% of the pages haven't been created yet.  There are two entries, one which displays pictures of themes, and another which briefly talks about styles -- but neither of them actually tell you how to install either one.

Any helpful suggestions?

[edit] Oops.  I suppose this should be in troubleshooting.