Achtung!  '; $ret .= $text .'

'; return $ret; } function information($text) { global $cfg; $ret = '

Info  '; $ret .= $text .'

'; return $ret; } function pageheader() { global $cfg; global $zlist; global $_POST; global $_SERVER; $ret .= ''; $ret .= ''; $ret .= ''; if (isset($zlist['newspaper'])) $ret .= sprintf('Zeitungsliste: %s', $zlist['newspaper']); elseif (isset($zlist['tag'])) $ret .= sprintf('Zeitungsliste: Tag %s', $zlist['tag']); else $ret .= 'Zeitungsliste'; $ret .= ''; $ret .= ''; $ret .= ''; if ($zlist['page'] == 'index') { $ret .= ''; $ret .= sprintf('', $cfg['basepath']); } elseif ($cfg['dir'] == 'zeitung') { $ret .= ''; } if (is_spider()) $ret .= ''; $ret .= ''; $ret .= sprintf('', $cfg['basepath']); $ret .= sprintf('', $cfg['basepath']); $ret .= sprintf('', $cfg['basepath']); if (isset($zlist['redirect'])) $ret .= sprintf('', $cfg['home'], $zlist['redirect']); $ret .= ''; if (javascript_ok()) { $ret .= sprintf('', $cfg['basepath']); $ret .= sprintf('', $cfg['basepath']); } $ret .= ''; $ret .= ''; $ret .= '
'; $ret .= '
Home'; if ($cfg['path'] != 'contact.html') $ret .= sprintf('   Kontakt', $cfg['basepath']); if (is_admin() && $cfg['path'] != 'admin.html') $ret .= sprintf('   Admin', $cfg['basepath']); if (is_spider()) $ret .= sprintf('   Sitemap', $cfg['basepath']); $ret .= '
'; if (logged_in()) { if ($cfg['path'] != "logout.html") { $ret .= '
'; if ($cfg['path'] != "options.html") $ret .= sprintf('Einstellungen   ', $cfg['basepath']); $ret .= sprintf('Abmelden', $cfg['basepath']); $ret .= '
'; } } else { if (($cfg['path'] != "login.html" && $cfg['path'] != "activate.html") || ($cfg['path'] == 'login.html' && isset($_POST['sendnew']))) $ret .= sprintf('
Anmelden
', $cfg['basepath']); } $ret .= sprintf('
%s
', userstatus()); $ret .= '
'; $ret .= '
'; if ($_SERVER['SERVER_NAME'] == 'www.zeitungsliste.de' && javascript_ok()) $ret .= "\n" . load_template('addsense.js'); return $ret; } function layout_page($body) { global $zlist; $ret = '
'; if (is_array($zlist['info'])) { include_once('info.inc'); foreach ($zlist['info'] as $func) $ret .= $func(); } $ret .= '
'; $ret .= '
'; $ret .= $body; $ret .= '
'; return $ret; } function layout_bookmarks($rel, $title) { global $cfg; // 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&bm_url=@url@&bm_description=@title@'), array('text' => 'Delicious', 'icon' => 'link_delicious.gif', 'link' => 'http://del.icio.us/post?v=4&noui&url=@url@&title=@title@'), array('text' => 'Google Bookmarks', 'icon' => 'link_google.gif', 'link' => 'http://www.google.com/bookmarks/mark?op=add&hl=de&bkmk=@url@&title=@title@'), array('text' => 'Yahoo Web', 'icon' => 'link_yahoo.gif', 'link' => 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u=@url@&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&url=@url@&title=@title@'), array('text' => 'Yigg', 'icon' => 'link_yigg.gif', 'link' => 'http://yigg.de/neu?action=addurl&exturl=@url@&exttitle=@title@'), array('text' => 'Taggle', 'icon' => 'link_taggle.gif', 'link' => 'http://taggle.de/addLinkDetails?mAddress=@url@&title=B@title@&submitted=Weiter'), array('text' => 'Linkarena', 'icon' => 'link_linkarena.gif', 'link' => 'http://www.linkarena.com/linkadd.php?linkName=@title@&linkURL=@url@'), array('text' => 'OneView', 'icon' => 'link_oneview.gif', 'link' => 'http://www.oneview.de/quickadd/neu/addBookmark.jsf?URL=@url@&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@&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&address=@url@&title=@title@'), array('text' => 'Simpy', 'icon' => 'link_simpy.gif', 'link' => 'http://www.simpy.com/simpy/LinkAdd.do?title=@title@&href=@url@'), array('text' => 'Ma.Gnolia', 'icon' => 'link_magnolia.gif', 'link' => 'http://ma.gnolia.com/bookmarklet/add?url=@url@&title=@title@&description=&tags='), array('text' => 'StumbleUpon', 'icon' => 'link_stumbleupon.gif', 'link' => 'http://www.stumbleupon.com/submit?url=@url@&title=@title@'), array('text' => 'linksilo.de', 'icon' => 'link_linksilo.gif', 'link' => 'http://www.linksilo.de/index.php?area=bookmarks&func=bookmark_new&addurl=@url@&addtitle=@title@'), array('text' => 'bookmarks.cc', 'icon' => 'link_bookmarkscc.gif', 'link' => 'http://www.bookmarks.cc/bookmarken.php?action=neu&url=@url@&title=@title@'), ); $url = $cfg['home'] . $rel; $ret = '
Lesezeichen: '; foreach ($bookmarks as $bm) { $ret .= sprintf('%s', str_replace(array('@url@', '@title@'), array(htmlspecialchars($url), htmlspecialchars($title)), $bm['link']), $bm['text'], $cfg['basepath'], $bm['icon'], $bm['text'], $bm['text']); } $ret .= '
'; return $ret; } /* * Add links to the main page for web spider so that they get the entire database */ function layout_sitemap() { global $_SESSION; global $_SERVER; global $cfg; if (!is_spider()) header('Location: ' . $cfg['home']); $ret = '

Sitemap der Zeitungsliste

'; $query = 'SELECT tagname FROM tags ORDER BY lower(tagname)'; $sth = db_query($query); if ($sth !== false && pg_num_rows($sth) > 0) { $ret .= '

User-Tags (Merkmale)

'; $ret .= ''; } $query = 'SELECT id,name,city FROM zeitungen WHERE deleted IS false ORDER BY name'; $sth = db_query($query); if ($sth !== false && pg_num_rows($sth) > 0) { $ret .= '

Zeitungen und Magazine

'; $ret .= ''; } $query = 'SELECT id,topic FROM topics ORDER BY created'; $sth = db_query($query); if ($sth !== false && pg_num_rows($sth) > 0) { $ret .= '

Diskussionen

'; $ret .= ''; } return $ret; } function layout_showpaper($archived=false) { global $_GET; global $zlist; if (!isset($_GET['zeitung']) || !is_numeric($_GET['zeitung'])) $ret = warning('Keine Zeitung oder Magazin gefunden.'); else { $zid = $_GET['zeitung']; $details = format_newspaper($zid, true); if ($details === false) $ret .= warning('Keine Zeitung oder Magazin gefunden.'); else { $zlist['zid'] = $zid; $ret .= $details; if (!$archived) { hits_inc ($zid); $ret .= format_board($zid); } else { $ret .= format_board($zid, $archived); } $ret .= layout_bookmarks(sprintf('zeitung/%d.html', $zid), $zlist['newspaper']); } } return $ret; } function layout_archive() { global $zlist; global $_GET; global $cfg; if (!isset($_GET['archiv']) || !is_numeric($_GET['archiv'])) $ret = warning('Keine Zeitung oder Magazin gefunden.'); else { $zid = $_GET['archiv']; $details = format_newspaper($zid, true); if ($details === false) $ret .= warning('Keine Zeitung oder Magazin gefunden.'); else { $zlist['zid'] = $zid; $ret .= $details; $query = sprintf('SELECT id,topic FROM topics ' . 'WHERE zeitung = %d ORDER BY created DESC', $_GET['archiv']); $sth = db_query($query); if (!$sth || pg_num_rows ($sth) == 0) $ret .= warning('Kein Archiv gefunden.'); else { $ret .= '

'; } } } return $ret; } function layout_showtag() { global $cfg; global $zlist; global $_GET; if (!isset($_GET['tag'])) $ret = warning('Keine derartiges Merkmal gefunden.'); else { $tagname = $_GET['tag']; $ret .= '

Merkmal ' . $tagname . '

'; $query = sprintf("SELECT zeitungen.id,name,count(uid) AS count FROM zeitungen " . "JOIN zeitung_tags ON zeitung = id " . "JOIN tags ON tag = tags.id " . "WHERE tagname = '%s' " . "GROUP BY zeitungen.id,name ORDER BY count DESC", pg_escape_string($tagname)); $sth = db_query($query); $zlist['tag'] = htmlspecialchars($tagname); 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_num_rows ($sth); $i++) { $row = pg_fetch_array ($sth, $i); $tag = tag_class($row['count']); if ($oldtag != $tag) { if ($oldtag != -1) $ret .= ''; $ret .= sprintf('

%s Bewertungen

', $tag, $headlines[$tag]); $ret .= ''; $ret .= layout_bookmarks(sprintf('tag/%s.html', htmlspecialchars($tagname)), 'Merkmal '.$tagname); } } return $ret; } function layout_topic() { global $zlist; global $_GET; if (!isset($_GET['topic']) || !is_numeric($_GET['topic'])) $ret = warning('Keine passende Diskussion gefunden.'); else { $discussion = format_topic($_GET['topic']); if (isset($zlist['zid'])) { $ret .= format_newspaper($zlist['zid'], true); if ($zlist['archived']) $ret .= '

Abgeschlossene Diskussion

'; else $ret .= '

Diskussion

'; } $ret .= $discussion; if (isset($zlist['zid'])) $ret .= layout_bookmarks(sprintf('topic/%d.html', $zlist['zid']), $zlist['topic']); } return $ret; } function notfound() { header("HTTP/1.0 404 Not Found"); return warning('Diese Seite existiert nicht!'); } function contact_send($topic, $email, $body) { global $cfg; global $_SESSION; global $_SERVER; $header = array(); if (!empty($email)) { if (isset($_SESSION['uid'])) $header[] = sprintf('Reply-To: %s <%s>', strlen($_SESSION['realname'])?$_SESSION['realname']:$_SESSION['nickname'], $email); else $header[] = 'Reply-To: ' . $email; } $body .= "\n\n" ."HTTP_USER_AGENT: " . $_SERVER['HTTP_USER_AGENT'] . "\n" ."REMOTE_ADDR : " . $_SERVER['REMOTE_ADDR'] . "\n"; if (isset($_SESSION['uid'])) $body .= "Nickname : " . $_SESSION['nickname'] . "\n"; $subject = str_replace(array('<', '>', '(', ')', '$', '/', '%', '\\', '#', ';', '&'), '', $topic); sendmail($cfg['mailto'], '', $subject, $body, $header); } 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!'); elseif (empty($_POST['body'])) $ret = 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.'); else { contact_send($_POST['topic'], $_POST['email'], $_POST['body']); $ret = information('Die Nachricht wurde an den Chef geschickt.'); $ret .= '

Die Bearbeitung kann eine Weile dauern. Wenn Sie eine '. 'Antwort erwarten, sollte diese in den nächsten Tagen an die von '. 'Ihnen angegebene Adresse geschickt werden.

'; return $ret; } $replace = array('topic' => $_POST['topic'], 'email' => $_POST['email'], 'body' => $_POST['body']); } elseif ($_SERVER['REQUEST_METHOD'] == 'GET') { if (isset($_SESSION['email'])) $replace = array('email' => $_SESSION['email']); else $replace = array(); } return load_javascript('contact.js') . load_template('contact.html', $replace); } ?>