| 43 |
|
|
|
| 44 |
====Bestehende Action verbessern am Beisiel von {{hits}}==
|
|
|
| 45 |
Erstelle eine Lokalisierung
|
|
|
| 46 |
|
|
|
| 47 |
Ăndere die Datei /community/action/hits.php
|
|
|
| 48 |
<?php
|
|
|
| 49 |
|
|
|
| 50 |
if (!defined('IN_WACKO'))
|
|
|
| 51 |
{
|
|
|
| 52 |
exit;
|
|
|
| 53 |
}
|
|
|
| 54 |
|
|
|
| 55 |
// {{hits}}
|
|
|
| 56 |
// take $this->page['hits'] in the first place
|
|
|
| 57 |
|
|
|
| 58 |
// set defaults
|
|
|
| 59 |
$page ??= '';
|
|
|
| 60 |
$result = 0;
|
|
|
| 61 |
|
|
|
| 62 |
if ($page)
|
|
|
| 63 |
{
|
|
|
| 64 |
$tag = $this->unwrap_link($page);
|
|
|
| 65 |
|
|
|
| 66 |
$rs = $this->db->load_single(
|
|
|
| 67 |
"SELECT hits " .
|
|
|
| 68 |
"FROM " . $this->prefix . "page " .
|
|
|
| 69 |
"WHERE tag = " . $this->db->q($tag) . " " .
|
|
|
| 70 |
"LIMIT 1");
|
|
|
| 71 |
|
|
|
| 72 |
if (isset($rs['hits']))
|
|
|
| 73 |
{
|
|
|
| 74 |
$result = $rs['hits'];
|
|
|
| 75 |
}
|
|
|
| 76 |
}
|
|
|
| 77 |
else
|
|
|
| 78 |
{
|
|
|
| 79 |
$result = $this->page['hits'];
|
|
|
| 80 |
}
|
|
|
| 81 |
|
|
|
| 82 |
$tpl->result = $result;
|
|
|
| 83 |
|
|
|
| 84 |
## echo number_format($result, 0, ',', '.');
|
|
|
| 85 |
|
|
|
| 86 |
Erstelle eine Datei /community/action/template/hits.tpl
|
|
|
| 87 |
|
|
|
| 88 |
Erstelle Sprachdateien
|
|
|
| 89 |
|
|
|
| 90 |
|
|
|
| 91 |
|
|
|