commit 8f6bbe1ded3ef8a6c80bcb55af9a90a87b7fc532
parent 92bd40d0940ab14c321fc7a36a327821113b2c6f
Author: MTRNord <mtrnord1@gmail.com>
Date: Sat, 13 Dec 2014 18:43:28 +0100
work on newpost function
Diffstat:
2 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/core/backend/admin/blog/.gitignore b/core/backend/admin/blog/.gitignore
@@ -1,4 +0,0 @@
-# Ignore everything in this directory
-*
-# Except this file
-!.gitignore
-\ No newline at end of file
diff --git a/core/backend/admin/blog/newpost.php b/core/backend/admin/blog/newpost.php
@@ -0,0 +1,36 @@
+<?php
+include('../../core/config/variables.config.php');
+
+################
+# lang support #
+################
+function getBrowserLangs() {
+ $langs[0] = $langs[1] = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
+ $langs[0] = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+ foreach($langs[0] as $l) {
+ $q = explode(';', $l);
+ $lang = substr($q[0], 0, 2);
+ $q = (isset($q[1])) ? (float)substr($q[1], 2) : 1;
+ $result[$lang] = $q;
+ }
+ if(isset($result) && is_array($result)) {
+ arsort($result, SORT_NUMERIC);
+ return $result;
+ }
+ return $result[$langs[1]] = 1;
+}
+
+$langs = getBrowserLangs();
+foreach($langs as $prio => $lang) {
+ if($lang = 'de') {
+ include('lang/de-DE.php');
+ break;
+ } elseif($lang = 'en') {
+ include('lang/en-US.php');
+ break;
+ }
+ // AND SO ON .................
+}
+$uri = $_SERVER['REQUEST_URI'];
+echo "$uri";
+?>
+\ No newline at end of file