Firefox PHP

In-body attachment links/images (for Phorum 5.1 or later)

Posted by Maurice Makaay 
Re: In-body attachment links/images (for Phorum 5.1 or later)
July 26, 2007 07:58PM
If you did some debugging already (sounds like it), then could you please provide full and clear info, with examples and clean sentences? Now I really cannot tell what was happening on your system and if it was in body attachments related (does not sound like it anyway).

I have tested the latest version of the module with the latest 5.1 and I did not see a problem. Here is the result of my testing.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: In-body attachment links/images (for Phorum 5.1 or later)
July 26, 2007 08:34PM
Hello,

i have just take a look to the DB on Table: phorum_files and see that message_id for files is like "0"

I don't know why. I have upgraded with overwriting phorum files perhaps its became for my old homemade template ?

thanks for you help, now i know it's on my box, there is a problem.

Have a nice day.
Re: In-body attachment links/images (for Phorum 5.1 or later)
September 24, 2007 08:42PM
Hello,
I am getting lots of the following error showing in my error logs. Can anyone help with a fix on this ? Running version 5.1.19.

PHP Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in /usr/local/phorum5/mods/in_body_attachments/in_body_attachments.php on line 42, referer: [myphorum.mysite.com]

Thanks !
Re: In-body attachment links/images (for Phorum 5.1 or later)
September 24, 2007 09:27PM
I don't understand the error. "phorum_page" should be defined for every Phorum page. It would be interesting to know what page/script is spawning this warning.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: In-body attachment links/images (for Phorum 5.1 or later)
September 24, 2007 09:57PM
Hi Maurice,
I am actually showing this for a few pages for the phorum_page constant but also for other constants.

PHP Notice: Use of undefined constant user_table - assumed 'user_table' in /usr/local/phorum5/topusers.php on line 27, referer: myphorum.mysite.com/list.php?1
PHP Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in /usr/local/phorum5/common.php on line 388, referer: myphorum.mysite.com/list.php?1
PHP Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in /usr/local/phorum5/mods/search_user/search_user.php on line 98, referer: myphorum.mysite.com/list.php?1
PHP Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in /usr/local/phorum5/common.php on line 293, referer: myphorum.mysite.com/list.php?1
PHP Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in /usr/local/phorum5/mods/in_body_attachments/in_body_attachments.php on line 43, referer: myphorum.mysite.com/allusers.php?1
PHP Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in /usr/local/phorum5/mods/in_body_attachments/in_body_attachments.php on line 42, referer: myphorum.mysite.com/allusers.php?1
PHP Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in /usr/local/phorum5/mods/in_body_attachments/in_body_attachments.php on line 41, referer: myphorum.mysite.com/allusers.php?1
PHP Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in /usr/local/phorum5/mods/in_body_attachments/in_body_attachments.php on line 40, referer: myphorum.mysite.com/allusers.php?1
Re: In-body attachment links/images (for Phorum 5.1 or later)
September 24, 2007 10:28PM
You have addon script(s?) that do not define 'phorum_page'. E.g. topusers.php sounds like a script that includes common.php, without first settings 'phorum_page'. That script should have some code like:
define('phorum_page', 'topusers');
include('common.php');


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: In-body attachment links/images (for Phorum 5.1 or later)
September 24, 2007 11:14PM
Maurice,
If I am understanding you correctly then the define needs to appear above the include ? The topusers error is actually for user_table and not for phorum_page. The mod_allusers shows the define after the include, the search shows it before.
Re: In-body attachment links/images (for Phorum 5.1 or later)
September 24, 2007 11:40PM
It needs to be before the common.php. I can see that it would throw warnings if it's after the common.php include.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: In-body attachment links/images (for Phorum 5.1 or later)
September 25, 2007 12:14AM
That makes sense, but the in_body_attachments.php file doesn't have an include or define at the top and the specific line numbers that the errors show are:

if (
phorum_page != 'post' &&
phorum_page != 'read' &&
phorum_page != 'list' &&
phorum_page != 'control' // for formatting the signature
) return;

All of the errors above have said it "assumed 'phorum_page' " with the single quotes around phorum_page. Is there perhaps something missing in this area? The error for the topusers.php is actually in the following:
$sql = "select
user_id, username, posts
from {$PHORUM[user_table]}
where posts > 0
order by
posts DESC
LIMIT 0,$num";

Again, should there be single quotes around user_table?

Thanks !
Re: In-body attachment links/images (for Phorum 5.1 or later)
September 25, 2007 01:17AM
in_body_attachments.php does not define phorum_page, because it's not a top level script. It's a module that is included and run from the top level scripts like index.php, list.php, read.php, etc.

There is probably one top level script (one including common.php) that is not defining phorum_page before including the common.php file. All the warnings that you see could be coming from that script (although I'm not sure what the user_table warning is about). You really have to find which script is run when the errors occur. If you do not know what script it is about, then start doing requests on your site and see if you can trace the one that is generating the warnings. You should look into scripts / code that interacts with Phorum and is not part of the core distribution.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login