6,876

(5 replies, posted in Feature requests)

I think that's a possible feature for 1.3
In the meantime, it could be done as a mod

6,877

(19 replies, posted in Feature requests)

If you make it a mod wink
There are issues with it (the fact that the pic might not exist, might not fit the max width/height, could be an image file served by the server holding it as PHP, etc).

6,878

(8 replies, posted in Feature requests)

Erm, what would the point of that be? If people can just pick up copies of threads via Google's cache, then why keep it so you need to register to view? A mod could be written, obviously, but this doesn't seem like a very good feature, and not a very useful one for most people

6,879

(6 replies, posted in PunBB 1.2 bug reports)

Well, if you're banned you can't see the forum wink
It's easy enough to add the lines so that banned people can't view it

6,880

(1 replies, posted in Feature requests)

I was messing around, and I realized that it was possible to do the version check with allow_url_fopen disabled using fsockopen.
My code:

if ($action == 'check_upgrade')
{
    if (!ini_get('allow_url_fopen'))
    {
        $latest_version = '';
        $fp = @fsockopen("www.punbb.org", 80, $errno, $errstr, 30);
            
        $out = "GET /latest_version HTTP/1.1\r\n";
        $out .= "Host: www.punbb.org\r\n";
        $out .= "Connection: close\r\n\r\n";
    
        fwrite($fp, $out);
        while (!feof($fp))
        {
            $latest_version .= trim(@fread($fp, 128));
        }
        $latest_version = explode("\n", $latest_version);
        $latest_version = array_pop($latest_version);
        @fclose($fp);
    }
    else
    {
        $fp = @fopen('http://punbb.org/latest_version', 'r');
        $latest_version = trim(@fread($fp, 16));
        @fclose($fp);
    }

Of course, you could use fsockopen for everything to simplify it.

6,881

(6 replies, posted in PunBB 1.2 bug reports)

People who are banned can still "read" the forums somewhat by using extern.php, because bans are never checked

Attachment Mod?

6,883

(7 replies, posted in General discussion)

Are you sure you updated it properly? Because searching for ""Hacked By Rain | Team" + punbb" gives me textpattern.de's forum, which was 1.2.5 and is currently offline

6,884

(13 replies, posted in General discussion)

Happy birthday Rickard smile

Well, that's a modded index page. Download a fresh copy of 1.2.6

6,886

(9 replies, posted in Feature requests)

post.php

6,887

(1 replies, posted in PunBB 1.2 bug reports)

    switch ($db_type)
    {
        case 'mysql':
        case 'mysqli':
            $sql = 'CREATE TABLE '.$db_prefix."config (
                    conf_name VARCHAR(255) NOT NULL DEFAULT '',
                    conf_value TEXT,
                    PRIMARY KEY (conf_name)
                    ) TYPE=MyISAM;";
            break;

        case 'pgsql':
            $sql = 'CREATE TABLE '.$db_prefix."config (
                    conf_name VARCHAR(255) NOT NULL DEFAULT '',
                    conf_value TEXT,
                    PRIMARY KEY (conf_name)
                    )";
            break;

        case 'sqlite':
            $sql = 'CREATE TABLE '.$db_prefix."config (
                    conf_name VARCHAR(255) NOT NULL DEFAULT '',
                    conf_value TEXT,
                    PRIMARY KEY (conf_name)
                    )";
            break;
    }

    $db->query($sql) or error('Unable to create table '.$db_prefix.'online. Please check your settings and try again.',  __FILE__, __LINE__, $db->error());

should be config instead of online in the error wink

6,888

(14 replies, posted in PunBB 1.2 bug reports)

No reason, I just like it better that way smile

I'm surprised no one told me that the original fix didn't work hmm

Because of course I'm an idiot smile
I just edited my original fix to reflect the correct usage of array_key_exists, try using that instead

Queen Elizabeth II wrote:

(and now I also got some PHP error msg that flashed by briefly when applying changes).

Change redirect time to a longer period (so you have time to see the error) and copy/paste the error here. Change redirect time back after, of course

Well, if you used the fix, then the problem shouldn't be there again
I'll check when I get home

6,893

(3 replies, posted in PunBB 1.2 troubleshooting)

Works fine for me...
Did you mod admin_reports.php or misc.php ?

FIND

$sql = 'SELECT p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, '.$substr_sql.'(p.message, 1, 1000) AS message, t.id AS tid, t.poster, t.subject, t.question t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.id IN('.$search_results.') ORDER BY '.$sort_by_sql;

REPLACE WITH

$sql = 'SELECT p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, '.$substr_sql.'(p.message, 1, 1000) AS message, t.id AS tid, t.poster, t.subject, t.question, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.id IN('.$search_results.') ORDER BY '.$sort_by_sql;

t.question didn't have a comma after it

6,895

(14 replies, posted in PunBB 1.2 bug reports)

It's a problem with admin_options.php

The fix:

FIND

        // Only update values that have changed
        if (isset($pun_config['o_'.$key]) && $pun_config['o_'.$key] != $input)

REPLACE WITH

        // Only update values that have changed
        if (array_key_exists('o_'.$key.'', $pun_config) && $pun_config['o_'.$key] != $input)

The problem is when values are NULL, isset is false, whereas array_key_exist is true

Edited to fix my being an idiot smile

http://punbb.org/docs/install.html

Email it to Rickard

"Plain" as in "unmodded", straight from the download

6,899

(6 replies, posted in Feature requests)

Jérémie wrote:

A directory can be writable and yet not be a 777. It would not be nice to silently force a 777 chmod if it's not needed.

I wasn't suggesting using 777, I said to replace it with whatever it should actually be tongue

Tobi wrote:

I think this does not make very much sense.

The script is run by the webserver.
The webserver is usually run as "www" or "nobody" and can only chmod files that it owns.

So, if the webserver already owns the directory it makes no sense chmoding it because nobody else will write in it.
If not the webserver will not be allowed to chmod it anyway.

No, sorry, I don't see the point. But maybe I'm just blind..,

I had someone I know install PunBB, the folders were there but weren't writable by the webserver. I think you're right, that chmod didn't work for him, but in that case isn't mkdir for those folders a good idea?

6,900

(1 replies, posted in Feature requests)

Well, you could discuss it with Chacmool, since he created the unified convertor