|
|
| Author |
Message |
format_c
Joined: 17 Aug 2007 Posts: 11
|
Posted: Mon Mar 10, 2008 3:46 pm Post subject: $config['url_path'] is not evaluated in plugin scripts |
|
|
Hi,
Cacti seems to work well. But opening a plugin (e.g. monitor) styles look wrong. Seems the $config['url_path'] variable isnt evaluated that compensates the plugin path in the url. poller.php for example includes global.php which includes config.php where the variable is set. But the second include seems not to be executed.
Do I have to set something special in php5?
Cheers Alex |
|
| Back to top |
|
 |
pepj Cacti User
Joined: 29 Sep 2005 Posts: 288 Location: switzerland
|
|
| Back to top |
|
 |
format_c
Joined: 17 Aug 2007 Posts: 11
|
Posted: Tue Mar 11, 2008 4:02 pm Post subject: |
|
|
Mhh in the posts the problem seems not to be solved; just described?
Cheers Alex |
|
| Back to top |
|
 |
pepj Cacti User
Joined: 29 Sep 2005 Posts: 288 Location: switzerland
|
Posted: Wed Mar 12, 2008 3:18 am Post subject: |
|
|
| format_c wrote: | Mhh in the posts the problem seems not to be solved; just described?
|
I had not really good explain how to solve it because I wanted Gigamit/Jimmy give a answer (and perhaps a better solution).
How to solve --->
in "plugings.php"
relpace:
| Code: |
if (isset($_SERVER['DOCUMENT_ROOT']) && isset($_SERVER['REMOTE_ADDR'])) {
$config['url_path'] = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']), strlen(__FILE__) - strlen($_SERVER['DOCUMENT_ROOT']) - strlen('include/plugins.php'));
db_execute("REPLACE INTO settings (name, value) VALUES ('url_path', '" . $config['url_path'] . "')");
} else {
$config['url_path'] = db_fetch_cell("SELECT value FROM settings WHERE name = 'url_path'");
}
define('URL_PATH', $config['url_path']);
|
with
| Code: |
if (isset($_SERVER['DOCUMENT_ROOT']) && isset($_SERVER['REMOTE_ADDR'])) {
$config['url_path'] = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']), strlen(__FILE__) - strlen($_SERVER['DOCUMENT_ROOT']) - strlen('include/plugins.php'));
$search= array('\\');
$replace='/';
$config['url_path']= str_replace($search,$replace,$config['url_path']);
db_execute("REPLACE INTO settings (name, value) VALUES ('url_path', '" . $config['url_path'] . "')");
} else {
$config['url_path'] = db_fetch_cell("SELECT value FROM settings WHERE name = 'url_path'");
}
define('URL_PATH', $config['url_path']);
|
[/b] |
|
| Back to top |
|
 |
format_c
Joined: 17 Aug 2007 Posts: 11
|
Posted: Fri Mar 14, 2008 6:15 am Post subject: |
|
|
Mhh I do not have such a sniplet in my plugins.php.
I am Using cacti-plugin-arch 0.8.7b.
Cacti has also version 0.8.7b.
I do not understand what I am doing wrong.
cheers Alex |
|
| Back to top |
|
 |
pepj Cacti User
Joined: 29 Sep 2005 Posts: 288 Location: switzerland
|
Posted: Sat Mar 15, 2008 4:07 pm Post subject: |
|
|
| format_c wrote: | Mhh I do not have such a sniplet in my plugins.php.
I am Using cacti-plugin-arch 0.8.7b.
Cacti has also version 0.8.7b.
I do not understand what I am doing wrong.
|
file "plugins.php" delivered in PA 2.0
http://cactiusers.org/downloads/patches/ |
|
| Back to top |
|
 |
|