Ok, I'm going to try to explain this as simple as possible.
I'm trying to modify a plugin called smart-lencioni-image-resizer v2.0. to be used in WP-Multisite.
I'm trying to display an image through SLIR using the following URL:
I've done this successfully in v.1.4.2. But v2.0 is using a different method for including files. The index.php
file looks like this:
function __autoload($className)
{
var_dump($className);
require_once strtolower($className) . '.class.php';
}
new SLIR();
Now, where ever I try to include WP header:
require_once($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php');
I get the following error message:
*Warning: require_once(translation_entry.class.php) [function.require-once]: failed to open stream: No such file or directory in I:\Development\wamp\www\mysite\wp-content\plugins\wp-filebrowser\slir\index.php on line 43*
Line 43 in the index.php
is:
require_once strtolower($className) . '.class.php';
For some reason the __autoload
function makes WP look for files in the SLIR directory. This is of cours wrong :(
UPDATE I found one solution on the web that kind of works:
function __autoload($className)
{
if(file_exists(strtolower($className) . '.class.php')) {
require_once strtolower($className) . '.class.php';
}
}
This allows WP header file to be loaded. But for some reason it loads mainsite.no
and drops executing the URL I added at the top.
Is there any other way I can solve this problem?
UPDATE2
There is an .htaccess file in the SLIR folder. The file looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule . index.php [L]
</IfModule>
# Prevent viewing of the error log file in its default location
<Files slir-error-log>
Order Deny,Allow
Deny from All
</Files>
Could it be that when I include the WP header file, it ignors the .htaccess file from SLIR?