FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » How to include a php file before any FUD processing is done?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
How to include a php file before any FUD processing is done? [message #39153] Wed, 03 October 2007 22:05 Go to next message
pgregg is currently offline  pgregg   United Kingdom
Messages: 14
Registered: July 2006
Karma: 0
Junior Member
Currently I am editing the header template to include 2 php files that setup the global environment for my site and the second to handle authentication. This works well - except for when the first hit on the site is a first-time session authentication event. In this case i get a
Fatal error: Cannot redeclare pdo_concat() (previously declared in E:\web\support\production\community\index.php:68) in E:\web\support\FUDforum_data\include\theme\default\db.inc on line 67

Now I figured, remove the includes from the header template and put them in GLOBALS.php (tried both the main doc root globals.php and the $INCLUDE/GLOBALS.php) but it doesn't seem to make a difference. The fatal error occurs before I get a chance to intercept it.

Seems the main forum index.php has function declarations for all the same functions as db.inc, but in including fudapi and forum_login I also include db.inc and so there is a conflict.

Any thoughts? Thanks.
PG
Re: How to include a php file before any FUD processing is done? [message #39158 is a reply to message #39153] Thu, 04 October 2007 23:32 Go to previous messageGo to next message
Ilia is currently offline  Ilia   
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The FUDAPI is intended to be used aside from the forum, so it ends up re-declaring the same code. To avoid this problem you need to comment out some duplicate functions such as pdo_concat()

FUDforum Core Developer
Re: How to include a php file before any FUD processing is done? [message #39196 is a reply to message #39158] Tue, 09 October 2007 15:33 Go to previous message
pgregg is currently offline  pgregg   United Kingdom
Messages: 14
Registered: July 2006
Karma: 0
Junior Member
I solved the problem in my login handler by making it recognise if the current REQUEST_URI was part of fudforum - if so then I redirect the user to the site home page with a target= of the requested url.
This way my login handler never includes the fudapi code when inside the forum and so the dupe function declarations never happen.
The home page then takes care of the login/fudapi, etc and bounces the user back to the original forum page.

Hacky, but it works. Smile

Cheers,
PG
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Extended letters in user names
Next Topic: test123
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 05:37:22 GMT 2024

Total time taken to generate the page: 0.03162 seconds