Just put up some google adds and host your mods on only that site (with the adds), then whine alot and get people to click on the g-adds. And ask for donations to your beer fund too! big_smile

EDIT --

Could always add admin/moderator viewable adds to any site that uses your mods too... (that ways only the "original installer" get's to see the adds, but they see them every day).

Sweet yah... now the pdo_sqlite dblayer is a litle more functional... lol ~.~

Now I have to track down a problem with loading up the $pun_user variable 0.o

EDIT --

Is it safe to assume that only non-altering sql commands (ie: SELECT is good, but DROP TABLE, or INSERT are things that alter the database) will use a call to $db->fetch_row or $db->fetch_assoc or $db->num_rows or $db->result?
With pdo, every fetch removes a row of data permanently, and the command needs to be executed again to re-populate the data of a SELECT, or what not.

EDIT --

Anyone have a premade "test_dblayer.php"? I need to find out what my pdo_sqlite isn't doing right that the sqlite backend is doing right. It's got to do with the differnt ways that sqlite (which I based my backend on) and pdo return fetches, and alter thier data structures after doing said fetch.

elbekko wrote:

$db->query() should always return a public MySQL resource.

Sorry, I'm brain dead... by public MySQL resource, you meen something that print_r($result) would spit out:

Array (
    [apple] => [red]
    [orange] => [orange]
)

Or could I return, say a PDOStatement object, for use in each call to $db->fetch_assoc?

I'mah try with the PDOStatement object and see what happends o.0

Could the value returned from $db->query be a private data structure that can only be viewed with $db->fetch_assoc or $db->fetch_row or $db->result? I'm having the odd error, here and there. Makes me wonder if the $result data is expected to be an array when returned from $db->query on occation.

http://www.gnu.org/copyleft/lesser.html
http://www.gnu.org/licenses/why-not-lgpl.html

Here's two links, the second explains the difference between the two GNU licencess. Basically, if it's GPL, anything that looks sideways, through a kalidascope at the code, has to itself be GPL. LGPL let's prorietary software look sidesways, through a kalidascope though.

281

(1,382 replies, posted in General discussion)

Killer instinct

282

(5 replies, posted in PunBB 1.2 troubleshooting)

Upgrade to linux and all your problems will disapear big_smile

On a less serious note, if you use sqlite (or maybe some of the other databases) they can't make asyncronous queries (in part or in full). Try a different type of database and compare the speeds you get.

Can always write a plug-in to display the last 5 posts (or a link to the last 5 posts) in forum "reviewed stories".

As for the second, you should be able to disable "viewing" forum "recently-submited-stories" but allow "posting" to forum "recently-submited-stories". No link shows up to allow people to post to stories forum, but you should be able to make your own link. As an admin check the forum stories, and click on the post button. You should get a link, that's something like this:

"http://<my url>/<forum path>/post.php?fid=XXX"

XXX is a number indicating the forum topic new posts are made to. Just add that link into the menu at the top of the page, so people have:

[PunBB.org] [Index] [User list] [Rules] [Search] [Profile] [b][Submit my story][/b] [Logout]

It may require a litle php know how and some editing of the punbb php scripts, but you should be able to get something functional. Could also add a database entry to table users, as a bool/int that indicates if someone has already submitted thier story. What you end up with is a forum topic that has unreviewed stories, and as you review them (or another mod reviews them) they are moved to the revied-stories topic. The newest 5 reviewed-stories posts get a link on the main page (by using some php and sql know-how).

284

(5 replies, posted in PunBB 1.2 discussion)

If your on *nix just download the sqlite file, type:
$ sqlite <database> ".dump" > commands.to.input

Then you can open pgsql and copy and past from the commands.to.input text file. Course It's better to recreate the database in pgsql and then import each individual INSERT command. Some minor speed and stability improvements are added in to each CREATE command depending on the database type.

Thanks, now I have a moderatly functioning punbb with pdo_sqlite support big_smile

PS: Your not stalking me smatys, your stalking EVERYBODY!!! AHAHAHAHA Runnnnnnnnnaaaaaawaaay!

tongue

Isn't there a GPLess or something? I think wine, or SDL uses it to allow companies to release software that uses thier libraries but is copyrighted under a different licence. But as far as I know GPL doesn't let you.

Hookais, so I've been coding a pdo_sqlite db abstraction layer, and I've managed to get to the point where install.php runs, creats the sqlite3 database, and spits out a config.php. When I go the the index.php page (or any of the other pages), I get this error:

There is no valid language pack '' installed. Please reinstall a language of that name.

I've managed to narrow down the cause of the error to include/functions.php in function set_default_user() (line 103-128)

    $pun_user['disp_topics'] = $pun_config['o_disp_topics_default'];
    $pun_user['disp_posts'] = $pun_config['o_disp_posts_default'];
    $pun_user['timezone'] = $pun_config['o_server_timezone'];
    $pun_user['language'] = $pun_config['o_default_lang'];
    $pun_user['style'] = $pun_config['o_default_style'];
    $pun_user['is_guest'] = true;

Before assigning $pun_config['o_default_lang'] to $pun_user, pun_user uses lang English, but after it uses NULL or "" as the language.

$ sqlite3 <database path> ".dump"
...
INSERT INTO "config" VALUES('o_default_lang', 'English');
INSERT INTO "config" VALUES('o_default_style', 'Oxygen');
INSERT INTO "config" VALUES('o_default_user_group', '4');
...

Looks like the database knows it's there... and the db abstraction layer has no trouble pulling out the info from table users, row guest (or row 0).

Anyone know where in the code pun_config get's it's assignment? I've tried greping, but couldn't find the line hmm

288

(6 replies, posted in PunBB 1.2 troubleshooting)

Just write a php script to read the database?

The posts table in the database holds post (I'm assuming with the highest id value being the newest). Then there's the topic id which I'm sure could get you the url directly with something like "<relative path to forum>/viewpost.php?id=$topic_id".

NOTE: I say ~something like~ because my forum is currently down, while I code a god dam pdo_sqlite.so db abstraction layer! So don't come crying to me when you find out to see the last 5 posts you need to write 30 lines of php code!

289

(3 replies, posted in PunBB 1.2 troubleshooting)

Change the permissions on catch to 777 (world read, write, and executable)
Change the permissions on all files in the catch dir to 666 (world read/writeable)

PS: You can modify the above depending on your know how of your server. chown to the web user, and or group, and give only that user and/or group permissions to read/write to them files and dir (edit: but don't disallow your ftp user account read/write access!!!). Also some webservers don't need executable permission to allow php, cgi etc.. to view and modify the content of that directory).

PPS: There's a couple directories/files that need write permission to function correctly, for example to allow uploading of avatars <install-dir>/img/avatars needs to be writable by the web user.

290

(4 replies, posted in Feature requests)

lol, your always one step ahead of me smartys big_smile

291

(4 replies, posted in Feature requests)

sqlite (v2.x) != sqlite3 (v3.x)

$ sqlite3 temp.db3 "BEGIN TRANSACTION; CREATE TABLE blah (id INTEGER NOT NULL); COMMIT;"
$ sqlite3 temp.db3 ".dump"
BEGIN TRANSACTION;
CREATE TABLE blah (id INTEGER NOT NULL);
COMMIT;
$ sqlite temp.db3 ".dump"
Unable to open database "temp.db3": file is encrypted or is not a database

sqlite3 adds support for many things that were missing from sqlite, but would slow down sqlite. So you want a fast simple database, use sqlite. You want a kindah fast database with some extras use sqlite3.

EDIT --

Reverse the above; sqlite3 test.db ".dump" on a sqlite db will spit out

BEGIN TRANSACTION;
COMMIT;

Regadless of how much or what kind of data you have in the database.

EDIT --

Well I've managed to get a sqlite3 database to be created... But "CREATE TABLE X(Y);"  never get's commited... even if I call $db->start_transaction() before $db->query() and $db->end_transaction() after the query... This is all done with the install.php script, in a clear punbb install (no mod or databases, etc...).

Anyone one know of an alternative to the php5-sqlite3 mod? I've hurd PDO might work with some effort?

292

(4 replies, posted in Feature requests)

Any word on when sqlite3 support will be avalible? I did a quick search of the forums and found a post asking for sqlite3 support from 2005, but nothing since. Anyone out there know what parts of the php code would have to be updated if I coded my own ./include/dblayer/sqlite3.php file? I can migrate the database myself, but need punbb to support sqlite3 for one of the mods I use.

@Smartys Public libraries in my area only have basic web access (no downloading content, 90% of shortcut keys disbled, etc..), so you can't ftp/sftp from them ;.; But I suppose Paul and you are right, board description shouldn't allow any html in it ;p

Meh... Can't edit main.tpl from a remote location (ie: library). And the process is just as long to edit main.tpl as sending an sql command to update the database entry. Announcement message, Additional menu items, and a couple others all have textareas. It should almost follow that ~any~ option that allows html (and subsequently, scripts, media content, etc...) should have the ability to add in newline chars, and have a large text size limit. Again, it's not impossible to edit the templates or database entries to achieve the same result; but it isn't convenient.

I had to edit admin_options.php to add in google adds at the top of every page. It ~could~ have been done with some sql editing, but having it this way makes more sence to me. Limiting the description of the board to 255 chars meens no extras at the top. Limiting the description to being one line (as an input type="text" field) meens that some javascript will cause errors in some browsers. I suggest making this change to allow the less php/html/sql savey administrators the ability to do the same thing I've done. Although you may want to check the limits of the different sql databases. I believe sqlite has limits to the length of a TEXT value, and possibly other databases have the same thing?

    <td>
        <!--<input type="textbox" name="form[board_desc]" size="50" maxlength="255" value="<?php echo pun_htmlspecialchars($pun_config['o_board_desc']) ?>" />-->
        <textarea name="form[board_desc]" rows="6" cols="50"><?php echo pun_htmlspecialchars($pun_config['o_board_desc']) ?></textarea>
        <span>A short description of this bulletin board (shown at the top of every page). This field may contain HTML.</span>
    </td>

Did a litle playing around with my configuration and found out that I was exicuting /bin/php but should have been running /bin/php-cgi. I managed to get this error now big_smile Again, thanks for the help (I should be able to manage from here on out) wink

An error occured on line 57 in file /www/pages/music/forum/include/dblayer/sqlite.php.

PunBB reported: Unable to create new database './/data/db/music_forum.db'. Permission denied

> It appears as if, when you submit the form, it never gets posted. I can't believe this has anything to do with PunBB.

Agreed. Probably something wrong with my php install hmm

> Have you successfully run any other PHP scripts that include forms?

Nope, but I've done perl forms successfully.

I'll play around a bit with my php install and see what comes up. Hopefully I can get $_POST variable to hold some data in another simple php script. Thanks Rickard and others for the effort and help big_smile

I did this instead because "dump" function call doesn't exists?

<body onload="document.getElementById('install').req_db_type.focus()">

<?php
  echo ($_POST);
  foreach ($_POST as $postdata)
    echo $postdata;
?>

<div id="puninstall" style="margin: auto 10% auto 10%">

And each time I try it (including when I first open the install page) I get this html:

<body onload="document.getElementById('install').req_db_type.focus()">

Array
<div id="puninstall" style="margin: auto 10% auto 10%">

Looks like that might be the problem... Maybe I'm missing some libs/php mods? I've only install the debian php5 package and the debian php5-sqlite package.

also this code:

<?php
  echo $_POST['form_sent'];
?>

print this:
Notice: Undefined index: form_sent in /www/pages/music/forum/install.php on line 115

Both on first load and after submitting the info.

When I first install php5 into the chroot, I forgot a few libs and got some errors (ohh and the page never actually displayed correctly). After fixing that (and now the page does display correctly) there hasn't been an errors in the logs hmm

I might have forgotten to mention that I've set the owner to www-user:www-user 755 for the forum directory (and sub directories); www-user:www-user 644 for all the files. This is the way lighttp works (it ignores run permissions; If it can read the file, and it's extention is "XXX", then it's run by program "Y"; lighttp is run as www-user:www-user).

I've also tried with the database created with sqlite, or sqlite3; and without any database created.

Yah, it's install.php that keeps showing up, as if no form was filled and no submit was pressed, never get to config.

@smartys: Sorry, I'm a litle paranoid. I'd prefer not to give someone write access to my HD (currently forums folder is set with www-user as owner; normally it's set as my default local logon account). No link for yous ;P

Humm, a litle more info: I tried to make an error, like mismatched passwords, and a javascript message box shows up. So I disabled javascript and tried again, and the same thing. Empty form, full form, invalid data in the form; it always just goes back to install.php as if nothing happend hmm