Add some bots
[infodrom.org/www.zeitungsliste.de] / lib / layout.inc
index 90a093f..6959c19 100644 (file)
@@ -24,10 +24,8 @@ function pageheader()
 {
   global $cfg;
   global $zlist;
-  global $_POST;
-  global $_SERVER;
 
-  $ret .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
+  $ret .= '<!DOCTYPE html">';
   $ret .= '<html lang="de">';
   $ret .= '<head>';
   if (isset($zlist['newspaper']))
@@ -36,18 +34,23 @@ function pageheader()
     $ret .= sprintf('<title>Zeitungsliste: Tag %s</title>', $zlist['tag']);
   else
     $ret .= '<title>Zeitungsliste</title>';
-  $ret .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
+  header('Content-Type: text/html; charset=UTF-8');
+  $ret .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
   $ret .= '<meta name="Author" content="joey@infodrom.org (Joey Schulze)">';
   $ret .= '<meta name="Language" content="de">';
   
   if ($zlist['page'] == 'index') {
-    $ret .= '<meta name="Keywords" content="Zeitung, Zeitungen, Liste, Zeitungsliste, Online-Zeitungen, Zeitungen im Web, Forum, Community">';
+    $ret .= '<meta name="Keywords" content="Zeitung, Zeitungen, Liste, Zeitungsliste, Online-Zeitungen, Zeitungen im Web, Forum, Community, '.
+      'Liste aller Zeitungen">';
     $ret .= sprintf('<link rel="alternate" type="application/rss+xml" title="Zeitungen" href="%szeitungen.rdf">', $cfg['basepath']);
+  } elseif ($cfg['dir'] == 'zeitung') {
+    $ret .= '<meta name="Keywords" content="Zeitung, Zeitungsliste, Online-Zeitung, Zeitung im Web, Forum, Community, '.
+      $zlist['newspaper'] . ', ' . $zlist['city'] . '">';
   }
 
   if (is_spider())
     $ret .= '<meta name="Robots" content="index,follow">';
-  $ret .= '<meta name="Copyright" content="(c) 2008 Information & Consulting">';
+  $ret .= '<meta name="Copyright" content="(c) 2018 Information & Consulting">';
   $ret .= sprintf('<link href="%smain.css" rel="stylesheet" type="text/css">', $cfg['basepath']);
   $ret .= sprintf('<link rel="icon" href="%sfavicon.ico" type="image/x-icon">', $cfg['basepath']);
   $ret .= sprintf('<link rel="shortcut icon" href="%sfavicon.ico" type="image/x-icon">', $cfg['basepath']);
@@ -71,6 +74,10 @@ function pageheader()
   $ret .= '<div class="homestatus"><a href="'.$cfg['home'].'">Home</a>';
   if ($cfg['path'] != 'contact.html')
     $ret .= sprintf('&nbsp;&nbsp;&nbsp;<a href="%scontact.html">Kontakt</a>', $cfg['basepath']);
+  if ($cfg['path'] != 'datenschutz.html')
+    $ret .= sprintf('&nbsp;&nbsp;&nbsp;<a href="%sdatenschutz.html">Datenschutz</a>', $cfg['basepath']);
+  if (is_admin() && $cfg['path'] != 'admin.html')
+    $ret .= sprintf('&nbsp;&nbsp;&nbsp;<a href="%sadmin/index.html">Admin</a>', $cfg['basepath']);
   if (is_spider())
     $ret .= sprintf('&nbsp;&nbsp;&nbsp;<a href="%ssitemap.html">Sitemap</a>', $cfg['basepath']);
   $ret .= '</div>';
@@ -126,78 +133,27 @@ function layout_bookmarks($rel, $title)
 
   // Mehr auf http://www.bikeshops.de/Bikeshops/BikeGuide/BikeGuideWertgarantie.asp
   $bookmarks = array(
-                    array('text' => 'Mister Wong',
-                          'icon' => 'link_misterwong.gif',
-                          'link' => 'http://www.mister-wong.de/index.php?action=addurl&amp;bm_url=@url@&amp;bm_description=@title@'),
                     array('text' => 'Delicious',
                           'icon' => 'link_delicious.gif',
                           'link' => 'http://del.icio.us/post?v=4&amp;noui&amp;url=@url@&amp;title=@title@'),
-                    array('text' => 'Google Bookmarks',
-                          'icon' => 'link_google.gif',
-                          'link' => 'http://www.google.com/bookmarks/mark?op=add&amp;hl=de&amp;bkmk=@url@&amp;title=@title@'),
-                    array('text' => 'Yahoo Web',
-                          'icon' => 'link_yahoo.gif',
-                          'link' => 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u=@url@&amp;t=@title@'),
-                    array('text' => 'Technorati',
-                          'icon' => 'link_technorati.gif',
-                          'link' => 'http://technorati.com/faves?add=@url@'),
                     array('text' => 'Digg it',
                           'icon' => 'link_digg.gif',
                           'link' => 'http://digg.com/submit?phase=2&amp;url=@url@&amp;title=@title@'),
-                    array('text' => 'Yigg',
-                          'icon' => 'link_yigg.gif',
-                          'link' => 'http://yigg.de/neu?action=addurl&amp;exturl=@url@&amp;exttitle=@title@'),
-                    array('text' => 'Taggle',
-                          'icon' => 'link_taggle.gif',
-                          'link' => 'http://taggle.de/addLinkDetails?mAddress=@url@&amp;title=B@title@&amp;submitted=Weiter'),
-                    array('text' => 'Linkarena',
-                          'icon' => 'link_linkarena.gif',
-                          'link' => 'http://www.linkarena.com/linkadd.php?linkName=@title@&amp;linkURL=@url@'),
-                    array('text' => 'OneView',
-                          'icon' => 'link_oneview.gif',
-                          'link' => 'http://www.oneview.de/quickadd/neu/addBookmark.jsf?URL=@url@&amp;title=@title@'),
                     array('text' => 'folk it',
                           'icon' => 'link_folkd.gif',
                           'link' => 'http://www.folkd.com/submit/@url@'),
-                    array('text' => 'Facebook',
-                          'icon' => 'link_facebook.gif',
-                          'link' => 'http://www.facebook.com/sharer.php?u=@url@&amp;title=@title@'),
-                    array('text' => 'Blinklist',
-                          'icon' => 'link_blinklist.gif',
-                          'link' => 'http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=@url@&Description=@title@'),
-                    array('text' => 'Furl',
-                          'icon' => 'link_furl.gif',
-                          'link' => 'http://www.furl.net/storeIt.jsp?t=@title@&u=@url@'),
                     array('text' => 'Reddit',
                           'icon' => 'link_reddit.gif',
                           'link' => 'http://reddit.com/submit?url=@url@&title=@title@'),
                     array('text' => 'Spurl',
                           'icon' => 'link_spurl.gif',
                           'link' => 'http://www.spurl.net/spurl.php?url=@url@&title=@title@'),
-                    array('text' => 'Shadows',
-                          'icon' => 'link_shadows.gif',
-                          'link' => 'http://www.shadows.com/features/tcr.htm?url=@url@&title=@title@'),
-                    array('text' => 'newsvine',
-                          'icon' => 'link_newsvine.gif',
-                          'link' => 'http://www.newsvine.com/_wine/save?popoff=1&u=@url@&tags=&blurb=@title@'),
-                    array('text' => 'CXWeb',
-                          'icon' => 'link_cxweb.gif',
-                          'link' => 'http://www.cxweb.de/login/?action=add&amp;address=@url@&amp;title=@title@'),
-                    array('text' => 'Simpy',
-                          'icon' => 'link_simpy.gif',
-                          'link' => 'http://www.simpy.com/simpy/LinkAdd.do?title=@title@&amp;href=@url@'),
-                    array('text' => 'Ma.Gnolia',
-                          'icon' => 'link_magnolia.gif',
-                          'link' => 'http://ma.gnolia.com/bookmarklet/add?url=@url@&amp;title=@title@&amp;description=&amp;tags='),
                     array('text' => 'StumbleUpon',
                           'icon' => 'link_stumbleupon.gif',
                           'link' => 'http://www.stumbleupon.com/submit?url=@url@&amp;title=@title@'),
                     array('text' => 'linksilo.de',
                           'icon' => 'link_linksilo.gif',
                           'link' => 'http://www.linksilo.de/index.php?area=bookmarks&amp;func=bookmark_new&amp;addurl=@url@&amp;addtitle=@title@'),
-                    array('text' => 'bookmarks.cc',
-                          'icon' => 'link_bookmarkscc.gif',
-                          'link' => 'http://www.bookmarks.cc/bookmarken.php?action=neu&amp;url=@url@&amp;title=@title@'),
                     );
 
   $url = $cfg['home'] . $rel;
@@ -223,8 +179,6 @@ function layout_bookmarks($rel, $title)
  */
 function layout_sitemap()
 {
-  global $_SESSION;
-  global $_SERVER;
   global $cfg;
 
   if (!is_spider())
@@ -236,11 +190,11 @@ function layout_sitemap()
 
   $sth = db_query($query);
 
-  if ($sth !== false && pg_NumRows($sth) > 0) {
-    $ret .= '<h3>Tags bzw. Merkmale</h3>';
+  if ($sth !== false && pg_num_rows($sth) > 0) {
+    $ret .= '<h3>User-Tags (Merkmale)</h3>';
     $ret .= '<ul class="gold">';
 
-    for ($i=0; $i < pg_NumRows($sth); $i++) {
+    for ($i=0; $i < pg_num_rows($sth); $i++) {
       $row = pg_fetch_array($sth, $i);
 
       $ret .= sprintf('<li><a href="%stag/%s.html">%s</a></li>',
@@ -255,10 +209,10 @@ function layout_sitemap()
 
   $sth = db_query($query);
 
-  if ($sth !== false && pg_NumRows($sth) > 0) {
+  if ($sth !== false && pg_num_rows($sth) > 0) {
     $ret .= '<h3>Zeitungen und Magazine</h3>';
     $ret .= '<ul class="gold">';
-    for ($i=0; $i < pg_NumRows($sth); $i++) {
+    for ($i=0; $i < pg_num_rows($sth); $i++) {
       $row = pg_fetch_array($sth, $i);
 
       $ret .= sprintf('<li><a href="%szeitung/%d.html">%s</a>, %s</li>',
@@ -267,14 +221,14 @@ function layout_sitemap()
     $ret .= '</ul>';
   }
 
-  $query = 'SELECT id,topic FROM topics WHERE ORDER BY created';
+  $query = 'SELECT id,topic FROM topics ORDER BY created';
 
   $sth = db_query($query);
 
-  if ($sth !== false && pg_NumRows($sth) > 0) {
+  if ($sth !== false && pg_num_rows($sth) > 0) {
     $ret .= '<h3>Diskussionen</h3>';
     $ret .= '<ul class="gold">';
-    for ($i=0; $i < pg_NumRows($sth); $i++) {
+    for ($i=0; $i < pg_num_rows($sth); $i++) {
       $row = pg_fetch_array($sth, $i);
 
       $ret .= sprintf('<li><a href="%stopic/%d.html">%s</a></li>',
@@ -288,7 +242,6 @@ function layout_sitemap()
 
 function layout_showpaper($archived=false)
 {
-  global $_GET;
   global $zlist;
 
   if (!isset($_GET['zeitung']) || !is_numeric($_GET['zeitung']))
@@ -317,7 +270,6 @@ function layout_showpaper($archived=false)
 function layout_archive()
 {
   global $zlist;
-  global $_GET;
   global $cfg;
 
   if (!isset($_GET['archiv']) || !is_numeric($_GET['archiv']))
@@ -337,11 +289,11 @@ function layout_archive()
 
       $sth = db_query($query);
 
-      if (!$sth || pg_NumRows ($sth) == 0)
+      if (!$sth || pg_num_rows ($sth) == 0)
        $ret .= warning('Kein Archiv gefunden.');
       else {
        $ret .= '<p><ul class="gold">';
-       for ($i=0; $i < pg_NumRows ($sth); $i++) {
+       for ($i=0; $i < pg_num_rows ($sth); $i++) {
          $row = pg_fetch_array($sth, $i);
          $ret .= sprintf('<li><a href="%stopic/%d.html">%s</a></li>',
                          $cfg['basepath'], $row['id'], $row['topic']);
@@ -358,7 +310,6 @@ function layout_showtag()
 {
   global $cfg;
   global $zlist;
-  global $_GET;
 
   if (!isset($_GET['tag']))
     $ret = warning('Keine derartiges Merkmal gefunden.');
@@ -376,14 +327,14 @@ function layout_showtag()
     $sth = db_query($query);
 
     $zlist['tag'] = htmlspecialchars($tagname);
-    if (!$sth || pg_NumRows ($sth) == 0) {
+    if (!$sth || pg_num_rows ($sth) == 0) {
       $ret .= warning('Keine Zeitungen oder Magazine mit diesem Merkmal gefunden.');
       unset($zlist['newspaper']);
     } else {
       $headlines = array('Mäßige','Mittelmäßige','Gute','Häufige','Häufigste');
       $oldtag = -1;
 
-      for ($i=0; $i < pg_NumRows ($sth); $i++) {
+      for ($i=0; $i < pg_num_rows ($sth); $i++) {
        $row = pg_fetch_array ($sth, $i);
        $tag = tag_class($row['count']);
 
@@ -410,7 +361,6 @@ function layout_showtag()
 function layout_topic()
 {
   global $zlist;
-  global $_GET;
 
   if  (!isset($_GET['topic']) || !is_numeric($_GET['topic']))
     $ret = warning('Keine passende Diskussion gefunden.');
@@ -443,8 +393,6 @@ function notfound()
 function contact_send($topic, $email, $body)
 {
   global $cfg;
-  global $_SESSION;
-  global $_SERVER;
 
   $header = array();
   if (!empty($email)) {
@@ -470,16 +418,15 @@ function contact_send($topic, $email, $body)
 
 function process_contact()
 {
-  global $_SERVER;
-  global $_POST;
-
   if ($_SERVER['REQUEST_METHOD'] == 'POST') {
     if (empty($_POST['topic']))
-      $ret = warning('Sie haben keinen Titel für die Nachricht angegeben!');
+      return warning('Sie haben keinen Titel für die Nachricht angegeben!');
     elseif (empty($_POST['body']))
-      $ret = warning('Sie haben keinen Text der Nachricht angegeben!');
+      return warning('Sie haben keinen Text der Nachricht angegeben!');
     elseif (!empty($_POST['email']) && !is_valid_email_address($_POST['email']))
-      $ret = warning('Die angegebene Mail-Adresse ist ungültig.');
+      return warning('Die angegebene Mail-Adresse ist ungültig.');
+    elseif (intval($_POST['pivot']) != intval(date('m')))
+      return warning('Die Testfrage ist falsch beantwortet.');
     else {
       contact_send($_POST['topic'], $_POST['email'], $_POST['body']);
       $ret = information('Die Nachricht wurde an den Chef geschickt.');
@@ -500,5 +447,3 @@ function process_contact()
 
   return load_javascript('contact.js') . load_template('contact.html', $replace);
 }
-
-?>
\ No newline at end of file