Quellcode durchsuchen

- Hinzufügen von Infos über Besucher und Downloads(Anon. IP, Referer, Browser, Datum, etc.)

- fixen von kleineren Bugs und fehlern.
master
Marcel Völkel vor 7 Jahren
Ursprung
Commit
05667f73ad

+ 0
- 4
Application/templates/SmartAdmin/Data/logout.tpl Datei anzeigen

@@ -1,4 +0,0 @@
1
-{include file="header.tpl"}
2
-
3
-
4
-{include file="footer.tpl"}

+ 5
- 5
Application/templates/SmartAdmin/Data/specific/sternenkindsaga.tpl Datei anzeigen

@@ -18,9 +18,6 @@
18 18
     </li>
19 19
 {/block}
20 20
 {block name="body"}
21
-
22
-
23
-
24 21
     <!-- widget grid -->
25 22
     <section id="widget-grid" class="">
26 23
 
@@ -94,13 +91,13 @@
94 91
                                 <tbody>
95 92
                                     <tr>
96 93
                                         <td>Downloads:</td>
97
-                                        <td>{$allDownloads}</td>
94
+                                        <td><span class="btn btn-xs btn-default" id="allDls">{$allDownloads}</span></td>
98 95
                                         <td><span class="label label-danger">Coming Soon</span></td>
99 96
                                         <td><span class="label label-danger">Coming Soon</span></td>
100 97
                                     </tr>
101 98
                                     <tr>
102 99
                                         <td>Besucher:</td>
103
-                                        <td>{$allVisitors}</td>
100
+                                        <td><span class="btn btn-xs btn-default" id="allVisits">{$allVisitors}</span></td>
104 101
                                         <td><span class="label label-danger">Coming Soon</span></td>
105 102
                                         <td><span class="label label-danger">Coming Soon</span></td>
106 103
                                     </tr>
@@ -117,6 +114,9 @@
117 114
                 </div>
118 115
             </article>
119 116
         </div>
117
+        <div class="row" id="ajaxReq">
118
+            {block name="ajaxAppend"}{/block}
119
+        </div>
120 120
     </section>
121 121
 {/block}
122 122
 {block name="additionalJSFiles"}

+ 35
- 0
Application/templates/SmartAdmin/ajax/downloadOverview.tpl Datei anzeigen

@@ -0,0 +1,35 @@
1
+{block name="ajaxAppend"}
2
+        <script src="lib/SmartAdmin/js/libs/jquery-2.1.1.min.js"></script>
3
+        <script src="lib/SmartAdmin/js/plugin/datatables/jquery.dataTables.min.js"></script>
4
+        <script src="lib/SmartAdmin/js/plugin/datatables/dataTables.bootstrap.min.js"></script>
5
+        <script src="lib/SmartAdmin/js/ajax/dataTable.js"></script>
6
+        <article class="col-sm-12">
7
+            <!-- new widget -->
8
+            <div class="jarviswidget jarviswidget-color-blueLight" id="wid-id-0" data-widget-togglebutton="false" data-widget-editbutton="false" data-widget-fullscreenbutton="false" data-widget-colorbutton="false" data-widget-deletebutton="false">
9
+                <header>
10
+                    <span class="widget-icon"> <i class="fa fa-line-chart txt-color-darken"></i> </span>
11
+                    <h2>Nutzerinformationen &uuml;ber die Downloads</h2>
12
+                </header>
13
+
14
+                <div class="no-padding">
15
+
16
+                    <div class="widget-body">
17
+                        <div class="alert alert-info">
18
+                            <i class="fa-fw fa fa-info"></i>
19
+                            <strong>Hinweis!</strong>
20
+                            IP-Adressen sind wegen des Datenschutzes Anonymisiert!
21
+                        </div>
22
+                        <table id="dlLists" class="table table-bordered table-hover table-striped table-responsive" width="100%">
23
+                            <thead>
24
+                                <th width="5%">ID</th>
25
+                                <th width="5%">IP Adresse</th>
26
+                                <th width="25%">UserAgent</th>
27
+                                <th width="5%">Timestamp</th>
28
+                                <th width="5%">DL Version</th>
29
+                            </thead>
30
+                        </table>
31
+                    </div>
32
+                </div>
33
+            </div>
34
+        </article>
35
+{/block}

+ 35
- 0
Application/templates/SmartAdmin/ajax/visitorOverview.tpl Datei anzeigen

@@ -0,0 +1,35 @@
1
+{block name="ajaxAppend"}
2
+        <script src="lib/SmartAdmin/js/libs/jquery-2.1.1.min.js"></script>
3
+        <script src="lib/SmartAdmin/js/plugin/datatables/jquery.dataTables.min.js"></script>
4
+        <script src="lib/SmartAdmin/js/plugin/datatables/dataTables.bootstrap.min.js"></script>
5
+        <script src="lib/SmartAdmin/js/ajax/dataTable.js"></script>
6
+        <article class="col-sm-12">
7
+            <!-- new widget -->
8
+            <div class="jarviswidget jarviswidget-color-blueLight" id="wid-id-0" data-widget-togglebutton="false" data-widget-editbutton="false" data-widget-fullscreenbutton="false" data-widget-colorbutton="false" data-widget-deletebutton="false">
9
+                <header>
10
+                    <span class="widget-icon"> <i class="fa fa-line-chart txt-color-darken"></i> </span>
11
+                    <h2>Nutzerinformationen &uuml;ber die Besucher der Landingpage</h2>
12
+                </header>
13
+
14
+                <div class="no-padding">
15
+
16
+                    <div class="widget-body">
17
+                        <div class="alert alert-info">
18
+                            <i class="fa-fw fa fa-info"></i>
19
+                            <strong>Hinweis!</strong>
20
+                            IP-Adressen sind wegen des Datenschutzes Anonymisiert!
21
+                        </div>
22
+                        <table id="visitorLists" class="table table-bordered table-hover table-striped table-responsive" width="100%">
23
+                            <thead>
24
+                                <th width="5%">ID</th>
25
+                                <th width="5%">IP Adresse</th>
26
+                                <th width="20%">UserAgent</th>
27
+                                <th width="30%">Referrer</th>
28
+                                <th width="40%">Datum</th>
29
+                            </thead>
30
+                        </table>
31
+                    </div>
32
+                </div>
33
+            </div>
34
+        </article>
35
+{/block}

+ 2
- 12
Application/templates/SmartAdmin/meta/htmlFooter.tpl Datei anzeigen

@@ -43,6 +43,8 @@
43 43
 <!-- FastClick: For mobile devices -->
44 44
 <script src="lib/SmartAdmin/js/plugin/fastclick/fastclick.min.js"></script>
45 45
 
46
+<script src="lib/SmartAdmin/js/plugin/datatables/jquery.dataTables.min.js"></script>
47
+
46 48
 
47 49
 <!--[if IE 8]>
48 50
 
@@ -53,18 +55,6 @@
53 55
 <!-- MAIN APP JS FILE -->
54 56
 <script src="lib/SmartAdmin/js/app.min.js"></script>
55 57
 
56
-<!-- ENHANCEMENT PLUGINS : NOT A REQUIREMENT -->
57
-<!-- Voice command : plugin -->
58
-<script src="lib/SmartAdmin/js/speech/voicecommand.min.js"></script>
59
-
60
-<!-- SmartChat UI : plugin -->
61
-<script src="lib/SmartAdmin/js/smart-chat-ui/smart.chat.ui.min.js"></script>
62
-<script src="lib/SmartAdmin/js/smart-chat-ui/smart.chat.manager.min.js"></script>
63
-
64
-
65
-<!-- Full Calendar -->
66
-<script src="lib/SmartAdmin/js/plugin/moment/moment.min.js"></script>
67
-<script src="lib/SmartAdmin/js/plugin/fullcalendar/jquery.fullcalendar.min.js"></script>
68 58
 <script src="lib/SmartAdmin/js/main.js"></script>
69 59
 {block name="additionalJSFiles"}{/block}
70 60
 <script>

+ 0
- 6
Application/templates/SmartAdmin/navigation/sideNavigation.tpl Datei anzeigen

@@ -45,11 +45,5 @@
45 45
             </li>
46 46
         </ul>
47 47
     </nav>
48
-
49
-
50
-    <span class="minifyme" data-action="minifyMenu">
51
-				<i class="fa fa-arrow-circle-left hit"></i>
52
-			</span>
53
-
54 48
 </aside>
55 49
 <!-- END NAVIGATION -->

+ 1
- 1
version Datei anzeigen

@@ -1 +1 @@
1
-v0.2.4
1
+v0.2.6

+ 22
- 0
web/ajax/downloadOverview.php Datei anzeigen

@@ -0,0 +1,22 @@
1
+<?php
2
+require_once "../../init.php";
3
+
4
+use SCF\Core\DI;
5
+use SCF\Core\Database;
6
+if(empty($_GET['ssp'])) {
7
+    $tpl->display("ajax/downloadOverview.tpl");
8
+}
9
+elseif ($_GET['ssp'] == 1) {
10
+    $db_slave = new Database($config['dbext'], $config['dbhost'], $config['dbuser'], $config['dbpass'], 'sks_gametracking');
11
+
12
+    $db_slave->query("SELECT * FROM sks_unique_dls ORDER BY `timestamp` ASC");
13
+    $result = $db_slave->fetchArray();
14
+
15
+    echo '{"data": '.json_encode($result).'}';
16
+}
17
+else {
18
+    return 'lol';
19
+}
20
+
21
+
22
+

+ 20
- 0
web/ajax/visitorOverview.php Datei anzeigen

@@ -0,0 +1,20 @@
1
+<?php
2
+require_once "../../init.php";
3
+
4
+use SCF\Core\DI;
5
+use SCF\Core\Database;
6
+
7
+if(empty($_GET['ssp'])) {
8
+    $tpl->display("ajax/visitorOverview.tpl");
9
+}
10
+elseif ($_GET['ssp'] == 1) {
11
+    $db_slave = new Database($config['dbext'], $config['dbhost'], $config['dbuser'], $config['dbpass'], 'sks_gametracking');
12
+
13
+    $db_slave->query("SELECT * FROM sks_unique_user ORDER BY `timestamp` ASC");
14
+    $result = $db_slave->fetchArray();
15
+
16
+    echo '{"data": '.json_encode($result).'}';
17
+}
18
+else {
19
+    return "lol";
20
+}

+ 94
- 0
web/lib/SmartAdmin/js/ajax/dataTable.js Datei anzeigen

@@ -0,0 +1,94 @@
1
+$.extend(true, $.fn.dataTable.defaults, {
2
+    bLengthChange: false,
3
+    pageLength: 15,
4
+    "language": {
5
+        "sEmptyTable": "Keine Daten in der Tabelle vorhanden",
6
+        "sInfo": "_START_ bis _END_ von _TOTAL_ Eintr&auml;gen",
7
+        "sInfoEmpty": "0 bis 0 von 0 Eintr&auml;gen",
8
+        "sInfoFiltered": "(gefiltert von _MAX_ Eintr&auml;gen)",
9
+        "sInfoPostFix": "",
10
+        "sInfoThousands": ".",
11
+        "sLengthMenu": "_MENU_ Eintr&auml;ge anzeigen",
12
+        "sLoadingRecords": "Wird geladen...",
13
+        "sProcessing": "Bitte warten...",
14
+        "sSearch": "Suchen: ",
15
+        "sZeroRecords": "Keine Eintr&auml;ge vorhanden.",
16
+        "oPaginate": {
17
+            "sFirst": "Erste",
18
+            "sPrevious": "Zur&uuml;ck",
19
+            "sNext": "N&auml;chste",
20
+            "sLast": "Letzte"
21
+        },
22
+        "oAria": {
23
+            "sSortAscending": ": aktivieren, um Spalte aufsteigend zu sortieren",
24
+            "sSortDescending": ": aktivieren, um Spalte absteigend zu sortieren"
25
+        }
26
+    },
27
+    responsive: true
28
+});
29
+
30
+function convertTimestamp(UNIX_TS) {
31
+    var date = new Date(UNIX_TS * 1000);
32
+    var year = date.getFullYear();
33
+    var month = date.getMonth()+1;
34
+    var day = date.getDate();
35
+    var hour = date.getHours() < 10 ? '0'+date.getHours() : date.getHours();
36
+    var min = date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes();
37
+    var sec = date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds();
38
+    var fulltime = day + '.' + month + '.' + year + ' - ' + hour + ':' + min + ':' + sec;
39
+    return fulltime;
40
+}
41
+
42
+function anonIP(ipdata) {
43
+    var split = ipdata.split(".", 2);
44
+    return split[0]+'.'+split[1]+'.xxx.xxx';
45
+}
46
+
47
+function refLink(referrer) {
48
+    if(referrer != 'direct') {
49
+        return '<a href="'+referrer+'" target="_blank">Link zum Referer</a><p class="note">'+referrer+'</p>';
50
+    } else {
51
+        return 'Browsereingabe oder Anonymisierter aufruf';
52
+    }
53
+}
54
+
55
+$(document).ready(function() {
56
+    $('#dlLists').DataTable({
57
+        "ajax": "ajax/downloadOverview.php?ssp=1",
58
+
59
+        columns: [
60
+            {"data": "guid"},
61
+            {"data": function(data) {
62
+                    return anonIP(data.ip_adress);
63
+                }
64
+            },
65
+            {"data": "user_agent"},
66
+            {"data": function(data) {
67
+                    return convertTimestamp(data.timestamp);
68
+                }
69
+            },
70
+            {"data": "dl_version"}
71
+        ]
72
+    });
73
+
74
+    $('#visitorLists').DataTable({
75
+        "ajax": "ajax/visitorOverview.php?ssp=1",
76
+
77
+        columns: [
78
+            {"data": "guid"},
79
+            {"data": function(data) {
80
+                    return anonIP(data.ip_adress);
81
+                }
82
+            },
83
+            {"data": "user_agent"},
84
+            {"data": function(data) {
85
+                    return refLink(data.referrer);
86
+                }
87
+            },
88
+            {"data": function(data) {
89
+                    return convertTimestamp(data.timestamp);
90
+                }
91
+            }
92
+        ]
93
+    });
94
+});

+ 32
- 0
web/lib/SmartAdmin/js/main.js Datei anzeigen

@@ -14,4 +14,36 @@ $(document).ready(function() {
14 14
             });
15 15
         });
16 16
     });
17
+
18
+    $('#allDls').click(function(e) {
19
+       var loadData = $.ajax({
20
+           method: "GET",
21
+           url: "ajax/downloadOverview.php"
22
+       });
23
+
24
+       loadData.done(function(data) {
25
+           $("#ajaxReq").html(data);
26
+       });
27
+
28
+       loadData.fail(function (jqXHR, textStatus) {
29
+           alert("Request failed: " + textStatus);
30
+       });
31
+       e.preventDefault();
32
+    });
33
+
34
+    $('#allVisits').click(function(e) {
35
+       var loadData = $.ajax({
36
+           method: "GET",
37
+           url: "ajax/visitorOverview.php"
38
+       });
39
+
40
+       loadData.done(function(data) {
41
+          $("#ajaxReq").html(data);
42
+       });
43
+
44
+       loadData.fail(function (jqXHR, textStatus) {
45
+           alert("Request failed: " + textStatus);
46
+       });
47
+    });
48
+
17 49
 });

Laden…
Abbrechen
Speichern