'func' => 'process_new'),
'bookmark.html' => array('lib' => 'bookmarks.inc',
'func' => 'process_bookmark'),
+ 'datenschutz.html' => array('func' => 'show_datenschutz'),
'contact.html' => array('func' => 'process_contact'),
'sitemap.html' => array('lib' => 'layout.inc',
'func' => 'layout_sitemap'),
'archiv' => array('func' => 'layout_archive'),
'tag' => array('func' => 'layout_showtag'),
'topic' => array('func' => 'layout_topic'),
+ 'admin' => array('lib' => 'admin.inc',
+ 'func' => 'layout_admin'),
);
function userstatus()
{
- global $_SESSION;
-
if (isset($_SESSION['uid']))
$info = array($_SESSION['online'], $_SESSION['users'], $_SESSION['zeitungen'],
$_SESSION['ztags'], $_SESSION['tags']);
function dispatch()
{
global $cfg;
- global $_SERVER;
- global $_SESSION;
- global $_GET;
- global $_POST;
global $zlist;
global $pages;
global $dirs;
return layout_page($body);
}
+function show_datenschutz()
+{
+ $body = load_template('datenschutz.html');
+
+ return $body;
+}
+
function tagcloud_min()
{
$query = 'SELECT count(uid) AS count FROM zeitung_tags GROUP BY zeitung,tag ORDER BY count ASC LIMIT 1';
if ($sth === false)
return 1;
- if (pg_NumRows($sth) === 0)
+ if (pg_num_rows($sth) === 0)
return 1;
$row = pg_fetch_array($sth, 0);
if ($sth === false)
return 10;
- if (pg_NumRows($sth) === 0)
+ if (pg_num_rows($sth) === 0)
return 10;
$row = pg_fetch_array($sth, 0);
function tag_class($count)
{
- global $_SESSION;
-
if (isset($_SESSION['uid'])) {
if (!isset($_SESSION['tagcloud_lastupdate']) ||
$_SESSION["tagcloud_lastupdate"] < time() - 60*60*12) {
$sth = db_query($query) or carp("format_newspaper");
- if (pg_NumRows ($sth) == 0)
+ if (pg_num_rows ($sth) == 0)
return false;
$row = pg_fetch_array ($sth, 0);
$ret = '<div class="newspaper">';
- $ret .= sprintf('<h3>%s</h3>', htmlspecialchars($row['name']));
- $zlist['newspaper'] = htmlspecialchars($row['name']);
+ $ret .= sprintf('<h3>%s</h3>', $row['name']);
+ $zlist['newspaper'] = $row['name'];
+ $zlist['city'] = $row['city'];
$ret .= sprintf('<p>%s<br>Ort: %s<br>URL: <a href="%s"><code>%s</code></a></p>',
$row['description'], $row['city'],
$row['url'], $row['url']);
+
+ $ret .= sprintf('<div class="link"><a href="%s">Zur Homepage</a></div>',
+ $row['url']);
+
$ret .= '</div>';
return $ret;
$sth = db_query($query) or carp("format_topten");
- if (pg_NumRows ($sth) == 0)
+ if (pg_num_rows ($sth) == 0)
return;
$ret = '<h3>Top 10</h3>';
$ret .= '<p><ul>';
- for ($n=0; $n < pg_NumRows ($sth); $n++) {
+ for ($n=0; $n < pg_num_rows ($sth); $n++) {
$row = pg_fetch_array ($sth, $n);
$ret .= sprintf('<li><a href="%szeitung/%d.html">%s</a></li>',
$cfg['basepath'], $row['zeitung'], $row['name']);
{
global $cfg;
global $zlist;
- global $_SERVER;
$query = sprintf("SELECT topic,archived,zeitung FROM topics WHERE id = %d",
$topic);
if (($sth = db_query($query)) === false)
return warning('Es ist ein Datenbankfehler aufgetreten.');
- if (pg_NumRows ($sth) == 0)
+ if (pg_num_rows ($sth) == 0)
return warning('Keine passende Diskussion gefunden.');
if (($info = pg_fetch_array ($sth, 0)) == false)
if (($sth2 = db_query($query)) === false) return false;
- if (pg_NumRows ($sth2) > 0) {
+ if (pg_num_rows ($sth2) > 0) {
$ret .= '<div class="topic">';
$ret .= sprintf ('<h3>%s</h3>', htmlspecialchars($info['topic']));
$col = 0;
$zlist['topic'] = $info['topic'];
$zlist['archived'] = $info['archived'] == 't';
- for ($j=0; $j < pg_NumRows ($sth2); $j++) {
+ for ($j=0; $j < pg_num_rows ($sth2); $j++) {
$row = pg_fetch_array ($sth2, $j);
$ret .= sprintf('<div class="art%d">', $col);
if (($sth = db_query($query)) === false) return false;
- if (pg_NumRows ($sth) == 0 && !$archived) {
+ if (pg_num_rows ($sth) == 0 && !$archived) {
$zlist['notopic'] = true;
return $ret;
}
- if (pg_NumRows ($sth) > 0) {
+ if (pg_num_rows ($sth) > 0) {
if ($archived)
$ret = '<h3>Abgeschlossene Diskussionen</h3>';
else
$ret = '<h3>Diskussion</h3>';
}
- for ($i=0; $i < pg_NumRows ($sth); $i++) {
+ for ($i=0; $i < pg_num_rows ($sth); $i++) {
$row = pg_fetch_array ($sth, $i);
$ret .= format_topic($row['id']);
}
function is_valid_url($url) {
+ if (strpos($url, '.') === false)
+ return false;
+
$parts = parse_url($url);
if (empty($parts['host']) || empty($parts['scheme']) || empty($parts['path']))
return true;
}
+function ajax_check_url()
+{
+ if (!empty($_POST['url']) && is_valid_url($_POST['url']))
+ return true;
+
+ return false;
+}
+
function sendmail($to, $name, $subject, $body, $header=array())
{
global $cfg;
function logbook($table,$refid,$column,$old,$new)
{
- global $_SESSION;
-
$query = sprintf("INSERT INTO logbook (uid,tab,refid,col,oldval,newval,modified) " .
"VALUES (%d,'%s',%d,'%s','%s','%s',now())",
$_SESSION['uid'], $table,$refid,$column,
function hits_inc($zeitung)
{
global $cfg;
- global $_SESSION;
if (is_spider())
return;
$sth = db_query($query);
- if (pg_NumRows ($sth) == 0)
+ if (pg_num_rows ($sth) == 0)
$query = sprintf("INSERT INTO hits (zeitung,uid,counter) " .
"VALUES (%d,%d,1)", $zeitung, $uid);
else
db_query($query);
}
-
-?>
\ No newline at end of file