damit bei mir in der 4.8.4 das agents Plugin von http://forum.contenido.org/viewtopic.php?p=75263#75263 weiterhin funktionierte musste ich nur in dem Modul im Layout folgendes ändern(auskommentieren)
Code: Alles auswählen
$handle = opendir($cfg['path']['contenido'] . $cfg["path"]['plugins'] );
while ($plugin = readdir($handle)){
$configfile = $cfg['path']['contenido'] . $cfg["path"]['plugins'] . $plugin . "/includes/config.plugin.php";
if (@file_exists($configfile)){
include($configfile);
}
}
Code: Alles auswählen
Cannot redeclare prepareworkflowitems() (previously declared in...
Code: Alles auswählen
<?php
//----- cut -----
/* Include the plugin configuration */
$handle = opendir($cfg['path']['contenido'] . $cfg["path"]['plugins'] );
while ($plugin = readdir($handle)){
$configfile = $cfg['path']['contenido'] . $cfg["path"]['plugins'] . $plugin . "/includes/config.plugin.php";
if (@file_exists($configfile)){
include($configfile);
}
}
if (isset($cfg['plugins']['agents'])){
$plugin = true;
}
else{
$plugin = false;
}
// Agent maskieren und auf gültigen Wert prüfen, bei Verletzung abbrechen
$agent = addslashes($HTTP_USER_AGENT);
$ip = $REMOTE_ADDR;
if ($plugin && (strlen(trim($agent))>0)){
$db = new DB_Contenido;
$db2 = new DB_Contenido;
// Filter prüfen
$sqlq = 'SELECT filterid FROM '.$cfg["tab"]["filter"].' WHERE "'.$agent.'" LIKE value';
$db->query($sqlq);
if (!$db->next_record()){
// Wenn Agent unbekannt => hinzufügen
$sqlq = 'SELECT agentid FROM '.$cfg["tab"]["agent"].' WHERE name = "'.$agent.'"';
$db->query($sqlq);
if (!$db->next_record()){
$nextid = $db2->nextid($cfg["tab"]["agent"]);
$sqli="INSERT INTO ".$cfg["tab"]["agent"]." (agentid,name) VALUES ('".$nextid."','".$agent."')";
$db->query($sqli);
$db->query($sqlq);
$db->next_record();
}
$agentid = $db->f("agentid");
// Wenn IP unbekannt => hinzufügen
$sqlq = 'SELECT hostid FROM '.$cfg["tab"]["host"].' WHERE ip = "'.$ip.'"';
$db->query($sqlq);
if (!$db->next_record()){
$nextid = $db2->nextid($cfg["tab"]["host"]);
$sqli="INSERT INTO ".$cfg["tab"]["host"]." (hostid,ip) VALUES ('".$nextid."','".$ip."')";
$db->query($sqli);
$db->query($sqlq);
$db->next_record();
}
$hostid = $db->f("hostid");
// Visit updaten / hinzufügen
$sqlq = 'SELECT visitid, hits FROM '.$cfg["tab"]["visit"].' WHERE agentid = "'.$agentid.'" AND hostid = "'.$hostid.'" AND date = "'.date("Y-m-d").'"';
$db->query($sqlq);
if (!$db->next_record()){
$nextid = $db2->nextid($cfg["tab"]["visit"]);
$sqli="INSERT INTO ".$cfg["tab"]["visit"]." (visitid,agentid,hostid,date,hits) VALUES ('".$nextid."','".$agentid."','".$hostid."','".date("Y-m-d")."','1')";
$db->query($sqli);
$db->query($sqlq);
$db->next_record();
}
else{
$visitid = $db->f("visitid");
$hits = $db->f("hits") + 1;
$sqlu="UPDATE ".$cfg["tab"]["visit"]." SET hits='".$hits."', date='".date("Y-m-d")."' WHERE visitid='".$visitid."'";
$db->query($sqlu);
}
}
}
//----- cut -----
?>
Code: Alles auswählen
<?php
//----- cut -----
/* Include the plugin configuration */
/*
$handle = opendir($cfg['path']['contenido'] . $cfg["path"]['plugins'] );
while ($plugin = readdir($handle)){
$configfile = $cfg['path']['contenido'] . $cfg["path"]['plugins'] . $plugin . "/includes/config.plugin.php";
if (@file_exists($configfile)){
include($configfile);
}
}
*/
if (isset($cfg['plugins']['agents'])){
$plugin = true;
}
else{
$plugin = false;
}
// Agent maskieren und auf gültigen Wert prüfen, bei Verletzung abbrechen
$agent = addslashes($HTTP_USER_AGENT);
$ip = $REMOTE_ADDR;
if ($plugin && (strlen(trim($agent))>0)){
$db = new DB_Contenido;
$db2 = new DB_Contenido;
// Filter prüfen
$sqlq = 'SELECT filterid FROM '.$cfg["tab"]["filter"].' WHERE "'.$agent.'" LIKE value';
$db->query($sqlq);
if (!$db->next_record()){
// Wenn Agent unbekannt => hinzufügen
$sqlq = 'SELECT agentid FROM '.$cfg["tab"]["agent"].' WHERE name = "'.$agent.'"';
$db->query($sqlq);
if (!$db->next_record()){
$nextid = $db2->nextid($cfg["tab"]["agent"]);
$sqli="INSERT INTO ".$cfg["tab"]["agent"]." (agentid,name) VALUES ('".$nextid."','".$agent."')";
$db->query($sqli);
$db->query($sqlq);
$db->next_record();
}
$agentid = $db->f("agentid");
// Wenn IP unbekannt => hinzufügen
$sqlq = 'SELECT hostid FROM '.$cfg["tab"]["host"].' WHERE ip = "'.$ip.'"';
$db->query($sqlq);
if (!$db->next_record()){
$nextid = $db2->nextid($cfg["tab"]["host"]);
$sqli="INSERT INTO ".$cfg["tab"]["host"]." (hostid,ip) VALUES ('".$nextid."','".$ip."')";
$db->query($sqli);
$db->query($sqlq);
$db->next_record();
}
$hostid = $db->f("hostid");
// Visit updaten / hinzufügen
$sqlq = 'SELECT visitid, hits FROM '.$cfg["tab"]["visit"].' WHERE agentid = "'.$agentid.'" AND hostid = "'.$hostid.'" AND date = "'.date("Y-m-d").'"';
$db->query($sqlq);
if (!$db->next_record()){
$nextid = $db2->nextid($cfg["tab"]["visit"]);
$sqli="INSERT INTO ".$cfg["tab"]["visit"]." (visitid,agentid,hostid,date,hits) VALUES ('".$nextid."','".$agentid."','".$hostid."','".date("Y-m-d")."','1')";
$db->query($sqli);
$db->query($sqlq);
$db->next_record();
}
else{
$visitid = $db->f("visitid");
$hits = $db->f("hits") + 1;
$sqlu="UPDATE ".$cfg["tab"]["visit"]." SET hits='".$hits."', date='".date("Y-m-d")."' WHERE visitid='".$visitid."'";
$db->query($sqlu);
}
}
}
//----- cut -----
?>