MyBB Community Forums

Full Version: Where is this?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am looking for witch file in MyBB answers for the main entry point I mean like in VB there is a file called class_core.php?
Now if that wan't clear enough then I just need to add this somewhere to fix something:
if ($_SERVER["HTTP_CF_CONNECTING_IP"]) {
              $_SERVER["REMOTE_ADDR"] = $_SERVER["HTTP_CF_CONNECTING_IP"];
If anyone understands that can you help me Huh
I don't think this is the right forum but there is a class_core.php in the /inc/ directory.
Does it answer for the main entry of members and stuff?
To be honest I'm not sure what you're asking. Maybe a staff member could better answer you but I don't think this forum is the right place to get their attention. Sad
The first file to be executed is init.php i think, cause thats where the mysql->connect are and stuff like that.
Quote:The first file to be executed is init.php i think, cause thats where the mysql->connect are and stuff like that.

<nitpick>
The first file to be parsed is the page being called.

Include and require (and their variants) work like you're putting them all into one big file. To PHP, there's no difference between

require("stuff.php");

echo $stuff_from_stuff;

And

$stuff_from_stuff = good_stuff();

echo $stuff_from_stuff;

PHP doesn't start to execute statements until it's gotten the code from the includes/requires and basically put it with the rest of the page the other pages are called in.

</nitpick>

Now, to the topic at hand:

You can put it anywhere (almost). It'd be best to put it at the top of the file that's always being called in every page.
Quote:The first file to be parsed is the page being called.
Yes that is also correct, but in order for a quiery to be performed, php must read init.php to get the initalizers
Well so far I put it in the init file and everything works so far will post back if something goes horribly wrong xD Thanks dikidera Big Grin
Global.php is included and executed on every page, so if you want your script to run all the time, include it via global.php
(2010-11-06, 12:11 AM)AXVIS Wrote: [ -> ]I am looking for witch file in MyBB answers for the main entry point I mean like in VB there is a file called class_core.php?
Now if that wan't clear enough then I just need to add this somewhere to fix something:
if ($_SERVER["HTTP_CF_CONNECTING_IP"]) {
              $_SERVER["REMOTE_ADDR"] = $_SERVER["HTTP_CF_CONNECTING_IP"];
If anyone understands that can you help me Huh

The IP is grabbed in the get_ip() function in the inc/functions.php file. It would be better for you to include your code in that function, this way it will be used wherever IP is called for.
Pages: 1 2