Esempio n. 1
0
 public function __construct()
 {
     $endpoint = $this;
     if ($page = page('webmention') and kirby()->path() == $page->uri()) {
         if (r::is('post')) {
             try {
                 $endpoint->start();
                 header::status(202);
                 tpl::set('status', 'success');
                 tpl::set('alert', null);
             } catch (Exception $e) {
                 header::status(400);
                 tpl::set('status', 'error');
                 tpl::set('alert', $e->getMessage());
             }
         } else {
             tpl::set('status', 'idle');
         }
     } else {
         kirby()->routes(array(array('pattern' => 'webmention', 'method' => 'GET|POST', 'action' => function () use($endpoint) {
             try {
                 $endpoint->start();
                 echo response::success('Yay', 202);
             } catch (Exception $e) {
                 echo response::error($e->getMessage());
             }
         })));
     }
 }
Esempio n. 2
0
 public function __construct($title, $hmenu, $was = 1, $file = null)
 {
     global $allgAr, $menu;
     header('Content-Type: text/html;charset=UTF-8');
     if (AJAXCALL) {
         $this->ajax = true;
         $this->json = array('title' => $title, 'hmenu' => $hmenu);
     } else {
         $this->ajax = false;
         if (!is_null($file)) {
             echo '<div style="display: block; background-color: #FFFFFF; border: 2px solid #ff0000;">!!Man konnte in einer PHP Datei eine spezielle Index angeben. Damit das Design fuer diese Datei anders aussieht. Diese Funktion wurde ersetzt. Weitere Informationen im Forum auf ilch.de ... Thema: <a href="http://www.ilch.de/forum-showposts-13758-p1.html#108812">http://www.ilch.de/forum-showposts-13758-p1.html#108812</a></div>';
         }
         $this->vars = array();
         $this->file = $file;
         // setzte das file standard 0 weil durch was definiert
         $this->was = $was;
         // 0 = smalindex, 1 = normal index , 2 = admin
         $this->design = tpl::get_design();
         $link = $this->htmlfile();
         $this->headerAdds = '';
         $this->bodyendAdds = '';
         $tpl = new tpl($link, 2);
         if ($tpl->list_exists('boxleft')) {
             $tpl->set('boxleft', $this->get_boxes('l', $tpl));
         }
         if ($tpl->list_exists('boxright')) {
             $tpl->set('boxright', $this->get_boxes('r', $tpl));
         }
         // ab 0.6 =  ... menu listen moeglich
         for ($i = 1; $i <= $allgAr['menu_anz']; $i++) {
             if ($tpl->list_exists('menunr' . $i)) {
                 $tpl->set('menunr' . $i, $this->get_boxes($i, $tpl));
             }
         }
         $ar = array('TITLE' => $this->escape_explode($title), 'HMENU' => '<span id="icHmenu">' . $this->escape_explode($hmenu) . '</span>', 'SITENAME' => $this->escape_explode($allgAr['title']), 'hmenuende' => '', 'vmenuende' => '', 'hmenubegi' => '', 'vmenubegi' => '', 'hmenupoint' => '', 'vmenupoint' => '', 'DESIGN' => $this->design);
         $tpl->set_ar($ar);
         $this->html = $tpl->get(0);
         $this->html .= '{EXPLODE}';
         $this->html .= $tpl->get(1);
         unset($tpl);
         $zsave0 = array();
         preg_match_all("/\\{_boxes_([^\\{\\}]+)\\}/", $this->html, $zsave0);
         $this->replace_boxes($zsave0[1]);
         unset($zsave0);
         $this->vars_replace();
         unset($this->vars);
         $this->html = explode('{EXPLODE}', $this->html);
     }
 }
Esempio n. 3
0
function search_finduser()
{
    $design = new design('Finduser', '', 0);
    $design->header();
    $tpl = new tpl('search_finduser');
    $tpl->out(0);
    if (isset($_POST['sub']) and !empty($_POST['name'])) {
        $name = str_replace('*', "%", $_POST['name']);
        $name = escape($name, 'string');
        $q = "SELECT `name`,`name` FROM `prefix_user` WHERE `name` LIKE '" . $name . "'";
        $tpl->set('username', dbliste('', $tpl, 'username', $q));
        $tpl->out(1);
    }
    $tpl->out(2);
    $design->footer();
}
Esempio n. 4
0
     $header = array('jquery/pstrength-min.1.2.js', 'jquery/pstrength.css', 'jquery/jquery.validate.js', 'forms/regist.js');
     $design = new design($title, $hmenu, 1);
     $design->header($header);
     if (empty($name) or empty($email)) {
         $fehler = $lang['yourdata'];
     } elseif ($name != $xname) {
         $fehler = $lang['wrongnickname'];
     } elseif ($ch_name == false) {
         $fehler = $lang['namealreadyinuse'];
     } elseif ($email != $xemail) {
         $fehler = $lang['wrongemail'];
     } elseif ($ch_email == false) {
         $fehler = $lang['emailalreadyinuse'];
     }
     $tpl = new tpl('user/regist');
     $tpl->set('name', $name);
     $tpl->set('email', $email);
     $tpl->set_out('FEHLER', $fehler, 1);
     if ($allgAr['forum_regist_user_pass'] == 1) {
         $tpl->out(2);
     }
     $tpl->out(3);
 } else {
     $pass = genkey(8);
     if (!empty($_POST['pass'])) {
         $pass = escape($_POST['pass'], 'string');
     }
     user_regist($name, $email, $pass);
     $tpl = new tpl('user/regist');
     $title = $allgAr['title'] . ' :: Users :: Registrieren :: Step 3 von 3';
     $hmenu = $extented_forum_menu . '<a class="smalfont" href="?user">User</a><b> &raquo; </b><a class="smalfont" href="?user-regist">Registrieren</a><b> &raquo; </b>Step 3 von 3' . $extented_forum_menu_sufix;
Esempio n. 5
0
    $abf = "SELECT id,besch,datei_name,endung FROM prefix_gallery_imgs WHERE cat = " . $cat;
    $erg = db_query($abf);
    $i = 0;
    $design = new design('Admins Area', 'Admins Area', 0);
    $design->header();
    $tpl = new tpl('selfbp-imagebrowser', 1);
    $tpl->out(0);
    gallery_admin_showcats(0, '');
    $tpl->out(1);
    while ($row = db_fetch_assoc($erg)) {
        if ($i != 0 and $i % $allgAr['gallery_imgs_per_line'] == 0) {
            echo '</tr><tr>';
        }
        $toput = 'include/images/gallery/img_' . $row['id'] . '.' . $row['endung'];
        $pfad = 'include/images/gallery/img_thumb_' . $row['id'] . '.' . $row['endung'];
        $tpl->set('toput', $toput);
        $tpl->set('pfad', $pfad);
        $tpl->out(2);
        $i++;
    }
    $design->footer(1);
}
$f = false;
if (!is_writable('./include/contents/selfbp/selfp')) {
    $f = true;
    echo 'Das include/contents/selfbp/selfp Verzeichnis braucht chmod 777 Rechte damit du eine eigene Datei erstellen kannst!<br /><br />';
}
if (!is_writable('./include/contents/selfbp/selfb')) {
    echo 'Das include/contents/selfbp/selfb Verzeichnis braucht chmod 777 Rechte damit du eine eigene Box erstellen kannst!<br /><br />';
    if ($f == true) {
        exit('Entweder das include/contents/selfbp/selfb oder das include/contents/selfbp/selfp Verzeichnis brauchen Schreibrechte sonst kann hier nicht gearbeitet werden');
Esempio n. 6
0
    $nm = 1;
    $ny = $y + 1;
}
$akt = mktime(0, 0, 0, $m, 1, $y);
# aktuelle timestamp
$aka = date('Y-m-d', $akt);
$ake = date('Y-m-d', mktime(0, 0, 0, $m, date('t', $akt), $y));
$jakt = mktime(0, 0, 0, 1, 1, $y);
# atkueller jahr timestamp
$jaka = date('Y-m-d', $jakt);
$jake = date('Y-m-d', mktime(0, 0, 0, 12, date('t', mktime(0, 0, 0, 12, 1, $y)), $y));
$kontodaten = db_result(db_query("SELECT t1 FROM prefix_allg WHERE k = 'kasse_kontodaten'"), 0);
$kontodaten = unescape($kontodaten);
$kontodaten = bbcode($kontodaten);
$tpl = new tpl('kasse.htm');
$tpl->set('kontodaten', $kontodaten);
$tpl->set('minus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag < 0"), 0));
$tpl->set('plus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag > 0"), 0));
$tpl->set('saldo', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse"), 0));
$tpl->set('Jminus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag < 0 AND datum >= '" . $jaka . "' AND datum <= '" . $jake . "'"), 0));
$tpl->set('Jplus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag > 0 AND datum >= '" . $jaka . "' AND datum <= '" . $jake . "'"), 0));
$tpl->set('Jsaldo', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE datum >= '" . $jaka . "' AND datum <= '" . $jake . "'"), 0));
$tpl->set('Mminus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag < 0 AND datum >= '" . $aka . "' AND datum <= '" . $ake . "'"), 0));
$tpl->set('Mplus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag > 0 AND datum >= '" . $aka . "' AND datum <= '" . $ake . "'"), 0));
$tpl->set('Msaldo', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE datum >= '" . $aka . "' AND datum <= '" . $ake . "'"), 0));
$tpl->set('month', $lang[date('F', $akt)]);
$tpl->set('pm', $pm);
$tpl->set('nm', $nm);
$tpl->set('py', $py);
$tpl->set('ny', $ny);
$tpl->set('jahr', $y);
Esempio n. 7
0
if (sizeof($news) == 0) {
    $newsout = $tpl->get("no news");
} else {
    foreach ($news as $new) {
        $newsout .= $tpl->list_get('news', array($new["id"], $new["title"]));
    }
}
// die neuen topics holen
$hottopics = get_topics_since_last_login();
$topicsout = "";
if (sizeof($hottopics) == 0) {
    $topicsout = $tpl->get("no topics");
} else {
    foreach ($hottopics as $hottopic) {
        $listar = array($hottopic["id"], $hottopic["title"], $hottopic["author"]);
        $listar[] = ceil(($hottopic['replies'] + 1) / $allgAr['Fpanz']);
        $listar[] = $hottopic["pid"];
        $topicsout .= $tpl->list_get('topics', $listar);
    }
}
$tpl->set('news', $newsout);
$tpl->set('topics', $topicsout);
// unsere templatevariable
$info = $_SESSION;
$info["lastlogin"] = formatdate($_SESSION["lastlogin"]);
$info["title"] = $allgAr["title"];
$tpl->set_ar($info);
// ausgabe
$tpl->out("actions");
$tpl->out("info");
$design->footer();
Esempio n. 8
0
 function load()
 {
     // initiate the site and make pages and page
     // globally available
     $pages = $this->pages;
     $page = $this->pages->active();
     // check for ssl
     if (c::get('ssl')) {
         // if there's no https in the url
         if (!server::get('https')) {
             go(str_replace('http://', 'https://', $page->url()));
         }
     }
     // check for index.php in rewritten urls and rewrite them
     if (c::get('rewrite') && preg_match('!index.php\\/!i', $this->uri->original)) {
         go($page->url());
     }
     // check for a misconfigured subfolder install
     if ($page->isErrorPage()) {
         // if you want to store subfolders in the homefolder for blog articles i.e. and you
         // want urls like http://yourdomain.com/article-title you can set
         // RedirectMatch 301 ^/home/(.*)$ /$1 in your htaccess file and those
         // next lines will take care of delivering the right pages.
         $uri = c::get('home') . '/' . $this->uri->path();
         if ($redirected = $this->pages()->find($uri)) {
             if ($redirected->uri() == $uri) {
                 $page = $redirected;
                 $this->pages->active = $page;
                 $this->uri = new uri($uri);
             }
         }
         // try to rewrite broken translated urls
         // this will only work for default uris
         if (c::get('lang.support')) {
             $path = $this->uri->path->toArray();
             $obj = $pages;
             $found = false;
             foreach ($path as $p) {
                 // first try to find the page by uid
                 $next = $obj->{'_' . $p};
                 if (!$next) {
                     // go through each translation for each child page
                     // and try to find the url_key or uid there
                     foreach ($obj as $child) {
                         foreach (c::get('lang.available') as $lang) {
                             $c = $child->content($lang);
                             // redirect to the url if a translated url has been found
                             if ($c && $c->url_key() == $p && !$child->isErrorPage()) {
                                 $next = $child;
                             }
                         }
                     }
                     if (!$next) {
                         break;
                     }
                 }
                 $found = $next;
                 $obj = $next->children();
             }
             if ($found && !$found->isErrorPage()) {
                 go($found->url());
             }
         }
     }
     // redirect file urls (file:image.jpg)
     if ($this->uri->param('file')) {
         // get the local file
         $file = $page->files()->find($this->uri->param('file'));
         if ($file) {
             go($file->url());
         }
     }
     // redirect /home to /
     if ($this->uri->path() == c::get('home')) {
         go(url());
     }
     // redirect tinyurls
     if ($this->uri->path(1) == c::get('tinyurl.folder') && c::get('tinyurl.enabled')) {
         $hash = $this->uri->path(2);
         if (!empty($hash)) {
             $resolved = $this->pages->findByHash($hash)->first();
             // redirect to the original page
             if ($resolved) {
                 go(url($resolved->uri));
             }
         }
     }
     // set the global template vars
     tpl::set('site', $this);
     tpl::set('pages', $pages);
     tpl::set('page', $page);
     $cacheID = $this->htmlCacheID();
     $cacheModified = time();
     $cacheData = null;
     if ($this->htmlCacheEnabled) {
         // check if the cache is disabled for some reason
         $this->htmlCacheEnabled = $page->isErrorPage() || in_array($page->uri(), c::get('cache.ignore', array())) ? false : true;
         // check for the last modified date of the cache file
         $cacheModified = cache::modified($cacheID);
         // check if the files have been modified
         // since the last html cache file has been written
         if ($this->htmlCacheEnabled && $cacheModified >= $this->modified) {
             $cacheData = cache::get($cacheID, true);
         }
     }
     // send a 404 header if this is the error page
     if ($page->isErrorPage() && c::get('404.header')) {
         header("HTTP/1.0 404 Not Found");
     }
     if (empty($cacheData)) {
         // load the main template
         $html = tpl::load($page->template(), array(), true);
         if ($this->htmlCacheEnabled) {
             cache::set($cacheID, (string) $html, true);
         }
     } else {
         $html = $cacheData;
     }
     die($html);
 }
Esempio n. 9
0
            $x .= '<br />';
        }
    }
    $tpl = new tpl('user/gallery');
    $tpl->set_out('x', $x, 4);
    $design->footer();
    exit;
}
// user gallery zeigen
$uname = db_result(db_query("SELECT `name` FROM `prefix_user` WHERE `id` = " . $uid), 0, 0);
$title = $allgAr['title'] . ' :: Users :: Gallery';
$hmenu = $extented_forum_menu . '<a class="smalfont" href="index.php?user">Users</a><b> &raquo; </b><a class="smalfont" href="?user-usergallery">Gallery</a><b> &raquo; </b>von ' . $uname . $extented_forum_menu_sufix;
$design = new design($title, $hmenu, 1);
$design->header();
$tpl = new tpl('user/gallery');
$tpl->set('uid', $uid);
$tpl->set('uname', $uname);
// bild loeschen...
if ($menu->getA(4) == 'd' and is_numeric($menu->getE(4)) and loggedin() and (is_siteadmin() or $uid == $_SESSION['authid'])) {
    $delid = escape($menu->getE(4), 'integer');
    $x = @db_result(db_query("SELECT `endung` FROM `prefix_usergallery` WHERE `uid` = " . $uid . " AND `id` = " . $delid), 0, 0);
    if (!empty($x)) {
        @unlink('include/images/usergallery/img_thumb_' . $delid . '.' . $x);
        @unlink('include/images/usergallery/img_' . $delid . '.' . $x);
        @db_query("DELETE FROM `prefix_usergallery` WHERE `uid` = " . $uid . " AND `id` = " . $delid);
    }
}
// bild hochladen
if (!empty($_FILES['file']['name']) and is_writeable('include/images/usergallery') and loggedin() and $uid == $_SESSION['authid'] and substr(ic_mime_type($_FILES['file']['tmp_name']), 0, 6) == 'image/') {
    require_once 'include/includes/func/gallery.php';
    $size = @getimagesize($_FILES['file']['tmp_name']);
Esempio n. 10
0
<?php

#   Copyright by Manuel
#   Support www.ilch.de
defined('main') or die('no direct access');
$tpl = new tpl('user/boxen_login.htm');
if (loggedin()) {
    if (user_has_admin_right($menu, false)) {
        $tpl->set('ADMIN', '<a class="box" href="admin.php?admin">' . $lang['adminarea'] . '</a>');
    } else {
        $tpl->set('ADMIN', '');
    }
    if ($allgAr['Fpmf'] == 1) {
        $erg = db_query("SELECT COUNT(id) FROM `prefix_pm` WHERE gelesen = 0 AND status < 1 AND eid = " . $_SESSION['authid']);
        $check_pm = db_result($erg, 0);
        $nachrichten_link = '<a class="box" href="index.php?forum-privmsg">' . $lang['messages'] . '</a>&nbsp;(' . $check_pm . ')<br>';
    } else {
        $nachrichten_link = '';
    }
    $tpl->set('SID', session_id());
    $tpl->set('NACHRICHTEN', $nachrichten_link);
    $tpl->set('NAME', $_SESSION['authname']);
    $tpl->out(0);
} else {
    if (empty($_POST['login_name'])) {
        $_POST['login_name'] = 'Nickname';
    }
    if (empty($_POST['login_pw'])) {
        $_POST['login_pw'] = 'הההההההה';
    }
    $regist = '';
Esempio n. 11
0
         $titelzw = '';
         $namezw = '';
     }
     $cattitle = ':: ' . $titelzw . $row['name'];
     $catname = '<b> &raquo; </b>' . $namezw . $row['name'];
 } else {
     $cattitle = '';
     $catname = '';
 }
 $title = $allgAr['title'] . ' :: Downloads ' . $cattitle;
 $hmenu = '<a class="smalfont" href="?downloads">Downloads</a>' . $catname;
 $design = new design($title, $hmenu);
 $load = array('jquery/jquery.validate.js', 'forms/upload.js');
 $design->header($load);
 $tpl = new tpl('downloads');
 $tpl->set('cid', $cid);
 $erg = db_query("SELECT `id`,`name`,`desc` FROM `prefix_downcats` WHERE `cat` = " . $cid . " AND `recht` >= " . $_SESSION['authright'] . " ORDER BY `pos`");
 if (db_num_rows($erg) > 0) {
     $tpl->out(1);
     $class = 'Cnorm';
     while ($row = db_fetch_assoc($erg)) {
         $row['files'] = count_files($row['id']);
         $class = $class == 'Cmite' ? 'Cnorm' : 'Cmite';
         $row['class'] = $class;
         $tpl->set_ar_out($row, 2);
     }
     $tpl->out(3);
 }
 // sortierung festlegen
 $sortierung = '`pos` ASC';
 $DOM = 'ASC';
Esempio n. 12
0
/**
 * zeigt den preview des texts an
 * nur aufrufen, wenn in $_POST["txt"] der text steht
 */
function showPreview()
{
    $tpl = new tpl('gbook');
    $tpl->set("TEXT", BBcode(escape($_POST["txt"], "textarea")));
    $tpl->out('preview');
}
Esempio n. 13
0
                db_query("UPDATE prefix_partners SET pos = " . $pos . " WHERE pos = " . $nps);
                db_query("UPDATE prefix_partners SET pos = " . $nps . " WHERE id = " . $id);
            }
        }
        // aendern vorbereiten.
        if ($menu->getA(2) == 'e') {
            $erg = db_query("SELECT id,name,banner,link FROM prefix_partners WHERE id = '" . $menu->getE(2) . "'");
            $_ilch = db_fetch_assoc($erg);
            $_ilch['pkey'] = $menu->getE(2);
        } else {
            $_ilch = array('pkey' => '', 'id' => '', 'banner' => '', 'name' => '', 'link' => '');
        }
        $tpl->set_ar_out($_ilch, 0);
        $page = $menu->getA(2) == 'p' ? $menu->getE(2) : 1;
        $limit = 20;
        $class = 'Cnorm';
        $MPL = db_make_sites($page, '', $limit, '?archiv-partners', 'partners');
        $anfang = ($page - 1) * $limit;
        $abf = "SELECT id,name,link, pos FROM prefix_partners ORDER BY pos ASC LIMIT " . $anfang . "," . $limit;
        $erg = db_query($abf);
        while ($row = db_fetch_assoc($erg)) {
            $class = $class == 'Cmite' ? 'Cnorm' : 'Cmite';
            $row['class'] = $class;
            $tpl->set_ar($row);
            $tpl->out(1);
        }
        $tpl->set('MPL', $MPL);
        $tpl->out(2);
        $design->footer();
        break;
}
Esempio n. 14
0
    # als upcoming war vormerken (kategorie 1)
    db_query("INSERT INTO prefix_wars (datime,`status`,gegner,tag,page,mail,icq,wo,tid,`mod`,game,mtyp,land,txt) VALUES ('" . $datum . "','1','" . $clanname . "','" . $clantag . "','" . $clanpage . "','" . $mailaddy . "','" . $icqnumber . "','" . $meetingplace . "','" . $squad . "','" . $xonx . "','" . $game . "','" . $matchtype . "','" . $clancountry . "','" . $message . "')");
    # pm an den leader
    sendpm($_SESSION['authid'], $row['mod1'], 'Fightus Anfrage', $txt, -1);
    # Wenn Co Leader != Leader
    if ($row['mod1'] != $row['mod2']) {
        sendpm($_SESSION['authid'], $row['mod2'], 'Fightus Anfrage', $txt, -1);
    }
    if ($row['mod3'] != $row['mod2'] and $row['mod1'] != $row['mod3']) {
        sendpm($_SESSION['authid'], $row['mod3'], 'Fightus Anfrage', $txt, -1);
    }
    # informieren
    echo sprintf($lang['leaderofxalert'], $row['name']);
} else {
    $clancountry = arlistee($clancountry, get_nationality_array());
    $squad = '<option value="0">choose</option>';
    $squad .= dblistee($squad, "SELECT id,name FROM prefix_groups WHERE show_fightus = 1 ORDER BY pos");
    if (empty($meetingtime)) {
        $meetingtime = date('d.m.Y - H:i:s');
    }
    $tpl = new tpl('fightus.htm');
    foreach ($far as $v) {
        if ($x > 0 and empty($_POST[$v])) {
            echo 'missing: ' . $lang[$v] . '<br />';
        }
        $tpl->set($v, ${$v});
    }
    $tpl->set('ANTISPAM', get_antispam('fightus', 120));
    $tpl->out(0);
}
$design->footer();
Esempio n. 15
0
    $ar = array('AUSRICHTUNG' => $var->check_var('ausr', 'Eigene Ausrichtung', $row['ausr'], $url), 'HINTERGRUND' => $var->check_var('hgrund', 'Eigener Hintergrund', $row['hgrund'], $url), 'BBREITE' => $var->shfarben($var->shconfig('ausr'), 'Breite der Box in %', 'bbreite', $row['bbreite'], $url, 1), 'BAUS' => $var->shfarben($var->shconfig('ausr'), 'Ausrichtung der Box', 'baus', $row['baus'], $url, 2), 'HFNAME' => $var->shfarben($var->shconfig('hgrund'), 'Hintergrundfarbe vom Namen', 'hfname', $row['hfname'], $url, 0), 'HFTEXT' => $var->shfarben($var->shconfig('hgrund'), 'Hintergrundfarbe vom Text', 'hftext', $row['hftext'], $url, 0), 'HFINPUT' => $var->shfarben($var->shconfig('hgrund'), 'Hintergrundfarbe vom Eingabefeld', 'hfinput', $row['hfinput'], $url, 0));
    $tpl->set_ar_out($ar, 3);
}
if (escape($menu->get(1), 'string') == 'show' || escape($menu->get(1), 'string') == '') {
    $tpl->out(4);
    $erg = db_query('SELECT * FROM `prefix_shbox4` ORDER BY `id` DESC');
    while ($row = db_fetch_assoc($erg)) {
        $ar = array('ID' => $row['id'], 'NAME' => $var->colorname($var->sh_usercheck($row['uid']), get_n($row['uid'])), 'TEXTNOBB' => $row['txt'], 'TEXT' => BBcode(substr($row['txt'], 0, 70)));
        $tpl->set_ar_out($ar, 5);
    }
    $tpl->out(6);
}
/*
    function showedit($gid) {
       $ed  = db_query('SELECT * FROM `prefix_shbox4` WHERE `id` = "' . $gid . '"');
       $e   = db_fetch_assoc($ed);
       return '<form action="?shbox4admin-show-send-'.$gid.'" method="POST">
             <tr>
              <td style="background-color:#FF0000">' . $e['id'] . '</td>
              <td style="background-color:#FF0000">' . get_n($e['uid']) . '</td>
              <td style="background-color: #FF0000">' . date ('d.m.Y - H:i:s', $e['time'] ) . '</td>
              <td style="background-color:#FF0000"><textarea name="edittxt" rows="2" cols="50" wrap="virtual">' . $e['txt'] . '</textarea></td>
              <td style="background-color: #FF0000" align="center"><input name="subedit" type="submit" value="ändern" /></td>
              <td style="background-color: #FF0000" align="center">&nbsp;</td>
             </tr>
            </form>';
    }
*/
$tpl->set('VERSIONFO', $var->version());
$tpl->out(7);
$design->footer();
Esempio n. 16
0
        $mail = '';
        $subject = '';
        $wer = '';
        $text = '';
    } else {
        echo $lang['emailcouldnotsend'];
    }
}
$tpl = new tpl('contact.htm');
$tpl->out(0);
$i = 1;
foreach ($k as $a) {
    $e = explode('|', $a);
    if ($e[0] == '' or $e[1] == '') {
        continue;
    }
    if ($i == 1) {
        $c = 'checked';
    } else {
        $c = '';
    }
    $tpl->set_ar_out(array('KEY' => md5($e[0]), 'VAL' => $e[1], 'c' => $c), 1);
    $i++;
}
$tpl->set('name', $name);
$tpl->set('mail', $mail);
$tpl->set('subject', $subject);
$tpl->set('text', $text);
$tpl->set('ANTISPAM', get_antispam('contact', 100));
$tpl->out(2);
$design->footer();
Esempio n. 17
0
    foreach ($_POST['in'] as $k => $v) {
        $k = escape($k, 'integer');
        $astat = db_result(db_query("SELECT stat FROM prefix_topics WHERE id = " . $k), 0, 0);
        $nstat = $astat == 1 ? 0 : 1;
        db_query("UPDATE `prefix_topics` SET stat = '" . $nstat . "' WHERE id = " . $k);
    }
    wd('index.php?forum-showtopics-' . $fid, 'Status ge&auml;ndert', 2);
} elseif (!$csrfCheck || empty($_POST['del']) && empty($_POST['shift'])) {
    $limit = $allgAr['Ftanz'];
    // Limit
    $page = $menu->getA(3) == 'p' ? $menu->getE(3) : 1;
    $MPL = db_make_sites($page, "WHERE fid = '{$fid}'", $limit, '?forum-editforum-' . $fid, 'topics');
    $anfang = ($page - 1) * $limit;
    $q = "SELECT a.id, a.name, a.rep, a.erst, a.hit, a.art, a.stat, b.time, b.erst as last, b.id as pid\r\n   FROM prefix_topics a\r\n  \tLEFT JOIN prefix_posts b ON a.last_post_id = b.id\r\n  \tWHERE a.fid = {$fid}\r\n   \tORDER BY a.art DESC, b.time DESC\r\n   \tLIMIT " . $anfang . "," . $limit;
    $tpl = new tpl('forum/editforum.htm');
    $tpl->set('id', $fid);
    $tpl->set('antispam', get_antispam('forum_edit_forum', 0, true));
    $tpl->set_out('MPL', $MPL, 0);
    $erg = db_query($q);
    while ($row = db_fetch_assoc($erg)) {
        $row['date'] = date('d.m.y - H:i', $row['time']);
        $tpl->set_ar_out($row, 1);
    }
    $tpl->out(2);
} elseif (isset($_POST['del']) and isset($_POST['dely']) and $_POST['dely'] == 'yes' and $csrfCheck) {
    $pmin = 0;
    $tmin = 0;
    foreach ($_POST['in'] as $k => $v) {
        $k = escape($k, 'integer');
        $erg = db_query("SELECT erstid FROM prefix_posts WHERE tid = " . $k . " AND erstid > 0");
        while ($row = db_fetch_object($erg)) {
Esempio n. 18
0
        $nk = implode('#', $k);
        db_query("UPDATE `prefix_allg` SET `t1` = '" . $nk . "' WHERE `k` = 'kontakt'");
        break;
    case 3:
        if (chk_antispam('adminuser_action', true)) {
            $row = db_fetch_object(db_query("SELECT `t1` FROM `prefix_allg` WHERE `k` = 'kontakt'"));
            $nk = $row->t1 . '#' . $_POST['mail'] . '|' . $_POST['name'];
            db_query("UPDATE `prefix_allg` SET `t1` = '" . $nk . "' WHERE `k` = 'kontakt'");
            break;
        }
    case 5:
        db_query('UPDATE `prefix_allg` SET ' . $feld . ' = "' . $ak . '" WHERE `k` = "kontakt"');
        break;
}
$tpl = new tpl('contact', 1);
$tpl->set('ANTISPAM', get_antispam('adminuser_action', 0, true));
$tpl->out(0);
$row = db_fetch_object(db_query("SELECT `t1`,`v2`,`v1` FROM `prefix_allg` WHERE `k` = 'kontakt'"));
$k = explode('#', $row->t1);
$b = explode('#', $row->v2);
$i = 0;
foreach ($k as $a) {
    $e = explode('|', $a);
    if ($e[0] != '' and $e[1] != '') {
        $ar = array('WO' => $i, 'MAIL' => $e[0], 'NAME' => $e[1]);
        $tpl->set_ar_out($ar, 1);
    }
    $i++;
}
$tpl->out(2);
// -----------------------------------------------------------|
Esempio n. 19
0
    }
    $row['posts'] = ($row['posts'] ? '<br />Posts: ' . $row['posts'] : '') . '<br />';
    $row['NEW'] = post_is_new($row["time"], $tid, $fid) ? "true" : "false";
    $tpl->set_ar_out($row, 1);
    $i++;
}
$tpl->set_ar_out(array('SITELINK' => $MPL, 'ANTWORTEN' => $antworten), 2);
if (loggedin()) {
    if ($menu->get(3) == 'topicalert') {
        if (1 == db_result(db_query("SELECT COUNT(*) FROM `prefix_topic_alerts` WHERE `uid` = " . $_SESSION['authid'] . " AND `tid` = " . $tid), 0)) {
            db_query("DELETE FROM `prefix_topic_alerts` WHERE `uid` = " . $_SESSION['authid'] . " AND `tid` = " . $tid);
        } else {
            db_query("INSERT INTO `prefix_topic_alerts` (`tid`,`uid`) VALUES (" . $tid . ", " . $_SESSION['authid'] . ")");
        }
    }
    echo 'Optionen:';
    if (1 == db_result(db_query("SELECT COUNT(*) FROM `prefix_topic_alerts` WHERE `uid` = " . $_SESSION['authid'] . " AND `tid` = " . $tid), 0)) {
        echo '<br />- <a href="index.php?forum-showposts-' . $tid . '-topicalert">' . $lang['nomailonreply'] . '</a><br />';
    } else {
        echo '<br />- <a href="index.php?forum-showposts-' . $tid . '-topicalert">' . $lang['mailonreply'] . '</a><br />';
    }
}
if ($forum_rights['mods'] == true) {
    $tpl->set('status', $aktTopicRow['stat'] == 1 ? $lang['close'] : $lang['open']);
    $tpl->set('festnorm', $aktTopicRow['art'] == 0 ? $lang['fixedtopic'] : $lang['normaltopic']);
    $tpl->set('tid', $tid);
    $tpl->out(3);
}
// toipc als gelesen markieren
$_SESSION['forumSEE'][$fid][$tid] = time();
$design->footer();
Esempio n. 20
0
	/**
	 * Add a variable to the view
	 *
	 * @param string $name Variable name
	 * @param mixed $value
	 */
	protected function setViewVar($name, $value) {
		$this->tpl->set($name, $value);
	}
Esempio n. 21
0
 function load()
 {
     // initiate the site and make pages and page
     // globally available
     $site = $this;
     $panel = $this;
     $pages = $this->pages;
     $page = $this->pages->active();
     if ($page->isErrorPage() && $this->uri()->path() != c::get('404')) {
         go(url(c::get('404')));
     }
     g::set('site', $this);
     g::set('panel', $this);
     g::set('pages', $pages);
     g::set('page', $page);
     // set the global template vars
     tpl::set('site', $this);
     tpl::set('panel', $this);
     tpl::set('pages', $pages);
     tpl::set('page', $page);
     // initiate the user settings
     $settings = new settings();
     g::set('settings', $settings);
     tpl::set('settings', $settings);
     // add a user
     $panel->user = new user();
     // load the language
     paneload::language();
     // check for a valid array of user accounts and other correct setups
     if (!check::installed() || !check::hasAccounts() || check::stillHasDefaultAccount() || check::wrongKirbyVersion()) {
         require c::get('root.panel') . '/modals/installation.php';
         return;
     }
     // add all panel info
     $panel->isHome = !$panel->uri->path(1) ? true : false;
     $panel->show = $panel->uri->param('show');
     $panel->action = $panel->uri->param('do');
     $panel->nocontent = (string) $page->contents() == '' ? true : false;
     if ($panel->isHome && $panel->show != 'info' && $panel->show != 'logout') {
         $panel->show = 'home';
     }
     switch ($panel->action) {
         case 'edit-pages':
             $panel->sortable = true;
             break;
     }
     if ($panel->isHome) {
         $settings->pages = true;
         $settings->flip = false;
     }
     switch ($panel->show) {
         case 'logout':
             $panel->user->logout();
             exit;
             break;
         case 'files':
             $thumbDir = c::get('root') . '/thumbs';
             $panel->fancybox = true;
             $panel->thumbs = is_dir($thumbDir) && is_writable($thumbDir) ? true : false;
             break;
             // more available views
         // more available views
         case 'info':
         case 'home':
         case 'pages':
         case 'options':
             if (($panel->show == 'home' || $panel->show == 'info') && !$panel->isHome) {
                 go(url() . '/show:' . $panel->show);
             }
             break;
         default:
             $valid = array('options', 'content');
             if (!in_array($panel->show, $valid)) {
                 $panel->show = 'content';
             }
             break;
     }
     // init the form
     if ($panel->show == 'info' || $panel->show == 'content') {
         $panel->form = new form($settings);
     }
     // set the template file;
     $panel->templateFile = $panel->show . '.php';
     $panel->templateRoot = c::get('root.panel') . '/templates';
     content::start();
     if ($panel->user->isLoggedIn()) {
         require $panel->templateRoot . '/' . $panel->templateFile;
     } else {
         require $panel->templateRoot . '/login.php';
     }
     content::end();
 }
Esempio n. 22
0
                    $tpl->set('page', $page);
                    $txt = $tpl->get(0);
                    unset($tpl);
                    icmail($_POST['email'], 'Admin hat dich angelegt', $txt);
                }
                $msg = 'Benutzer angelegt <a href="javascript:closeThisWindow()">Fenster schließen</a>';
            }
        }
        $pass = '';
        $email = '';
        $recht = '';
        if (isset($_POST['pass'])) {
            $pass = $_POST['pass'];
        }
        if (isset($_POST['email'])) {
            $email = $_POST['email'];
        }
        if (isset($_POST['recht'])) {
            $recht = $_POST['recht'];
        } else {
            $recht = '-1';
        }
        $tpl = new tpl('user/new_user', 1);
        $tpl->set('msg', $msg);
        $tpl->set('pass', $pass);
        $tpl->set('email', $email);
        $tpl->set('recht', dblistee($recht, "SELECT id,name FROM prefix_grundrechte ORDER BY id ASC"));
        $tpl->set('antispam', get_antispam('adminuser_create', 0, true));
        $tpl->out(0);
        break;
}
Esempio n. 23
0
    }
}
if (count($far) != $x or $ch_name == false or $joinusspam == false) {
    $tpl = new tpl('joinus.htm');
    $skill = '<option></option>';
    $skill .= arlistee($skill, $skill_ar);
    $squad = '<option></option>';
    $squad .= dblistee($squad, "SELECT `id`,`name` FROM `prefix_groups` WHERE `show_joinus` = 1 ORDER BY `pos`");
    if (loggedin()) {
        $name = $_SESSION['authname'];
    }
    foreach ($far as $v) {
        if ($x > 0 and empty($_POST[$v])) {
            $fehler .= '&middot;&nbsp;' . 'Bitte ' . $lang[$v] . ' angeben!<br />';
        }
        $tpl->set($v, ${$v});
    }
    if ($x > 0 and $name != $xname) {
        $fehler .= '&middot;&nbsp;' . $lang['wrongnickname'] . '<br />';
    } elseif ($x > 0 and $ch_name == false) {
        $fehler .= '&middot;&nbsp;' . $lang['namealreadyinuse'] . '<br />';
    }
    $name = $xname;
    $tpl->set('readonly', loggedin() ? ' readonly' : '');
    $tpl->set('FEHLER', '<div id="formfehler">' . $fehler . '</div>');
    $tpl->out(0);
    if ($allgAr['joinus_rules'] != 1) {
        $tpl->out(1);
    } else {
        $rules = '<h2>' . $lang['rules'] . '</h2>';
        $rerg = db_query('SELECT `zahl`,`titel`,`text` FROM `prefix_rules` ORDER BY `zahl`');
Esempio n. 24
0
#   Support: www.ilch.de
defined('main') or die('no direct access');
# check ob ein fehler aufgetreten ist.
check_forum_failure($forum_failure);
$title = $allgAr['title'] . ' :: Forum :: ' . aktForumCats($aktForumRow['kat'], 'title') . ' :: ' . $aktForumRow['name'];
$hmenu = $extented_forum_menu . '<a class="smalfont" href="index.php?forum">Forum</a><b> &raquo; </b>' . aktForumCats($aktForumRow['kat']) . '<b> &raquo; </b>' . $aktForumRow['name'] . $extented_forum_menu_sufix;
$design = new design($title, $hmenu, 1);
$design->header();
$limit = $allgAr['Ftanz'];
// Limit
$page = $menu->getA(3) == 'p' ? $menu->getE(3) : 1;
$MPL = db_make_sites($page, "WHERE fid = '{$fid}'", $limit, '?forum-showtopics-' . $fid, 'topics');
$anfang = ($page - 1) * $limit;
$tpl = new tpl('forum/showtopic');
if ($forum_rights['start'] == TRUE) {
    $tpl->set('NEWTOPIC', '<b>[ <a href="index.php?forum-newtopic-' . $fid . '">' . $lang['newtopic'] . '</a> ]</b>');
} else {
    $tpl->set('NEWTOPIC', '');
}
$tpl->set('MPL', $MPL);
$tpl->set_out('FID', $fid, 0);
$q = "SELECT a.id, a.name, a.rep, a.erst, a.hit, a.art, a.stat, b.time, b.erst as last, b.id as pid\r\n\tFROM prefix_topics a\r\n\tLEFT JOIN prefix_posts b ON a.last_post_id = b.id\r\n\tWHERE a.fid = {$fid}\r\n\tORDER BY a.art DESC, b.time DESC\r\n\tLIMIT " . $anfang . "," . $limit;
$erg = db_query($q);
if (db_num_rows($erg) > 0) {
    while ($row = db_fetch_assoc($erg)) {
        if ($row['stat'] == 0) {
            $row['ORD'] = 'cord';
        } else {
            #$row['ORD'] = get_ordner($row['time']);
            $row['ORD'] = forum_get_ordner($row['time'], $row['id'], $fid);
        }
Esempio n. 25
0
     $fid = escape($_REQUEST['fid'], 'integer');
     if (isset($_POST['s']) and $_POST['s'] == 'Add') {
         # find user id
         $name = escape($_POST['name'], 'string');
         $uid = @db_result(@db_query("SELECT id FROM prefix_user where name = BINARY '" . $name . "'"), 0, 0);
         if (!empty($uid) and 0 == db_result(db_query("SELECT COUNT(*) FROM prefix_forummods WHERE uid = " . $uid . " AND fid = " . $fid), 0)) {
             db_query("INSERT INTO prefix_forummods (uid,fid) VALUES (" . $uid . ", " . $fid . ")");
         }
     }
     # delete
     if ($menu->getA(2) == 'd' and is_numeric($menu->getE(2))) {
         $uid = escape($menu->getE(2), 'integer');
         db_query("DELETE FROM prefix_forummods WHERE uid = " . $uid . " AND fid = " . $fid);
     }
     $tpl = new tpl('forum/mods', 1);
     $tpl->set('fid', $fid);
     $tpl->out(0);
     $class = '';
     $erg = db_query("SELECT name, uid FROM prefix_forummods LEFT JOIN prefix_user ON prefix_user.id = prefix_forummods.uid WHERE prefix_forummods.fid = " . $fid);
     while ($r = db_fetch_assoc($erg)) {
         $class = $class == 'Cmite' ? 'Cnorm' : 'Cmite';
         $r['class'] = $class;
         $tpl->set_ar_out($r, 1);
     }
     $tpl->out(2);
     $show = false;
     break;
 case 'newForum':
     if (empty($_POST['sub'])) {
         # false if no cat exists
         if (db_result(db_query("SELECT COUNT(id) FROM prefix_forumcats"), 0) == 0) {
Esempio n. 26
0
/**
 * gibt den link zu einem event aus
 *
 * @param tpl $calendartpl der tpl des kalenders (zugriff auf "event link")
 * @param  $view view, was angezeigt werden soll
 * @param array $eventinfo die info des events
 * @return den link
 */
function eventlink(&$calendartpl, $view, $eventinfo)
{
    $calendartpl->set_ar($eventinfo);
    $calendartpl->set("view", $view);
    return $calendartpl->get("event link");
}
Esempio n. 27
0
 $design = new design('Ilch Admin-Control-Panel :: Serverkonfiguration', '', 2);
 $design->header();
 $tpl = new tpl('checkconf', 1);
 $tpl->out(0);
 // # Server conf
 $tpl->set_out('head', $lang['phpserverconf'], 1);
 $tpl->set_ar_out(array('class' => 'Cmite', 'opt' => 'version', 'val' => phpversion()), 3);
 $confstrings = array("safe_mode", "display_errors", "max_execution_time", "memory_limit", "register_globals", "file_uploads", "upload_max_filesize", "post_max_size", "disable_functions");
 $class = 'Cmite';
 foreach ($confstrings as $str) {
     if ($class == 'Cmite') {
         $class = 'Cnorm';
     } else {
         $class = 'Cmite';
     }
     $tpl->set("class", $class);
     $tpl->set("opt", $str);
     $tpl->set("val", ini_get($str));
     $tpl->out(3);
 }
 // sockets
 if ($class == 'Cmite') {
     $class = 'Cnorm';
 } else {
     $class = 'Cmite';
 }
 $tpl->set("class", $class);
 $tpl->set("opt", 'sockets');
 $tpl->set("val", defined('AF_INET') ? 1 : 0);
 $tpl->out(3);
 $tpl->out(2);
Esempio n. 28
0
<a class="box" href="{link}" target="_blank">{title}</a><br />
{EXPLODE}
<img src="{banner}" alt="{name}" border="0">
tpl;
defined('main') or die('no direct access');
$allyAnzahl = $allgAr['Aanz'];
if ($allgAr['Aart'] == 1) {
    $sqlORDER = 'pos';
} else {
    $sqlORDER = 'RAND()';
}
$allyNameAr = array();
$allyLinkAr = array();
$allyBanaAr = array();
$allyAktAnz = 0;
$allyAbf = 'SELECT * FROM `prefix_partners` ORDER BY ' . $sqlORDER . ' LIMIT  0,' . $allyAnzahl;
$allyErg = db_query($allyAbf);
if (db_num_rows($allyErg) > 0) {
    $tpl = new tpl($tpl_alianz, 3);
    $tpl->out(0);
    while ($allyRow = db_fetch_object($allyErg)) {
        $tpl->set("link", $allyRow->link);
        if (empty($allyRow->banner) or $allyRow->banner == 'http://') {
            $tpl->set("title", $allyRow->name);
        } else {
            $tpl->set("title", $tpl->set_ar_get(array("banner" => $allyRow->banner, "name" => $allyRow->name), 3));
        }
        $tpl->out(2);
    }
    $tpl->out(1);
}
Esempio n. 29
0
 function load()
 {
     // initiate the site and make pages and page
     // globally available
     $pages = $this->pages;
     $page = $this->pages->active();
     // check for ssl
     if (c::get('ssl')) {
         // if there's no https in the url
         if (!server::get('https')) {
             go(str_replace('http://', 'https://', $page->url()));
         }
     }
     // check for a misconfigured subfolder install
     if ($page->isErrorPage()) {
         // get the subfolder in which the site is running
         $subfolder = ltrim(dirname(server::get('script_name')), '/');
         // if it is running in a subfolder and it does not match the config
         // send an error with some explanations how to fix that
         if (!empty($subfolder) && c::get('subfolder') != $subfolder) {
             // this main url
             $url = 'http://' . server::get('http_host') . '/' . $subfolder;
             require_once c::get('root.kirby') . '/modals/subfolder.php';
             exit;
         }
     }
     // redirect file urls (file:image.jpg)
     if ($this->uri->param('file')) {
         // get the local file
         $file = $page->files()->find($this->uri->param('file'));
         if ($file) {
             go($file->url());
         }
     }
     // redirect /home to /
     if ($this->uri->path() == c::get('home')) {
         go(url());
     }
     // redirect tinyurls
     if ($this->uri->path(1) == c::get('tinyurl.folder') && c::get('tinyurl.enabled')) {
         $hash = $this->uri->path(2);
         if (!empty($hash)) {
             $resolved = $this->pages->findByHash($hash)->first();
             // redirect to the original page
             if ($resolved) {
                 go(url($resolved->uri));
             }
         }
     }
     // set the global template vars
     tpl::set('site', $this);
     tpl::set('pages', $pages);
     tpl::set('page', $page);
     $cacheID = $this->uri->toCacheID() . '.php';
     $cacheModified = time();
     $cacheData = null;
     if ($this->htmlCacheEnabled) {
         // check if the cache is disabled for some reason
         $this->htmlCacheEnabled = $page->isErrorPage() || in_array($page->uri(), c::get('cache.ignore', array())) ? false : true;
         // check for the last modified date of the cache file
         $cacheModified = cache::modified($cacheID);
         // check if the files have been modified
         // since the last html cache file has been written
         if ($this->htmlCacheEnabled && $cacheModified >= $this->modified) {
             $cacheData = cache::get($cacheID, true);
         }
     }
     if (empty($cacheData)) {
         // load the main template
         $html = tpl::load($page->template(), false, true);
         if ($this->htmlCacheEnabled) {
             cache::set($cacheID, (string) $html, true);
         }
     } else {
         $html = $cacheData;
     }
     die($html);
 }
Esempio n. 30
0
     $class = 'Cnorm';
     while ($row = db_fetch_assoc($erg)) {
         $row['gallery'] = count_files($row['id']);
         $class = $class == 'Cmite' ? 'Cnorm' : 'Cmite';
         $row['class'] = $class;
         $tpl->set_ar_out($row, 2);
     }
     $tpl->out(3);
 }
 $limit = $img_per_site;
 $page = $menu->getA(2) == 'p' ? escape($menu->getE(2), 'integer') : 1;
 $MPL = db_make_sites($page, '', $limit, '?gallery-' . $cid, "gallery_imgs LEFT JOIN prefix_gallery_cats ON prefix_gallery_imgs.cat = prefix_gallery_cats.id WHERE prefix_gallery_imgs.cat = " . $cid . " AND (recht >= " . $_SESSION['authright'] . " OR recht IS NULL)");
 $anfang = ($page - 1) * $limit;
 $erg = db_query("SELECT prefix_gallery_imgs.id,prefix_gallery_imgs.cat,datei_name,endung,prefix_gallery_imgs.`besch`,klicks,vote_wertung,vote_klicks FROM prefix_gallery_imgs LEFT JOIN prefix_gallery_cats ON prefix_gallery_imgs.cat = prefix_gallery_cats.id WHERE prefix_gallery_imgs.cat = " . $cid . " AND (recht >= " . $_SESSION['authright'] . " OR recht IS NULL) ORDER BY id ASC LIMIT " . $anfang . "," . $limit);
 if (db_num_rows($erg) > 0) {
     $tpl->set('imgperline', $allgAr['gallery_imgs_per_line']);
     $tpl->set('cname', $cname);
     $tpl->set('breite', $allgAr['gallery_normal_width'] + 30);
     $tpl->set('MPL', $MPL);
     $tpl->out(4);
     $class = 'Cnorm';
     $i = 0;
     while ($row = db_fetch_assoc($erg)) {
         $class = $class == 'Cmite' ? 'Cnorm' : 'Cmite';
         $row['class'] = $class;
         $row['anz_koms'] = db_result(db_query("SELECT COUNT(*) FROM prefix_koms WHERE uid = " . $row['id'] . " AND cat = 'GALLERYIMG'"), 0);
         $row['besch'] = unescape($row['besch']);
         $row['width'] = round(100 / $img_per_line);
         $row['bildr'] = $i + ($page - 1) * $img_per_site;
         if ($i != 0 and $i % $img_per_line == 0) {
             echo '</tr><tr>';