280MB is not huge by any means. Furthermore, DB size does not normally affect resource usage; having more simultaneous users does.

They really aren't comparable, it's like asking the difference between a search engine and a discussion forum. A CMS is a software program designed to help you manage a site; a portal is a type of website or webpage page that directs you to various other websites or pages, kind of in a hierarchy.

3

(24 replies, posted in PunBB 1.2 troubleshooting)

Smartys wrote:

How would you associate the CAPTCHA data with the guests I think you would end up either reimplementing PunBB's system or reimplementing the PHP session system. In either case, using the existing system is better than writing your own, if only for the assurance that it just works. tongue

I would do something like this rather than use sessions or adding a column to online table:

create table captchas ( captcha_id varchar(16) not null primary key, captcha_code varchar(6) not null, timestamp timestamp not null default now() );

In register.php
- generate random captcha_id, random captcha_code, insert them into the captchas table
- add hidden form field to register form for captcha_id
- call image generating php script with captcha_id in query string
- when submitted, compare the entered captcha code to captcha_code in the db

Hmm, you could also generate the image within register.php and save it with some random name, and use an hmac/salted hash  in the hidden form field, then you need neither cookies nor a db table. But you would need a script to delete the old images.

4

(2 replies, posted in Programming)

The only difference I can see is the SERIAL columns. The equivalent of "SERIAL" in MySQL is "INT NOT NULL AUTO_INCREMENT". However, you can't have more than one auto_increment column in one table in MySQL, so you'll have to change your disp_position to something else. Other than that it should work fine.

5

(24 replies, posted in PunBB 1.2 troubleshooting)

Yes, adding a column to the online table does not sound like a good idea, but why would you do it like that instead of having a seperate table just for captchas? Not trying to argue, as I do agree that using mods for spam protection is good because then everyone's is a little different smile Just a hypothetical question I guess.

6

(47 replies, posted in Programming)

I don't think the PayPal API is that bad. Can those of you who want a PayPal mod give a little more detail on what you're looking for?

7

(24 replies, posted in PunBB 1.2 troubleshooting)

Why is adding a table not a good option? Just curious.

8

(19 replies, posted in PunBB 1.2 troubleshooting)

b0ne wrote:

I tried removing all of the footer coding except my closing div, body and html tags and still get the error. It appears that it's the changing exit($tpl_main) to echo($tpl_main) is the cause but I can't figure out why? I even tried just making that change without including my own footer file and still get the errors.

You can't change exit to echo, they aren't the same thing. For example profile.php has in numerous places the following line:

require PUN_ROOT.'footer.php';

and it expects the script will stop at that line.  If you change the exit to echo, it will continue on doing things that aren't supposed to happen.

9

(10 replies, posted in PunBB 1.2 troubleshooting)

Another option is to set up a redirect so that you can only log in from one domain.

10

(5 replies, posted in Programming)

Then you need to get the form variable first.  Add the following to the beginning of your index.php:

$lang = $_GET['lang'];

11

(5 replies, posted in Programming)

Is $lang set correctly? Is "register globals" enabled on your PHP setup? Try adding the following to the bottom of your page:

<?php echo "The language you selected is $lang"; ?>

FYI It is recommended you NOT use register globals for security reasons.

12

(12 replies, posted in Programming)

Create a new table with the columns you want, copy the contents of original table to the new one, drop the original, and then create another new table with the original name and copy the contents again. You can wrap the whole thing in a transaction if you want.

CREATE TEMPORARY TABLE mytable2 (col1, col2, col3);
INSERT INTO mytable2 SELECT col1, col2, NULL [or default value for col3] FROM mytable;
DROP TABLE mytable;
CREATE TABLE mytable (col1, col2, col3);
INSERT INTO mytable SELECT col1, col2, col3 FROM mytable2;
DROP TABLE mytable2;

13

(12 replies, posted in Programming)

Rickard wrote:

No, SQLite 2 has ALTER TABLE ADD COLUMN support.

That's incorrect. Alter table add column was not added until SQLite 3.2.0. See http://www.sqlite.org/changes.html.

Just to make sure I tried it out myself.

C:\>sqlite3
SQLite version 3.2.1
Enter ".help" for instructions
sqlite> create table sometable (col1 int, col2 int);
sqlite> alter table sometable add column col3 int;
sqlite>
C:\sqlite2_8_17>sqlite.exe
SQLite version 2.8.17
Enter ".help" for instructions
sqlite> create table sometable (col1 int, col2 int);
sqlite> alter table add column col3 int;
SQL error: near "alter": syntax error
sqlite>

14

(12 replies, posted in Programming)

Check what version of SQLite you are using. ALTER TABLE ADD COLUMN did not come until SQLite 3.2.

15

(7 replies, posted in PunBB 1.2 troubleshooting)

What does the table look like?

16

(2 replies, posted in Programming)

Actually, I figured out a way to do this with one query (this won't work on MySQL 4.0.X or earlier, though). I tried it out myself on your test data and the result is exactly what you wanted.

SELECT idx, relate_idx, creation FROM table WHERE (relate_idx, creation) IN (SELECT relate_idx, max(creation) FROM table GROUP BY relate_idx) ORDER BY creation DESC;

17

(5 replies, posted in Programming)

Dunno if you figured it out already or not, but figured I would post anyway in case someone else had this problem.

Since your pattern is two characters (read "any character except backslash followed by a percent sign"), both characters will be replaced. You need to put the first character back in.  In the pattern, put parenthesis around the first character, and then prefix the replacement with \1.

preg_replace('/([^\\\\])%/', \1 . $this->literal, $formatting);

I selected it because it's fast and efficient and the default theme/layout is simple and clean. Most other forums are so visually cluttered it makes my head spin.

19

(19 replies, posted in PunBB 1.2 discussion)

I am using PunBB for a support forum for a web application I designed. Actually, it's not officially live yet, but it will be soon. Anyway, I expect very little traffic (less than a few posts per day) so went with SQLite.  SQLite is also useful for testing, since it's easy to configure and the data is all in one file.