diff --git a/.htaccess b/.htaccess index 0f1f401..f29fd07 100644 --- a/.htaccess +++ b/.htaccess @@ -22,3 +22,8 @@ RewriteCond %{REQUEST_FILENAME} !-d RewriteRule "^([a-z0-9_\-\./,]+)$" page.php?url=$1 [QSA] + +# Ein paar nette PHP-Einstellungen die das Leben schoener machen: +php_flag expose_php off +php_flag zlib.output_compression on +php_value zlib.output_compression_level 6 diff --git a/README.txt b/README.txt index d89e983..10bda70 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ ### Weblogsystem Jlog ### Programmiert von Jeena Paradies, Dennis Riehle, Robert Bienert ### Mailingliste: -### Projektseite: +### Projektseite: ### Hilfe zur Installation: ### diff --git a/admin/auth.php b/admin/auth.php index a80d8a9..ae34a91 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -1,12 +1,15 @@ BBCode Anleitung +

Links | Betonung | + Bilder | Überschrift | + Listen | Zitate | HTML +

+

Allgemein zu Zeilenumbrüchen, Absätzen und Leerzeichen

+

[Enter] im normalen Fließtext darf nur in Paaren vorkommen, wenn man + einen richtigen Absatz erzeugen will. Vor jedem + block Element + muss zwei mal [Enter] gedrückt werden, da dies so zu sagen einen neuen + Absatz einleitet. +

+

Man sollte nie nur einen + Enter einzeln setzen, um die Breite des Textes zu bestimmen. Das macht + die Auszeichnungssprache XHTML + nämlich von ganz alleine, je nachdem wie viel Platz der Besucher auf seinem Bildschirm + hat. Auch brauchst du keine Angst haben dass der Platz im Eingabefensterchen + nicht ausreicht, wenn du einen langen URL schreibst, das bricht auch automatisch um. + Bitte also keinen [Enter] vor einen URL setzen nur damit das in der neuen Zeile Anfängt. +

+

Leerzeichen müssen vor und hinter jedes inline Element. + Innerhalb von inline Elementen dürfen Leerzeichen nur zwischen zwei Wörtern + stehen, niemals aber direkt hinter dem einleitenden Tag, also niemals so:
+ [url=http://exapmle.tld][Leerzeichen]Beispiel Link[Leerzeichen][/url]
+ sondern in etwa so: [url=http://example.tld]Beispiel Link[/url]. +

+

Die einzige Ausnahme dieser Regel ist, wenn man nur einen Teil eines Wortes als + etwas besonderes auszeichnen will. Dann macht man es zum Beispiel so:
+ Inter[url=http://communication.tld]kommunikation[/url]smanagment
+ welches ergibt: Interkommunikationsmanagment +

+

Vor einem Punkt ».« kommt niemals ein Leerzeichen, sondern immer dahinter. +

+ + + + +

Betonung (inline)

+
    +
  • [b]stark betont[/b]
  • +
  • [i]leicht betont[/i]
  • +
+ +

Bilder ( inline / + block )

+

Grundsätzlich wird ein Bild so eingefügt: [img]1.jpg[/url] und ist ein + inline Element. Bei dir macht + das ja sowieso das Script. Wenn du irgendwann ein Bild von einem anderen Server einfügen + möchtest dann musst du es so machen: [url]http://example.tld/pfad/zum/Bild.jpg[/img] + meistens ist das aber von anderen Webmastern nur sehr ungern gesehen. Bilder können noch drei + Attribute enthalten:

+

Erstens: + [img class="klassenname"]1.jpg[/img] welches dem Bild eine Klasse mitgibt. + Man könnte z.B. eine Klasse fr in CSS so gestalten, dass Sie + das Bild rechts floaten lässt, oder eine Klasse photo, die allen + Photos einen Weißen Rahmen gibt usw. usf. Verschiedene Klassen sind durch Leerzeichen + zu trennen.

+

Zweitens: [img alt="Alternativ Text für das Bild"]1.jpg[/img] welcher + eigentlich immer angegeben werden sollte. Er nutzt Suchmaschinen, die keine Bilder + sehen können und auch Menschen die keine Bilder sehen können, sei es dass sie + Blind sind, oder Bilder abschalten um schneller surfen zu können, oder dass Ihr + Browser keine Bilder anzeigen kann.

+

Drittens: [img caption="Eine Bildunterschrift"]1.jpg[/img] + das Attribut caption ist anders als die anderen zwei. Es macht aus dem Bild + eine Definitionsliste und somit ein block Element, der dann das class Attribut anstatt + dem Bild übergeben wird. Darüber Hinaus bekommt die Definitionsliste auch noch die Breite + des Bildes. Der ausgegebene HTML Code sieht dann in Etwa so aus:

+

+  <dl class="photo fr" style="width: 200px;">
+   <dt><img alt="Ein Pferd" style="width: 200px; height: 150px;" />
+    <dd>Eine Bildunterschrift</dd>
+  </dl>

+

Dies funktioniert nur bei Bildern, die über das Jlog hochgeladen wurden.

+

Vollständig könnte das zum Beispiel so aussehen:

+

[img class="fr" alt="Ein sehr großer Pferdekopf" caption="Mein Pferd ist das + schönste"]http://jeenaparadies.net/img/weblog/pferd.jpg[/img]

+

Bilder sollten aber mit Rücksicht auf die Benutzer mit kleinem Bildschirm/Fenster + und die Modembenutzer nicht all zu groß sein. Alles was breiter als 500px + ist, fängt an gefährlich zu werden. +

+ +

Überschrift (block)

+
[headline]

Überschrift erster Ordnung

[/headline]
+ +

Listen (block)

+

Hier auch wichtig davor und dahinter eine Leerzeile zu lassen, damit das auch als + richtiger Absatz gesehen wird. Aber bitte hier auch keine unnötigen Leerzeichen + reinmachen. +

+ +

Ungeordnete Liste (block)

+

[list]
+ [*]erster Punkt
+ [*]zweiter Punkt
+ [*]dritter Punkt
+ [/list] +

+

Ergibt:

+
    +
  • erster Punkt
  • +
  • zweiter Punkt
  • +
  • dritter Punkt
  • +
+ +

Nummerierte Liste (block)

+

Genau so wie bei der ungeordneten, mit der Ausnahme, dass anstatt [list], [#list] + verwendet wird. Das Ergebniss sieht dann so aus: +

+
    +
  1. erster Punkt
  2. +
  3. zweiter Punkt
  4. +
  5. dritter Punkt
  6. +
+ +

Zitate (block)

+

Bitte nach [quote] kein Leerzeichen und auch keinen Zeilenumbruch ein fügen. Genau so + bei [/quote] keinen davor. +

+
+

[quote]Ich bin ein Zitat welches nur dazu da ist um zu zeigen wie + das alles hier so geht. Und aber auch dazu um zu zeigen dass es mehrere Zeilen + sein können.

+

Oder auch mehrere Absätze wie jetzt zum Beispiel hier.[/quote]

+
+

HTML

+

Um normalen HTML Quelltext eingeben zu können, der von BBCode nicht behandelt wird, + kann man [html] verwenden. Dann muss man sich allerdings um alles selbst kümmern, + auch um Absätze und Zeilenumbrüche.

+ '; + +require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php'); +echo $body; + +?> \ No newline at end of file diff --git a/admin/blog.func.php b/admin/blog.func.php index 052d518..e096044 100644 --- a/admin/blog.func.php +++ b/admin/blog.func.php @@ -2,6 +2,8 @@ // Untersuchen ob alles eingegeben wurde function check_input($form_input) { global $l; + $errors = array(); + if(strlen(trim($form_input['topic'])) < 1) $errors[] = $l['admin']['no_headline']; // checking URL @@ -29,8 +31,8 @@ global $l; } else { $sql = "SELECT id FROM ".JLOG_DB_CONTENT." WHERE - YEAR(date) = ".date("Y", $f['date'])." AND - MONTH(date) = ".date("m", $f['date'])." AND + YEAR(date) = ".date("Y", strtotime($f['date']))." AND + MONTH(date) = ".date("m", strtotime($f['date']))." AND url = '".$f['url']."';"; } @@ -54,7 +56,11 @@ global $l; $errors[] = $l['admin']['false_teaserpic']; } - if($form_input['teaserpiconblog'] == "1" AND strlen(trim($form_input['teaserpic'])) == 0) $errors[] = $l['admin']['no_teaserpic_uploaded']; + if(isset($form_input['teaserpiconblog']) && $form_input['teaserpiconblog'] == "1" + AND strlen(trim($form_input['teaserpic'])) == 0) + { + $errors[] = $l['admin']['no_teaserpic_uploaded']; + } if(strlen(trim($form_input['teaser'])) < 1) $errors[] = $l['admin']['no_teaser']; if(strlen(trim($form_input['content'])) < 1) $errors[] = $l['admin']['no_content']; @@ -64,17 +70,31 @@ global $l; // Eingabeformular function form_output($form_input) { - $form_input = array_htmlspecialchars($form_input); -global $l, $categories, $plugins; + $form_input = array_htmlspecialchars($form_input); + global $l, $categories, $plugins; - if($form_input['teaserpiconblog'] == 1) $form_input['teaserpiconblog_check'] = "checked='checked'"; - if($form_input['section'] == 'page') $page = " checked='checked'"; - else $weblog = " checked='checked'"; - if($form_input['allowcomments'] === '0') $form_input['comments_check'] = "checked='checked'"; - if($form_input['allowpingback'] === '0') $form_input['pingback_check'] = "checked='checked'"; + if (isset($form_input['teaserpiconblog']) && $form_input['teaserpiconblog'] == 1) + $form_input['teaserpiconblog_check'] = "checked='checked'"; + if (isset($form_input['section']) && $form_input['section'] == 'page') { + $page = " checked='checked'"; + $weblog = ''; + } + else { + $page = ''; + $weblog = " checked='checked'"; + } + if (isset($form_input['allowcomments']) && $form_input['allowcomments'] === '0') + $form_input['comments_check'] = "checked='checked'"; + if (isset($form_input['allowpingback']) && $form_input['allowpingback'] === '0') + $form_input['pingback_check'] = "checked='checked'"; + + array_contains($form_input, + array('topic', 'url', 'teaser', 'keywords', 'categories', + 'teaserpic', 'teaserpiconblog_check', 'comments_check', + 'pingback_check', 'content', 'id', 'date')); $o = " -
+
".$l['admin']['metadata']."


  @@ -141,16 +161,22 @@ global $l, $bbcode, $categories; // get data from _post if(empty($form_input['date'])) $form_input['date'] = time(); - $output = "

".$l['admin']['preview']."

\n
".do_entry($form_input, NULL, $section)."
"; + $output = "

".$l['admin']['preview']."

\n
".do_entry($form_input, NULL, $form_input['section'])."
"; return $output; } function insert_blog($form_input) { -global $l, $plugins; +global $l, $plugins, $connect; - if($form_input['allowcomments'] != "0") $form_input['allowcomments'] = "1"; - if($form_input['allowpingback'] != "0") $form_input['allowpingback'] = "1"; + $form_input['allowcomments'] = + isset($form_input['allowcomments']) && $form_input['allowcomments'] == "0" ? + "0" : "1"; + $form_input['allowpingback'] = + isset($form_input['allowpingback']) && $form_input['allowpingback'] == "0" ? + "0" : "1"; + + array_contains($form_input, array('teaserpiconblog')); $form_input = escape_for_mysql($form_input); $sql = "INSERT INTO ".JLOG_DB_CONTENT." ( @@ -179,7 +205,7 @@ global $l, $plugins; '".$form_input['allowpingback']."' );"; $writeblog = new Query($sql); - $id = mysql_insert_id(); + $id = $connect->insert_id; if($writeblog->error()) { echo "
\n";
         echo $writeblog->getError();
@@ -190,6 +216,7 @@ global $l, $plugins;
     if(is_array($form_input['categories']) AND $form_input['categories']['0'] != 'no_categories') {
     $sql = "INSERT INTO ".JLOG_DB_CATASSIGN." ( cat_id, content_id )
                 VALUES \n";
+    $i = 0;
     foreach($form_input['categories'] AS $category) {
             if(++$i > 1) $sql .= ",\n";
             $sql .= "( '".$category."', '".$id."')";
@@ -236,10 +263,15 @@ global $l, $categories;
 function update_blog($form_input) {
 global $l, $plugins;
 
-    if($form_input['allowcomments'] != "0") $form_input['allowcomments'] = "1";
-    if($form_input['allowpingback'] != "0") $form_input['allowpingback'] = "1";
+    if(!isset($form_input['allowcomments']) || $form_input['allowcomments'] != "0")
+    	$form_input['allowcomments'] = "1";
+    if(!isset($form_input['allowpingback']) || $form_input['allowpingback'] != "0")
+    	$form_input['allowpingback'] = "1";
 
      $form_input = escape_for_mysql($form_input);
+     array_contains($form_input,
+     	['teaserpiconblog', 'allowcomments', 'allowpingback']);
+
      $sql = "UPDATE ".JLOG_DB_CONTENT." SET
                     topic              = '".$form_input['topic']."',
                     url                 = '".$form_input['url']."',
@@ -275,6 +307,7 @@ global $l, $plugins;
     if(is_array($form_input['categories']) AND $form_input['categories']['0'] != 'no_categories') {
         $sql = "INSERT INTO ".JLOG_DB_CATASSIGN." ( cat_id, content_id )
                     VALUES \n";
+	$i = 0;
         foreach($form_input['categories'] AS $category) {
             if(++$i > 1) $sql .= ",\n";
             $sql .= "( '".$category."', '".$form_input['id']."')";
diff --git a/admin/categories.php b/admin/categories.php
index d7f485a..e80d042 100644
--- a/admin/categories.php
+++ b/admin/categories.php
@@ -10,6 +10,8 @@
  $c['meta']['title'] = $l['admin']['cat_title'];
  $c['main'] = output_admin_menu()."

".$l['admin']['cat_title']."

\n"; + array_contains($get, array('action')); + switch ($get['action']) { case 'new': @@ -25,7 +27,7 @@ $c['main'] .= $categories->output_form($form_input, 'new', $l['admin']['cat_new']); } } - else $c['main'] .= $categories->output_form(array('id' => NULL, 'name' => NULL, 'url' => NULL, 'description' => NULL), 'new', $l['admin']['cat_new']); + else $c['main'] .= $categories->output_form(array(), 'new', $l['admin']['cat_new']); break; case 'change': @@ -76,4 +78,3 @@ require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php'); echo $body; -?> diff --git a/admin/change.php b/admin/change.php index f936d62..5a230d8 100644 --- a/admin/change.php +++ b/admin/change.php @@ -11,6 +11,8 @@ $c['main'] = output_admin_menu(); $c['main'] .= "

".$l['admin']['change_headline']."

"; +array_contains($get, array('action')); + if($get['action'] == "trash" AND $post['trash'] == $l['admin']['yes']) { $c['main'] .= "

".trash_blog($get['id'])."

"; include_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'update.php'); @@ -31,13 +33,17 @@ else { if(isset($get['id'])) $form_input = get_blog($get['id']); elseif (isset($_POST)) $form_input = $post; else $c['main'] .= $l['admin']['error_occurred']; - - if($post['form_submitted'] == $l['admin']['preview']) { + + $formSubmitted = array_key_exists('form_submitted', $post); + + if($formSubmitted && $post['form_submitted'] == $l['admin']['preview']) + { $c['main'] .= error_output(check_input($form_input)); $c['main'] .= preview_output($form_input); $c['main'] .= form_output($form_input); } - elseif($post['form_submitted'] == $l['admin']['publish']) { + elseif($formSubmitted && $post['form_submitted'] == $l['admin']['publish']) + { // Put data to database if(!check_input($form_input)) { $c['main'] .= "

".update_blog($form_input)."

"; @@ -57,4 +63,3 @@ else { require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php'); echo $body; -?> diff --git a/admin/comments.php b/admin/comments.php index 1784bed..bb39665 100644 --- a/admin/comments.php +++ b/admin/comments.php @@ -5,14 +5,16 @@ define("JLOG_COMMENTS", true); require_once('..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php'); require(JLOG_BASEPATH.'admin'.DIRECTORY_SEPARATOR.'blog.func.php'); -$get = strip($_GET); -$data = strip($_POST); -$mysql_id = escape_for_mysql($get['id']); +$get = strip($_GET); +$data = strip($_POST); +$mysql_id = isset($get['id']) ? escape_for_mysql($get['id']) : null; -$c['meta']['title'] = $l['admin']['kill_c_topic']; -$c['main'] = output_admin_menu(); +$c['meta']['title'] = $l['admin']['kill_c_topic']; +$c['main'] = output_admin_menu(); -if($get['action'] == 'trash' AND $data['trash'] == $l['admin']['yes']) { +array_contains($get, array('action')); + +if($get['action'] == 'trash' AND $data['trash'] == $l['admin']['yes']) { ### Plugin Hook $get['id'] = $plugins->callHook('deleteComment', $get['id']); @@ -80,138 +82,147 @@ elseif($get['action'] == 'change' AND !empty($get['id'])) { $l["comments_plz_format_txt"] = $l['admin']["comments_plz_format_txt"]; $l["comments_url_href"] = $l['admin']["comments_url_href"]; $l["comments_url_node"] = $l['admin']["comments_url_node"]; - - if($data['form_submitted'] == $l['comments_preview']) { - $c['main'] .= "\n

".$l['admin']['comments_change_h']."

-
    - ".do_comment($data, 1)." -
".com_form_output($data).com_javascript_variables(); - } - elseif($data['form_submitted'] == $l['comments_send']) { - if(count($errors = com_check_errors($data)) > 0) $c['main'] .= "\n

".$l['admin']['comments_change_h']."

\n".error_output($error).com_form_output($data).com_javascript_variables(); - else { - $data = com_clean_data($data); - -### Plugin Hook - $data = $plugins->callHook('updateComment', $data); - - $data = escape_for_mysql($data); - - $sql = "UPDATE ".JLOG_DB_COMMENTS." - SET - name = '".$data['name']."', - city = '".$data['city']."', - email = '".$data['email']."', - homepage = '".$data['homepage']."', - content = '".$data['content']."', - mail_by_comment = '".$data['mail_by_comment']."' - WHERE id = '".$data['id']."' LIMIT 1;"; - - $updatecomment = new Query($sql); - if($updatecomment->error()) { - echo "
\n"; 
-               echo $updatecomment->getError(); 
-               echo "
\n"; - die(); - } - $c['main'] .= "\n

".$l['admin']['comments_change_h']."

\n".$l['admin']['comments_updated']." ".$l['admin']['comments_admin'].""; - include_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'update.php'); - } - } - else { + $form_submitted = false; + + if (isset($data['form_submitted'])) { + if($data['form_submitted'] == $l['comments_preview']) { + $c['main'] .= "\n

".$l['admin']['comments_change_h']."

+
    + ".do_comment($data, 1)." +
".com_form_output($data).com_javascript_variables(); + $form_submitted = true; + } + elseif($data['form_submitted'] == $l['comments_send']) { + if(count($errors = com_check_errors($data)) > 0) $c['main'] .= "\n

".$l['admin']['comments_change_h']."

\n".error_output($error).com_form_output($data).com_javascript_variables(); + else { + + $data = com_clean_data($data); + + ### Plugin Hook + $data = $plugins->callHook('updateComment', $data); + + $data = escape_for_mysql($data); + + $sql = "UPDATE ".JLOG_DB_COMMENTS." + SET + name = '".$data['name']."', + city = '".$data['city']."', + email = '".$data['email']."', + homepage = '".$data['homepage']."', + content = '".$data['content']."', + mail_by_comment = '".$data['mail_by_comment']."' + WHERE id = '".$data['id']."' LIMIT 1;"; + + $updatecomment = new Query($sql); + if($updatecomment->error()) { + echo "
\n";
+		       echo $updatecomment->getError();
+		       echo "
\n"; + die(); + } + $c['main'] .= "\n

".$l['admin']['comments_change_h']."

\n".$l['admin']['comments_updated']." ".$l['admin']['comments_admin'].""; + include_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'update.php'); + } + + $form_submitted = true; + } + } + + if (!$form_submitted) { $sql = 'SELECT id, sid, name, city, email, homepage, content, ' . 'UNIX_TIMESTAMP(date) AS date, reference, ' . - 'mail_by_comment, type FROM '.JLOG_DB_COMMENTS." - WHERE id = ".$mysql_id." - ORDER BY id DESC LIMIT 1;"; + 'mail_by_comment, type FROM '.JLOG_DB_COMMENTS." + WHERE id = ".$mysql_id." + ORDER BY id DESC LIMIT 1;"; - $comment = new Query($sql); - if($comment->error()) { - echo "
\n"; 
-            echo $comment->getError(); 
-            echo "
\n"; - die(); + $comment = new Query($sql); + if($comment->error()) { + echo "
\n";
+            echo $comment->getError();
+            echo "
\n"; + die(); } - - $data = $comment->fetch(); - if(empty($data['name'])) $data['name'] = $l['comments_name']; - if(empty($data['city'])) $data['city'] = $l['comments_city']; - if(empty($data['email'])) $data['email'] = $l['comments_email']; - if(empty($data['homepage'])) $data['homepage'] = $l['comments_homepage']; + + $data = $comment->fetch(); + if(empty($data['name'])) $data['name'] = $l['comments_name']; + if(empty($data['city'])) $data['city'] = $l['comments_city']; + if(empty($data['email'])) $data['email'] = $l['comments_email']; + if(empty($data['homepage'])) $data['homepage'] = $l['comments_homepage']; - $c['main'] .= "\n

".$l['admin']['comments_change_h']."

-
    - ".do_comment($data, 1)." -
".com_form_output($data).com_javascript_variables(); + $c['main'] .= "\n

".$l['admin']['comments_change_h']."

+
    + ".do_comment($data, 1)." +
".com_form_output($data).com_javascript_variables(); } } -else { -$yl = new Year_Links($get['y'], JLOG_START_YEAR, add_session_id_to_url(JLOG_PATH."/admin/comments.php"), $l['admin']); +else { + $yl = new Year_Links($get['y'] ?? null, JLOG_START_YEAR, + add_session_id_to_url(JLOG_PATH."/admin/comments.php"), + $l['admin']); - $c['main'] .= " -

".$l['admin']['kill_c_topic']."

-

".$l['admin']['kill_c_description']."

-

".$yl->get_admin_linklist()."

- - - - "; + $c['main'] .= " +

".$l['admin']['kill_c_topic']."

+

".$l['admin']['kill_c_description']."

+

".$yl->get_admin_linklist()."

+
".$l['admin']['change']."".$l['admin']['delete']."ID".$l['comments_name']."".$l['comments_posted']."".$l['admin']['kill_c_entry']."
+ + + "; - $sql = "SELECT - ".JLOG_DB_COMMENTS.".id AS id, - ".JLOG_DB_CONTENT.".url AS url, - UNIX_TIMESTAMP(".JLOG_DB_CONTENT.".date) AS reference_date, - UNIX_TIMESTAMP(".JLOG_DB_COMMENTS.".date) AS date, - ".JLOG_DB_COMMENTS.".name AS name, - ".JLOG_DB_CONTENT.".topic AS topic, + $sql = "SELECT + ".JLOG_DB_COMMENTS.".id AS id, + ".JLOG_DB_CONTENT.".url AS url, + UNIX_TIMESTAMP(".JLOG_DB_CONTENT.".date) AS reference_date, + UNIX_TIMESTAMP(".JLOG_DB_COMMENTS.".date) AS date, + ".JLOG_DB_COMMENTS.".name AS name, + ".JLOG_DB_CONTENT.".topic AS topic, ".JLOG_DB_COMMENTS.".email AS email, ".JLOG_DB_COMMENTS.".type AS type - FROM ".JLOG_DB_COMMENTS.", ".JLOG_DB_CONTENT." - WHERE ".JLOG_DB_COMMENTS.".reference = ".JLOG_DB_CONTENT.".id - AND YEAR(".JLOG_DB_COMMENTS.".date) = '".$yl->get_selected_year()."' - ORDER BY id DESC;"; + FROM ".JLOG_DB_COMMENTS.", ".JLOG_DB_CONTENT." + WHERE ".JLOG_DB_COMMENTS.".reference = ".JLOG_DB_CONTENT.".id + AND YEAR(".JLOG_DB_COMMENTS.".date) = '".$yl->get_selected_year()."' + ORDER BY id DESC;"; - $comments = new Query($sql); - if($comments->error()) { - echo "
\n"; 
-        echo $comments->getError(); 
-        echo "
\n"; - die(); + $comments = new Query($sql); + if($comments->error()) { + echo "
\n";
+        echo $comments->getError();
+        echo "
\n"; + die(); } while ($daten = $comments->fetch()) { - + if(empty($daten['name'])) $daten['name'] = $l['comments_anonym']; elseif($daten['type'] != 'pingback') $daten['name'] = htmlspecialchars($daten['name'], ENT_QUOTES); - if(!empty($daten['email'])) { - $email_a = ""; - $email_b = ""; + if(!empty($daten['email'])) { + $email_a = ""; + $email_b = ""; } - else { - $email_a = ""; - $email_b = ""; + else { + $email_a = ""; + $email_b = ""; } - $comment = " + $comment = " - - - - - - - "; + + + + + + + "; ### Plugin Hook $c['main'] .= $plugins->callHook('commentAdminList', $comment, $daten); } - $c['main'] .= " -
".$l['admin']['change']."".$l['admin']['delete']."ID".$l['comments_name']."".$l['comments_posted']."".$l['admin']['kill_c_entry']."
".$l[".$l[".$daten['id']."".$email_a.$daten['name'].$email_b."".strftime(JLOG_DATE_COMMENT, $daten['date'])."".$daten['topic']."
".$l[".$l[".$daten['id']."".$email_a.$daten['name'].$email_b."".strftime(JLOG_DATE_COMMENT, $daten['date'])."".$daten['topic']."
"; + $c['main'] .= " + "; } -require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php'); -echo $body; -?> +require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php'); +echo $body; diff --git a/admin/index.php b/admin/index.php index 39e1a05..80b58c5 100644 --- a/admin/index.php +++ b/admin/index.php @@ -5,11 +5,12 @@ require(JLOG_BASEPATH.'admin'.DIRECTORY_SEPARATOR.'blog.func.php'); $get = strip($_GET); - $yl = new Year_Links($get['y'], JLOG_START_YEAR, add_session_id_to_url(JLOG_PATH."/admin/"), $l['admin']); + $yl = new Year_Links($get['y'] ?? null, JLOG_START_YEAR, add_session_id_to_url(JLOG_PATH."/admin/"), $l['admin']); if(isset($get['show']) AND $get['show'] == 'page') { $show_section = "".$l['admin']['section_weblog']." | ".$l['admin']['section_page'].""; $where = "section = 'page'"; + $year_menu = ''; } else { $show_section = "".$l['admin']['section_weblog']." | ".$l['admin']['section_page'].""; @@ -23,6 +24,8 @@ $c['meta']['title'] = $l['admin']['index_headline']; + if (!isset($c['main'])) $c['main'] = ''; + $c['main'] .= output_admin_menu()."

".$l['admin']['admin_headline']."

»» ".$l['admin']['new_post']."

@@ -72,4 +75,4 @@ require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php'); echo $body; -// eof \ No newline at end of file +// eof diff --git a/admin/login.php b/admin/login.php index deeb7b5..02a5b8c 100644 --- a/admin/login.php +++ b/admin/login.php @@ -6,11 +6,12 @@ ### ### adapted for Jlog by Jeena Paradies -ini_set("session.use_trans_sid", false); +ini_set('session.use_trans_sid', false); -define("JLOG_ADMIN", true); -define("JLOG_LOGIN", true); +define('JLOG_ADMIN', true); +define('JLOG_LOGIN', true); require_once('..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php'); +require_once('..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'proto.inc.php'); require(JLOG_BASEPATH.'admin'.DIRECTORY_SEPARATOR.'blog.func.php'); $false_password = ""; @@ -43,7 +44,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' AND $dispatch_login) { if ($path == $url) $url = $path . 'new.php'; if (!empty($url)) $path = $url; - header('Location: ' . add_session_id_to_url("http://".$hostname.$path)); + header('Location: ' . add_session_id_to_url(proto().'://'.$hostname.$path)); exit; } else { @@ -55,15 +56,16 @@ else { } $c['meta']['title'] = $l['admin']['login_headline']; +$btnValue = htmlspecialchars($l['admin']['login_send']); $c['main'] = '

'.$l['admin']['login_headline'].'

' . $false_password . '

- +

-

+

'; @@ -73,4 +75,3 @@ $c["main"] = $plugins->callHook('loginForm', $c["main"]); require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php'); echo $body; - diff --git a/admin/media/select-picture.php b/admin/media/select-picture.php index a2b42e2..9c52458 100644 --- a/admin/media/select-picture.php +++ b/admin/media/select-picture.php @@ -3,14 +3,14 @@ define("JLOG_ADMIN", true); require_once('..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php'); ?> - + <?php echo $l['admin']['pic_choose_old'] ?> + - +

@@ -18,14 +18,17 @@ // Bildernamen für blog in ein Array schreiben $dir = JLOG_BASEPATH.'img'.DIRECTORY_SEPARATOR; -if($_GET['p']) { ?> -

-
+if(isset($_GET['p'])) { + $p = htmlspecialchars($_GET['p']); + $btnSubmit = htmlspecialchars($l['admin']['pic_insert']); + ?> +

+



-

+

\n"; + + foreach ($file as $filename => $ctime) { + $filename = htmlspecialchars($filename); + ?> + + - + <?php echo $l['admin']['pic_choose_old_teaser'] ?> + - + +

@@ -26,18 +39,16 @@ while (false !== ($filename = readdir ($handle))) { closedir($handle); if(is_array($file)) { - asort($file); reset($file); - while ( list($filename, $ctime) = each($file)) { - echo " "; + foreach($file as $filename => $ctime) { + $filename = htmlspecialchars($filename); + ?> diff --git a/admin/media/upload-picture.php b/admin/media/upload-picture.php index 7ac1cd8..dccc899 100644 --- a/admin/media/upload-picture.php +++ b/admin/media/upload-picture.php @@ -9,77 +9,82 @@ $up_dir_img = JLOG_PATH."/img/"; ?> - + <?php echo $l['admin']['pic_upload_header'] ?> + - +

$max_file_size) $errors[] = $l['admin']['pic_to_big']." (".number_format($_FILES['probe']['size']/1000,0,",","")." KB)"; + if ($_FILES['probe']['size'] > $max_file_size) $errors[] = $l['admin']['pic_to_big']." (".number_format($_FILES['probe']['size']/1000,0,",","")." KB)"; - if(empty($errors)) { - $nr = 0; - switch(true) - { - case preg_match('~.jpg|jpeg~i', $e): - for(;;) { $nr++; if (!file_exists($up_dir.$nr.".jpg")) break; } - $filename = $nr.".jpg"; - break; - case preg_match('~.gif~i', $e): - for(;;) { $nr++; if (!file_exists($up_dir.$nr.".gif")) break; } - $filename = $nr.".gif"; - break; - case preg_match('~.png~i', $e): - for(;;) { $nr++; if (!file_exists($up_dir.$nr.".png")) break; } - $filename = $nr.".png"; - break; - } + if(empty($errors)) { + $nr = 0; + switch(true) + { + case preg_match('~.jpg|jpeg~i', $e): + for(;;) { $nr++; if (!file_exists($up_dir.$nr.".jpg")) break; } + $filename = $nr.".jpg"; + break; + case preg_match('~.gif~i', $e): + for(;;) { $nr++; if (!file_exists($up_dir.$nr.".gif")) break; } + $filename = $nr.".gif"; + break; + case preg_match('~.png~i', $e): + for(;;) { $nr++; if (!file_exists($up_dir.$nr.".png")) break; } + $filename = $nr.".png"; + break; + } + + if(empty($errors)) { + if(!move_uploaded_file($_FILES['probe']['tmp_name'], $up_dir.$filename)) $errors[] = $l['admin']['pic_error']; + else chmod($up_dir.$filename, 0664); + } + } + if (empty($errors)) { + $btnSubmit = htmlspecialchars($l['admin']['pic_insert']); + ?> +

+

+
+


+

+


+

+

+
+ -

-

-
-


-

-


-

-

-
-



- +
- + <?php echo $l['admin']['pic_upload_teaser'] ?> + - +

$max_file_size) $errors[] = $l['admin']['pic_to_big']." (".number_format($_FILES['probe']['size']/1000,0,",","")." KB)"; + if ($_FILES['probe']['size'] > $max_file_size) $errors[] = $l['admin']['pic_to_big']." (".number_format($_FILES['probe']['size']/1000,0,",","")." KB)"; - if(empty($errors)) { - $nr = 0; - switch(true) - { - case preg_match('~.jpg|jpeg~i', $e): - for(;;) { $nr++; if (!file_exists($up_dir."t_".$nr.".jpg")) break; } - $filename = "t_".$nr.".jpg"; - break; - case preg_match('~.gif~i', $e): - for(;;) { $nr++; if (!file_exists($up_dir."t_".$nr.".gif")) break; } - $filename = "t_".$nr.".gif"; - break; - case preg_match('~.png~i', $e): - for(;;) { $nr++; if (!file_exists($up_dir."t_".$nr.".png")) break; } - $filename = "t_".$nr.".png"; - break; - } + if(empty($errors)) { + $nr = 0; + switch(true) + { + case preg_match('~.jpg|jpeg~i', $e): + for(;;) { $nr++; if (!file_exists($up_dir."t_".$nr.".jpg")) break; } + $filename = "t_".$nr.".jpg"; + break; + case preg_match('~.gif~i', $e): + for(;;) { $nr++; if (!file_exists($up_dir."t_".$nr.".gif")) break; } + $filename = "t_".$nr.".gif"; + break; + case preg_match('~.png~i', $e): + for(;;) { $nr++; if (!file_exists($up_dir."t_".$nr.".png")) break; } + $filename = "t_".$nr.".png"; + break; + } - $imginfo = getimagesize($_FILES['probe']['tmp_name']); + $imginfo = getimagesize($_FILES['probe']['tmp_name']); - if($imginfo[1] > 150 AND $imginfo[0] > 150 ) { - $errors[] = $l['admin']['pic_height_widht']; - } - elseif($imginfo[0] > 150 ) { - $errors[] = $l['admin']['pic_width']; - } - elseif($imginfo[1] > 150 ) { - $errors[] = $l['admin']['pic_height']; - } - if(empty($errors)) { - if(!move_uploaded_file($_FILES['probe']['tmp_name'], $up_dir.$filename)) $errors[] = $l['admin']['pic_error']; - else chmod($up_dir.$filename, 0664); - } - } - if (empty($errors)) { - ?> -

- -

- 150 AND $imginfo[0] > 150 ) { + $errors[] = $l['admin']['pic_height_widht']; + } + elseif($imginfo[0] > 150 ) { + $errors[] = $l['admin']['pic_width']; + } + elseif($imginfo[1] > 150 ) { + $errors[] = $l['admin']['pic_height']; + } + if(empty($errors)) { + if(!move_uploaded_file($_FILES['probe']['tmp_name'], $up_dir.$filename)) $errors[] = $l['admin']['pic_error']; + else chmod($up_dir.$filename, 0664); + } + } + if (empty($errors)) { + ?> +

+ +

+



- +
array('title' => '')); + $c['meta']['title'] .= $l['admin']['new_post']; $c['main'] = output_admin_menu(); $c['main'] .= "

".$l['admin']['new_post']."

"; $form_input = strip($_POST); $form_input['date'] = strftime("%Y-%m-%d %H:%M:%s"); -if($_POST['form_submitted'] == $l['admin']['preview']) { +if (!isset($_POST['form_submitted'])) { + // show form + $c['main'] .= form_output($form_input); +} +elseif($_POST['form_submitted'] == $l['admin']['preview']) { $c['main'] .= error_output(check_input($form_input)); + $form_input['date'] = time(); $c['main'] .= preview_output($form_input); $c['main'] .= form_output($form_input); } @@ -30,7 +38,7 @@ elseif($_POST['form_submitted'] == $l['admin']['publish']) { } // if(is_array($pingresult)) $c['main'] .= "\n
    ".join($pingresult)."\n
"; - if($form_input['allowpingback'] != '0') { + if(isset($form_input['allowpingback']) && $form_input['allowpingback'] != '0') { $blogentryForURL = get_blog($id); require_once(JLOG_BASEPATH.'xmlrpc.php'); $pingback = new Jlog_SendPingback($bbcode->parse($form_input['content']), blog($blogentryForURL['date'], $blogentryForURL['url']), " -- Jlog v".JLOG_SOFTWARE_VERSION); @@ -76,7 +84,7 @@ function doPing($url) { $url = parse_url($url); $fp = @fsockopen($url['host'], 80, $errno, $errstr, $timeout); - if(!$fp) { + if(!$fp || preg_match('/\\s/', $url['host'])) { $response = 'Fehler: '.$errstr.' ('.$errno.')
Es konnte keine Verbindung hergestellt werden'; } else { $data_string = ' @@ -88,7 +96,7 @@ function doPing($url) { '; $data_header = "POST ".$url['path']." HTTP/1.0\r\n". - "Host: $host\r\n". + "Host: {$url['host']}\r\n". "Content-Type: text/xml\r\n". "User-Agent: qxm XML-RPC Client\r\n". "Content-Length: ".strlen($data_string)."\r\n\r\n"; diff --git a/admin/plugin.php b/admin/plugin.php index 7478a4f..9039d77 100644 --- a/admin/plugin.php +++ b/admin/plugin.php @@ -12,18 +12,19 @@ $handle = ""; $file = ""; $plugindirectory = JLOG_BASEPATH.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR; + $availablePlugins = ''; if(is_dir($plugindirectory)) { $handle = opendir($plugindirectory); while( false !== ( $file = readdir ($handle) ) ) { if(substr($file, -10) === '.jplug.php') { - $pluginName = substr($file, 0, -10); + $pluginName = htmlspecialchars(substr($file, 0, -10)); $availablePlugins .= "
  • ".$pluginName."
  • \n"; } } closedir($handle); - if(!empty($availablePlugins)) { + if(strlen($availablePlugins) > 0) { $availablePlugins = "
      \n".$availablePlugins."
    \n"; $title = $l['admin']['plugins_headline']; } @@ -50,4 +51,3 @@ require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php'); echo $body; -?> diff --git a/archive.php b/archive.php index c41a209..f8157b0 100644 --- a/archive.php +++ b/archive.php @@ -2,13 +2,19 @@ require_once('.'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php'); $get = strip($_GET); - if(isset($get['cat'])) $cat_y_link = "cat=".$get['cat']; + $cat_y_link = isset($get['cat']) ? "cat=".$get['cat'] : ''; + if (!isset($get['y'])) $get['y'] = null; $yl = new Year_Links($get['y'], JLOG_START_YEAR, archive(), $l, $cat_y_link); if(isset($get['show'])) $p = (int) escape_for_mysql($get['show']); else $p = 0; $amount = 5; $c['meta']['robots'] = "noindex, follow"; + +if (!isset($c['main'])) $c['main'] = ''; +if (!isset($c['meta'])) $c['meta'] = array(); +if (!isset($c['meta']['aditionalheader'])) $c['meta']['aditionalheader'] = ''; +$count = 0; if(isset($get['cat'])) { @@ -64,7 +70,8 @@ $count = $_count['count']; } else { - if(!empty($get['m'])) $where_month = " AND MONTH(date) = '".escape_for_mysql($get['m'])."'"; + $where_month = empty($get['m']) ? '' : " AND MONTH(date) = '".escape_for_mysql($get['m'])."'"; + if (!isset($where_from)) $where_from = ''; $c['meta']['title'] = $l['content_archive_header']; $c['main'] = "

    ".$c['meta']['title']." ".$yl->get_selected_year()."

    "; diff --git a/error404.php b/error404.php index 81b60e6..9ca7ae3 100644 --- a/error404.php +++ b/error404.php @@ -1,15 +1,16 @@ ".$l['err404_topic']."\n

    ".$l['err404_message']."

    "; + $btnValue = htmlspecialchars($l['content_search']); $c['main'] .= '
    -

    -

    +

    +

    '; require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php'); echo $body; -?> diff --git a/index.php b/index.php index c31e40c..fd21864 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ * $HeadURL: http://jeenaparadies.net/svn/jlog/trunk/index.php $ * $Rev: 1777 $ * $Author: robertb $ - * $Date: 2009-01-04 18:22:36 +0100 (Sön, 04 Jan 2009) $ + * $Date: 2009-01-04 18:22:36 +0100 (So, 04. Jan 2009) $ */ if(!file_exists(dirname( __FILE__ ).DIRECTORY_SEPARATOR.'personal'.DIRECTORY_SEPARATOR.'settings.inc.php')) { diff --git a/lang/.htaccess b/lang/.htaccess new file mode 100644 index 0000000..fc7eaf5 --- /dev/null +++ b/lang/.htaccess @@ -0,0 +1,4 @@ +# .htaccess fuer Verzeichnisse, die nicht fuer die Oeffentlichkeit +# bestimmt sind: + +Options -Indexes diff --git a/lang/lang-admin.de.inc.php b/lang/lang-admin.de.inc.php old mode 100644 new mode 100755 index 711a1a2..4da79cf --- a/lang/lang-admin.de.inc.php +++ b/lang/lang-admin.de.inc.php @@ -243,4 +243,4 @@ // Do not change the folowing line ); -// eof \ No newline at end of file +// eof diff --git a/lang/lang-admin.en.inc.php b/lang/lang-admin.en.inc.php old mode 100644 new mode 100755 index 85ca46e..1a0c5e5 --- a/lang/lang-admin.en.inc.php +++ b/lang/lang-admin.en.inc.php @@ -243,4 +243,4 @@ // Do not change the folowing line! ); -// eof \ No newline at end of file +// eof diff --git a/lang/lang-admin.inc.php b/lang/lang-admin.inc.php new file mode 100644 index 0000000..a92d3d4 --- /dev/null +++ b/lang/lang-admin.inc.php @@ -0,0 +1,245 @@ + "Inhalte", +"menu_categories" => "Kategorien", +"menu_comments" => "Kommentare", +"menu_settings" => "Einstellungen", +"menu_plugins" => "Plugins", +"menu_logout" => "Ausloggen", +"new_post" => "Neuen Eintrag erstellen", +"index_headline" => "Admincenter", +"change_headline" => "Alten Weblogeintrag ändern", +"go" => "los", +"admin_headline" => "Administrationscenter", +"change" => "Ändern", +"delete" => "Löschen", +"date" => "Datum", +"headline" => "Überschrift", +"metadata" => "Metadaten", +"contentdata" => "Inhalt des Eintrages", +"url" => "URL für permanenten Link (nur 0-9 a-z -.,_/)", +"keywords" => "Schlüsselwörter, Keywords", +"categories" => "Kategorie (Mehrfachauswahl mit [Strg], bzw. Apfel Taste)", +"no_categories" => "keine", +"preview" => "Vorschau", +"publish" => "Veröffentlichen", +"submit" => "Absenden", +"cancel" => "Abbrechen", +"no_headline" => "Überschrift fehlt", +"no_url" => "URL fehlt", +"false_url_letters" => "Der URL darf nur Kleinbuchstaben (a-z), Zahlen (0-9) und diese Zeichen enthalten: -.,_/", +"url_duplicate" => "Während eines Monats darf ein URL nur ein einziges mal vorkommen sonst kann das Blog sie nicht auseinanderhalten", +"url_duplicate_page" => "Pages müssen unikate URLs haben, das heißt, dass jede page einen anderen URL haben muss", +"false_teaserpic" => "Die Angabe des Bildes für die Zusammenfassung stimmt nicht, ein solches Bild wurde nicht hochgeladen", +"no_teaserpic_uploaded" => "Das Bild für die Zusammenfassung kann nicht im Blog angezeigt werden wenn es nicht hochgeladen wurde", +"no_teaser" => "Zusammenfassung fehlt", +"no_content" => "Inhalt fehlt", +"pic_for_teaser" => "Ein Bild für die Zusammenfassung (max 150px):", +"pic_upload" => "Bild hochladen", +"pic_choose" => "Bild auswählen", +"show_tpic_on_archive" => "Dieses Bild auch auf der richtigen Blogseite anzeigen.", +"teaser" => "Zusammenfassung", +"contentpic_choose" => "Ein Bild für den Inhalt:", +"content" => "Inhalt des Beitrags", +"howto_bbcode" => "Wie nutze ich BBCode?", +"content_choose_year" => "Das Jahr wählen:", + +"content_bold" => "fett", +"content_italic" => "kursiv", +"content_quote" => "Zitat", +"content_url" => "Link", +"content_plz_format_txt" => "Bitte gebe den zu formatierenden Text ein:", +"content_input_on_pos" => "Einfügen an Position", +"content_url_href" => "Linkziel eingeben:", +"content_url_node" => "Linktext eingeben:", +"content_list" => "Liste", +"content_headline" => "Überschrift", + +"section" => "Art des Beitrages", +"section_show" => "Art der Beiträge zeigen", +"section_weblog" => "weblog", +"section_page" => "page", + +"entry_saved" => "Eintrag gespeichert.", +"data_updated" => "Daten aktualisiert.", +"post_deleted" => "Der Blogeintrag wurde gelöscht.", +"index_topic" => "Letzte Weblogbeiträge", + +"yes" => "Ja", +"no" => "Nein", +"rearly_delete" => "Diesen Eintrag wirklich löschen?", +"delete_blogentry" => "Eintrag löschen", +"postdeleted" => "Eintrag gelöscht", +"error_occurred" => "Ein Fehler ist aufgetreten", + +"can_not_open" => "Kann Datei nicht öffnen", +"can_not_write" => "Kann in Datei nicht schreiben", +"no_wrtitenable" => "Die Datei ist nicht beschreibbar", +"rss_ok" => "RSS und Aktuelles erfolgreich aktualisiert.", +"master_ok" => "Setupdatei erfolgreich aktualisiert.", + +"pic_choose_old" => "Älteres Bild auswählen", +"pic_choose_old_teaser" => "Älteres Teaserbild auswählen", +"pic_upload_header" => "Bild hochladen", +"pic_upload_teaser" => "Teaserbild hochladen", +"pic_error" => "Fehler beim Hochladen bitte Administrator benachrichtigen", +"pic_uploaded" => "Bild wurde hochgeladen", +"pic_insert" => "Bild einfügen", +"pic_instructions" => "Nur PNG, GIF oder JPEG Bilder hochladen. Die Dateigröße darf 300 kB nicht überschreiten.", +"pic_upload" => "Hochladen", +"pic_class" => "CSS Klasse falls benötigt", +"pic_alt" => "Alternativtext", + +"pic_height_widht" => "Bild ist zu hoch und zu breit", +"pic_width" => "Bild ist zu breit", +"pic_height" => "Bild ist zu hoch", +"pic_instr_teaser" => "Nur PNG, GIF oder JPEG Bilder hochladen, die nicht breiter oder höher als 150px sind und 60 kB nicht überschreiten.", +"pic_bad_type" => "Falsches Format", +"pic_to_big" => "Das Bild ist zu groß", + +"kill_c_topic" => "Kommentare administrieren", +"kill_c_killed" => "Kommentar erfolgreich gelöscht.", +"kill_c_sure" => "Diesen Kommentar wirklich löschen?", +"kill_c_h2" => "Unwiederbringlich löschen", +"kill_c_description" => "Achtung, wenn ein Kommentar hier gelöscht wird ist er unwiederbringlich verloren!", +"kill_c_entry" => "Weblogeintrag", +"kill_c_email" => "Diesen Kommentar löschen", +"comments_change_h" => "Kommentar ändern", +"comments_anonym" => "Anonym", +"comments_mail_txt" => "Neuer Kommentar auf ".JLOG_WEBSITE."\nDer Titel war: ", +"comments_posted" => "schrieb am", +"comments_mailsubject" => "Kommentar auf ".JLOG_WEBSITE, +"comments_comment_topic" => "Kommentare", +"comments_by" => "Kommentar von", +"comments_name" => "Name", +"comments_city" => "Stadt / Land", +"comments_email" => "E-Mail", +"comments_homepage" => "http://", +"comments_bbcode" => "Wie benutze ich", +"comments_send" => "Absenden", +"comments_preview" => "Vorschau", +"comments_no_sid" => "Es scheint eine Manipulation vorzuliegen", +"comments_false_mail" => "Die E-Mail Adresse sieht nicht richtig aus", +"comments_notext" => "Es wurde kein Text eingegeben", +"comments_false_hp" => "Die URL zur Homepage scheint falsch zu sein", +"comments_permalink" => "Permanenter link zu diesem Kommentar", +"comments_from" => "aus", +"comments_posted" => "schrieb am", +"comments_entryform" => "Kommentar ändern", +"comments_mail_by_comment" => "Bei Kommentar benachrichtigen", +"comments_thx" => "Der Kommentar wurde geändert", +"comments_preview" => "Vorschau", +"comments_send" => "Senden", +"comments_bold" => "fett", +"comments_italic" => "kursiv", +"comments_quote" => "Zitat", +"comments_url" => "Link", +"comments_plz_format_txt" => "Bitte gebe den zu formatierenden Text ein:", +"comments_url_href" => "Linkziel eingeben:", +"comments_url_node" => "Linktext eingeben:", +"comments_updated" => "Der Kommentar wurde geändert. Zurück zum", +"comments_admin" => "Kommentar Administrationscenter", +"comments_closed" => "Kommentare für diesen Beitrag schließen", + +"m_writenable" => "beschreibbar", +"m_title" => "Haupteinstellungen des Weblogs", +"m_clean_url" => "Saubere URLs (mod_rewrite) verwenden? Beispiel: http://example.com/2005/01/firefox", +"m_metadata" => "Metadaten", +"m_website" => "Der Name des Weblogs", +"m_publisher" => "Name des Verfassers der Einträge", +"m_admin_password" => "Administrationscenter Passwort", +"m_admin_password_again" => "Passwort bestätigen", +"m_admin_password_admin" => "(leer lassen falls unverändert)", +"m_email" => "E-Mail des Betreibers des Weblogs", +"m_description" => "Eine Kurze Beschreibung des Weblogs", +"m_bs" => "Weblogdienste bei neuem Eintrag benachrichtigen, die den eigenen Eintrag in ihre Suchmaschinen aufnehmen (für jeden eine Zeile)", +"m_bs_weblogs_com" => "weblogs.com", +"m_bs_technorati_com" => "technorati.com", +"m_bs_blogg_de" => "blogg.de", +"m_behavior" => "Verhalten des Weblogs", +"m_max_blog_orginal" => "Anzahl der Einträge, die vollständig auf der Startseite erscheinen", +"m_max_blog_big" => "Anzahl der Einträge, deren Beschreibung auf der Startseite erscheinen", +"m_max_blog_small" => "Anzahl der Einträge, deren Datum und Name auf der Startseite erscheinen", +"m_sub_current" => "Anzahl der Einträge, deren Datum und Name in der Subnavigation, die auf jeder Seite erscheint, erscheinen", +"m_info_by_comment" => "Benachrichtigung des Betreibers des Weblogs bei neuem Kommentar", +"m_database" => "Datenbank", +"m_db" => "Datenbankname", +"m_db_url" => "Datenbank Hostname, in der Regel localhost", +"m_db_user" => "Datenbank Username", +"m_db_pwd" => "Datenbank Passwort", +"m_db_prefix" => "Kürzel, das Tabellennamen vorangestellt wird", +"m_date" => "Format des Datums wie bei der PHP-Funktion strftime()", +"m_date_posting" => "Format für den Eintrag", +"m_date_comment" => "Format für die Kommentare", +"m_date_subcurrent" => "Format für die Subnavigation", +"m_e404_path" => "Pfad zur Fehlerseite 404", +"m_settings_ok" => "Die Einstellungen wurden gespeichert.", + +"e_path" => "Die angegebene URL scheint nicht zu stimmen", +"e_basepath" => "Das angegebene Verzeichnis existiert nicht", +"e_website" => "Bitte Namen des Weblogs eingeben", +"e_publisher" => "Bitte Namen des Betreibers eingeben", +"e_admin_password" => "Bitte Administrationscenter Passwort eingeben", +"e_admin_password_again" => "Bitte Administrationscenter Passwort bestätigen", +"e_email" => "E-Mail Adresse des Betreibers scheint falsch zu sein", +"e_description" => "Bitte eine Beschreibung des Weblogs eingeben", +"e_max_blog_orginal" => "Anzahl der Einträge, die vollständig auf der Startseite erscheinen muss eine Zahl größer oder gleich Null sein", +"e_max_blog_big" => "Anzahl der Einträge, deren Beschreibung auf der Startseite erscheinen muss eine Zahl größer oder gleich Null sein", +"e_max_blog_small" => "Anzahl der Einträge, deren Datum und Name auf der Startseite erscheinen muss eine Zahl größer oder gleich Null sein", +"e_sub_current" => "Anzahl der Einträge, deren Datum und Name in der Subnavigation erscheinen muss eine Zahl größer oder gleich Null sein", +"e_start_year" => "Das versteckte Jahresfeld ist leer", +"e_db" => "Bitte Namen der Datenbank eingeben", +"e_db_url" => "Bitte Datenbank Hostname eingeben", +"e_db_user" => "Bitte Datenbank Benutzernamen eingeben", +"e_db_content" => "Bitte Tabellennamen für Inhalte eingeben", +"e_db_comments" => "Bitte Tabellennamen für Kommentare eingeben", +"e_db_occurred" => "Datenbankfehler", +"e_db_is" => "Es ist ein Fehler auf ".JLOG_PATH." aufgetreten. Der Fehler lautet:", + +"s_phpv_tolow" => "Die PHP Version ist zu alt, bitte auf eine neuere upgraden, bzw. deinen Provider danach fragen", +"s_mysqlv_tolow" => "Die MySQL Version ist zu alt, bitte auf eine neuere upgraden, bzw. deinen Provider danach fragen", +"s_personal_not_wrtbl" => "Das Verzeichnis 'personal' ist nicht beschreibbar. (Chmod 777)", +"s_img_not_wrtbl" => "Das Verzeichnis 'img' ist nicht beschreibbar. (Chmod 777)", +"s_tables_ok" => "Tabellen in der Datenbank angelegt.", +"s_ready_head" => "Setup erfolgreich beendet", +"s_ready" => "Bitte lösche jetzt die Datei 'setup.php' von deinem Webspace. Es ist sehr wichtig, sonst kann jeder dein Passwort ändern und hat vollen Zugang auf dein Weblog. Danach kannst du im Administrations Center den ersten Eintrag machen.", +"s_ready_menu_admin" => "Zum Administrations Center", +"s_ready_menu_home" => "Auf die Startseite", +"s_problem_mkdir" => "Es gibt ein Problem beim Erstellen notwendiger Verzeichnisse. Das Verzeichnis 'personal' muss Schreibrechte für das Setupscript besitzen, also chmod 777", +"s_problem_fwrite" => "Probleme beim Erstellen notwendiger Dateien", +"s_problem_chmod" => "Probleme beim Setzen der Schreibrechte", +"s_problem_fwrite" => "Probleme beim notwendigem Schreiben in Dateien", +"s_personal_ok" => "Dateien im Verzeichnis 'personal' angelegt", +"s_install" => "Installieren", + +"login_headline" => "Geschützter Bereich", +"login_password" => "Passwort eingeben:", +"login_send" => "Einloggen", +"login_cookies" => "Hinweis! Cookies müssen aktiv sein.", +"login_false_pw" => "Es wurde ein falsches Passwort eingegeben.", + +"cat_name" => "Name der Kategorie", +"cat_url" => "URL im Kategoriearchiv (nur a-z 0-9 _-,. )", +"cat_description" => "Beschreibung der Kategorie, die im Archiv auftaucht", +"cat_new" => "Neue Kategorie anlegen", +"cat_title" => "Kategorien Verwaltung", +"cat_noname" => "Die Kategorie muss einen Namen haben", +"cat_change" => "Die Kategoriedaten ändern", +"cat_new_ok" => "Neue Kategorie angelegt", +"cat_really_trash" => "Folgende Kategorie wirklich löschen? (Alle Informationen gehen verloren)", +"cat_trash_ok" => "Kategorie erfolgreich gelöscht. Zurück zum", +"cat_admincenter" => "Kategorie Administrationscenter", +"cat_duplicate" => "Eine andere Kategorie hat diesen URL schon besetzt.", + +"update_successfull" => "Das Update ist gelungen. Viel Spaß!", +"pingback_closed" => "Pingbacks für diesen Eintrag schließen.", + +"plugin_no_content" => "Das Plugin muss nicht administriert werden.", +"plugins_h_not_avaliable" => "Keine Plugins", +"plugins_not_avaliable" => "Es wurden keine Plugins gefunden.", +"plugins_headline" => "Plugin Administration", + +// Do not change the folowing line +); +// eof diff --git a/lang/lang-admin.it.inc.php b/lang/lang-admin.it.inc.php old mode 100644 new mode 100755 index c0bff8a..317ba2d --- a/lang/lang-admin.it.inc.php +++ b/lang/lang-admin.it.inc.php @@ -238,4 +238,4 @@ // Do not change the folowing line! ); -// eof \ No newline at end of file +// eof diff --git a/lang/lang-admin.pl.inc.php b/lang/lang-admin.pl.inc.php index cec356c..1604d15 100644 --- a/lang/lang-admin.pl.inc.php +++ b/lang/lang-admin.pl.inc.php @@ -238,4 +238,4 @@ // Do not change the folowing line! ); -// eof \ No newline at end of file +// eof diff --git a/lang/lang.de.inc.php b/lang/lang.de.inc.php old mode 100644 new mode 100755 index efb2805..29f4e5b --- a/lang/lang.de.inc.php +++ b/lang/lang.de.inc.php @@ -119,4 +119,5 @@ // do not change the folowing lines ) -); ?> +); +// eof diff --git a/lang/lang.en.inc.php b/lang/lang.en.inc.php old mode 100644 new mode 100755 index 9b6abf2..623b0e5 --- a/lang/lang.en.inc.php +++ b/lang/lang.en.inc.php @@ -120,4 +120,5 @@ // do not change the folowing lines ) -); ?> +); +// eof diff --git a/lang/lang.inc.php b/lang/lang.inc.php new file mode 100644 index 0000000..b1f872e --- /dev/null +++ b/lang/lang.inc.php @@ -0,0 +1,123 @@ + "Herzlich Willkommen", +"subnav_current" => "Aktuelle Einträge", +"subnav_info" => "Informationen", +"subnav_rss" => "Aktuelles von dieser Seite per RSS Feed. Mehr darüber erfahren Sie auf der Seite von Alp Uçkan.", +"subnav_copyright" => "Alle Rechte vorbehalten.", +"subnav_powered" => "Powered by", + +"content_posted" => "geschrieben am", +"content_more" => "weiterlesen", +"content_more_title" => "Ganzen Eintrag lesen", +"content_permalink" => "permanenter Link zu diesem Eintrag", +"content_posted" => "Eingestellt am", +"content_archive" => "Ältere Weblogeinträge gibt es im", +"content_archivelink" => "Archiv", +"content_archive_header" => "Archivierte Einträge", +"content_categories_header"=> "Kategorien", +"content_skip" => "Zum Hauptinhalt springen.", +"content_choose_year" => "Das Jahr wählen:", +"content_search_header" => "Suche auf der Webseite", +"content_search" => "suchen", +"content_nothing_found" => "Es wurden 0 Ergebnisse gefunden. Vorschläge:
    • Überprüfen Sie die Schreibweise.
    • Suchen Sie mit anderen bzw. weniger Schlüsselwörtern.
    • Entfernen Sie Frage- oder Pluszeichen.
    ", +"content_search_topic" => "Weblog durchsuchen", +"content_from" => "von", +"content_comments" => "Kommentare", +"content_comment_plz" => "kommentieren", +"content_comments_title" => "zu Kommentaren springen", +"content_cat_linklist" => "zugeordnete Kategorien", +"content_cat_link" => "Alle Einträge dieser Kategorie anzeigen", +"content_categorieslist_h" => "Kategorien", +"content_archive_preview" => "Vorherige Seite", +"content_archive_next" => "Nächste Seite", + +"meta_start" => "Zurück zur Startseite", +"meta_search" => "Suche", +"meta_copyright" => "Urheberrecht", + +"comments_comment_topic" => "Kommentare", +"comments_by" => "Kommentar von", +"comments_name" => "Name", +"comments_city" => "Stadt / Land", +"comments_email" => "E-Mail", +"comments_homepage" => "http://", +"comments_bbcode" => "Wie benutze ich", +"comments_send" => "Absenden", +"comments_preview" => "Vorschau", +"comments_no_sid" => "Es scheint eine Manipulation vorzuliegen", +"comments_false_mail" => "Die E-Mail Adresse sieht nicht richtig aus", +"comments_notext" => "Es wurde kein Text eingegeben", +"comments_false_hp" => "Die URL zur Homepage scheint falsch zu sein", +"comments_anonym" => "Anonym", +"comments_permalink" => "Permanenter link zu diesem Kommentar", +"comments_from" => "aus", +"comments_posted" => "schrieb am", +"comments_entryform" => "Dein Kommentar", +"comments_save_data" => "Userdaten in einem Cookie sichern", +"comments_mail_by_comment" => "Bei Kommentar benachrichtigen", +"comments_duplicate" => "Aus versehen wurde das Formular zwei mal abgesandt", +"comments_thx" => "Danke - Der Kommentar wurde gespeichert", +"comments_mailsubject" => "Kommentar auf ".JLOG_WEBSITE, +"comments_mail_txt" => "Neuer Kommentar auf ".JLOG_WEBSITE."\nDer Titel war: ", +"comments_stop_receiving" => "Um die Benachrichtigung bei neuen Kommentaren abzustellen klicken Sie hier:", +"comments_stop_successful" => "Die Benachrichtigung wurde abgestellt.", +"comments_preview" => "Vorschau", +"comments_send" => "Senden", +"comments_show" => "Kommentare anzeigen", +"comments_hide" => "Kommentare verstecken", +"comments_bold" => "fett", +"comments_italic" => "kursiv", +"comments_quote" => "Zitat", +"comments_url" => "Link", +"comments_plz_format_txt" => "Bitte gebe den zu formatierenden Text ein:", +"comments_url_href" => "Linkziel eingeben:", +"comments_url_node" => "Linktext eingeben:", +"comments_closed" => "Die Kommentare sind für diesen Eintrag geschlossen.", +"comments_teaser_closed" => "(Kommentare geschlossen)", +"pingback_topic" => "Pingbacks", + +"db_error" => "Datenbankfehler", +"plz_try_again" => "Bitte versuchen Sie es später noch einmal.", + +"error" => "Fehler", +"err404_topic" => "Fehler 404 - Seite nicht gefunden", +"err404_message" => "Diese Seite existiert leider nicht. Versuchen Sie sie über die Suchfunktion zu finden.", + +"language" => "de-de", +"html_language" => "de", +"locale" => array('de_DE', 'de_DE@euro', 'de', 'deu_deu', 'german', 'ge', 'de-DE', 'de_DE.ISO8859-1', 'de_DE.ISO8859-15', 'de_DE.ISO_8859-15', 'de_DE.ISO_8859-15'), +"date_format" => "%d. %B %Y um %H:%M Uhr", +"date_format_comment" => "%d.%m.%Y", +"date_format_subcurrent" => "%d.%m.%Y", + +"index_topic" => "Startseite", +"bbtitle" => "BBcode nutzen", +"bbxmp" => "
    • Zeilenumbrüche werden automatisch erzeugt und man kann die Codeschnipsel auch kombinieren.
    • +
    • [url]http://example.com[/url]
    • +
    • [url=http://example.com]Beispiellink[/url]
    • +
    • [b]fett[/b]
    • +
    • [i]kursiv[/i]
    • +
    • [quote]Ein zitierter Text welcher aus einer anderen Quelle stammt. Es empfiehlt sich die Quelle auch mit anzugeben.[/quote]

    ", + +// do not change the following line +"months" => array ( +// here you can change the months for the archive +1 => "Januar", +2 => "Februar", +3 => "März", +4 => "April", +5 => "Mai", +6 => "Juni", +7 => "Juli", +8 => "August", +9 => "September", +10 => "Oktober", +11 => "November", +12 => "Dezember" + +// do not change the folowing lines + ) +); +// eof diff --git a/lang/lang.it.inc.php b/lang/lang.it.inc.php old mode 100644 new mode 100755 index 0e84224..a2737b4 --- a/lang/lang.it.inc.php +++ b/lang/lang.it.inc.php @@ -119,4 +119,5 @@ // do not change the folowing lines ) -); ?> +); +// eof diff --git a/lang/lang.pl.inc.php b/lang/lang.pl.inc.php index b5aefef..5e9df0a 100644 --- a/lang/lang.pl.inc.php +++ b/lang/lang.pl.inc.php @@ -120,4 +120,4 @@ // do not change the folowing lines ) ); -// eof \ No newline at end of file +// eof diff --git a/lang/lang.sv.inc.php b/lang/lang.sv.inc.php index 8f07b46..3a4b2c6 100644 --- a/lang/lang.sv.inc.php +++ b/lang/lang.sv.inc.php @@ -1,122 +1,123 @@ - "Välkommen", -"subnav_current" => "Aktuella inlägg", -"subnav_info" => "Information", -"subnav_rss" => "Aktuellt frÃ¥n denna sida via RSS Feed. Mer info om detta hittar du pÃ¥ http://susning.nu/RSS.", -"subnav_copyright" => "Alla rättigheter förbehÃ¥llna", -"subnav_powered" => "Powered by", - -"content_posted" => "skrivet den", -"content_more" => "läs mer", -"content_more_title" => "Läs hela webbloginlägget", -"content_permalink" => "permanent länk till detta webbloginlägg", -"content_posted" => "Inlagt den", -"content_archive" => "Äldre webbloginlägg finns i", -"content_archivelink" => "Arkiv", -"content_archive_header" => "Arkiverade inlägg", -"content_categories_header"=> "Kategori", -"content_skip" => "Hoppa till huvudinnehÃ¥ll.", -"content_choose_year" => "Välj Ã¥r:", -"content_search_header" => "Sök pÃ¥ webbsidan", -"content_search" => "sök", -"content_nothing_found" => "Antal träffar: 0. Förslag: :
    • Kontrollera stavningen.
    • Sök med andra eller färre nyckelord.
    • Radera frÃ¥ge- eller plustecken.
    ", -"content_search_topic" => "Sök igenom webblog", -"content_from" => "från", -"content_comments" => "Kommentarer", -"content_comment_plz" => "kommentera", -"content_comments_title" => "hoppa till kommentarer", -"content_cat_linklist" => "tilldelade kategorier", -"content_cat_link" => "Visa alla inlägg ur denna kategori", -"content_categorieslist_h" => "Kategorier", -"content_archive_preview" => "Föregående sida", -"content_archive_next" => "Nästa sida", - -"meta_start" => "Tillbaka till startsidan", -"meta_search" => "Genomsöker", -"meta_copyright" => "Upphovsrätt", - -"comments_comment_topic" => "Kommentarer", -"comments_by" => "Kommentar från", -"comments_name" => "Namn", -"comments_city" => "Stad / Land", -"comments_email" => "E-mail", -"comments_homepage" => "http://", -"comments_bbcode" => "Hur använder jag", -"comments_send" => "Skicka", -"comments_preview" => "Förhandsgranskning", -"comments_no_sid" => "Det verkar ha skett en manipulation", -"comments_false_mail" => "E-mailadressen ser inte korrekt ut", -"comments_notext" => "Ingen text har skrivits", -"comments_false_hp" => "Kontrollera att rätt URL har angivits", -"comments_anonym" => "Anonym", -"comments_permalink" => "Permanent länk till denna kommentar", -"comments_from" => "från", -"comments_posted" => "skrev den", -"comments_entryform" => "Din kommentar", -"comments_save_data" => "Spara användarinställningar", -"comments_mail_by_comment" => "Underrätta vid kommentar", -"comments_duplicate" => "Formuläret skickades av misstag två gånger", -"comments_thx" => "Tack - Kommentaren har sparats", -"comments_mailsubject" => "Kommentar på ".JLOG_WEBSITE, -"comments_mail_txt" => "Ny kommentar på ".JLOG_WEBSITE."\nTiteln var: ", -"comments_stop_receiving" => "För att avaktivera underrättelsen vid nya kommentarer, klicka här:", -"comments_stop_successful" => "Underrättelsen har avaktiverats", -"comments_preview" => "Förhandsgranskning", -"comments_send" => "Skicka", -"comments_show" => "visa kommentarer", -"comments_hide" => "dölj kommentarer", -"comments_bold" => "fet", -"comments_italic" => "kursiv", -"comments_quote" => "citera", -"comments_url" => "länk", -"comments_plz_format_txt" => "Vänligen ange texten som ska formateras", -"comments_url_href" => "Ange länkmål:", -"comments_url_node" => "Ange länktext:", -"comments_closed" => "Kommentarerna är stängda för detta inlägg.", -"comments_teaser_closed" => "(Kommentarer stängda)", -"pingback_topic" => "Pingbacks", - -"db_error" => "Databasfel", -"plz_try_again" => "Var god försök igen senare.", - -"error" => "Error", -"err404_topic" => "Error 404 - Sidan hittades inte", -"err404_message" => "Denna sida existerar tyvärr inte. Försök hitta den genom sökfunktionen.", - + "Välkommen", +"subnav_current" => "Aktuella inlägg", +"subnav_info" => "Information", +"subnav_rss" => "Aktuellt från denna sida via RSS Feed. Mer info om detta hittar du på http://susning.nu/RSS.", +"subnav_copyright" => "Alla rättigheter förbehållna", +"subnav_powered" => "Powered by", + +"content_posted" => "skrivet den", +"content_more" => "läs mer", +"content_more_title" => "Läs hela webbloginlägget", +"content_permalink" => "permanent länk till detta webbloginlägg", +"content_posted" => "Inlagt den", +"content_archive" => "Äldre webbloginlägg finns i", +"content_archivelink" => "Arkiv", +"content_archive_header" => "Arkiverade inlägg", +"content_categories_header"=> "Kategori", +"content_skip" => "Hoppa till huvudinnehåll.", +"content_choose_year" => "Välj år:", +"content_search_header" => "Sök på webbsidan", +"content_search" => "sök", +"content_nothing_found" => "Antal träffar: 0. Förslag: :
    • Kontrollera stavningen.
    • Sök med andra eller färre nyckelord.
    • Radera frÃ¥ge- eller plustecken.
    ", +"content_search_topic" => "Sök igenom webblog", +"content_from" => "från", +"content_comments" => "Kommentarer", +"content_comment_plz" => "kommentera", +"content_comments_title" => "hoppa till kommentarer", +"content_cat_linklist" => "tilldelade kategorier", +"content_cat_link" => "Visa alla inlägg ur denna kategori", +"content_categorieslist_h" => "Kategorier", +"content_archive_preview" => "Föregående sida", +"content_archive_next" => "Nästa sida", + +"meta_start" => "Tillbaka till startsidan", +"meta_search" => "Genomsöker", +"meta_copyright" => "Upphovsrätt", + +"comments_comment_topic" => "Kommentarer", +"comments_by" => "Kommentar från", +"comments_name" => "Namn", +"comments_city" => "Stad / Land", +"comments_email" => "E-mail", +"comments_homepage" => "http://", +"comments_bbcode" => "Hur använder jag", +"comments_send" => "Skicka", +"comments_preview" => "Förhandsgranskning", +"comments_no_sid" => "Det verkar ha skett en manipulation", +"comments_false_mail" => "E-mailadressen ser inte korrekt ut", +"comments_notext" => "Ingen text har skrivits", +"comments_false_hp" => "Kontrollera att rätt URL har angivits", +"comments_anonym" => "Anonym", +"comments_permalink" => "Permanent länk till denna kommentar", +"comments_from" => "från", +"comments_posted" => "skrev den", +"comments_entryform" => "Din kommentar", +"comments_save_data" => "Spara användarinställningar", +"comments_mail_by_comment" => "Underrätta vid kommentar", +"comments_duplicate" => "Formuläret skickades av misstag två gånger", +"comments_thx" => "Tack - Kommentaren har sparats", +"comments_mailsubject" => "Kommentar på ".JLOG_WEBSITE, +"comments_mail_txt" => "Ny kommentar på ".JLOG_WEBSITE."\nTiteln var: ", +"comments_stop_receiving" => "För att avaktivera underrättelsen vid nya kommentarer, klicka här:", +"comments_stop_successful" => "Underrättelsen har avaktiverats", +"comments_preview" => "Förhandsgranskning", +"comments_send" => "Skicka", +"comments_show" => "visa kommentarer", +"comments_hide" => "dölj kommentarer", +"comments_bold" => "fet", +"comments_italic" => "kursiv", +"comments_quote" => "citera", +"comments_url" => "länk", +"comments_plz_format_txt" => "Vänligen ange texten som ska formateras", +"comments_url_href" => "Ange länkmål:", +"comments_url_node" => "Ange länktext:", +"comments_closed" => "Kommentarerna är stängda för detta inlägg.", +"comments_teaser_closed" => "(Kommentarer stängda)", +"pingback_topic" => "Pingbacks", + +"db_error" => "Databasfel", +"plz_try_again" => "Var god försök igen senare.", + +"error" => "Error", +"err404_topic" => "Error 404 - Sidan hittades inte", +"err404_message" => "Denna sida existerar tyvärr inte. Försök hitta den genom sökfunktionen.", + "language" => "sv-se", -"html_language" => "sv", -"locale" => array('sv_SE', 'sve_sve'), -"date_format" => "%Y-%B-%d kl %H:%M", -"date_format_comment" => "%Y-%m-%d", -"date_format_subcurrent" => "%Y-%m-%d", - -"index_topic" => "Startsida", -"bbtitle" => "Använd BBcode", -"bbxmp" => "
    • Radbrytning sker automatiskt och man kan även kombinera kodstyckena.
    • -
    • [url]http://example.com[/url]
    • -
    • [url=http://example.com]Exempellänk[/url]
    • -
    • [b]fet[/b]
    • -
    • [i]kursiv[/i]
    • -
    • [quote]Ett citat ur en annan källtext. Det rekommenderas att även ange denna.[/quote]

    ", - -// do not change the following line -"months" => array ( -// here you can change the months for the archive -1 => "januari", -2 => "februari", -3 => "mars", -4 => "april", -5 => "maj", -6 => "juni", -7 => "juli", -8 => "august", -9 => "september", -10 => "oktober", -11 => "november", -12 => "december" - -// do not change the folowing lines - ) -); ?> +"html_language" => "sv", +"locale" => array('sv_SE', 'sve_sve'), +"date_format" => "%Y-%B-%d kl %H:%M", +"date_format_comment" => "%Y-%m-%d", +"date_format_subcurrent" => "%Y-%m-%d", + +"index_topic" => "Startsida", +"bbtitle" => "Använd BBcode", +"bbxmp" => "
    • Radbrytning sker automatiskt och man kan även kombinera kodstyckena.
    • +
    • [url]http://example.com[/url]
    • +
    • [url=http://example.com]Exempellänk[/url]
    • +
    • [b]fet[/b]
    • +
    • [i]kursiv[/i]
    • +
    • [quote]Ett citat ur en annan källtext. Det rekommenderas att även ange denna.[/quote]

    ", + +// do not change the following line +"months" => array ( +// here you can change the months for the archive +1 => "januari", +2 => "februari", +3 => "mars", +4 => "april", +5 => "maj", +6 => "juni", +7 => "juli", +8 => "august", +9 => "september", +10 => "oktober", +11 => "november", +12 => "december" + +// do not change the folowing lines + ) +); +// eof diff --git a/learn_bb.php b/learn_bb.php index c9abcde..25cea86 100644 --- a/learn_bb.php +++ b/learn_bb.php @@ -1,6 +1,6 @@ fetch()); - foreach($commentsArray as $tmp_comment) if($tmp_comment['type'] != 'pingback') ++$countComments; + foreach($commentsArray as $tmp_comment) { + if(!(isset($tmp_comment['type']) && $tmp_comment['type'] == 'pingback')) { + ++$countComments; + } + } $preview = ""; if(isset($error)) $preview .= error_output($error); @@ -119,7 +123,11 @@ elseif(isset($com_form['form_submitted']) AND $com_form['form_submitted'] == $l[ ### Plugin Hook $com_form = $plugins->callHook('newComment', $com_form, $blogentry); - + + if (!isset($com_form['sid'])) { + $c['form_content'] .= '

    Der Kommentar wurde nicht gespeichert.

    '; + } + else { $com = escape_for_mysql($com_form); if(!isset($com['mail_by_comment'])) $com['mail_by_comment'] = ""; @@ -149,7 +157,7 @@ elseif(isset($com_form['form_submitted']) AND $com_form['form_submitted'] == $l[ )"; $newcomment = new Query($sql); - $cid = mysql_insert_id(); + $cid = $connect->insert_id; if($newcomment->error()) { if($newcomment->getErrno() == 1062) { $errors[] = $l['comments_duplicate']; @@ -224,12 +232,14 @@ elseif(isset($com_form['form_submitted']) AND $com_form['form_submitted'] == $l[ $mail->setText($text . $data['email']); $mail = $plugins->callHook('commentorMail', $mail, $blogentry); // send mail - $mail->send(); + # XXX bugfix + $mail->send($data['email']); } } $c['form_content'] .= "

    ".$l['comments_thx']."

    ".com_javascript_variables(); } } + } } // If nothing happens diff --git a/personal/css/admin.css b/personal/css/admin.css index 51ff90b..df1b2c5 100644 --- a/personal/css/admin.css +++ b/personal/css/admin.css @@ -26,3 +26,6 @@ #admin .hide { display: none; } #admin-menu { position: relative; z-index: 2; } +#admin div.center { + overflow-x: scroll +} diff --git a/personal/css/ielte6.css b/personal/css/ielte6.css index 2d93510..b2b132a 100644 --- a/personal/css/ielte6.css +++ b/personal/css/ielte6.css @@ -1,34 +1,33 @@ /* additional hacks for IE + * TODO: Are they still necessary? (robertb) * btw. IE sucks! ;-) */ - #pokal { /* do not display the alpha image */ - display: none; - } - - #container { /* IE max-width and PNG no-alpha hack */ - height: 1%; - width: 750px; - width:expression(document.body.clientWidth>805?"800px":"auto"); - background-image: url(img/banner-ielte6.jpg); - } +#container { /* IE max-width and PNG no-alpha hack */ + height: 1%; + width: 750px; + width:expression(document.body.clientWidth>805?"800px":"auto"); +} - #main { width: 63%; margin: 0 0 0 15px; } +#main { width: 63%; margin: 0 0 0 15px; } - ul.comments li { - overflow-x: scroll; - } +ul.comments li { + overflow-x: scroll; +} - #admin table { /* adapting the font size for IE 5.x */ - font-size: 1em; - } - - * html #subnav { /* Box-Model Bug */ - content:"\"; width: 30%; padding: 2em 1.5em; - } +#admin table { /* adapting the font size for IE 5.x */ + font-size: 1em; +} - * html #main { width: 62.5%; margin: 0 0 0 15px; } - - html + body #admin { /* close the hole in IE 5.0 */ - margin: 0; - } +* html #subnav { /* Box-Model Bug */ + content:"\"; width: 30%; padding: 2em 1.5em; +} + +* html #main { + width: 62.5%; + margin: 0 0 0 15px; +} + +html + body #admin { /* close the hole in IE 5.0 */ + margin: 0; +} diff --git a/personal/css/popup.css b/personal/css/popup.css index d3196ab..a4e48fb 100644 --- a/personal/css/popup.css +++ b/personal/css/popup.css @@ -31,4 +31,4 @@ blockquote { padding: 0 1em 0.3em 1em; margin: 0; background: #eee url(/img/anfuehrungszeichen.png) 2% 1px no-repeat; -} +} \ No newline at end of file diff --git a/plugins/MiniAntispam.jplug.php b/plugins/MiniAntispam.jplug.php index 67c5365..384200c 100644 --- a/plugins/MiniAntispam.jplug.php +++ b/plugins/MiniAntispam.jplug.php @@ -8,7 +8,7 @@ class MiniAntispam extends JlogPlugin { - function hook_commentForm($form) { + function hook_commentForm($form, $cf) { $uid = $this->generate_uid(); $uid_inputs = "\n ".''; $uid_inputs .= "\n ".''; @@ -29,7 +29,7 @@ class MiniAntispam extends JlogPlugin { $uid = ''; mt_srand((double)microtime()*1000000); - for($i=0; $i < $len; $i++) $uid .= $acceptedChars{ mt_rand(0, $maxchar) }; + for($i=0; $i < $len; $i++) $uid .= $acceptedChars[mt_rand(0, $maxchar)]; return $uid; } diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..c314521 --- /dev/null +++ b/robots.txt @@ -0,0 +1,18 @@ +# Sperre bestimmte Bots +User-agent: GPTBot +Disallow: / + +# Sperre einige Jlog-Verzeichnisse + Datenschutzeinstellungen +User-Agent: * +Disallow: /admin +Disallow: /lang +Disallow: /plugins +Disallow: /scripts + +# Sperre bestimmte Bilder aus +User-agent: * +Disallow: /img/t_* +Disallow: /img/JLOG_* + +# Fuer weiteres siehe auch die .htaccess bzw. entsprechende Dateien +# in Unterverzeichnissen. diff --git a/scripts/JlogUpdater.php b/scripts/JlogUpdater.php index 9194840..28ee773 100644 --- a/scripts/JlogUpdater.php +++ b/scripts/JlogUpdater.php @@ -52,7 +52,8 @@ class JlogUpdater $html .= $class->getForm($l); $version = $this->versions[$version]; } - $html .= '

    '; + $btnUpdate = htmlspecialchars($l['admin']['update_start']); + $html .= '

    '; $html .= ''; return $html; } diff --git a/scripts/bbcode.php b/scripts/bbcode.php index d153756..0b72aa2 100644 --- a/scripts/bbcode.php +++ b/scripts/bbcode.php @@ -67,14 +67,17 @@ function do_bbcode_img ($action, $attributes, $content, $params, $node_object) { } $title = empty($attributes["title"]) ? "" : " title='".htmlspecialchars($attributes["title"])."'"; + $class = ''; + if (isset($attributes['class']) AND isset($attributes['caption'])) $class_caption = " class='img ".htmlspecialchars($attributes['class'])."'"; elseif (isset($attributes['class'])) $class = " class='".htmlspecialchars($attributes['class'])."'"; elseif (isset($attributes['caption'])) $class_caption = " class='img'"; // bugfix by Sebastian Kochendörfer #215 - if (strpos($content, "http://") === 0) return "".htmlspecialchars($attributes["; + if (strpos($content, 'http://') === 0 || strpos($content, 'https://') === 0) + return "".htmlspecialchars($attributes["; else { list($img_width, $img_height, $img_type, $img_attr) = @getimagesize(JLOG_BASEPATH.'/img'.DIRECTORY_SEPARATOR.htmlspecialchars($content)); - $img = "".htmlspecialchars($attributes["; + $img = "".htmlspecialchars($attributes["; } if(isset($attributes['caption'])) { diff --git a/scripts/categories.class.php b/scripts/categories.class.php index 0adf1e6..67ac2a8 100644 --- a/scripts/categories.class.php +++ b/scripts/categories.class.php @@ -6,7 +6,7 @@ class Categories { var $categories = array(); var $l = array(); - function Categories($l) { + function __construct($l) { $this->l = $l; @@ -66,8 +66,9 @@ class Categories { ." \n"; foreach($this->categories AS $id => $data) { + $selected = ''; if(is_array($catassign)) if(in_array($id, $catassign)) $selected = " selected='selected'"; - else unset($selected); + else $selected = ''; $output .= " ".$data['name']."\n"; } @@ -79,6 +80,8 @@ class Categories { function output_rss($id) { $ids = $this->get_assigned_categories($id); + $output = ''; + if(is_array($ids)) { foreach($ids AS $i) { $output .= " ".$this->get($i, 'name')."\n"; @@ -89,12 +92,13 @@ class Categories { function output_assigned_links($ids) { if(!is_array($ids)) $ids = $this->get_assigned_categories($ids); + $output = ''; if(is_array($ids)) { foreach($ids as $id) { $output .= $this->link($id)." "; } } - if(isset($output)) return " » ".$output.""; + if(strlen($output) > 0) return " » ".$output.""; } function output_whole_list($_before = "
      \n", $_after = "
    \n", $before = "
  • ", $after = "
  • \n") { @@ -137,7 +141,9 @@ class Categories { return $output; } - function output_form($form_input = "", $action = 'new', $legend) { + function output_form($form_input = array(), $action = 'new', $legend) { + array_contains($form_input, ['name', 'url', 'id', 'description']); + $output = "
    ".$legend." @@ -247,4 +253,3 @@ class Categories { return $errors; } } -?> diff --git a/scripts/database.class.php b/scripts/database.class.php index bf804da..6e72c6f 100644 --- a/scripts/database.class.php +++ b/scripts/database.class.php @@ -2,20 +2,24 @@ // call database class class Query { // Variablen + var $_conn; var $_sql = ""; var $_result = 0; var $_errno = 0; var $_error = ""; //Konstruktor - function Query($sql) + function __construct($sql) { + global $connect; + $this->_conn = $connect; + // Query in der Klasse speichern $this->_sql = trim($sql); - $this->_result = mysql_query($this->_sql); + $this->_result = $this->_conn->query($this->_sql); if(!$this->_result) { - $this->_errno = mysql_errno(); - $this->_error = mysql_error(); + $this->_errno = $this->_conn->errno; + $this->_error = $this->_conn->error; } } @@ -50,7 +54,7 @@ echo "An Error has occurred, please check your MySQL-Query."; $return = null; } - else $return = mysql_fetch_assoc($this->_result); + else $return = $this->_result->fetch_assoc(); return $return; } @@ -58,14 +62,13 @@ if($this->error()) { $return = -1; } - else $return = mysql_num_rows($this->_result); + else $return = $this->_result->num_rows; return $return; } function free() { // Speicher freimachen - mysql_free_result($this->_result); + #mysql_free_result($this->_result); } } -?> diff --git a/scripts/do_template.php b/scripts/do_template.php index 0c86fe1..ffd5c72 100644 --- a/scripts/do_template.php +++ b/scripts/do_template.php @@ -54,7 +54,7 @@ if(defined('JLOG_ADMIN')) { $_search = array ( "", - "", + "", "", "", "", @@ -82,7 +82,7 @@ $_search = array ( $_replace = array ( $l['language'], - $l['html_language'], + $l['html_language'], htmlspecialchars(JLOG_WEBSITE, ENT_QUOTES), htmlspecialchars($c['meta']['title']), $c['meta']['aditionalheader'], diff --git a/scripts/general.func.php b/scripts/general.func.php index 406ece1..0172c75 100644 --- a/scripts/general.func.php +++ b/scripts/general.func.php @@ -2,8 +2,15 @@ // get weblog link function blog($date, $url, $section = 'weblog') { if($section == 'weblog' OR $section == 'comment') { - $y = date("Y", $date); - $m = date("m", $date); + $matches = array(); + if (preg_match('/^(\d{4})-(\d{2})/', $date, $matches)) { + $y = $matches[1]; + $m = $matches[2]; + } + else { + $y = date("Y", $date); + $m = date("m", $date); + } if(JLOG_CLEAN_URL === true) $permalink = JLOG_PATH."/".$y."/".$m."/".$url; else $permalink = JLOG_PATH."/log.php?y=".$y."&m=".$m."&url=".$url; } @@ -27,12 +34,13 @@ function archive() { // get year links class Year_Links { - function Year_Links($get, $start, $page, $l, $cat="") { + function __construct($get, $start, $page, $l, $cat="") { $date = getdate(); $this->_now = $date['year']; $this->_start = $start; $this->_page = $page; $this->_l = $l; + $this->cat = ''; if(JLOG_CLEAN_URL === true) { if($cat != "") { list($tmp, $cat) = explode("=", $cat); @@ -46,7 +54,7 @@ class Year_Links { } function get_linklist() { - + $years_links = ''; for($y = $this->_start; $y <= $this->_now; $y++) { if($y != $this->_start) $years_links .= " | "; if($y == $this->year) $years_links .= " ".$y.""; @@ -60,6 +68,7 @@ class Year_Links { } function get_admin_linklist() { + $years_links = ''; for($y = $this->_start; $y <= $this->_now; $y++) { if($y != $this->_start) $years_links .= " | "; @@ -88,14 +97,11 @@ function strip($_data) { } // escape input for mysql function escape_for_mysql($_data) { - if (is_array($_data)) - foreach($_data as $key => $val) $_data[$key] = escape_for_mysql($val); - else - $_data = mysql_real_escape_string($_data); - // uses last opened MySQL link implicitly - // assumption is valid because this function is never called - // before mysql_connect + global $connect; + if (is_array($_data)) foreach($_data as $key => $val) $_data[$key] = escape_for_mysql($val); + // FIXME deprecated + else $_data = $connect->real_escape_string($_data); return $_data; } // htmlspecialchars a whole array @@ -140,7 +146,7 @@ global $l, $bbcode, $categories, $plugins; if(empty($data['date_url'])) $data['date_url'] = $data['date']; # fix for search.php $output = "\n
    \n"; - if($data['teaserpic'] != "") { + if(isset($data['teaserpic']) && $data['teaserpic'] != "") { list($img_width, $img_height, $img_type, $img_attr) = @getimagesize(JLOG_BASEPATH.'img'.DIRECTORY_SEPARATOR.'t_'.$data['teaserpic']); $output .= " \n"; } @@ -178,7 +184,11 @@ global $l, $bbcode, $categories, $plugins; if($section == 'weblog' OR ($cat = $categories->output_assigned_links($data['id'])) != "") { $output .= "

    "; - if($section == 'weblog') $output .= $l['content_posted']." ".strftime(JLOG_DATE, $data['date']); + if($section == 'weblog') { + $output .= $l['content_posted']." "; + #$output .= is_int($data['date']) ? strftime(JLOG_DATE, $data['date']) : $data['date']; + $output .= strftime(JLOG_DATE, $data['date']); + } $output .= $categories->output_assigned_links($data['id'])."

    "; } @@ -186,8 +196,10 @@ global $l, $bbcode, $categories, $plugins; $path_parts = pathinfo($_SERVER['SCRIPT_NAME']); if($data['section'] == 'weblog' AND $path_parts['basename'] != 'log.php') { - if(isset($cc[$data['id']]) AND $cc[$data['id']] != 0) $tmp_comments = " ".$l['content_comments']." (".$cc[$data['id']].")"; - elseif($data['comments'] === '0') $tmp_comments = $l['comments_teaser_closed']; + if(isset($cc[$data['id']]) AND $cc[$data['id']] != 0) + $tmp_comments = " ".$l['content_comments']." (".$cc[$data['id']].")"; + elseif(isset($data['comments']) && $data['comments'] === '0') + $tmp_comments = $l['comments_teaser_closed']; else $tmp_comments = "".$l['content_comment_plz'].""; $output .="

    ".$tmp_comments."

    "; } @@ -295,7 +307,7 @@ function my_serialize_cfg($arg) { class JLOG_Tags { var $tree = array(); - function JLOG_Tags($body) { + function __construct($body) { preg_match_all('/]*)\/?>(<\/(\1):(\2)>)?/ims', $body, $this->tree); } @@ -319,6 +331,16 @@ class JLOG_Tags { // security functions function hashPassword($pw) { - // TODO: see iusses/2 for details + // TODO: see issues/2 for details return md5($pw); } + +/** + * + */ +function array_contains(&$arr, $fields) { + foreach ($fields as $key) { + if (!isset($arr[$key])) + $arr[$key] = ''; + } +} diff --git a/scripts/ixr-library.inc.php b/scripts/ixr-library.inc.php index 26f4b3c..da85a37 100644 --- a/scripts/ixr-library.inc.php +++ b/scripts/ixr-library.inc.php @@ -12,7 +12,7 @@ class IXR_Value { var $data; var $type; - function IXR_Value ($data, $type = false) { + function __construct ($data, $type = false) { $this->data = $data; if (!$type) { $type = $this->calculateType(); @@ -132,7 +132,7 @@ class IXR_Message { var $_currentTagContents; // The XML parser var $_parser; - function IXR_Message ($message) { + function __construct ($message) { $this->message = $message; } function parse() { @@ -275,7 +275,7 @@ class IXR_Server { var $callbacks = array(); var $message; var $capabilities; - function IXR_Server($callbacks = false, $data = false) { + function __construct($callbacks = false, $data = false) { $this->setCapabilities(); if ($callbacks) { $this->callbacks = $callbacks; @@ -328,7 +328,7 @@ EOD; } $method = $this->callbacks[$methodname]; // Perform the callback and send the response - if (count($args) == 1) { + if ($args !== null && count($args) == 1) { // If only one paramater just send that instead of the whole array $args = $args[0]; } @@ -430,7 +430,7 @@ class IXR_Request { var $method; var $args; var $xml; - function IXR_Request($method, $args) { + function __construct($method, $args) { $this->method = $method; $this->args = $args; $this->xml = <<code = $code; $this->message = $message; } @@ -601,7 +601,7 @@ class IXR_Date { var $hour; var $minute; var $second; - function IXR_Date($time) { + function __construct($time) { // $time can be a PHP timestamp or an ISO one if (is_numeric($time)) { $this->parseTimestamp($time); @@ -639,7 +639,7 @@ class IXR_Date { class IXR_Base64 { var $data; - function IXR_Base64($data) { + function __construct($data) { $this->data = $data; } function getXml() { @@ -651,7 +651,7 @@ class IXR_Base64 { class IXR_IntrospectionServer extends IXR_Server { var $signatures; var $help; - function IXR_IntrospectionServer() { + function __construct() { $this->setCallbacks(); $this->setCapabilities(); $this->capabilities['introspection'] = array( @@ -795,7 +795,7 @@ class IXR_IntrospectionServer extends IXR_Server { class IXR_ClientMulticall extends IXR_Client { var $calls = array(); - function IXR_ClientMulticall($server, $path = false, $port = 80) { + function __construct($server, $path = false, $port = 80) { parent::IXR_Client($server, $path, $port); $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)'; } @@ -814,4 +814,3 @@ class IXR_ClientMulticall extends IXR_Client { } } -?> diff --git a/scripts/jlogPlugins.class.php b/scripts/jlogPlugins.class.php index 578f87c..81700a2 100644 --- a/scripts/jlogPlugins.class.php +++ b/scripts/jlogPlugins.class.php @@ -1,30 +1,34 @@ get = strip($_GET); @@ -72,7 +76,7 @@ class JlogPluginManager { foreach ($this->plugins as $plugin) { $parameters[0] = $hookresult; if($hook == 'hook_adminTitle' OR $hook == 'hook_adminContent') { - if(strtolower($this->get['jplug']) === strtolower(get_class($plugin))) + if(isset($this->get['jplug']) && strtolower($this->get['jplug']) === strtolower(get_class($plugin))) $hookresult = call_user_func_array(array($plugin, $hook), $parameters); } else $hookresult = call_user_func_array(array($plugin, $hook), $parameters); @@ -80,4 +84,3 @@ class JlogPluginManager { return $hookresult; } } -?> diff --git a/scripts/prepend.inc.php b/scripts/prepend.inc.php index dcf0280..a6d73c5 100644 --- a/scripts/prepend.inc.php +++ b/scripts/prepend.inc.php @@ -20,7 +20,7 @@ * $HeadURL: http://jeenaparadies.net/svn/jlog/trunk/scripts/prepend.inc.php $ * $Rev: 1739 $ * $Author: driehle $ - * $Date: 2008-09-03 15:53:30 +0200 (Ons, 03 Sep 2008) $ + * $Date: 2008-09-03 15:53:30 +0200 (Mi, 03. Sep 2008) $ */ // load settings and version information @@ -51,6 +51,10 @@ define("JLOG_DB_CATASSIGN", JLOG_DB_PREFIX."catassign"); define("JLOG_DB_CATEGORIES", JLOG_DB_PREFIX."categories"); define("JLOG_DB_ATTRIBUTES", JLOG_DB_PREFIX."attributes"); +if (!function_exists('get_magic_quotes_gpc')) { + function get_magic_quotes_gpc() { return false; } +} + // we need these files on every page require_once(JLOG_BASEPATH.'lang'.DIRECTORY_SEPARATOR.'lang.'.JLOG_LANGUAGE.'.inc.php'); require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'database.class.php'); @@ -62,20 +66,21 @@ require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'comments.php'); if(defined('JLOG_ADMIN')) require_once(JLOG_BASEPATH.'lang'.DIRECTORY_SEPARATOR.'lang-admin.'.JLOG_LANGUAGE.'.inc.php'); // connect to database -$connect = @mysql_connect(JLOG_DB_URL, JLOG_DB_USER, JLOG_DB_PWD); +$connect = new mysqli(JLOG_DB_URL, JLOG_DB_USER, JLOG_DB_PWD, JLOG_DB); if ($connect == FALSE) { mail(JLOG_EMAIL, $l['admin']['e_db'], $l['admin']['e_db_is']."\n".mysql_error()); die("".$l['db_error']."
    ".$l['plz_try_again']."."); } // select our database -$select = @mysql_select_db(JLOG_DB); +#$select = @mysql_select_db(JLOG_DB); if ($connect == FALSE) { mail(JLOG_EMAIL, $l['admin']['e_db'], $l['admin']['e_db_is']."\n".mysql_error()); die("".$l['db_error']."
    ".$l['plz_try_again']."."); } // do some settings -@mysql_query("SET NAMES utf8"); -@mysql_query("SET sql_mode=''"); +$connect->set_charset('utf8'); +$connect->query("SET NAMES utf8"); +$connect->query("SET sql_mode=''"); // some more code that needs to run for every page - however, this // code requires an established connection to the database @@ -88,4 +93,4 @@ $plugins = new JlogPluginManager(JLOG_BASEPATH.'plugins'.DIRECTORY_SEPARATOR); $bbcode = $plugins->callHook('bbcode', $bbcode); $bbcomments = $plugins->callHook('bbcomments', $bbcomments); -// eof \ No newline at end of file +// eof diff --git a/scripts/proto.inc.php b/scripts/proto.inc.php new file mode 100644 index 0000000..30444b2 --- /dev/null +++ b/scripts/proto.inc.php @@ -0,0 +1,12 @@ +l = $l; - } - - /** - * getValue() - reads configuration data - * - * This procedure returns the value for then configuration option - * specified by $key or an array of all options if $key is not - * specified or false - * - * @access public - * @param string|boolean $key - * @return mixed - */ - function getValue($key = false) { - if($key === false) return $this->d; - else return $this->d[strtolower($key)]; - } - - /** - * setValue() - sets configuration data - * - * @access public - * @param string|boolean $key - * @param mixed $value - * @return mixed - */ - function setValue($key, $value) { - $this->d[strtolower($key)] = $value; - } - - /** - * importDataByConstants() - * - * imports data from global constats starting with JLOG_ prefix - * - * @access public - * @return void - */ - function importDataByConstants() { - # no return - // this is a blacklist of constats which are not to be written in settings.inc.php - $search = array( - 'JLOG_ADMIN', - 'JLOG_DB_CONTENT', - 'JLOG_DB_COMMENTS', - 'JLOG_DB_CATASSIGN', - 'JLOG_DB_CATEGORIES', - 'JLOG_DB_ATTRIBUTES', - 'JLOG_UPDATE', - 'JLOG_LOGIN', - 'JLOG_SOFTWARE_VERSION', - 'JLOG_SOFTWARE_URL', - 'JLOG_SOFTWARE_PHPV', - 'JLOG_SOFTWARE_MYSQLV', - 'JLOG_ADMIN_PASSWORD_AGAIN' - ); - - // get all needed constants and put it into the class - $constants = get_defined_constants(); - foreach($constants as $key => $value) { - if(!in_array($key, $search) AND strpos($key, "JLOG_") !== false) { - $this->setValue($key, $value); - } - } - } - - /** - * importDataByArray() - sets configuration data - * - * Sets configuration data according to $d. If working in - * non-exclusive mode (the default), $d is merged into the current - * configuration, otherwise the current configuration is discared - * and $d is set as the new configuration. - * - * @access public - * @param array $d - * @param boolean $exclusiv - * @return void - */ - function importDataByArray($d = false, $exclusiv = false) { - - // get the data from users $d array and put it into the class - if($d !== false) { - if($exclusiv) $this->d = $d; - else $this->d = array_merge($this->d, $d); - } - - if(JLOG_ADMIN === true) { - $this->d['jlog_db'] = JLOG_DB; - $this->d['jlog_db_url'] = JLOG_DB_URL; - $this->d['jlog_db_user'] = JLOG_DB_USER; - $this->d['jlog_db_pwd'] = JLOG_DB_PWD; - $this->d['jlog_db_prefix'] = JLOG_DB_PREFIX; - $this->d['jlog_start_year'] = JLOG_START_YEAR; - $this->d['jlog_path'] = JLOG_PATH; - $this->d['jlog_basepath'] = JLOG_BASEPATH; - if($this->d['jlog_admin_password'] == '') { - $this->jlog_admin_password = JLOG_ADMIN_PASSWORD; - } - else { - $this->d['jlog_admin_password'] = hashPassword($this->d['jlog_admin_password']); - $this->d['jlog_admin_password_again'] = hashPassword($this->d['jlog_admin_password_again']); - } - $this->d['jlog_installed_version'] = JLOG_INSTALLED_VERSION; - $this->d['jlog_installed_url'] = JLOG_INSTALLED_URL; - $this->d['jlog_installed_phpv'] = JLOG_INSTALLED_PHPV; - $this->d['jlog_installed_mysqlv'] = JLOG_INSTALLED_MYSQLV; - } - else { - $this->d['jlog_admin_password'] = hashPassword($this->d['jlog_admin_password']); - $this->d['jlog_admin_password_again'] = hashPassword($this->d['jlog_admin_password_again']); - } - - if((defined('JLOG_SETUP') AND JLOG_SETUP === true)) - { - $this->d['jlog_installed_version'] = JLOG_SOFTWARE_VERSION; - $this->d['jlog_installed_url'] = JLOG_SOFTWARE_URL; - $this->d['jlog_installed_phpv'] = JLOG_SOFTWARE_PHPV; - $this->d['jlog_installed_mysqlv'] = JLOG_SOFTWARE_MYSQLV; - } - } - - /** - * importSuggestedData() - preallocates configuration data - * - * Initialises the configuration with useful settings during - * the installation process. - * - * @access public - * @return void - */ - function importSuggestedData() { - // suggest some data for setup - $this->setValue('jlog_path', $this->getSuggestPath()); - $this->setValue('jlog_basepath', dirname(dirname( __FILE__ )).DIRECTORY_SEPARATOR); - $date = getdate(); - $this->setValue('jlog_start_year', $date['year']); - $this->setValue('jlog_max_blog_orginal', 1); - $this->setValue('jlog_max_blog_big', 4); - $this->setValue('jlog_max_blog_small', 15); - $this->setValue('jlog_sub_current', 6); - $this->setValue('jlog_date', $this->l['date_format']); - $this->setValue('jlog_date_comment', $this->l['date_format_comment']); - $this->setValue('jlog_date_subcurrent', $this->l['date_format_subcurrent']); - $this->setValue('jlog_info_by_comment', true); - $this->setValue('jlog_db_url', 'localhost'); - $this->setValue('jlog_db_prefix', 'jlog_'); - $this->setValue('jlog_blogservices', 'http://rpc.pingomatic.com/'); - $this->setValue('jlog_language', (defined('JLOG_LANGUAGE') ? JLOG_LANGUAGE : 'de')); - } - - - /** - * getSuggestPath() - generate a suggestion for JLOG_PATH - * - * @access private - * @return string - */ - function getSuggestPath() { - $host = empty($_SERVER['HTTP_HOST']) - ? (empty($_SERVER['SERVER_NAME']) - ? $_SERVER['SERVER_ADDR'] - : $_SERVER['SERVER_NAME']) - : $_SERVER['HTTP_HOST']; - $proto = (empty($_SERVER['HTTPS']) OR $_SERVER['HTTPS'] == 'off') - ? 'http' - : 'https'; - $port = $_SERVER['SERVER_PORT']; - - $uri = $proto . '://' . $host; - if ((('http' == $proto) and (80 != $port)) - or (('https' == $proto) and (443 != $port))) - { - $uri .= ':' . $port; - } - $uri .= dirname($_SERVER['SCRIPT_NAME']); - - return $uri; - } - - /** - * defaultValue() - gets a value of an array - * - * Look for index $key in the array $array and return - * the corresponding value if it exists or the default - * value $default if it doesn't. - * - * @access public - * @param array $array - * @param mixed $key - * @param mixed $default - * @return mixed - */ - function defaultValue($array, $key, $default = '') { - if(isset($array[$key])) { - return $array[$key]; - } - else { - return $default; - } - } - - /** - * form_output() - generates HTML output for formular - * - * @access public - * @return string - */ - function form_output() { - # returns the filled form - - $data = array_htmlspecialchars($this->d); - - if(isset($data['jlog_clean_url']) AND ($data['jlog_clean_url'] === 'true' OR $data['jlog_clean_url'] === '1')) - $d['clean_url_yes'] = " checked='checked'"; - else $d['clean_url_no'] = " checked='checked'"; - - if(isset($data['jlog_info_by_comment'])) $d['info_by_comment'] = " checked='checked'"; - else $d['info_by_comment'] = ""; - - if(isset($data['jlog_bs_weblogs_com']) AND ($data['jlog_bs_weblogs_com'] === 'true' OR $data['jlog_bs_weblogs_com'] === '1')) - $d['bs_weblogs_com'] = " checked='checked' "; - - if(defined("JLOG_ADMIN") AND JLOG_ADMIN === true) $admincenter_password = " ".$this->l['admin']['m_admin_password_admin']; - else $admincenter_password = ''; - - // get available languages - $dir = opendir(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'lang'); - $languages = array(); - while(($file = readdir($dir)) !== false) { - if($file == '.' OR $file == '..') continue; - if(!preg_match('/lang\.([a-zA-z0-9]+)\.inc\.php/', $file, $matches)) continue; - $languages[] = $matches[1]; - } - - // do the form - $form = " - -
    ".$this->l['admin']['m_metadata']." -


    "; - - if(defined("JLOG_ADMIN") AND JLOG_ADMIN === true) $form .= add_session_id_input_tag(); - - $form .= "

    -


    -

    -


    -

    -


    -

    -


    -

    -


    -

    -
    - -
    ".$this->l['admin']['m_behavior']." -


    - -

    -


    -

    -


    -

    -


    -

    -


    -

    -

    -

    -

    -

    -

    -

    -

    -
    - "; - - if(defined('JLOG_SETUP') AND JLOG_SETUP === true) { - $form .= - " -
    ".$this->l['admin']['m_database']." -


    -

    -


    -

    -


    -

    -


    -

    -


    - -

    - - -
    - "; - } - - $form .= " -

    - - "; - - return $form; - } - - /** - * validate() - validates the current configuration - * - * If the current configuration is valid, an empty array is returned. - * Otherwise the returned array containes all errors, described in the - * current language. - * - * @access public - * @return array - */ - function validate() { - # if everything validate then return true - # otherwise return the $errors array - - $errors = array(); - - // paths - if(empty($this->d['jlog_path']) OR (check_url($this->d['jlog_path'], array ('http')) === false)) $errors[] = $this->l['admin']['e_path']; - if(empty($this->d['jlog_basepath']) OR !is_dir($this->d['jlog_basepath'])) $errors[] = $this->l['admin']['e_basepath']; - if($this->d['jlog_clean_url'] != 'true') $this->d['jlog_clean_url'] = 'false'; - // metadata - if(empty($this->d['jlog_website'])) $errors[] = $this->l['admin']['e_website']; - if(empty($this->d['jlog_publisher'])) $errors[] = $this->l['admin']['e_publisher']; - if(defined('JLOG_SETUP') AND JLOG_SETUP) { - if($this->d['jlog_admin_password'] == hashPassword("")) - $errors[] = $this->l['admin']['e_admin_password']; - elseif($this->d['jlog_admin_password'] !== $this->d['jlog_admin_password_again']) - $errors[] = $this->l['admin']['e_admin_password_again']; - } - elseif(!empty($this->d['jlog_admin_password']) AND $this->d['jlog_admin_password'] !== $this->d['jlog_admin_password_again']) { - $errors[] = $this->l['admin']['e_admin_password_again']; - } - // Fix of bug #148 - if(isset($this->d['jlog_admin_password_again'])) - unset($this->d['jlog_admin_password_again']); - - if(empty($this->d['jlog_email']) OR !strpos($this->d['jlog_email'], '@')) $errors[] = $this->l['admin']['e_email']; - if(empty($this->d['jlog_description'])) $errors[] = $this->l['admin']['e_description']; - // behavour - if(!is_numeric($this->d['jlog_max_blog_orginal']) OR intval($this->d['jlog_max_blog_orginal']) < 0) $errors[] = $this->l['admin']['e_max_blog_orginal']; - if(!is_numeric($this->d['jlog_max_blog_big']) OR intval($this->d['jlog_max_blog_big']) < 0) $errors[] = $this->l['admin']['e_max_blog_big']; - if(!is_numeric($this->d['jlog_max_blog_small']) OR intval($this->d['jlog_max_blog_small']) < 0) $errors[] = $this->l['admin']['e_max_blog_small']; - if(!is_numeric($this->d['jlog_sub_current']) OR intval($this->d['jlog_sub_current']) < 0) $errors[] = $this->l['admin']['e_sub_current']; - if(!is_numeric($this->d['jlog_start_year'])) $errors[] = $this->l['admin']['e_start_year']; - if($this->d['jlog_info_by_comment'] != 'true') $this->d['jlog_info_by_comment'] = 'false'; - // database - if(empty($this->d['jlog_db'])) $errors[] = $this->l['admin']['e_db']; - if(empty($this->d['jlog_db_url'])) $errors[] = $this->l['admin']['e_db_url']; - // Fix of bug #196, prefix should only contain alphanumeric values, can be empty! - if(!preg_match('/^[a-zA-Z0-9_]*$/', $this->d['jlog_db_prefix'])) $errors[] = $this->l['admin']['e_db_prefix']; - - return $errors; - } - - /** - * do_settings() - save configuration - * - * Saves the current configuration to the settings.inc.php file - * in the personal folder. Return an empty array if configuration - * was saved successfully, or an array containing descriptions of - * the errors that occured otherwise. - * - * @access public - * @return array - */ - function do_settings() { - # if it's all done return true - # otherwise return the $errors array - - $errors = array(); - - // if there is no new password set the old - if(JLOG_ADMIN AND empty($this->d['jlog_admin_password'])) $this->d['jlog_admin_password'] = JLOG_ADMIN_PASSWORD; - - // remove slashes at the end of JLOG_PATH if present - $this->d['jlog_path'] = rtrim($this->d['jlog_path'], '/'); - // make shure JLOG_BASEPATH ends with a slash!! - $this->d['jlog_basepath'] = rtrim($this->d['jlog_basepath'], '/\\') . DIRECTORY_SEPARATOR; - - // no quotes for bolean and numbers - $no_quotes = array ( - 'jlog_clean_url' => 'bool', - 'jlog_max_blog_orginal' => 'int', - 'jlog_max_blog_big' => 'int', - 'jlog_max_blog_small' => 'int', - 'jlog_sub_current' => 'int', - 'jlog_start_year' => 'int', - 'jlog_info_by_comment' => 'bool' - ); - - // serialize data to file format - $file_content = 'd as $key => $value) { - $output = ''; - if(isset($no_quotes[$key])) { - // boolean values - if($no_quotes[$key] == 'bool') { - if($value == 'true' OR $value === true) $output = 'true'; - else $output = 'false'; - } - // numeric values - else { - $output = (int) $value; - } - } - // string values - else { - $output = '\'' . $this->escapeForPhp($value) . '\''; - } - $key = '\'' . $this->escapeForPhp(strtoupper($key)) . '\''; - $file_content .= 'define(' . $key . ', ' . $output . ');' . PHP_EOL; - } - - $file_content .= '// eof'; - - // write to settings.inc.php - if(!$handle = fopen(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."settings.inc.php", "w")) $errors[] = $this->l['admin']['can_not_open']." /personal/settings.inc.php"; - if(!fwrite($handle, $file_content)) $errors[] = $this->l['admin']['can_not_write']." /personal/settings.inc.php"; - fclose($handle); - - return $errors; - } - - /** - * escapeForPhp() - * - * escapes $value so that it can be used between single quotes in a - * PHP script, single quotes are better than double qoutes, as therein no - * further substituions are performed - * - * @access public - * @param string $value - * @return string - */ - function escapeForPhp($value) { - $value = str_replace('\\', '\\\\', $value); - $value = str_replace("'", "\'", $value); - $value = str_replace("\0", '', $value); - $value = str_replace("\r\n", "'.chr(13).chr(10).'", $value); - $value = str_replace("\r", "'.chr(13).'", $value); - $value = str_replace("\n", "'.chr(10).'", $value); - return $value; - } -} - -// eof +l = $l; + } + + /** + * getValue() - reads configuration data + * + * This procedure returns the value for then configuration option + * specified by $key or an array of all options if $key is not + * specified or false + * + * @access public + * @param string|boolean $key + * @return mixed + */ + function getValue($key = false) { + if($key === false) return $this->d; + else return $this->d[strtolower($key)]; + } + + /** + * setValue() - sets configuration data + * + * @access public + * @param string|boolean $key + * @param mixed $value + * @return mixed + */ + function setValue($key, $value) { + $this->d[strtolower($key)] = $value; + } + + /** + * importDataByConstants() + * + * imports data from global constats starting with JLOG_ prefix + * + * @access public + * @return void + */ + function importDataByConstants() { + # no return + // this is a blacklist of constats which are not to be written in settings.inc.php + $search = array( + 'JLOG_ADMIN', + 'JLOG_DB_CONTENT', + 'JLOG_DB_COMMENTS', + 'JLOG_DB_CATASSIGN', + 'JLOG_DB_CATEGORIES', + 'JLOG_DB_ATTRIBUTES', + 'JLOG_UPDATE', + 'JLOG_LOGIN', + 'JLOG_SOFTWARE_VERSION', + 'JLOG_SOFTWARE_URL', + 'JLOG_SOFTWARE_PHPV', + 'JLOG_SOFTWARE_MYSQLV', + 'JLOG_ADMIN_PASSWORD_AGAIN' + ); + + // get all needed constants and put it into the class + $constants = get_defined_constants(); + foreach($constants as $key => $value) { + if(!in_array($key, $search) AND strpos($key, "JLOG_") !== false) { + $this->setValue($key, $value); + } + } + } + + /** + * importDataByArray() - sets configuration data + * + * Sets configuration data according to $d. If working in + * non-exclusive mode (the default), $d is merged into the current + * configuration, otherwise the current configuration is discared + * and $d is set as the new configuration. + * + * @access public + * @param array $d + * @param boolean $exclusiv + * @return void + */ + function importDataByArray($d = false, $exclusiv = false) { + + // get the data from users $d array and put it into the class + if($d !== false) { + if($exclusiv) $this->d = $d; + else $this->d = array_merge($this->d, $d); + } + + if(JLOG_ADMIN === true) { + $this->d['jlog_db'] = JLOG_DB; + $this->d['jlog_db_url'] = JLOG_DB_URL; + $this->d['jlog_db_user'] = JLOG_DB_USER; + $this->d['jlog_db_pwd'] = JLOG_DB_PWD; + $this->d['jlog_db_prefix'] = JLOG_DB_PREFIX; + $this->d['jlog_start_year'] = JLOG_START_YEAR; + $this->d['jlog_path'] = JLOG_PATH; + $this->d['jlog_basepath'] = JLOG_BASEPATH; + if($this->d['jlog_admin_password'] == '') { + $this->jlog_admin_password = JLOG_ADMIN_PASSWORD; + } + else { + $this->d['jlog_admin_password'] = hashPassword($this->d['jlog_admin_password']); + $this->d['jlog_admin_password_again'] = hashPassword($this->d['jlog_admin_password_again']); + } + $this->d['jlog_installed_version'] = JLOG_INSTALLED_VERSION; + $this->d['jlog_installed_url'] = JLOG_INSTALLED_URL; + $this->d['jlog_installed_phpv'] = JLOG_INSTALLED_PHPV; + $this->d['jlog_installed_mysqlv'] = JLOG_INSTALLED_MYSQLV; + } + else { + $this->d['jlog_admin_password'] = hashPassword($this->d['jlog_admin_password']); + $this->d['jlog_admin_password_again'] = hashPassword($this->d['jlog_admin_password_again']); + } + + if((defined('JLOG_SETUP') AND JLOG_SETUP === true)) + { + $this->d['jlog_installed_version'] = JLOG_SOFTWARE_VERSION; + $this->d['jlog_installed_url'] = JLOG_SOFTWARE_URL; + $this->d['jlog_installed_phpv'] = JLOG_SOFTWARE_PHPV; + $this->d['jlog_installed_mysqlv'] = JLOG_SOFTWARE_MYSQLV; + } + } + + /** + * importSuggestedData() - preallocates configuration data + * + * Initialises the configuration with useful settings during + * the installation process. + * + * @access public + * @return void + */ + function importSuggestedData() { + // suggest some data for setup + $this->setValue('jlog_path', $this->getSuggestPath()); + $this->setValue('jlog_basepath', dirname(dirname( __FILE__ )).DIRECTORY_SEPARATOR); + $date = getdate(); + $this->setValue('jlog_start_year', $date['year']); + $this->setValue('jlog_max_blog_orginal', 1); + $this->setValue('jlog_max_blog_big', 4); + $this->setValue('jlog_max_blog_small', 15); + $this->setValue('jlog_sub_current', 6); + $this->setValue('jlog_date', $this->l['date_format']); + $this->setValue('jlog_date_comment', $this->l['date_format_comment']); + $this->setValue('jlog_date_subcurrent', $this->l['date_format_subcurrent']); + $this->setValue('jlog_info_by_comment', true); + $this->setValue('jlog_db_url', 'localhost'); + $this->setValue('jlog_db_prefix', 'jlog_'); + $this->setValue('jlog_blogservices', 'http://rpc.pingomatic.com/'); + $this->setValue('jlog_language', (defined('JLOG_LANGUAGE') ? JLOG_LANGUAGE : 'de')); + } + + + /** + * getSuggestPath() - generate a suggestion for JLOG_PATH + * + * @access private + * @return string + */ + function getSuggestPath() { + $host = empty($_SERVER['HTTP_HOST']) + ? (empty($_SERVER['SERVER_NAME']) + ? $_SERVER['SERVER_ADDR'] + : $_SERVER['SERVER_NAME']) + : $_SERVER['HTTP_HOST']; + $proto = (empty($_SERVER['HTTPS']) OR $_SERVER['HTTPS'] == 'off') + ? 'http' + : 'https'; + $port = $_SERVER['SERVER_PORT']; + + $uri = $proto . '://' . $host; + if ((('http' == $proto) and (80 != $port)) + or (('https' == $proto) and (443 != $port))) + { + $uri .= ':' . $port; + } + $uri .= dirname($_SERVER['SCRIPT_NAME']); + + return $uri; + } + + /** + * defaultValue() - gets a value of an array + * + * Look for index $key in the array $array and return + * the corresponding value if it exists or the default + * value $default if it doesn't. + * + * @access public + * @param array $array + * @param mixed $key + * @param mixed $default + * @return mixed + */ + function defaultValue($array, $key, $default = '') { + if(isset($array[$key])) { + return $array[$key]; + } + else { + return $default; + } + } + + /** + * form_output() - generates HTML output for formular + * + * @access public + * @return string + */ + function form_output() { + # returns the filled form + + $data = array_htmlspecialchars($this->d); + + if (isset($data['jlog_clean_url']) AND + ($data['jlog_clean_url'] === 'true' OR $data['jlog_clean_url'] === '1')) + { + $d['clean_url_yes'] = " checked='checked'"; + $d['clean_url_no'] = ''; + } + else { + $d['clean_url_yes'] = ''; + $d['clean_url_no'] = " checked='checked'"; + } + + if(isset($data['jlog_info_by_comment'])) $d['info_by_comment'] = " checked='checked'"; + else $d['info_by_comment'] = ""; + + if(isset($data['jlog_bs_weblogs_com']) AND ($data['jlog_bs_weblogs_com'] === 'true' OR $data['jlog_bs_weblogs_com'] === '1')) + $d['bs_weblogs_com'] = " checked='checked' "; + + if(defined("JLOG_ADMIN") AND JLOG_ADMIN === true) $admincenter_password = " ".$this->l['admin']['m_admin_password_admin']; + else $admincenter_password = ''; + + // get available languages + $dir = opendir(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'lang'); + $languages = array(); + while(($file = readdir($dir)) !== false) { + if($file == '.' OR $file == '..') continue; + if(!preg_match('/lang\.([a-zA-z0-9]+)\.inc\.php/', $file, $matches)) continue; + $languages[] = $matches[1]; + } + + // do the form + $form = " +
    +
    ".$this->l['admin']['m_metadata']." +


    "; + + if(defined("JLOG_ADMIN") AND JLOG_ADMIN === true) $form .= add_session_id_input_tag(); + + $form .= "

    +


    +

    +


    +

    +


    +

    +


    +

    +


    +

    +
    + +
    ".$this->l['admin']['m_behavior']." +


    + +

    +


    +

    +


    +

    +


    +

    +


    +

    +

    +

    +

    +

    +

    +

    +

    +
    + "; + + if(defined('JLOG_SETUP') AND JLOG_SETUP === true) { + $form .= + " +
    ".$this->l['admin']['m_database']." +


    +

    +


    +

    +


    +

    +


    +

    +


    + +

    + + +
    + "; + } + + $form .= " +

    +
    + "; + + return $form; + } + + /** + * validate() - validates the current configuration + * + * If the current configuration is valid, an empty array is returned. + * Otherwise the returned array containes all errors, described in the + * current language. + * + * @access public + * @return array + */ + function validate() { + # if everything validate then return true + # otherwise return the $errors array + + $errors = array(); + + // paths + if(empty($this->d['jlog_path']) OR (check_url($this->d['jlog_path'], array ('http')) === false)) $errors[] = $this->l['admin']['e_path']; + if(empty($this->d['jlog_basepath']) OR !is_dir($this->d['jlog_basepath'])) $errors[] = $this->l['admin']['e_basepath']; + if($this->d['jlog_clean_url'] != 'true') $this->d['jlog_clean_url'] = 'false'; + // metadata + if(empty($this->d['jlog_website'])) $errors[] = $this->l['admin']['e_website']; + if(empty($this->d['jlog_publisher'])) $errors[] = $this->l['admin']['e_publisher']; + if(defined('JLOG_SETUP') AND JLOG_SETUP) { + if($this->d['jlog_admin_password'] == hashPassword("")) + $errors[] = $this->l['admin']['e_admin_password']; + elseif($this->d['jlog_admin_password'] !== $this->d['jlog_admin_password_again']) + $errors[] = $this->l['admin']['e_admin_password_again']; + } + elseif(!empty($this->d['jlog_admin_password']) AND $this->d['jlog_admin_password'] !== $this->d['jlog_admin_password_again']) { + $errors[] = $this->l['admin']['e_admin_password_again']; + } + // Fix of bug #148 + if(isset($this->d['jlog_admin_password_again'])) + unset($this->d['jlog_admin_password_again']); + + if(empty($this->d['jlog_email']) OR !strpos($this->d['jlog_email'], '@')) $errors[] = $this->l['admin']['e_email']; + if(empty($this->d['jlog_description'])) $errors[] = $this->l['admin']['e_description']; + // behavour + if(!is_numeric($this->d['jlog_max_blog_orginal']) OR intval($this->d['jlog_max_blog_orginal']) < 0) $errors[] = $this->l['admin']['e_max_blog_orginal']; + if(!is_numeric($this->d['jlog_max_blog_big']) OR intval($this->d['jlog_max_blog_big']) < 0) $errors[] = $this->l['admin']['e_max_blog_big']; + if(!is_numeric($this->d['jlog_max_blog_small']) OR intval($this->d['jlog_max_blog_small']) < 0) $errors[] = $this->l['admin']['e_max_blog_small']; + if(!is_numeric($this->d['jlog_sub_current']) OR intval($this->d['jlog_sub_current']) < 0) $errors[] = $this->l['admin']['e_sub_current']; + if(!is_numeric($this->d['jlog_start_year'])) $errors[] = $this->l['admin']['e_start_year']; + if($this->d['jlog_info_by_comment'] != 'true') $this->d['jlog_info_by_comment'] = 'false'; + // database + if(empty($this->d['jlog_db'])) $errors[] = $this->l['admin']['e_db']; + if(empty($this->d['jlog_db_url'])) $errors[] = $this->l['admin']['e_db_url']; + // Fix of bug #196, prefix should only contain alphanumeric values, can be empty! + if(!preg_match('/^[a-zA-Z0-9_]*$/', $this->d['jlog_db_prefix'])) $errors[] = $this->l['admin']['e_db_prefix']; + + return $errors; + } + + /** + * do_settings() - save configuration + * + * Saves the current configuration to the settings.inc.php file + * in the personal folder. Return an empty array if configuration + * was saved successfully, or an array containing descriptions of + * the errors that occured otherwise. + * + * @access public + * @return array + */ + function do_settings() { + # if it's all done return true + # otherwise return the $errors array + + $errors = array(); + + // if there is no new password set the old + if(JLOG_ADMIN AND empty($this->d['jlog_admin_password'])) $this->d['jlog_admin_password'] = JLOG_ADMIN_PASSWORD; + + // remove slashes at the end of JLOG_PATH if present + $this->d['jlog_path'] = rtrim($this->d['jlog_path'], '/'); + // make shure JLOG_BASEPATH ends with a slash!! + $this->d['jlog_basepath'] = rtrim($this->d['jlog_basepath'], '/\\') . DIRECTORY_SEPARATOR; + + // no quotes for bolean and numbers + $no_quotes = array ( + 'jlog_clean_url' => 'bool', + 'jlog_max_blog_orginal' => 'int', + 'jlog_max_blog_big' => 'int', + 'jlog_max_blog_small' => 'int', + 'jlog_sub_current' => 'int', + 'jlog_start_year' => 'int', + 'jlog_info_by_comment' => 'bool' + ); + + // serialize data to file format + $file_content = 'd as $key => $value) { + $output = ''; + if(isset($no_quotes[$key])) { + // boolean values + if($no_quotes[$key] == 'bool') { + if($value == 'true' OR $value === true) $output = 'true'; + else $output = 'false'; + } + // numeric values + else { + $output = (int) $value; + } + } + // string values + else { + $output = '\'' . $this->escapeForPhp($value) . '\''; + } + $key = '\'' . $this->escapeForPhp(strtoupper($key)) . '\''; + $file_content .= 'define(' . $key . ', ' . $output . ');' . PHP_EOL; + } + + $file_content .= '// eof'; + + // write to settings.inc.php + if(!$handle = fopen(JLOG_BASEPATH."personal".DIRECTORY_SEPARATOR."settings.inc.php", "w")) $errors[] = $this->l['admin']['can_not_open']." /personal/settings.inc.php"; + if(!fwrite($handle, $file_content)) $errors[] = $this->l['admin']['can_not_write']." /personal/settings.inc.php"; + fclose($handle); + + return $errors; + } + + /** + * escapeForPhp() + * + * escapes $value so that it can be used between single quotes in a + * PHP script, single quotes are better than double qoutes, as therein no + * further substituions are performed + * + * @access public + * @param string $value + * @return string + */ + function escapeForPhp($value) { + $value = str_replace('\\', '\\\\', $value); + $value = str_replace("'", "\'", $value); + $value = str_replace("\0", '', $value); + $value = str_replace("\r\n", "'.chr(13).chr(10).'", $value); + $value = str_replace("\r", "'.chr(13).'", $value); + $value = str_replace("\n", "'.chr(10).'", $value); + return $value; + } +} + +// eof diff --git a/scripts/stringparser.class.php b/scripts/stringparser.class.php index 46f78f3..151cb93 100644 --- a/scripts/stringparser.class.php +++ b/scripts/stringparser.class.php @@ -199,7 +199,7 @@ class StringParser { * * @access public */ - function StringParser () { + function __construct () { } /** @@ -459,7 +459,7 @@ class StringParser { // if yes, how should this be achieved? Another member of // StringParser_Node? $this->_setStatus (0); - $res = $this->_appendText ($this->_text{$topelem->occurredAt}); + $res = $this->_appendText ($this->_text[$topelem->occurredAt]); if (!$res) { return false; } @@ -568,7 +568,7 @@ class StringParser { return false; } if (!$res) { - $res = $this->_appendText ($this->_text{$this->_cpos}); + $res = $this->_appendText ($this->_text[$this->_cpos]); if (!$res) { return false; } @@ -910,7 +910,7 @@ class StringParser_Node { * occurred at. If not determinable, it is -1. * @global __STRINGPARSER_NODE_ID */ - function StringParser_Node ($occurredAt = -1) { + function __construct ($occurredAt = -1) { $this->_id = $GLOBALS['__STRINGPARSER_NODE_ID']++; $this->occurredAt = $occurredAt; } @@ -1248,7 +1248,8 @@ class StringParser_Node { * @param object $node The node to destroy * @return bool True on success, else false. */ - function destroyNode (&$node) { + // FIXME static added due to Strict Standards + static function destroyNode (&$node) { if ($node === null) { return false; } @@ -1486,8 +1487,8 @@ class StringParser_Node_Text extends StringParser_Node { * occurred at. If not determinable, it is -1. * @see StringParser_Node_Text::content */ - function StringParser_Node_Text ($content, $occurredAt = -1) { - parent::StringParser_Node ($occurredAt); + function __construct ($content, $occurredAt = -1) { + parent::__construct ($occurredAt); $this->content = $content; } diff --git a/scripts/stringparser_bbcode.class.php b/scripts/stringparser_bbcode.class.php index 7db60e0..9309b87 100644 --- a/scripts/stringparser_bbcode.class.php +++ b/scripts/stringparser_bbcode.class.php @@ -1053,12 +1053,12 @@ class StringParser_BBCode extends StringParser { $ol = strlen ($output); switch ($node->getFlag ('newlinemode.begin', 'integer', BBCODE_NEWLINE_PARSE)) { case BBCODE_NEWLINE_IGNORE: - if ($ol && $output{0} == "\n") { + if ($ol && $output[0] == "\n") { $before = "\n"; } // don't break! case BBCODE_NEWLINE_DROP: - if ($ol && $output{0} == "\n") { + if ($ol && $output[0] == "\n") { $output = substr ($output, 1); $ol--; } @@ -1066,12 +1066,12 @@ class StringParser_BBCode extends StringParser { } switch ($node->getFlag ('newlinemode.end', 'integer', BBCODE_NEWLINE_PARSE)) { case BBCODE_NEWLINE_IGNORE: - if ($ol && $output{$ol-1} == "\n") { + if ($ol && $output[$ol-1] == "\n") { $after = "\n"; } // don't break! case BBCODE_NEWLINE_DROP: - if ($ol && $output{$ol-1} == "\n") { + if ($ol && $output[$ol-1] == "\n") { $output = substr ($output, 0, -1); $ol--; } @@ -1449,10 +1449,13 @@ class StringParser_BBCode_Node_Paragraph extends StringParser_Node { $f_begin = $this->_children[0]->getFlag ('newlinemode.begin', 'integer', BBCODE_NEWLINE_PARSE); $f_end = $this->_children[0]->getFlag ('newlinemode.end', 'integer', BBCODE_NEWLINE_PARSE); $content = $this->_children[0]->content; - if ($f_begin != BBCODE_NEWLINE_PARSE && $content{0} == "\n") { + if ($f_begin != BBCODE_NEWLINE_PARSE && $content[0] == "\n") { $content = substr ($content, 1); } - if ($f_end != BBCODE_NEWLINE_PARSE && $content{strlen($content)-1} == "\n") { + if ($f_end != BBCODE_NEWLINE_PARSE && + strlen($content) > 0 && + $content[strlen($content)-1] == "\n") + { $content = substr ($content, 0, -1); } if (!strlen ($content)) { diff --git a/scripts/update.php b/scripts/update.php index 3b86e05..c46e80c 100644 --- a/scripts/update.php +++ b/scripts/update.php @@ -105,6 +105,7 @@ $file['sub'] = JLOG_BASEPATH.'personal'.DIRECTORY_SEPARATOR.'subcurrent.inc'; } $i = 0; +$errors = array(); foreach($file AS $d => $filename) { if (is_writable($filename)) { diff --git a/scripts/version.inc.php b/scripts/version.inc.php old mode 100644 new mode 100755 index 23677aa..27f4c41 --- a/scripts/version.inc.php +++ b/scripts/version.inc.php @@ -20,12 +20,12 @@ * $HeadURL: http://jeenaparadies.net/svn/jlog/trunk/scripts/version.inc.php $ * $Rev: 1785 $ * $Author: driehle $ - * $Date: 2009-01-13 21:58:12 +0100 (Tis, 13 Jan 2009) $ + * $Date: 2009-01-13 21:58:12 +0100 (Di, 13. Jan 2009) $ */ define('JLOG_SOFTWARE_VERSION', '1.1.3'); -define('JLOG_SOFTWARE_URL', 'http://jeenaparadies.net/projects/jlog'); +define('JLOG_SOFTWARE_URL', 'https://github.com/jeena/jlog'); define('JLOG_SOFTWARE_PHPV', '4.1.1'); define('JLOG_SOFTWARE_MYSQLV', '4.1.0'); -// eof \ No newline at end of file +// eof diff --git a/search.php b/search.php index 9a2d10a..82375e6 100644 --- a/search.php +++ b/search.php @@ -5,16 +5,17 @@ $c['meta']['title'] = $l['content_search_header']; $c['main'] = ""; - $searchstring = strip($_GET['q']); + $searchstring = isset($_GET['q']) ? strip($_GET['q']) : ''; + $btnValue = htmlspecialchars($l['content_search']); $c['main'] .= '

    -

    +

    '; -if(!empty($searchstring)) { +if(strlen($searchstring) > 0) { $sql_searchstring = escape_for_mysql($searchstring);