I have made the block of statistics:

// see and read cache
if ($cached = cache_get("site_stats", 'cache')) {
 $out = $cached->data;
}
else {
 // veriable
 $l10n_projects = db_fetch_object(db_query("SELECT count(*) AS num FROM {l10n_community_project}"));
 $l10n_files = db_fetch_object(db_query("SELECT count(*) AS num FROM {l10n_community_file}"));
 $l10n_string = db_fetch_object(db_query("SELECT count(*) AS num FROM {l10n_community_string}"));
 $l10n_string_by_language =  db_query("SELECT COUNT(DISTINCT sid) AS num,  language AS lang FROM {l10n_community_translation} WHERE is_active = 1  GROUP BY lang ORDER BY num DESC"); 

 $out .= " Projects(files):<strong>$l10n_projects->num($l10n_files->num)</strong>";
 $out .= " String:<strong>$l10n_string->num</strong>";
 $out .= " <br />Translate: ";
while ($l10n_string_by_languages = db_fetch_object($l10n_string_by_language)) {
 $out .=  $l10n_string_by_languages->lang . "(<strong>" .  $l10n_string_by_languages->num  . "</strong>) ";
}

 // write cache (10min)
  cache_set("site_stats", 'cache', $out, time() + (60 * 10 ));
}

// out 
echo $out;

Data do not coincide with Localization server (see: http://www.drupaler.ru/translate/languages).
Where a mistake?

CommentFileSizeAuthor
#4 Screenshot_3.gif11.92 KBpvasili
#3 Screenshot_2.png52.49 KBgábor hojtsy

Comments

pvasili’s picture

p.s. The block is visible to the registered users (it is possible with drupal.org login).

gábor hojtsy’s picture

Status: Active » Closed (fixed)

As far as I see these display the same data. I went to http://www.drupaler.ru/translate and I see the block is visible without logging in. All seem to be the same data as in the summary. I have a screenshot but file attachments are not working now, so you need to believe. Reopen if you can point to an actual difference.

BTW I also plan to include an "our heroes" like feature in the upcoming UI updates for l10n_server (good changes are coming :)

gábor hojtsy’s picture

StatusFileSize
new52.49 KB

Here is how I see it. Everything seems to be right.

pvasili’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)
StatusFileSize
new11.92 KB

I wrote other URL address (http://www.drupaler.ru/translate/languages). A mistake in quantity of translations. Mine SQL inquiry correct?

pvasili’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

Has forgotten statistics for heroes:

 $l10n_string_by_language =  .....
 $l10n_string_heroes  =  db_query("SELECT COUNT( DISTINCT s.sid ) num,  u.name  users FROM {l10n_community_translation} s LEFT JOIN {users} u ON s.uid_entered = u.uid WHERE s.is_active =1  GROUP BY s.uid_entered ORDER BY num DESC LIMIT 0,5");
.....
while ($l10n_string_by_languages ....
 $out .= " <br />Our heroes(records):";
while ($l10n_string_heroe = db_fetch_object($l10n_string_heroes)) {
 $out .=  $l10n_string_heroe->users . "(<strong>" .  $l10n_string_heroe->num  . "</strong>),  ";
}

:)

gábor hojtsy’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Eh, instead of a page full with numbers, you might be able to point out what is the *exact* problem!

Looking at your SQL query, you use "is_active = 1" to filter for translations, but "is_suggestion = 0 AND is_active = 1" provides you with the translations.

pvasili’s picture

Component: Code » Miscellaneous

I have changed:

...
$l10n_string_by_language =  db_query("SELECT COUNT(DISTINCT sid) AS num,  language AS lang FROM {l10n_community_translation} WHERE is_suggestion = 0 AND is_active = 1  GROUP BY lang ORDER BY num DESC");
$l10n_string_heroes  =  db_query("SELECT COUNT( DISTINCT s.sid ) num,  u.name  users FROM {l10n_community_translation} s LEFT JOIN {users} u ON s.uid_entered = u.uid WHERE s.is_suggestion = 0 AND s.is_active =1  GROUP BY s.uid_entered ORDER BY num DESC LIMIT 0,5");
...

The result is not equal to yours: :-(. Where a mistake at me?

gábor hojtsy’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Nobody else reported stats issues, so this must have been fixed in the past two years.