Bladeren bron

Merge pull request #3 in ~MVOELKEL/sks-landingpage from develop to master

* commit 'ef6a423a0f':
  - fixing bug in Version NUmber Tracking
  -fixing stuff
master
Marcel Völkel 7 jaren geleden
bovenliggende
commit
13aa8657f4

+ 4
- 2
Application/scf/Additionals/Download.php Bestand weergeven

52
         $this->absolutePath = $absolutePath;
52
         $this->absolutePath = $absolutePath;
53
     }
53
     }
54
 
54
 
55
+    /**
56
+     * Download Control. Starts Downloads with the selected File in $tmpFile
57
+     * Absolute Path must be given!
58
+     */
55
     public function startDownloadFile()
59
     public function startDownloadFile()
56
     {
60
     {
57
         $tmpPath = $this->getAbsolutePath();
61
         $tmpPath = $this->getAbsolutePath();
73
         fclose($fh);
77
         fclose($fh);
74
 
78
 
75
     }
79
     }
76
-
77
-//TODO: Finishing Download Class to generate correct Downloads for Page!
78
 }
80
 }

+ 27
- 2
Application/scf/Additionals/Tracking.php Bestand weergeven

6
 
6
 
7
 class Tracking
7
 class Tracking
8
 {
8
 {
9
-
9
+    /**
10
+     * @var Database
11
+     */
10
     private $_db;
12
     private $_db;
11
 
13
 
14
+    /**
15
+     * @var string
16
+     */
12
     private $currentUserIp;
17
     private $currentUserIp;
13
 
18
 
19
+    /**
20
+     * @var string
21
+     */
14
     private $currentUserAgent;
22
     private $currentUserAgent;
15
 
23
 
24
+    /**
25
+     * @var string
26
+     */
16
     private $currentUserReferer;
27
     private $currentUserReferer;
17
 
28
 
29
+    /**
30
+     * @var string
31
+     */
18
     private $trackingTarget;
32
     private $trackingTarget;
19
 
33
 
34
+    /**
35
+     * Tracking constructor.
36
+     * @param Database $db
37
+     */
20
     public function __construct(Database $db)
38
     public function __construct(Database $db)
21
     {
39
     {
22
         $this->_db = $db;
40
         $this->_db = $db;
70
         return $this->currentUserReferer;
88
         return $this->currentUserReferer;
71
     }
89
     }
72
 
90
 
91
+    /**
92
+     * Check Users to track them only once a day
93
+     */
73
     public function checkUniqueUser()
94
     public function checkUniqueUser()
74
     {
95
     {
75
         $this->_db->query("SELECT ip_adress, `timestamp` FROM sks_unique_user WHERE ip_adress = '{$this->getCurrentUserIp()}' ORDER BY `timestamp` DESC LIMIT 1");
96
         $this->_db->query("SELECT ip_adress, `timestamp` FROM sks_unique_user WHERE ip_adress = '{$this->getCurrentUserIp()}' ORDER BY `timestamp` DESC LIMIT 1");
108
         return $this->trackingTarget;
129
         return $this->trackingTarget;
109
     }
130
     }
110
 
131
 
132
+    /**
133
+     * @param $target
134
+     * @param $dlVersion
135
+     */
111
     public function saveTrackingInDb($target, $dlVersion)
136
     public function saveTrackingInDb($target, $dlVersion)
112
     {
137
     {
113
         $tmpTarget = $target;
138
         $tmpTarget = $target;
114
-        $tmpDlVersion = $dlVersion;
139
+        $tmpDlVersion = substr($dlVersion, 1);
115
         $timestamp = time();
140
         $timestamp = time();
116
         if ($tmpTarget == 'download') {
141
         if ($tmpTarget == 'download') {
117
             try {
142
             try {

+ 0
- 3
Application/templates/sternenkindsaga/errorpages/404.tpl Bestand weergeven

10
         <div class="clearfix"></div>
10
         <div class="clearfix"></div>
11
     </div>
11
     </div>
12
 </div>
12
 </div>
13
-
14
-
15
-
16
 {include file="footer.tpl"}
13
 {include file="footer.tpl"}

+ 1
- 1
Application/templates/sternenkindsaga/misc/facebook.tpl Bestand weergeven

1
 <div id="fb-root"></div>
1
 <div id="fb-root"></div>
2
-<script>(function (d, s, id) {
2
+<script type="text/javascript">(function (d, s, id) {
3
         var js, fjs = d.getElementsByTagName(s)[0];
3
         var js, fjs = d.getElementsByTagName(s)[0];
4
         if (d.getElementById(id)) return;
4
         if (d.getElementById(id)) return;
5
         js = d.createElement(s);
5
         js = d.createElement(s);

+ 0
- 3
bootstrap.php Bestand weergeven

44
 $di->set('tracking', new Tracking(DI::getInstance()->get('db')), true);
44
 $di->set('tracking', new Tracking(DI::getInstance()->get('db')), true);
45
 
45
 
46
 $settings = new System(DI::getInstance()->get('db'));
46
 $settings = new System(DI::getInstance()->get('db'));
47
-
48
 $router = DI::getInstance()->get('router');
47
 $router = DI::getInstance()->get('router');
49
-
50
-
51
 $tpl = new Templates($settings,$router);
48
 $tpl = new Templates($settings,$router);

+ 1
- 1
version Bestand weergeven

1
-v1.1.2 Rev: 2
1
+v1.1.2 Rev: 4

+ 5
- 6
web/Styles/css/sks-v2.css Bestand weergeven

7
 
7
 
8
 header {
8
 header {
9
     max-width: 800px;
9
     max-width: 800px;
10
-    margin: 20px auto 0px auto;
11
-    box-shadow: 0px 5px 10px #000;
10
+    margin: 20px auto 0 auto;
11
+    box-shadow: 0 5px 10px #000;
12
 }
12
 }
13
 
13
 
14
 footer {
14
 footer {
20
     border-top: 2px solid #e79b1f;
20
     border-top: 2px solid #e79b1f;
21
     background: url("../images/bg.png");
21
     background: url("../images/bg.png");
22
     background-position: top left;
22
     background-position: top left;
23
-    box-shadow: 0px -5px 10px #000000;
23
+    box-shadow: 0 -5px 10px #000000;
24
 }
24
 }
25
 
25
 
26
 a {
26
 a {
39
 }
39
 }
40
 
40
 
41
 .mediaLinks {
41
 .mediaLinks {
42
-    margin: 10px auto 0px auto;
42
+    margin: 10px auto 0 auto;
43
     float: right;
43
     float: right;
44
 }
44
 }
45
 
45
 
50
 }
50
 }
51
 
51
 
52
 .row-width {
52
 .row-width {
53
-
54
     width: 95%;
53
     width: 95%;
55
     max-width: 800px;
54
     max-width: 800px;
56
     margin: 20px auto 10px auto;
55
     margin: 20px auto 10px auto;
104
     background: linear-gradient(#1f1a16, #4d3c32);
103
     background: linear-gradient(#1f1a16, #4d3c32);
105
     padding: 10px;
104
     padding: 10px;
106
 
105
 
107
-    box-shadow: 0px 5px 10px #000000;
106
+    box-shadow: 0 5px 10px #000000;
108
     -webkit-border-radius: 5px;
107
     -webkit-border-radius: 5px;
109
     -moz-border-radius: 5px;
108
     -moz-border-radius: 5px;
110
     border-radius: 5px;
109
     border-radius: 5px;

+ 0
- 2
web/index.php Bestand weergeven

22
 $tracking->setCurrentUserReferer($userReferer);
22
 $tracking->setCurrentUserReferer($userReferer);
23
 $tracking->checkUniqueUser();
23
 $tracking->checkUniqueUser();
24
 if($match === false) {
24
 if($match === false) {
25
-    var_dump($match);
26
     $tpl->display('errorpages/404.tpl');
25
     $tpl->display('errorpages/404.tpl');
27
 }
26
 }
28
 else {
27
 else {
29
     try {
28
     try {
30
         require $match['target'];
29
         require $match['target'];
31
     } catch(Exception $e) {
30
     } catch(Exception $e) {
32
-        echo '3';
33
         return $e->getMessage();
31
         return $e->getMessage();
34
     }
32
     }
35
 }
33
 }

Laden…
Annuleren
Opslaan