function top_match()
{
    global $db, $allowHover, $llwars, $picformat, $sql_prefix;
    $qry = db("SELECT s1.datum,s1.cid,s1.id,s1.bericht,s1.xonx,s1.punkte,s1.gpunkte,s1.squad_id,s2.icon,s2.name FROM " . $db['cw'] . " AS s1\n             LEFT JOIN " . $db['squads'] . " AS s2 ON s1.squad_id = s2.id\n             WHERE `top` = '1'\n             ORDER BY RAND()");
    if ($get = _fetch($qry)) {
        //Clans Mod
        $clandetailssql = db("SELECT clantag, gegner FROM " . $sql_prefix . "clans WHERE id LIKE " . $get['cid']);
        $clans = _fetch($clandetailssql);
        $squad = '_defaultlogo.jpg';
        $gegner = '_defaultlogo.jpg';
        foreach ($picformat as $end) {
            if (file_exists(basePath . '/inc/images/clanwars/' . $get['cid'] . '_logo.' . $end)) {
                $gegner = $get['cid'] . '_logo.' . $end;
            }
            if (file_exists(basePath . '/inc/images/squads/' . $get['squad_id'] . '_logo.' . $end)) {
                $squad = $get['squad_id'] . '_logo.' . $end;
            }
        }
        if ($allowHover == 1 || $allowHover == 2) {
            $hover = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . jsconvert(re($get['name'])) . '<br/>vs.<br/> ' . jsconvert(re($clans['gegner'])) . '</td></tr><tr><td><b>' . _played_at . ':</b></td><td>' . date("d.m.Y H:i", $get['datum']) . _uhr . '</td></tr><tr><td><b>' . _cw_xonx . ':</b></td><td>' . jsconvert(re($get['xonx'])) . '</td></tr><tr><td><b>' . _result . ':</b></td><td>' . cw_result_nopic_raw($get['punkte'], $get['gpunkte']) . '</td></tr><tr><td><b>' . _comments_head . ':</b></td><td>' . cnt($db['cw_comments'], "WHERE cw = '" . $get['id'] . "'") . '</td></tr>\')" onmouseout="DZCP.hideInfo()"';
        }
        $topmatch .= show("menu/top_match", array("id" => $get['id'], "clantag" => re(cut($clans['clantag'], $llwars)), "team" => re(cut($get['name'], $llwars)), "game" => substr(strtoupper(str_replace('.' . $icon, '', re($get['icon']))), 0, 5), "id" => $get['id'], "gegner" => $gegner, "squad" => $squad, "hover" => $hover, "info" => $get['datum'] > time() ? date("d.m.Y", $get['datum']) : cw_result_nopic($get['punkte'], $get['gpunkte'])));
    }
    return empty($topmatch) ? '<center style="margin:3px 0">' . _no_top_match . '</center>' : '<table class="navContent" cellspacing="0">' . $topmatch . '</table>';
}
示例#2
0
/**
 * Remember that this is not sanitized and should be commented out of your code when done using
 */
function debugRequest()
{
    echo "Echoing for debug:<br>";
    echo "You should see 'DONE' line at the end if all is successful<br>";
    function show($arr, $label = "")
    {
        echo "{$label}<br>";
        echo "<pre>";
        var_dump($arr);
        echo "</pre>";
        echo "<br>";
    }
    // === Section 1
    show($_GET, "GET");
    show($_POST, "POST");
    show($_COOKIE, "COOKIE");
    show($_SERVER, "SERVER");
    show(getallheaders(), "Request headers");
    show(apache_response_headers(), "Response headers: apache_response_headers (array)");
    // Section 1 ===
    if (isset($_COOKIE["thetestcookie"])) {
        echo "thetestcookie:" . $_COOKIE["thetestcookie"] . "<br>";
    } else {
        echo "thetestcookie: cookie is not set<br>";
    }
    echo "<br><br>Usage notes:<br>";
    $readme = "";
    $readme .= "- You can set a cookie called 'thetestcookie'";
    echo $readme;
    echo "<br>DONE<br>";
}
function show($node)
{
    if ($node->hasChildren()) {
        $children = $node->getChildren();
        // display each child
        foreach ($children as $child) {
            //$content = $child->getContent();
            //$content->load();
            //echo $content->getTitle();
            echo $child->getId();
            echo '<br>';
            show($child);
            /*
            if ($level > 20)
            {
            		trigger_error('menu::displayChildren() level higher than 20, infinite loop ?');
            }
            else
            {
            	
            }
            */
        }
    }
}
 public function getbean()
 {
     $uid = I('uid');
     $beancount = M('beancount');
     $data = array();
     if (!$uid) {
         show(101, '非法操作!', $data);
     }
     $task = I('task');
     switch ($task) {
         case "school":
         case "head":
             $num = 10;
             break;
         case "weixin":
         case "qq":
             $num = 10;
             break;
         default:
             return show(102, "非法操作!", $data);
             break;
     }
     $result = $beancount->where("uid={$uid}")->setInc('amount', $num);
     if ($result) {
         $data = $beancount->where("uid={$uid}")->find();
         show(200, '操作成功!', $data);
     } else {
         show(102, '操作失败!', $data);
     }
 }
 function resetpwd()
 {
     global $db;
     //判断是否登陆
     !isset($_SESSION['user']) && exit('Please login!');
     //转到登陆页面
     if (!isset($_POST['update'])) {
         tpl('resetpwd');
     }
     //处理修改密码事件
     $post = htmlescape($_POST, 'yes');
     $rs = $db->row_query_one("SELECT * FROM user WHERE user='******'user']}'");
     if (!isset($rs['passwd']) || $rs['passwd'] != md5($post['passwd'])) {
         show('提示', '原密码输入错误', '-1');
         exit;
     }
     $arr = array('user' => $post['user'], 'passwd' => md5($post['newpwd']));
     $rs = $db->row_update('user', $arr, "user='******'user']}'");
     if ($rs) {
         $_SESSION['user'] = $post['user'];
         show('提示', '修改成功,下次登陆请使用新密码', '?module=admin&act=right');
     } else {
         show('提示', '修改密码失败,请稍后再试', '-1');
     }
     exit;
 }
 public function sendSMS()
 {
     $post_code = isset($_POST['post_code']) ? $_POST['post_code'] : '';
     $phone_num = isset($_POST['telephone']) ? $_POST['telephone'] : '';
     //         $post_code='U2FsdGVkX1+zY61T/9h6KxyTBWVwbNR9Z01QjZN5EmT5BzDIEROXMFb9it8VgTrW
     //         Yippi/B79Y0u+ZXJMwSLXGo8imoz9OTrB3k0uhvjIEyi4pF27xCm/Cg0pW0T3SoS
     //         9oCORpIFF/600rCAvhDsMOADCKCBtvLhpL4YpLKHQ3/jqQFsjWF8YUVMc0x9LtPa
     //         3eeGQIFsdRDr2nSWMlnGQExvNvyKnfLWUrH+YkJDIJlYzXihdv32yMw+vCf/DDa2
     //         Oq4CU2BkzLqff4IjGmA/9+FP2SS19kDMzdf5e1DO132QBhHDrLy1ffrSIabFRHVf
     //         SVDsy1qZSsC7Ea24RdmQBQ==';
     if ($phone_num == '') {
         return show(103, '手机号不能为空');
     }
     if (preg_match('/^1[34578][0-9]{9}$/', $phone_num)) {
     } else {
         return show(101, '手机号格式不正确');
     }
     $mobile_code = random(6, 1);
     //random()是公共自定义函数
     $target = "http://106.ihuyi.cn/webservice/sms.php?method=Submit";
     $post_data = "account=cf_guoqingyu&password=luping521&mobile=" . $phone_num . "&content=" . rawurlencode("您的校验码是:" . $mobile_code . "。请不要把校验码泄露给其他人。如非本人操作,可不用理会!");
     //密码可以使用明文密码或使用32位MD5加密
     $gets = xml_to_array(Post($post_data, $target));
     if ($gets['SubmitResult']['code'] == 2) {
         S('phone_num', $phone_num, 60);
         S($phone_num . 'mobile_code', $mobile_code, 60);
         return show(104, '发送成功');
     } else {
         return show(102, '发送失败');
     }
 }
示例#7
0
文件: vote.php 项目: nopuls/dzcp
function vote($ajax = false)
{
    global $db, $balken_vote_menu, $prev;
    $qry = db("SELECT * FROM " . $db['votes'] . " WHERE menu = '1' AND forum = 0");
    $get = _fetch($qry);
    if (_rows($qry)) {
        $qryv = db("SELECT * FROM " . $db['vote_results'] . " WHERE vid = '" . $get['id'] . "' ORDER BY what");
        while ($getv = _fetch($qryv)) {
            $stimmen = sum($db['vote_results'], " WHERE vid = '" . $get['id'] . "'", "stimmen");
            if ($stimmen != 0) {
                if (ipcheck("vid_" . $get['id']) || isset($_COOKIE[$prev . "vid_" . $get['id']]) || $get['closed'] == 1) {
                    $percent = round($getv['stimmen'] / $stimmen * 100, 1);
                    $rawpercent = round($getv['stimmen'] / $stimmen * 100, 0);
                    $balken = show(_votes_balken, array("width" => $rawpercent));
                    $votebutton = "";
                    $results .= show("menu/vote_results", array("answer" => re($getv['sel']), "percent" => $percent, "stimmen" => $getv['stimmen'], "balken" => $balken));
                } else {
                    $votebutton = '<input id="contentSubmitVote" type="submit" value="' . _button_value_vote . '" class="voteSubmit" />';
                    $results .= show("menu/vote_vote", array("id" => $getv['id'], "answer" => re($getv['sel'])));
                }
            } else {
                $votebutton = '<input id="contentSubmitVote" type="submit" value="' . _button_value_vote . '" class="voteSubmit" />';
                $results .= show("menu/vote_vote", array("id" => $getv['id'], "answer" => re($getv['sel'])));
            }
        }
        $vote = show("menu/vote", array("titel" => re($get['titel']), "vid" => $get['id'], "results" => $results, "votebutton" => $votebutton, "stimmen" => $stimmen));
    }
    return empty($vote) ? '<center style="margin:2px 0">' . _vote_menu_no_vote . '</center>' : ($ajax ? $vote : '<div id="navVote">' . $vote . '</div>');
}
示例#8
0
function show(&$smarty, $tmp, $setting, &$html, $lv = 0, &$limit)
{
    if ($setting['shownode'] && $lv != 0) {
        if (is_object($smarty) && method_exists($smarty, 'gen_url')) {
            $url = $smarty->gen_url(array('app' => 'content', 'ctl' => 'site_article', 'act' => 'lists', 'arg0' => $tmp['info']['node_id']));
        }
        $html .= html($lv, $url, $tmp['info']['node_name']);
    }
    if (!$setting['shownode']) {
        if ($limit <= 0) {
            return;
        }
        #$tmp['article'] = array_slice( $tmp['article'], 0, $setting['limit'] );
    }
    if ($tmp['article']) {
        if ($setting['styleart']) {
            $tmp_lv = $setting['shownode'] ? $setting['lv'] + 1 : 2;
        } else {
            $tmp_lv = $lv + 1;
        }
        foreach ($tmp['article'] as $row) {
            if (is_object($smarty) && method_exists($smarty, 'gen_url')) {
                $url = $smarty->gen_url(array('app' => 'content', 'ctl' => 'site_article', 'act' => 'index', 'arg0' => $row['article_id']));
            }
            $html .= html($tmp_lv, $url, $row['title']);
            $limit--;
        }
    }
    if ($tmp['child']) {
        foreach ($tmp['child'] as $row) {
            show($smarty, $row, $setting, $html, $lv + 1, $limit);
        }
    }
}
示例#9
0
文件: ftopics.php 项目: nopuls/dzcp
function ftopics()
{
    global $db, $maxftopics, $lftopics, $maxfposts, $allowHover;
    $f = 0;
    $qry = db("SELECT s1.*,s2.id AS subid FROM " . $db['f_threads'] . " s1, " . $db['f_skats'] . " s2, " . $db['f_kats'] . " s3\n               WHERE s1.kid = s2.id AND s2.sid = s3.id ORDER BY s1.lp DESC LIMIT 100");
    while ($get = _fetch($qry)) {
        if ($f == $maxftopics) {
            break;
        }
        if (fintern($get['kid'])) {
            $lp = cnt($db['f_posts'], " WHERE sid = '" . $get['id'] . "'");
            $pagenr = ceil($lp / $maxfposts);
            if ($pagenr == 0) {
                $page = 1;
            } else {
                $page = $pagenr;
            }
            if ($allowHover == 1) {
                $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . jsconvert(re($get['topic'])) . '</td></tr><tr><td><b>' . _forum_posts . ':</b></td><td>' . $lp . '</td></tr><tr><td><b>' . _forum_lpost . ':</b></td><td>' . date("d.m.Y H:i", $get['lp']) . _uhr . '</td></tr>\')" onmouseout="DZCP.hideInfo()"';
            }
            $ftopics .= show("menu/forum_topics", array("id" => $get['id'], "pagenr" => $page, "p" => $lp + 1, "titel" => cut(re($get['topic']), $lftopics), "info" => $info, "kid" => $get['kid']));
            $f++;
        }
    }
    return empty($ftopics) ? '' : '<table class="navContent" cellspacing="0">' . $ftopics . '</table>';
}
示例#10
0
文件: navi.php 项目: nopuls/dzcp
function navi($kat)
{
    global $db, $chkMe, $userid, $designpath;
    if ($k = _fetch(db("SELECT `level` FROM " . $db['navi_kats'] . " WHERE `placeholder` = '" . up($kat) . "'"))) {
        $intern = $chkMe >= 2 ? '' : " AND s1.`internal` = '0'";
        $permissions = $kat == 'nav_admin' && admin_perms($userid) ? "" : $intern . " AND " . intval($chkMe) . " >= '" . intval($k['level']) . "'";
        $qry = db("SELECT s1.* FROM " . $db['navi'] . " AS s1 LEFT JOIN " . $db['navi_kats'] . " AS s2 ON s1.kat = s2.placeholder\n                 WHERE s1.kat = '" . up($kat) . "' AND s1.`shown` = '1' " . $permissions . "\n                 ORDER BY s1.pos");
        while ($get = _fetch($qry)) {
            if ($get['type'] == 0) {
                $link = '';
            } elseif ($get['type'] == 1 || $get['type'] == 2 || $get['type'] == 3) {
                $name = $get['wichtig'] == 1 ? '<span class="fontWichtig">' . navi_name(re($get['name'])) . '</span>' : navi_name(re($get['name']));
                $target = $get['target'] == 1 ? '_blank' : '_self';
                if (file_exists($designpath . '/menu/' . $get['kat'] . '.html')) {
                    $link = show("menu/" . $get['kat'] . "", array("target" => $target, "href" => re($get['url']), "title" => strip_tags($name), "css" => ucfirst(str_replace('nav_', '', re($get['kat']))), "link" => $name));
                } else {
                    $link = show("menu/nav_link", array("target" => $target, "href" => re($get['url']), "title" => strip_tags($name), "css" => ucfirst(str_replace('nav_', '', re($get['kat']))), "link" => $name));
                }
                $table = strstr($link, '<tr>') ? true : false;
            }
            $navi .= $link;
        }
    }
    return empty($navi) ? '' : ($table ? '<table class="navContent" cellspacing="0">' . $navi . '</table>' : $navi);
}
示例#11
0
文件: fvote.php 项目: nopuls/dzcp
function fvote($id, $ajax = false)
{
    global $db, $balken_vote_menu, $prev;
    if (!permission("votes")) {
        $intern = ' AND intern = 0';
    }
    $qry = db("SELECT * FROM " . $db['votes'] . "  WHERE id = '" . $id . "' " . $intern . "");
    $get = _fetch($qry);
    if (_rows($qry)) {
        $qryv = db("SELECT * FROM " . $db['vote_results'] . " WHERE vid = '" . $get['id'] . "' ORDER BY id ASC");
        while ($getv = _fetch($qryv)) {
            $stimmen = sum($db['vote_results'], " WHERE vid = '" . $get['id'] . "'", "stimmen");
            if ($stimmen != 0) {
                if (ipcheck("vid_" . $get['id']) || isset($_COOKIE[$prev . "vid_" . $get['id']]) || $get['closed'] == 1) {
                    $percent = round($getv['stimmen'] / $stimmen * 100, 1);
                    $rawpercent = round($getv['stimmen'] / $stimmen * 100, 0);
                    $balken = show(_votes_balken, array("width" => $rawpercent));
                    $votebutton = "";
                    $results .= show("forum/vote_results", array("answer" => re($getv['sel']), "percent" => $percent, "stimmen" => $getv['stimmen'], "balken" => $balken));
                } else {
                    $votebutton = '<input id="contentSubmitFVote" type="submit" value="' . _button_value_vote . '" class="voteSubmit" />';
                    $results .= show("forum/vote_vote", array("id" => $getv['id'], "answer" => re($getv['sel'])));
                }
            } else {
                $votebutton = '<input id="contentSubmitFVote" type="submit" value="' . _button_value_vote . '" class="voteSubmit" />';
                $results .= show("forum/vote_vote", array("id" => $getv['id'], "answer" => re($getv['sel'])));
            }
        }
        $qryf = db("SELECT id,kid FROM " . $db['f_threads'] . " WHERE vote = '" . $get['id'] . "'");
        $getf = _fetch($qryf);
        $vote = show("forum/vote", array("titel" => re($get['titel']), "vid" => $get['id'], "fid" => $getf['id'], "kid" => $getf['kid'], "umfrage" => _forum_vote, "results" => $results, "votebutton" => $votebutton, "stimmen" => $stimmen));
    }
    return empty($vote) ? '' : ($ajax ? $vote : '<div id="navFVote">' . $vote . '</div>');
}
示例#12
0
文件: auth.php 项目: jsib/intranet
function check_rights($right_name = "")
{
    //Define global variables
    global $user;
    //Check rights
    if (isset($GLOBALS['super_rights_users'][$user->data['username']])) {
        //For users with super rights
        return true;
    } else {
        //If
        if ($right_name !== "") {
            $rightRES = db_query("SELECT * FROM `phpbb_rights` WHERE `name`='{$right_name}'");
            if (db_count($rightRES) == 1) {
                $right_id = db_fetch($rightRES)['id'];
            } else {
                show("Ошибка в функции check_right_name(). Права с именем '{$right_name}' не существует или имеется несколько прав с таким именем.<br/>");
                show('Debug backtrace:');
                show(debug_backtrace());
                exit;
            }
            if (db_easy_count("SELECT * FROM `phpbb_rights_users` WHERE `user_id`={$user->data['user_id']} AND `right_id`={$right_id}") > 0) {
                return true;
            } else {
                return false;
            }
        }
    }
}
示例#13
0
文件: motm.php 项目: nopuls/dzcp
function motm()
{
    global $db, $allowHover;
    $userpics = get_files(basePath . '/inc/images/uploads/userpics/');
    $qry = db("SELECT * FROM " . $db['users'] . " WHERE level >= 2");
    while ($rs = _fetch($qry)) {
        foreach ($userpics as $userpic) {
            $tmpId = intval($userpic);
            if ($tmpId == $rs['id']) {
                $temparr[] = $rs['id'];
                $a++;
                break;
            }
        }
    }
    $arrayID = rand(0, count($temparr) - 1);
    $uid = $temparr[$arrayID];
    $get = _fetch(db("SELECT * FROM " . $db['users'] . " WHERE id = '" . $uid . "'"));
    if (!empty($get) && !empty($temparr)) {
        $status = $get['status'] == 1 || $get['level'] == 1 ? _aktiv : _inaktiv;
        if ($allowHover == 1) {
            $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . rawautor($get['id']) . '</td></tr><tr><td width=80px><b>' . _posi . ':</b></td><td>' . getrank($get['id']) . '</td></tr><tr><td><b>' . _status . ':</b></td><td>' . $status . '</td></tr><tr><td><b>' . _age . ':</b></td><td>' . getAge($get['bday']) . '</td></tr><tr><td colspan=2 align=center>' . jsconvert(userpic($get['id'])) . '</td></tr>\')" onmouseout="DZCP.hideInfo()"';
        }
        $member = show("menu/motm", array("uid" => $get['id'], "upic" => userpic($get['id'], 130, 161), "info" => $info));
    } else {
        $member = '';
    }
    return empty($member) ? '' : '<table class="navContent" cellspacing="0">' . $member . '</table>';
}
 public function showCategoryTopics($name)
 {
     $name = isset($name) ? urldecode($name['action']) : show(404);
     $topics = Topic::getTopicByCategory($name) or redirect(404);
     $singleTopic = $topics[0];
     echo $this->blade->render('category-topics', compact('topics', 'singleTopic'));
 }
function getArticlesAdminContent()
{
    global $site;
    global $sActionText;
    $ret = '';
    //	$ret .= '<div id="artBlock">' . "\n";
    if (strlen($sActionText) != 0) {
        $ret .= '<div class="categoryAction">' . "\n";
        $ret .= $sActionText . "\n";
        $ret .= '</div>' . "\n";
    }
    $ret .= '<div>' . "\n";
    switch ($_GET['action']) {
        case 'create':
            $ret .= getArticleEditForm() . "\n";
            break;
        case 'edit':
            $ret .= getArticleEditForm(intval($_GET[ID])) . "\n";
            break;
        case 'show':
            $ret .= show(intval($_GET[ID])) . "\n";
            break;
        default:
            $ret .= letterlist() . "\n";
            break;
    }
    $ret .= '</div>' . "\n";
    //	$ret .= '</div>' . "\n";
    return $ret;
}
示例#16
0
function add_group()
{
    global $sql;
    if (strlen($_POST["group"]) > 5) {
        $sql->execute("INSERT INTO products (name,k,b,z,u,sv) VALUE (':name',0,0,0,0,0)", [["name" => ":name", "val" => $_POST["group"], "type" => SQL::PARAM_STR]]);
    }
    show();
}
 private function load($class)
 {
     $file = CORE_ROOT . "{$class}.class.php";
     if (is_file($file)) {
         include $file;
     } else {
         show(300, "{$class} 库加载失败");
     }
 }
示例#18
0
function counter()
{
    //$sql_prefix hinzufügen
    global $db, $today, $counter_start, $useronline, $where, $isSpider, $sql_prefix;
    if (!$isSpider) {
        $qry2day = db("SELECT visitors FROM " . $db['counter'] . "\n                   WHERE today = '" . $today . "'");
        if (_rows($qry2day)) {
            $get2day = _fetch($qry2day);
            $v_today = $get2day['visitors'];
        } else {
            $v_today = 0;
        }
        $gestern = time() - 86400;
        $tag = date("j", $gestern);
        $monat = date("n", $gestern);
        $jahr = date("Y", $gestern);
        $yesterday = $tag . "." . $monat . "." . $jahr;
        $qryyday = db("SELECT visitors FROM " . $db['counter'] . "\n                   WHERE today = '" . $yesterday . "'");
        if (_rows($qryyday)) {
            $getyday = _fetch($qryyday);
            $yDay = $getyday['visitors'];
        } else {
            $yDay = 0;
        }
        $qrystats = db("SELECT SUM(visitors) AS allvisitors,\n                           MAX(visitors) AS maxvisitors,\n                           MAX(maxonline) AS maxonline,\n                           AVG(visitors) AS avgvisitors,\n                           SUM(visitors) AS allvisitors\n                    FROM " . $db['counter'] . "");
        $getstats = _fetch($qrystats);
        if (abs(online_reg()) != 0) {
            $qryo = db("SELECT id FROM " . $db['users'] . "\n                  WHERE time+'" . $useronline . "'>'" . time() . "'\n                  AND online = 1\n                  ORDER BY nick");
            while ($geto = _fetch($qryo)) {
                $ousers .= '<tr><td>' . rawautor($geto['id']) . '</td><td align=right valign=middle><small>' . jsconvert(getrank($geto['id'])) . '</small></td></tr>';
            }
            $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . _online_head . '</td></tr><tr><td><table width=100% cellpadding=0 cellspacing=0>' . $ousers . '</table></td></tr>\')" onmouseout="DZCP.hideInfo()"';
        }
        //Klicks Mod
        if (strpos($_SERVER['PHP_SELF'], "/admin/") !== false) {
            $clicksnumber = "-";
        } else {
            if ($_SERVER['QUERY_STRING'] != "") {
                $whereclicks = $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'];
            } else {
                $whereclicks = $_SERVER['PHP_SELF'];
            }
            $clicksrownumber = mysql_num_rows(db("SELECT klicks FROM " . $sql_prefix . "klicks WHERE wo = '" . $whereclicks . "'"));
            if ($clicksrownumber == 0) {
                $qry = db("INSERT INTO " . $sql_prefix . "klicks \n                       SET `wo`  = '" . $whereclicks . "',\n                           `klicks`  = '1'");
                $clicksnumber = 1;
            } else {
                $clicksnumber = mysql_fetch_array(db("SELECT klicks FROM " . $sql_prefix . "klicks WHERE wo = '" . $whereclicks . "'"));
                $clicksnumber = $clicksnumber[0] + 1;
                $qry = db("UPDATE " . $sql_prefix . "klicks SET klicks = '" . $clicksnumber . "' WHERE wo LIKE '" . $whereclicks . "'");
            }
        }
        //Klicks Mod Ende
        $counter = show("menu/counter", array("v_today" => $v_today, "aufrufe" => $clicksnumber, "v_yesterday" => $yDay, "v_all" => $getstats['allvisitors'] + $counter_start, "v_perday" => round($getstats['avgvisitors'], 2), "v_max" => $getstats['maxvisitors'], "g_online" => abs(online_guests($where) - online_reg()), "u_online" => abs(online_reg()), "info" => $info, "v_online" => $getstats['maxonline'], "head_online" => _head_online, "head_visits" => _head_visits, "head_max" => _head_max, "user" => _cnt_user, "guests" => _cnt_guests, "today" => _cnt_today, "yesterday" => _cnt_yesterday, "all" => _cnt_all, "percentperday" => _cnt_pperday, "perday" => _cnt_perday, "online" => _cnt_online));
        return '<table class="navContent" cellspacing="0">' . $counter . '</table>';
    }
}
示例#19
0
function rotationsbanner()
{
    global $db;
    $qry = db("SELECT * FROM " . $db['sponsoren'] . "\n\t\t\t         WHERE banner = 1 ORDER BY RAND() LIMIT 1");
    while ($get = _fetch($qry)) {
        $rotationbanner .= show(_sponsors_bannerlink, array("id" => $get['id'], "title" => htmlspecialchars(str_replace('http://', '', re($get['link']))), "banner" => empty($get['blink']) ? "../banner/sponsors/banner_" . $get['id'] . "." . $get['bend'] : re($get['blink'])));
    }
    return empty($rotationbanner) ? '' : $rotationbanner;
}
示例#20
0
文件: l_reg.php 项目: nopuls/dzcp
function l_reg()
{
    global $db, $llreg, $maxlreg;
    $qry = db("SELECT id,nick,country,regdatum FROM " . $db['users'] . "\n               ORDER BY regdatum DESC\n               LIMIT " . $maxlreg . "");
    while ($get = _fetch($qry)) {
        $lreg .= show("menu/last_reg", array("nick" => re(cut($get['nick'], $llreg)), "country" => flag($get['country']), "reg" => date("d.m.", $get['regdatum']), "id" => $get['id']));
    }
    return empty($lreg) ? '' : '<table class="navContent" cellspacing="0">' . $lreg . '</table>';
}
示例#21
0
 function ubah_pass()
 {
     $kode = $this->session->userdata('id');
     $profil['data'] = $this->model_admin->profil_user($kode);
     if ($profil) {
         show('ubah_pass', $profil);
     } else {
         redirect('login');
     }
 }
示例#22
0
function events()
{
    global $db, $sql_prefix;
    $qry = db("SELECT id, name, start FROM " . $sql_prefix . "events_info\n              WHERE (`start` >= " . time() . " OR (`start` <= " . time() . " AND `ende` >= " . time() . ")) AND `show` = 1\n              ORDER BY `start`\n              LIMIT " . config('m_events') . "");
    while ($get = _fetch($qry)) {
        $events = show(_ev_next_event_link, array("datum" => date("d.m.", $get['start']), "id" => $get['id'], "event" => $get['name']));
        $eventbox .= show("menu/event", array("events" => $events));
    }
    return empty($eventbox) ? '<center style="margin:2px 0">' . _no_events . '</center>' : '<table class="navContent" cellspacing="0">' . $eventbox . '</table>';
}
示例#23
0
 function login()
 {
     !isset($_POST['user']) && exit;
     $arr = escape($_POST, 'yes');
     strtolower($arr['code']) != $_SESSION['authCode'] && show('登陆失败', '验证码错误', '-1');
     $rs = $db->row_query_one("SELECT `passwd` FROM `user` WHERE `user`='{$arr['user']}'");
     (!isset($rs['passwd']) || $rs['passwd'] != md5($arr['passwd'])) && show('登陆失败', '用户名或密码错误', '-1');
     $_SESSION['user'] = $arr['user'];
     tpl('main');
 }
示例#24
0
文件: events.php 项目: nopuls/dzcp
function events()
{
    global $db, $maxevent;
    $qry = db("SELECT id,datum,title,event FROM " . $db['events'] . "\n              WHERE datum > " . time() . "\n              ORDER BY datum\n              LIMIT " . $maxevent . "");
    while ($get = _fetch($qry)) {
        $events = show(_next_event_link, array("datum" => date("d.m.", $get['datum']), "timestamp" => $get['datum'], "event" => $get['title']));
        $eventbox .= show("menu/event", array("events" => $events));
    }
    return empty($eventbox) ? '<center style="margin:2px 0">' . _no_events . '</center>' : '<table class="navContent" cellspacing="0">' . $eventbox . '</table>';
}
示例#25
0
文件: sponsors.php 项目: nopuls/dzcp
function sponsors()
{
    global $db;
    $qry = db("SELECT * FROM " . $db['sponsoren'] . " WHERE box = 1 ORDER BY pos");
    while ($get = _fetch($qry)) {
        $banner = show(_sponsors_bannerlink, array("id" => $get['id'], "title" => htmlspecialchars(str_replace('http://', '', re($get['link']))), "banner" => empty($get['xlink']) ? "../banner/sponsors/box_" . $get['id'] . "." . $get['xend'] : re($get['xlink'])));
        $sponsors .= show("menu/sponsors", array("banner" => $banner));
    }
    return empty($sponsors) ? '' : '<table class="navContent" cellspacing="0">' . $sponsors . '</table>';
}
 public function show()
 {
     // If no messages, return right away
     if (empty($this->messages)) {
         return false;
     }
     // Calculate times
     $this->calculate();
     // ksort
     ksort($this->messages);
     show($this->messages);
 }
示例#27
0
function quickinfo()
{
    global $db, $sql_prefix;
    $get = db("SELECT * FROM " . $sql_prefix . "quickinfo WHERE status = '1' ORDER BY RAND()", false, true);
    if ($get['more'] != "") {
        $more = '<a href="' . $get['more'] . '">' . _quickinfo_more . '</a>';
    } else {
        $more = '';
    }
    $quickinfo = show("menu/quickinfo", array("title" => $get['title'], "content" => bbcode($get['content']), "more" => $more));
    return empty($quickinfo) ? '' : '<table class="navContent" cellspacing="0">' . $quickinfo . '</table>';
}
示例#28
0
文件: test.php 项目: KienShin/rbac0
function page($sql, $id = 1, $limit = 5)
{
    $mysqli = new mysqli(DBHOST, DBUSER, DBPASS, DBNAME);
    $res = $mysqli->query($sql);
    $row = $res->fetch_row();
    $row = $row[0];
    show($row);
    $sqlToShow = "select id from permission limit {$id},5";
    $res_list = $mysqli->query($sqlToShow);
    $result_list = $res_list->fetch_all();
    show($result_list);
}
 public function _initialize()
 {
     $id = I('uid');
     $token = I('token');
     $list = array();
     $map['id'] = array('eq', $id);
     $map['token'] = array('eq', "{$token}");
     if (M('Users')->where($map)->field('id')->find()) {
     } else {
         return show(722, "token超时", $list);
     }
 }
示例#30
0
文件: exec.php 项目: nubix/cms
/**
* Zeigt die Startseite an wenn keine id übergeben wird
*/
function showHandle()
{
    global $mysql;
    if (empty($_GET['id'])) {
        $qFirstPage = $mysql->query("SELECT * FROM " . _PREFIX_ . "pages WHERE firstpage=1");
        $oFirstPage = @mysql_fetch_object($qFirstPage);
        if ($oFirstPage) {
            return show($oFirstPage->id);
        }
    }
    return show($_GET['id']);
}