No need to declare superglobals global
[infodrom.org/www.zeitungsliste.de] / lib / functions.inc
index 6f6badc..5fd453c 100644 (file)
@@ -54,8 +54,6 @@ function carp($msg)
 
 function userstatus()
 {
-  global $_SESSION;
-
   if (isset($_SESSION['uid']))
     $info = array($_SESSION['online'], $_SESSION['users'], $_SESSION['zeitungen'],
                  $_SESSION['ztags'], $_SESSION['tags']);
@@ -69,10 +67,6 @@ function userstatus()
 function dispatch()
 {
   global $cfg;
-  global $_SERVER;
-  global $_SESSION;
-  global $_GET;
-  global $_POST;
   global $zlist;
   global $pages;
   global $dirs;
@@ -143,8 +137,6 @@ function tagcloud_max()
 
 function tag_class($count)
 {
-  global $_SESSION;
-
   if (isset($_SESSION['uid'])) {
     if (!isset($_SESSION['tagcloud_lastupdate']) ||
        $_SESSION["tagcloud_lastupdate"] < time() - 60*60*12) {
@@ -295,7 +287,6 @@ function format_topic($topic)
 {
   global $cfg;
   global $zlist;
-  global $_SERVER;
 
   $query = sprintf("SELECT topic,archived,zeitung FROM topics WHERE id = %d",
                   $topic);
@@ -437,8 +428,6 @@ function is_valid_url($url) {
 
 function ajax_check_url()
 {
-  global $POST;
-
   if (!empty($_POST['url']) && is_valid_url($_POST['url']))
     return true;
 
@@ -476,8 +465,6 @@ function sendmail($to, $name, $subject, $body, $header=array())
 
 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,
@@ -490,7 +477,6 @@ function logbook($table,$refid,$column,$old,$new)
 function hits_inc($zeitung)
 {
   global $cfg;
-  global $_SESSION;
 
   if (is_spider())
     return;
@@ -510,5 +496,3 @@ function hits_inc($zeitung)
 
   db_query($query);
 }
-
-?>