Patch for Statistics module

Patch for multilingual modules
Locked
Wiedmann
Forum Members
Forum Members
Posts: 233
Joined: Wed Mar 26, 2008 1:49 am
Location: Stuttgart / Germany

Patch for Statistics module

Post by Wiedmann »

Attached is a MLE patch for the Statistics module.

Regards,
Carsten
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

sirab
Forum Members
Forum Members
Posts: 10
Joined: Fri Apr 25, 2008 8:14 pm

Re: Patch for Statistics module

Post 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
Wiedmann
Forum Members
Forum Members
Posts: 233
Joined: Wed Mar 26, 2008 1:49 am
Location: Stuttgart / Germany

Re: Patch for Statistics module

Post 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
sirab
Forum Members
Forum Members
Posts: 10
Joined: Fri Apr 25, 2008 8:14 pm

Re: Patch for Statistics module

Post by sirab »

Ok, thanks!
User avatar
requish
Forum Members
Forum Members
Posts: 183
Joined: Sat Jan 24, 2009 3:12 pm

Re: Patch for Statistics module

Post by requish »

...and? still I dont know what should I to modify for good work module..  ???
CMS Made Simple! Best CMS! :)
alby

Re: Patch for Statistics module

Post 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
Last edited by alby on Sat Mar 07, 2009 9:14 am, edited 1 time in total.
Locked

Return to “Modules/Addon patchs”