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?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Screenshot_3.gif | 11.92 KB | pvasili |
| #3 | Screenshot_2.png | 52.49 KB | gábor hojtsy |
Comments
Comment #1
pvasili commentedp.s. The block is visible to the registered users (it is possible with drupal.org login).
Comment #2
gábor hojtsyAs 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 :)
Comment #3
gábor hojtsyHere is how I see it. Everything seems to be right.
Comment #4
pvasili commentedI wrote other URL address (http://www.drupaler.ru/translate/languages). A mistake in quantity of translations. Mine SQL inquiry correct?
Comment #5
pvasili commentedHas forgotten statistics for heroes:
:)
Comment #6
gábor hojtsyEh, 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.
Comment #7
pvasili commentedI have changed:
The result is not equal to yours: :-(. Where a mistake at me?
Comment #8
gábor hojtsyNobody else reported stats issues, so this must have been fixed in the past two years.