At line 96 in AP_News_Generator.php I suggest a change of the query to the following:

$time = mktime(0, 0, 0, 1, $month_start, $year_start);
$result = $db->query('SELECT id, subject FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.' AND posted>='.$time.' AND posted<'.$time.' ORDER BY posted DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

The reason is that UNX_TIMESTAMP() does not exist in PostgreSQL

Hi,

This looks like a very nice mod! The birthday functionality requires changes to an already existing database table and it is also responsible for most of the changes to the main code. Not having a birthday feature would make installation easier!

Gh()sT wrote:

Can someone confirm that this works on 1.2.1 bug-free?

Also, when can we expect the full release?

-Gh()sT

THIS IS A BETA!!! MAKE BACKUPS!!! DO NOT USE ON A LIVE SITE!!!!!

That actually means that it works on 1.2.1 bug-free, it's just a new way of saying it smile

I had to migrate from MySQL to PostgreSQL yesterday. At first I tried to use use some convertion script but they didn't work. Possibly because I use MySQL 4.0. In case anyone else needs to do this I thought I could document the procedure here. Most of this will probably apply if you need to go the other way too, with only minor modifications.

1. Dump your MySQL database with

mysqldump punbb > mysql-dump.sql

2. Edit mysql-dump.sql and delete anything but the "INSERT INTO ..." entries for categories, forums, groups, posts, rank, topics, users. Replace all back quotes `around identifiers with double quotes ", a global search and replace worked for me.

3. Create a new postgres database with createdb, and setup a version of PunBB to use this new postgres database by running install.php.

4. Dump the new postgres database with the command

pg_dump punbb-pg > postgres-dump.sql

5. Edit postgres-dump.sql and delete all the "COPY ..." statements for the corresponding tables that you DID NOT delete in mysql-dump.sql. You will also need to update some of the counters at the end of postgres-dump.sql, these read "SELECT pg_catalog.setval(...)", you need to use a higher number than you insert in mysql-dump.sql.

6. Create a second postgres database.

7. Import the data into the new postgres database with

psql punbb-pg2 < mysql-dump.sql
psql punbb-pg2 < postgres-dump.sql

If this fails, figure out what went wrong, edit the dumps, recreate punbb-pg2 and try again.

8. Check if your new database works!

Connorhd wrote:

yes you use a program called patch but you need shell(ssh) access to your server

It is not necessary although it makes patching somewhat easier, you can download the punbb-files and then use diffutils on your local machine, and upload the files again. If you run unix locally, diffutils may already be installed, otherwise just install it. For windows there are a few alternatives, you could use the version from http://www.gnu.org/software/diffutils/diffutils.html or the version in the MinGW suite at http://www.mingw.org/download.shtml located in the MSYS module. I'm sure CygWin also includes a version of diffutils. The MinGW suite is truly nice - it provides a Unix-like environment with a good shell inside a nice terminal and it is not as bloated as CygWin. Highly recommended if you have to use Windows!

To apply the patch, enter the punbb-directory in a shell and type

/path/to/patch -p2 < /path/to/some.patch

If there are conflicts you will get .rej-files, and these you will have to examine and apply by hand, much the same way as you would usually go about applying a punbb-patch.

Ulf