1

(4 replies, posted in PunBB 1.2 discussion)

Go into your Administration -> Options and save changes. I think that should fix it. smile

2

(4 replies, posted in PunBB 1.2 discussion)

Try removing all styles except the one you wish to use.

Each method has advantages and disadvantages.

Cookies:

Advantages
* Easy to set, and keep track of
* Little server overhead

Disadvantage
* Easily modified, unset, and ignored by user / spam bot
* What happens if the user doesn't support cookies? (I know rare, but it happens)

Sessions:
Advantages:
* Easy to use
* Cannot be changed by user

Disadvantages:
* PHP seems to store the Session ID in a cookie meaning we have the same problem as we do with cookies.
* Disappears when we close the browser (I think - personally don't use sessions at all)

IP Address (with Database):
Advantages:
* Generally Consistent
* Does not count on the user being able to store data between page views (all server side)

Disadvantages:
* Can be changed using a proxy
* If database is not cleaned when needed - results in a big table
* Usually not static

I personally would go the IP address method.

It should be pretty easy to do. I don't have time to throw some code up at the moment, but if nobody has posted anything by this time tomorrow I will put a solution up.

Basicly if you know PHP or not, it should still be pretty easy to do.

http://hudzilla.org/phpwiki   

1. Add a new field to your users table using phpMyAdmin.
2. Add the HTML to the appropriate parts of register.php and profile.php (http://htmldog.com)
3. Add to the SQL query's in the appropriate parts of register.php and profile.php

5

(14 replies, posted in General discussion)

So you want to do for PunBB what YaBB SE (PHP) did for YaBB (Perl)?

6

(11 replies, posted in PunBB 1.2 troubleshooting)

http://punbb.org/forums/viewtopic.php?id=13471

I did not investigate your problem (I can't run IE7 as I only have XP SP1, not SP2 - last time I attempted to install SP2 damn computer froze) but I assume the above will fix your problem.

7

(3 replies, posted in PunBB 1.2 discussion)

The developers work on PunBB when they have the time and are motivated. Meaning some weeks lots of code changes are made, other weeks little or no changes are made to the source code. I believe they are aiming for a release before Easter but don't be surprised if it is released earlier or later.

8

(2 replies, posted in PunBB 1.2 troubleshooting)

If both your old installation and new installation are located in the same database, just open your config.php and change the db_prefix to that of your old one.

If they are on different databases, either modify your config.php on your new install to the db details of the old one or:

Export your old database.
Empty the new database
Import the old database
Modify config.php to reflect any changes with the db_prefix.

If you only have the backup, import it after emptying the database of your new installation and modify config.php as necessary.

I'm hoping this will happen at least for security issues as I am in the process of developing an online game using PunBB 1.2.x as a base.  Since I have already modified a lot of files and even rewrote some although the game is no where near complete it will be a pain to port all the changes over to PunBB 1.3.

10

(4 replies, posted in General discussion)

I don't really think it adds anything new to a phone though. It is basically a $800 Smart phone running a custom Apple OS with a larger hard drive and the Apple Branding. Since it is branded as a Apple product it will be successful but it is hardly unique as existing Smart phones offer the same functions.

11

(35 replies, posted in General discussion)

DNS stands for Domain name system.

http://en.wikipedia.org/wiki/DNS

You use it to join your domain name with your hosting account. Your hosting provider will provide two name servers (ns1.host.com and ns2.host.com or something like that - changes for each host) that you need to enter (their will be a form in the control  panel) somewhere at the website of the company you brought it from. Once that is done, log in to your Host monster account and look for a place in your Control Panel that says something along the lines of domain. Their should be a form where you can enter the domain name you just entered the name servers for.

12

(4 replies, posted in Programming)

It works.

I did have a few problems initially where the script was timing out but it turns out I had made a change to my dice function that I should not have. Replacing it with the dice function I had in my dice test file and adding the line of code you suggested fixed the problem, so the dice roller now works as intended.

Thank you.

13

(4 replies, posted in Programming)

Thank you, I will try it.

14

(4 replies, posted in Programming)

I have the following PHP function which I use to roll a dice using the d20 format (2d6+2 for example) for describing the role.

function dice($rollwhat) {

        $ex = explode("d",$rollwhat);
        $diceroll = 0;
        if (eregi("\+",$rollwhat)) {
                $ex2 = explode("+",$ex[1]);
                for ($i = 1; $i <= $ex[0]; $i++) {
                        $diceroll = round($diceroll + rand(1,$ex2[0]));
                }
                $result = round($diceroll + $ex2[1]);
        } elseif (eregi("-",$rollwhat)) {
                $ex2 = explode("-",$ex[1]);
                for ($i = 1; $i <= 10; $i++) {
                        $diceroll = round($diceroll + rand(1,$ex2[0]));
                }
                $result = round($diceroll - $ex2[1]);
        } elseif (eregi("%",$rollwhat) || eregi("100",$rollwhat)) {
                $ex[1] = str_replace("%","",$ex[1]);
                if (eregi("\+",$rollwhat)) {
                        $ex2 = explode("-",$ex[1]);
                        for ($i = 1; $i <= $ex[0]; $i++) {
                                $dice1 = rand(0,9);
                                $dice2 = rand(0,9);
                                $combine_rolls = $dice1."".$dice2;
                                if ($combine_rolls==00) $rolled = 100;
                                else $rolled = $combine_rolls;
                                $diceroll = round($diceroll + $rolled);
                        }
                        $result = round($diceroll + $ex2[1]);
                } elseif (eregi("-",$rollwhat)) {
                        $ex2 = explode("-",$ex[1]);
                        for ($i = 1; $i <= 10; $i++) {
                                $dice1 = rand(0,9);
                                $dice2 = rand(0,9);
                                $combine_rolls = $dice1."".$dice2;
                                if ($combine_rolls==00) $rolled = 100;
                                else $rolled = $combine_rolls;
                                $diceroll = round($diceroll + $rolled);
                        }
                        $result = round($diceroll - $ex2[1]);
                } else {
                        for ($i = 1; $i <= $ex[0]; $i++) {
                                $dice1 = rand(0,9);
                                $dice2 = rand(0,9);
                                $combine_rolls = $dice1."".$dice2;
                                if ($combine_rolls==00) $rolled = 100;
                                else $rolled = $combine_rolls;
                                $diceroll = round($diceroll + $rolled);
                        }
                        $result = round($diceroll);
                }
        } else {
                for ($i = 1; $i <= $ex[0]; $i++) {
                        $diceroll = round($diceroll + rand(1,$ex[1]));
                }
                $result = round($diceroll);
        }
        
        return $rollwhat." = ".$result;

}

The function works as expected when I call it using:

<?php

// function seen above here

echo dice("2d9+9"); //returns: 2d9+9 = the result of the role

?>

The problem I'm having results when attempting to implement it as BBcode within PunBB.

I have added the function dice to the functions.php file in the include directory.

I have added the following code to post.php aswell as the parse_message function as I don't want the dice rerolling everytime someone refreshs the page. It is before the SQL query to add messages to the database.

$message = preg_replace('#\[diceroll\](.*?)\[/diceroll\]#s',dice('$1'),$message);

My problem is that the result for the dice roll is always 0 which is impossible to roll as seen in the function.

As I mentioned earlier, calling the function with echo dice("1d6+2"); works correctly.

Why is this happening and how can I fix it?

Thanks in advance.