Page 1 of 1

Patch for Statistics module

Posted: Tue Apr 22, 2008 4:36 pm
by Wiedmann
Attached is a MLE patch for the Statistics module.

Regards,
Carsten

Re: Patch for Statistics module

Posted: Tue May 06, 2008 10:55 am
by sirab
Hi,

I have MLE 1.2.4b and added this patch. I have 2 languages: english and dutch. Before the patch, the Current Online Visitors always calles the pages by the Dutch titles. After the patch it calles all the pages by the English title. Ofcourse it needs to call the pages whatever is really is (so if I visit a Dutch page, I would like the dutch title and an english page should get an english title in Current Online Visitors).
What can I do?

Sincerely,
Sirab

Re: Patch for Statistics module

Posted: Wed May 07, 2008 4:17 pm
by Wiedmann
Hi Sirab,

sorrry for the delay.
Before the patch, the Current Online Visitors always calles the pages by the Dutch titles. After the patch it calles all the pages by the English title.
That's not exactly what happens. "Statistics" only count pages with their pageid, regardless if you access the Dutch or English version. And in the "Statistics" you see now the page titles according to your current language setting.

Without this patch, you see most time no page titles. Or, if you have transferred a normal site to MLE, you see only the old page titles, but no titles for new pages (or if you change a page title).
Ofcourse it needs to call the pages whatever is really is
That would be really nice ;-) But needs a lot of more changes in "Statistics" (and makes "Statistics" uncompatible to the standard version.)

Regards,
Carsten

Re: Patch for Statistics module

Posted: Thu May 08, 2008 2:46 pm
by sirab
Ok, thanks!

Re: Patch for Statistics module

Posted: Wed Mar 04, 2009 3:33 pm
by requish
...and? still I dont know what should I to modify for good work module..  ???

Re: Patch for Statistics module

Posted: Fri Mar 06, 2009 5:47 pm
by alby
requish wrote: ...and? still I dont know what should I to modify for good work module..  ???
Is a diff file:
--- modules/Statistics/Statistics.module.php.orig 2008-04-22 17:36:43.859375000 +0100
+++ modules/Statistics/Statistics.module.php 2008-04-22 17:37:16.765625000 +0100
@@ -644,7 +644,10 @@

function InternalGetPageTitle($content_alias, $forcemenutext=false) {
$db=&$this->GetDb();
- $query="SELECT content_name,menu_text FROM ".cms_db_prefix()."content WHERE content_alias=? OR content_id=?";
+// Start MLE
+        global $mleblock;
+ $query="SELECT content_name$mleblock AS content_name,menu_text$mleblock AS menu_text FROM ".cms_db_prefix()."content WHERE content_alias=? OR content_id=?";
+// End MLE
$dbresult=$db->Execute($query,array($content_alias,$content_alias));
if (!$dbresult || $dbresult->RecordCount()==0) return "";
$row=$dbresult->FetchRow();
Edit modules/Statistics/Statistics.module.php and (around 644 row) and look for signs:
- Delete this row
+ Add this row

Alby