function navigation()
 {
     global $config, $my, $tpl, $db, $myini;
     $scache = new scache('modules_navigation');
     if ($scache->existsdata() == TRUE) {
         $menu = $scache->importdata();
     } else {
         $result = $db->query("SELECT id, name, link, param, groups, sub, module FROM {$db->pre}menu WHERE active = '1' AND FIND_IN_SET('navigation', position) ORDER BY ordering, id", __LINE__, __FILE__);
         $menu = array();
         while ($row = $db->fetch_assoc($result)) {
             if (!isset($menu[$row['sub']])) {
                 $menu[$row['sub']] = array();
             }
             $menu[$row['sub']][] = $row;
         }
         $scache->exportdata($menu);
     }
     foreach ($menu[0] as $row) {
         if ($row['module'] == 0 && isset($menu[$row['id']])) {
             if ($this->GroupCheck($row['groups'])) {
                 $nav_s = array();
                 foreach ($menu[$row['id']] as $sub) {
                     if ($this->GroupCheck($sub['groups'])) {
                         $sub['sub'] = array();
                         if (isset($menu[$sub['id']])) {
                             foreach ($menu[$sub['id']] as $subsub) {
                                 if ($this->GroupCheck($subsub['groups'])) {
                                     $sub['sub'][] = $subsub;
                                 }
                             }
                         }
                         $nav_s[] = $sub;
                     }
                 }
                 $tpl->globalvars(compact("row", "nav_s", "nav_ss"));
                 echo $tpl->parse("modules/navigation");
             }
         } else {
             if ($row['module'] == 1 && ($row['groups'] == NULL || $this->GroupCheck($row['groups']) == TRUE)) {
                 $dir = 'modules/' . $row['link'] . '/';
                 $ini = $myini->read($dir . "config.ini");
                 if (count($ini) > 0 && file_exists($dir . $ini['php'][0])) {
                     include $dir . $ini['php'][0];
                 }
                 unset($dir, $ini);
             }
         }
     }
 }
Example #2
0
	<?php 
    echo foot();
} elseif ($job == 'cache_refresh') {
    $file = $gpc->get('file', str);
    echo head();
    $cache = new scache($file);
    $cache->deletedata();
    ok('admin.php?action=misc&job=cache', 'Die Cache-Datei wurde gelöscht, deswegen wird diese Datei vorerst nicht mehr in der Übersicht aufgeführt. Wenn sie das nächste mal gebraucht wird, wird der Cache automatisch neu aufgebaut und in der Übersicht wieder angezeigt.');
} elseif ($job == 'cache_refresh_all') {
    echo head();
    $dir = 'cache';
    if ($dh = @opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
            if (strpos($file, '.inc.php') !== false) {
                $file = str_replace('.inc.php', '', $file);
                $cache = new scache($file);
                $cache->deletedata();
            }
        }
        closedir($dh);
    }
    ok('admin.php?action=misc&job=cache', 'Die Cache-Dateien wurden gelöscht, deswegen werden diese Dateien vorerst nicht mehr in der Übersicht aufgeführt. Wenn sie das nächste mal gebraucht werden, wird der Cache automatisch neu aufgebaut und in der Übersicht wieder angezeigt.');
} elseif ($job == 'onlinestatus') {
    echo head();
    $b = file_get_contents('data/imservers.php');
    ?>
<form name="form" method="post" action="admin.php?action=members&job=onlinestatus2">
 <table class="border" border="0" cellspacing="0" cellpadding="4" align="center">
  <tr> 
   <td class="obox" colspan="2"><b>Onlinestatus-Server</b></td>
  </tr>
function cache_spiders()
{
    global $db;
    $scache = new scache('spiders');
    if ($scache->existsdata() == TRUE) {
        $bot = $scache->importdata();
    } else {
        $result = $db->query("SELECT id, user_agent, bot_ip, name, type FROM {$db->pre}spider", __LINE__, __FILE__);
        $bot = array();
        while ($row = $db->fetch_assoc($result)) {
            $bot[$row['id']] = $row;
        }
        $scache->exportdata($bot);
    }
    return $bot;
}
 function getStatusData()
 {
     global $db;
     $scache = new scache('group_status');
     if ($scache->existsdata() == TRUE) {
         $this->statusdata = $scache->importdata();
     } else {
         $cresult = $db->query("SELECT id, admin, guest, title, core FROM {$db->pre}groups ORDER BY core DESC", __LINE__, __FILE__);
         while ($row = $db->fetch_assoc($cresult)) {
             $this->statusdata[$row['id']] = $row;
         }
         $scache->exportdata($this->statusdata);
     }
 }
    ?>
 <table class="border" border="0" cellspacing="0" cellpadding="4" align="center">
  <tr> 
   <td class="obox"><b>Schritt 1 von <?php 
    echo $steps + 1;
    ?>
</b></td>
  </tr>
  <tr> 
   <td class="mbox">Die Daten wurden gespeichert<br>Die Emails werden nun in Staffeln versandt.</td>
  </tr>
 </table>	
<?php 
    echo foot();
} elseif ($job == 'newsletter3') {
    $scache = new scache('newsletter_session');
    $emails = $scache->importdata();
    $int2 = $gpc->get('int2', int, 100);
    $page = $gpc->get('page', int, 1);
    $anz = count($emails);
    $steps = ceil($anz / $int2);
    $result = $db->query('SELECT * FROM ' . $db->pre . 'newsletter WHERE id = ' . $gpc->get('id', int));
    $row = $db->fetch_assoc($result);
    $split = array_chunk($emails, $int2);
    $minus = $page - 1;
    $plus = $page + 1;
    $i = 0;
    if (!isset($split[$minus]) || !is_array($split[$minus])) {
        echo head();
        error('admin.php?action=members&job=newsletter', 'Keine E-Mail-Adressen zu dieser Staffel gefunden!');
    }
function save_error_data($fc)
{
    global $gpc;
    $fid = md5(microtime());
    $scache = new scache('temp/errordata/' . $fid, '');
    foreach ($fc as $key => $row) {
        $fc[$key] = $gpc->unescape($row);
    }
    $scache->exportdata($fc);
    return $fid;
}
<?php

$scache = new scache('grabrss');
if ($scache->existsdata() == TRUE) {
    $grabrss_cache = $scache->importdata();
} else {
    $cresult = $db->query("SELECT id, file, title, entries, max_age FROM {$db->pre}grab", __LINE__, __FILE__);
    $grabrss_cache = array();
    while ($row = $db->fetch_assoc($cresult)) {
        $row['title'] = htmlentities($row['title'], ENT_QUOTES);
        $grabrss_cache[$row['id']] = $row;
    }
    $scache->exportdata($grabrss_cache);
}
 function cache_smileys()
 {
     global $db, $bbcode;
     $scache = new scache('smileys');
     if ($scache->existsdata() == TRUE) {
         $cache = $scache->importdata();
     } else {
         $bbresult = $db->query("SELECT * FROM {$db->pre}smileys", __LINE__, __FILE__);
         $cache = array();
         while ($bb = $db->fetch_assoc($bbresult)) {
             $cache[] = $bb;
         }
         $scache->exportdata($cache);
     }
     $this->smileys = $cache;
 }
<?php

global $gpc;
$stime = times();
$today = $stime - gmmktime(0, 0, 0, gmdate('m', $stime), gmdate('d', $stime), gmdate('Y', $stime), date('I', $stime)) - 60;
$scache = new scache('birthday_module');
if ($scache->existsdata($today) == TRUE) {
    $data = $scache->importdata();
} else {
    $result = $db->query("SELECT id, name, birthday FROM {$db->pre}user WHERE RIGHT( birthday, 5 ) = '" . gmdate('m-d', times()) . "' ORDER BY name", __LINE__, __FILE__);
    $data = array();
    while ($e = $db->fetch_assoc($result)) {
        $e['name'] = $gpc->prepare($e['name']);
        $e['birthday'] = explode('-', $e['birthday']);
        $e['age'] = getAge($e['birthday']);
        $data[] = $e;
    }
    $scache->exportdata($data);
}
if (count($data) > 0) {
    $tpl->globalvars(compact("data"));
    echo $tpl->parse($dir . "birthday_box");
}
Example #10
0
        $mymodules->load('popup_hlcode_bottom');
    }
} elseif ($_GET['action'] == "filetypes") {
    $result = $db->query("SELECT * FROM {$db->pre}filetypes WHERE extension LIKE '%{$_GET['type']}%'", __LINE__, __FILE__);
    $nr = $db->num_rows($result);
    $cache = array();
    while ($row = $db->fetch_assoc($result)) {
        $row['extension'] = str_replace(',', ', ', $row['extension']);
        $cache[] = $row;
    }
    echo $tpl->parse("popup/header");
    echo $tpl->parse("popup/filetypes");
    $mymodules->load('popup_filetypes_bottom');
} elseif ($_GET['action'] == "code") {
    include_once 'classes/class.geshi.php';
    $scache = new scache('syntax-highlight');
    if ($scache->existsdata() == TRUE) {
        $clang = $scache->importdata();
    } else {
        $clang = array();
        $d = dir("classes/geshi");
        while (false !== ($entry = $d->read())) {
            if (get_extension($entry, TRUE) == 'php' && !is_dir("classes/geshi/" . $entry)) {
                include_once "classes/geshi/" . $entry;
                $short = str_replace('.php', '', $entry);
                $clang[$short]['file'] = $entry;
                $clang[$short]['name'] = $language_data['LANG_NAME'];
                $clang[$short]['short'] = $short;
            }
        }
        $d->close();
    }
    if (count($error) > 0) {
        error($error, "register.php?name=" . $_POST['name'] . "&amp;email=" . $_POST['email'] . SID2URL_x);
    } else {
        $reg = time();
        $_POST['pwx'] = md5($_POST['pwx']);
        $db->query("INSERT INTO {$db->pre}user (name, pw, mail, regdate, confirm) VALUES ('{$_POST['name']}', '{$_POST['pwx']}', '{$_POST['email']}', '{$reg}', '{$config['confirm_registration']}')", __LINE__, __FILE__);
        $redirect = $db->insert_id();
        $confirmcode = md5($config['cryptkey'] . $reg);
        if ($config['confirm_registration'] != '11') {
            $data = $lang->get_mail('register_' . $config['confirm_registration']);
            $to = array('0' => array('name' => $_POST['name'], 'mail' => $_POST['email']));
            $from = array();
            xmail($to, $from, $data['title'], $data['comment']);
        }
        $scache = new scache('memberdata');
        if ($scache->existsdata() == TRUE) {
            $cache = $scache->deletedata();
        }
        ok($lang->phrase('register_confirm_' . $config['confirm_registration']), "log.php?action=login" . SID2URL_x);
    }
} elseif ($_GET['action'] == 'confirm') {
    $result = $db->query("SELECT id, name, regdate, confirm FROM {$db->pre}user WHERE id = '{$_GET['id']}' AND confirm != '01' AND confirm != '11' LIMIT 1", __LINE__, __FILE__);
    $row = $db->fetch_assoc($result);
    $row['name'] = $gpc->prepare($row['name']);
    if ($db->num_rows($result) != 1) {
        error($lang->phrase('register_code_no_user'), "log.php?action=login" . SID2URL_x);
    }
    $confirmcode = md5($config['cryptkey'] . $row['regdate']);
    if ($confirmcode == $_GET['fid']) {
        if ($row['confirm'] == '00') {
	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
error_reporting(E_ALL);
DEFINE('SCRIPTNAME', 'components');
include "data/config.inc.php";
include "classes/function.viscacha_frontend.php";
$zeitmessung1 = t1();
$slog = new slog();
$my = $slog->logged();
$lang->init($my->language);
$tpl = new tpl();
$my->p = $slog->Permissions();
$cid = $gpc->get('cid', int);
$scache = new scache('components');
if ($scache->existsdata() == TRUE) {
    $cache = $scache->importdata();
} else {
    $cresult = $db->query("SELECT id, file FROM {$db->pre}component WHERE active = '1'", __LINE__, __FILE__);
    $cache = array();
    while ($comp = $db->fetch_assoc($cresult)) {
        $cache[$comp['id']] = $comp;
    }
    $scache->exportdata($cache);
}
if (isset($cache[$cid])) {
    DEFINE('COM_ID', $cache[$_GET['cid']]['id']);
    DEFINE('COM_DIR', 'components/' . COM_ID . '/');
    $ini = $myini->read(COM_DIR . 'components.ini');
    $mod = $gpc->get('file', str, 'frontpage');
function cache_spiders()
{
    global $db;
    $s3cache = new scache('spiders');
    if ($s3cache->existsdata() == TRUE) {
        $botua = $s3cache->importdata();
    } else {
        $cresult = $db->query("SELECT user_agent, name, type FROM {$db->pre}spider", __LINE__, __FILE__);
        $botua = array();
        while ($catc = $db->fetch_assoc($cresult)) {
            $botua[] = $catc;
        }
        $s3cache->exportdata($botua);
    }
    return $botua;
}