phorum_db_post_message() API
Posted by gurufocus
|
phorum_db_post_message() API January 31, 2007 03:08PM |
Registered: 20 years ago Posts: 49 |
Where can I find more information about phorum_db_post_message() API? how to use it?
thanks!
-------
[www.gurufocus.com]
Stock Picks of Warren Buffett Gurus
thanks!
-------
[www.gurufocus.com]
Stock Picks of Warren Buffett Gurus
|
Re: phorum_db_post_message() API January 31, 2007 04:34PM |
Admin Registered: 22 years ago Posts: 8,532 |
How about the source? There's no API documentation outside the source code. If you're looking for an example use, check out ./include/posting/action_post.php
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: phorum_db_post_message() API January 31, 2007 04:40PM |
Registered: 20 years ago Posts: 49 |
|
Re: phorum_db_post_message() API January 31, 2007 04:50PM |
Admin Registered: 22 years ago Posts: 8,532 |
Well, then read the example code from post.php. The function is called from that file in 5.0.13. Did anybody ever mention that you should upgrade? ;-)
If you want to use the API, then you need at least:
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
If you want to use the API, then you need at least:
<?php # doesn't really matter what this is exactly, as long as you use a name # that isn't already the name of a Phorum phorum_page name. define('phorum_page', 'yourscript'); # Change directory to the Phorum install dir (required, because all Phorum # code asumes that it's run from a script in the Phorum install dir). chdir("/path/to/your/phorum/installdir/"); # Load common code and setup database connection. include_once("common.php"); ?>
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: phorum_db_post_message() API January 31, 2007 05:00PM |
Registered: 20 years ago Posts: 49 |
Thank you!
I apologize for the post on another thread. I did that before I saw your first reply.
I cannot upgrade, although I would like to. I added a lot of new fields to database table to category the messages, so that other non-Phorum pages can use them in different ways. I also added a lot of new fields to distinguish the users. I dare not to make any changes to the database.
I apologize for the post on another thread. I did that before I saw your first reply.
I cannot upgrade, although I would like to. I added a lot of new fields to database table to category the messages, so that other non-Phorum pages can use them in different ways. I also added a lot of new fields to distinguish the users. I dare not to make any changes to the database.
|
Re: phorum_db_post_message() API January 31, 2007 05:06PM |
Admin Registered: 22 years ago Posts: 8,532 |
Still, now and then consider doing an upgrade and maybe document changes and write modules as much as possible, to be able to get along with future upgrades. Now you might be running a version with security problems and bugs. Also, the new features in 5.1 are worth the upgrade IMO. But as long as it's your fingers that are cut, I have no problem with you staying at the 5.0 tree =)
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: phorum_db_post_message() API May 31, 2007 10:08AM |
Registered: 20 years ago Posts: 49 |
I am trying to use phorum_db_post_message() API. However, I got this error:
Warning: main(./include/db/.php) [function.main]: failed to open stream: No such file or directory in /public_html/forum/common.php on line 114
When I look at line 114 in common.php, it is:
include_once( "./include/db/{$PHORUM['DBCONFIG']['type']}.php" );
It seems that it cannot find the DB file. Can someone help?
I have done all of these:
Edited 1 time(s). Last edit at 05/31/2007 11:14AM by gurufocus.
Warning: main(./include/db/.php) [function.main]: failed to open stream: No such file or directory in /public_html/forum/common.php on line 114
When I look at line 114 in common.php, it is:
include_once( "./include/db/{$PHORUM['DBCONFIG']['type']}.php" );
It seems that it cannot find the DB file. Can someone help?
I have done all of these:
Quote
mmakaay
Well, then read the example code from post.php. The function is called from that file in 5.0.13. Did anybody ever mention that you should upgrade? ;-)
If you want to use the API, then you need at least:
<?php # doesn't really matter what this is exactly, as long as you use a name # that isn't already the name of a Phorum phorum_page name. define('phorum_page', 'yourscript'); # Change directory to the Phorum install dir (required, because all Phorum # code asumes that it's run from a script in the Phorum install dir). chdir("/path/to/your/phorum/installdir/"); # Load common code and setup database connection. include_once("common.php"); ?>
Edited 1 time(s). Last edit at 05/31/2007 11:14AM by gurufocus.
|
Re: phorum_db_post_message() API May 31, 2007 10:34AM |
Admin Registered: 22 years ago Posts: 8,532 |
common.php should load include/db/config.php which should define $PHORUM["DBCONFIG"],which should set the $PHORUM["DBCONFIG"]["type"] which appears to be empty. Debug this chain to see where it's broken.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: phorum_db_post_message() API May 31, 2007 11:01AM |
Registered: 20 years ago Posts: 49 |
|
Re: phorum_db_post_message() API May 31, 2007 11:08AM |
Admin Registered: 22 years ago Posts: 8,532 |
That sounds like common.php is not included at all. So check if you have the chdir() correct. Also check if the common.php is readable. Maybe add a simple die("OK") statement or so to the start of common.php. If you see the die(), then common is loaded, otherwise not.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: phorum_db_post_message() API May 31, 2007 11:19AM |
Registered: 20 years ago Posts: 49 |
common.php is included. chdir() is correct. If I disable chdir(). The error message becomes:
Warning: main(./common.php) [function.main]: failed to open stream: No such file or directory in [filename] on line 243
If I enable chdir(), it can find common.php, but it seems that it included /include/db/config.php. but it does not recognize "define( "PHORUM", "5.0.13a" );"
Warning: main(./common.php) [function.main]: failed to open stream: No such file or directory in [filename] on line 243
If I enable chdir(), it can find common.php, but it seems that it included /include/db/config.php. but it does not recognize "define( "PHORUM", "5.0.13a" );"
|
Re: phorum_db_post_message() API May 31, 2007 11:20AM |
Admin Registered: 22 years ago Posts: 8,532 |
It's right there in the code of common.php, so if that is really included, the PHORUM constant should be available.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: phorum_db_post_message() API May 31, 2007 11:27AM |
Admin Registered: 23 years ago Posts: 9,240 |
|
Re: phorum_db_post_message() API May 31, 2007 03:01PM |
Registered: 20 years ago Posts: 49 |
Sorry, only registered users may post in this forum.