Wednesday 04 June 2008 11:52:34 pm
Hello, I'm a newcomer to the world of Ez Publish. I'm having a lot of troubles with the updateviewcount.php script and had to do a little modification in the code to make it work. I just replaced the next lines:
$url = str_replace( "content/view/full/", "", $url );
$url = str_replace( "/", "", $url );
$url = preg_replace( "/\?(.*)/", "", $url );
$nodeIDArray[] = $url;
With these ones:
$pos_in_url = strrpos($url, "/");
if ($pos_in_url !== false) {
$url = substr($url, $pos_in_url+1, strlen($url)-$pos_in_url);
$nodeIDArray[] = $url;
}
That's because $url was coming with a string like this one: "index.phpeng87". It should come only with the ID, but was coming with index.php and siteaccess. The script is working fine now, information is being registered in database (ezview_counter table), but I still have the URL problem, described by Fábio Farnesi. I have applied the patch André R. recommended, and even after that, the bug persists. The problem is with Virtual URLS. System URLs are being registered correctly in the database. I don't know what to do, maybe wait for version 4.0.1...
|