function sqlSafe($data, $col = false) { $sql = getSQL(); if (!isset($data)) { return 'NULL'; } if ($col) { return "`" . $sql->real_escape_string($data) . "`"; } return "'" . $sql->real_escape_string($data) . "'"; }
<link rel="stylesheet" type="text/css" href='/styles.css'/> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> <!-- links end --> <!-- metas --> <meta name="viewport" content="width=device-width, user-scalable=no" /> <?php include '/script.php'; ?> </head> <body> <div id="err_404" class="err"> <div id="err_no"> <?php echo getSQL("error_no", "errors")[0]; ?> </div> <div id="err_message"> <?php echo getSQL("message", "errors")[0]; ?> </div> <a href="http://noge.tk" id="back_front">Back to frontpage!</a> </div> </body> </html>
function sqlSafe($data) { $sql = getSQL(); return "'" . $sql->real_escape_string($data) . "'"; }
/** * 保存一条记录 * @param object $row */ public function save($table, &$row) { $sqlA = ''; foreach ($row as $k => $v) { $sqlA .= "`{$k}` = '" . getSQL($v) . "',"; } $sqlA = substr($sqlA, 0, -1); $sql = "INSERT INTO `{$table}` SET {$sqlA}"; //file_put_contents('out.txt', $sql,FILE_APPEND); if ($this->query($sql)) { return $this->last_insert_id(); } else { return false; } }
echo strtolower(getSQL("title", "menu")[0]); ?> </div></a> <a href="https://github.com/santerinogelainen"><div id="github" class="menu_item"><?php echo strtolower(getSQL("title", "menu")[2]); ?> </div></a> <a href="http://noge.tk/photos"><div id="photos" class="menu_item"><?php echo strtolower(getSQL("title", "menu")[3]); ?> </div></a> </div> <h1> <?php echo "<span id='links'>" . getSQL("title", "menu")[1] . "</span>"; ?> </h1> <div id="content"> <?php include "instagram.php"; include "vsco.php"; include "tumblr.php"; include "twitter.php"; include "twitch.php"; include "osu.php"; include "lastfm.php"; include "facebook.php"; include "snapchat.php"; include "steam.php";
function GetParam($name) { global $params; if (!$name) { return; } if (!$params) { $params = getSQL("SELECT name, value FROM " . PARAMS_TABLE, 'name'); } return $params[$name]; }
include 'script.php'; ?> </head> <body> <img src="img/logo.png" id="logo"/> <div id="hamburger"><img src="svg/hamburger.svg" id="hamburger_svg"></div> <div id="expand"></div> <div id="menu"> <a href="http://noge.tk/information/"><div id="information" class="menu_item"><?php echo strtolower(getSQL("title", "menu")[0]); ?> </div></a> <a href="http://noge.tk/links/"><div id="links" class="menu_item"><?php echo strtolower(getSQL("title", "menu")[1]); ?> </div></a> <a href="https://github.com/santerinogelainen"><div id="github" class="menu_item"><?php echo strtolower(getSQL("title", "menu")[2]); ?> </div></a> <a href="http://noge.tk/photos"><div id="photos" class="menu_item"><?php echo strtolower(getSQL("title", "menu")[3]); ?> </div></a> </div> <script src="script.js"></script> <script src="menu.js"></script> </body> </html>
/** Core function that you should call to obtain the SQL filter */ function getSQL($filterObj) { global $mapping; if ($filterObj == null) { return "1=1"; } if (isset($filterObj->operatorId)) { return $mapping[$filterObj->operatorId]($filterObj->fieldId, $filterObj->values); } else { $leftSql = getSQL($filterObj->left); $rightSql = getSQL($filterObj->right); return "(" . $leftSql . " " . $filterObj->logicalOperator . " " . $rightSql . ")"; } }
<!-- SNAPCHAT --> <div class="block small_block" id="snapchat"> <div class="widget_header"> <div class="widget_name"><a target='_blank' href="https://www.snapchat.com/add/santerinog">SNAPCHAT</a></div> <a href="https://www.snapchat.com/add/santerinog"><img class="profile_pic" src="../img/snapchat.png"></a> </div> <a href="https://www.snapchat.com/add/santerinog"><h2><?php echo getSQL("username", "usernames")[0]; ?> </h2></a> </div>
if (getSQL("link", "usernames")[$cn] !== "nolink") { echo "</a>"; } echo "</div>"; $cn++; } ?> </div> </div> <div class="fixedImgView"> </div> <div class="whitespace" id="whitespace_PROJECTS"> <div id="PROJECTS"> </div> <h2 id="project_title"><?php echo getSQL("title", "menu")[2]; ?> </h2> <div id="soon">SOON™</div> </div> <script src="script.js"></script> </body> </html>
function iCMS_contents($vars, &$iCMS) { if (isset($vars['mid'])) { $mId = (int) $vars['mid']; $model = $iCMS->getCache('system/models.cache', $mId); $table = $model['tbn']; } elseif (isset($vars['name'])) { $model = $iCMS->getCache('system/models.table', $vars['name']); $mId = $model['id']; $table = $model['tbn']; } else { if (isset($iCMS->metadata)) { $mId = $iCMS->metadata->mid; $table = $iCMS->metadata->table; $model = $iCMS->getCache('system/models.cache', $mId); } else { echo $iCMS->language('error:model.empty'); return; } } if (empty($model)) { echo $iCMS->language('error:model.exit'); return; } //---------------------------- $whereSQL = " status='1'"; $_cache = $iCMS->getCache(array('system/forum.cache', 'system/forum.hidden')); $_cache['system/forum.hidden'] && ($whereSQL .= getSQL($_cache['system/forum.hidden'], 'fid', 'not')); $maxperpage = isset($vars['row']) ? (int) $vars['row'] : 10; $cacheTime = isset($vars['time']) ? (int) $vars['time'] : -1; isset($vars['userid']) && ($whereSQL .= " AND `userid`='{$vars['userid']}'"); isset($vars['author']) && ($whereSQL .= " AND `author`='{$vars['author']}'"); isset($vars['top']) && ($whereSQL .= " AND `top`='" . _int($vars['top']) . "'"); $vars['call'] == 'user' && ($whereSQL .= " AND `postype`='0'"); $vars['call'] == 'admin' && ($whereSQL .= " AND `postype`='1'"); $forum = $_cache['system/forum.cache']; if (isset($vars['fid!'])) { $_Nfid = getfids($vars['fid!']); $_Nfid && ($Nfids[] = $_Nfid); $vars['sub'] == 'all' && ($Nfids[] = $vars['fid!']); $ids = $Nfids && $vars['sub'] == 'all' ? implode(',', $Nfids) : $vars['fid!']; $whereSQL .= getSQL($ids, 'fid', 'not'); } if (isset($vars['fid'])) { $_fid = getfids($vars['fid']); $_fid && ($fids[] = $_fid); $vars['sub'] == 'all' && ($fids[] = $vars['fid']); $ids = $fids && $vars['sub'] == 'all' ? implode(',', $fids) : $vars['fid']; $whereSQL .= getSQL($ids, 'fid'); } isset($vars['type']) && ($whereSQL .= " AND `type` ='{$vars['type']}'"); $vars['id'] && ($whereSQL .= getSQL($vars['id'], 'id')); $vars['id!'] && ($whereSQL .= getSQL($vars['id!'], 'id', 'not')); $by = $vars['by'] == "ASC" ? "ASC" : "DESC"; switch ($vars['orderby']) { case "id": $orderSQL = " ORDER BY `id` {$by}"; break; case "hot": $orderSQL = " ORDER BY `hits` {$by}"; break; case "comment": $orderSQL = " ORDER BY `comments` {$by}"; break; case "pubdate": $orderSQL = " ORDER BY `pubdate` {$by}"; break; case "disorder": $orderSQL = " ORDER BY `orderNum` {$by}"; break; // case "rand": $orderSQL=" ORDER BY rand() $by"; break; // case "rand": $orderSQL=" ORDER BY rand() $by"; break; case "top": $orderSQL = " ORDER BY `top`,`orderNum` ASC"; break; default: $orderSQL = " ORDER BY `id` DESC"; } isset($vars['date']) && (list($iCMS->date['y'], $iCMS->date['m'], $iCMS->date['d']) = explode('-', $vars['date'])); if ($iCMS->date) { $day = empty($iCMS->date['d']) ? '01' : $iCMS->date['d']; $start = strtotime($iCMS->date['y'] . $iCMS->date['m'] . $day); $end = empty($iCMS->date['d']) ? $start + 86400 * $iCMS->date['total'] : $start + 86400; $whereSQL .= " AND `pubdate`<='{$end}' AND `pubdate`>='{$start}'"; } else { isset($vars['startdate']) && ($whereSQL .= " AND `pubdate`>='" . strtotime($vars['startdate']) . "'"); isset($vars['enddate']) && ($whereSQL .= " AND `pubdate`<='" . strtotime($vars['enddate']) . "'"); } isset($vars['where']) && ($whereSQL .= $vars['where']); if ($vars['action'] == 'search') { $whereSQL .= $iCMS->actionSQL; } elseif ($vars['action'] == 'tag') { if (empty($vars['tag'])) { return false; } if (is_array($vars['tag'])) { $_tCache = $vars['tag']; } else { $_tCache = $iCMS->getCache($iCMS->getTagKey($vars['tag'])); } if ($_tCache['id']) { $tidSQL = 'AND `tid`=\'' . $_tCache['id'] . '\''; } else { if ($_tCache) { foreach ($_tCache as $_tag) { if ($_tag) { $_tids[] = $_tag['id']; } } } if (empty($_tids)) { return false; } $tidSQL = 'AND `tid` in (' . implode(',', $_tids) . ')'; } $countSQL = 'SELECT count(#iCMS@__' . $table . '.id) FROM `#iCMS@__' . $table . '`,`#iCMS@__taglist` WHERE #iCMS@__' . $table . '.id = `indexId` ' . $tidSQL . ' AND #iCMS@__taglist.modelId=' . $mId . ' AND'; $selectSQL = 'SELECT #iCMS@__' . $table . '.* FROM `#iCMS@__' . $table . '`,`#iCMS@__taglist` WHERE #iCMS@__' . $table . '.id = `indexId` ' . $tidSQL . ' AND #iCMS@__taglist.modelId=' . $mId . ' AND'; $orderSQL = " ORDER BY #iCMS@__taglist.indexId {$by}"; $vars['indexId!'] && ($whereSQL .= getSQL($vars['indexId!'], '#iCMS@__' . $table . '.id', 'not')); } $offset = 0; if ($vars['page']) { empty($countSQL) && ($countSQL = "SELECT count(*) FROM `#iCMS@__{$table}` WHERE"); $total = iCMS_DB::getValue($countSQL . " {$whereSQL}"); // echo iCMS_DB::last_query; $pagenav = isset($vars['pagenav']) ? $vars['pagenav'] : "pagenav"; $pnstyle = isset($vars['pnstyle']) ? $vars['pnstyle'] : 0; $offset = $iCMS->multi(array('total' => $total, 'perpage' => $maxperpage, 'unit' => $iCMS->language('page:list'), 'nowindex' => $GLOBALS['page'], 'pagenav' => $pagenav, 'pnstyle' => $pnstyle)); // $GLOBALS['cpn'] && $iCMS->_vars['pagenav'].='<span><a class="page_more" href="more.php?fid='.$ids.'" target="_self">'.$iCMS->language('page:more').'</a></span>'; //$iCMS->addto($pagenav,"----------------"); } $iscache = true; if ($vars['cache'] == false || isset($vars['page'])) { $iscache = false; $rs = array(); } else { $cacheName = 'clist/' . md5($whereSQL . $orderSQL . $maxperpage); $rs = $iCMS->getCache($cacheName); } if (empty($rs)) { empty($selectSQL) && ($selectSQL = "SELECT * FROM `#iCMS@__{$table}` WHERE"); $rs = iCMS_DB::getArray($selectSQL . " {$whereSQL} {$orderSQL} LIMIT {$offset} , {$maxperpage}"); //echo iCMS_DB::$last_query; //iCMS_DB::$last_query='explain '.iCMS_DB::$last_query; //$explain=iCMS_DB::getRow(iCMS_DB::$last_query); //print_r($explain); $_count = count($rs); for ($i = 0; $i < $_count; $i++) { $F = $forum[$rs[$i]['fid']]; $rs[$i]['sort']['name'] = $F['name']; $rs[$i]['sort']['url'] = $iCMS->iurl('forum', $F)->href; $rs[$i]['sort']['link'] = "<a href='{$rs[$i]['sort']['url']}'>{$rs[$i]['sort']['name']}</a>"; $rs[$i]['url'] = $iCMS->iurl('content', array($rs[$i], $F, $model))->href; $rs[$i]['commentUrl'] = $iCMS->config['publicURL'] . "/comment.php?indexId=" . $rs[$i]['id'] . "&mId=" . $mId . "&sortId=" . $rs[$i]['fid']; $rs[$i]['link'] = "<a href='{$rs[$i]['url']}'>{$rs[$i]['title']}</a>"; if ($rs[$i]['tags'] && isset($vars['tag'])) { $tagarray = explode(',', $rs[$i]['tags']); foreach ($tagarray as $tk => $tag) { $t = $iCMS->getTag($tag); if ($t) { $rs[$i]['tag'][$tk]['name'] = $tag; $rs[$i]['tag'][$tk]['url'] = $t['url']->href; $rs[$i]['taglink'] .= '<a href="' . $rs[$i]['tag'][$tk]['url'] . '" class="tag" target="_self">' . $tag . '</a> '; } } } if ($fArray = explode(',', $model['field'])) { foreach ($fArray as $k => $field) { if (!model::isDefField($field)) { $FV = model::FieldValue($mId, $field, $rs[$i][$field]); $FV !== Null && ($rs[$i][$field] = $FV); } } } } $iscache && $iCMS->SetCache($cacheName, $rs, $cacheTime); } // var_dump($rs); return $rs; }
function camm_convert_json_to_sql_string() { /* ================= input validation ================= */ /* ==================================================== */ if (is_error_message()) { echo "Validation error."; exit; } $raw_json_where = (string) (isset($_POST['filter']) ? $_POST['filter'] : $_POST['filter']); $sql_where = getSQL(camm_JDecode(stripslashes($raw_json_where))); echo camm_JEncode(array('success' => true, 'sql_filter' => $sql_where)); }
function iCMS_list($vars, &$iCMS) { if ($vars['loop'] == "rel" && empty($vars['id'])) { return false; } $whereSQL = " status='1'"; $_cache = $iCMS->getCache(array('system/forum.cache', 'system/forum.hidden')); $_cache['system/forum.hidden'] && ($whereSQL .= getSQL($_cache['system/forum.hidden'], 'fid', 'not')); $maxperpage = isset($vars['row']) ? (int) $vars['row'] : 10; $cacheTime = isset($vars['time']) ? (int) $vars['time'] : -1; isset($vars['userid']) && ($whereSQL .= " AND `userid`='{$vars['userid']}'"); isset($vars['author']) && ($whereSQL .= " AND `author`='{$vars['author']}'"); isset($vars['top']) && ($whereSQL .= " AND `top`='" . _int($vars['top']) . "'"); $vars['call'] == 'user' && ($whereSQL .= " AND `postype`='0'"); $vars['call'] == 'admin' && ($whereSQL .= " AND `postype`='1'"); $forum = $_cache['system/forum.cache']; if (isset($vars['fid!'])) { $_Nfid = getfids($vars['fid!']); $_Nfid && ($Nfids[] = $_Nfid); $vars['sub'] == 'all' && ($Nfids[] = $vars['fid!']); $ids = $Nfids && $vars['sub'] == 'all' ? implode(',', $Nfids) : $vars['fid!']; $whereSQL .= getSQL($ids, 'fid', 'not'); } if (isset($vars['fid'])) { $_fid = getfids($vars['fid']); $_fid && ($fids[] = $_fid); $vars['sub'] == 'all' && ($fids[] = $vars['fid']); $ids = $fids && $vars['sub'] == 'all' ? implode(',', $fids) : $vars['fid']; $whereSQL .= getSQL($ids, 'fid'); } isset($vars['type']) && ($whereSQL .= " AND `type` ='{$vars['type']}'"); $vars['id'] && ($whereSQL .= getSQL($vars['id'], 'id')); $vars['id!'] && ($whereSQL .= getSQL($vars['id!'], 'id', 'not')); $by = $vars['by'] == "ASC" ? "ASC" : "DESC"; if ($vars['keywords']) { if (strpos($vars['keywords'], ',') === false) { $vars['keywords'] = str_replace(array('%', '_'), array('\\%', '\\_'), $vars['keywords']); $whereSQL .= " AND CONCAT(title,keywords,description) like '%" . addslashes($vars['keywords']) . "%'"; } else { $kw = explode(',', $vars['keywords']); foreach ($kw as $v) { $keywords .= addslashes($v) . "|"; } $keywords = substr($keywords, 0, -1); $whereSQL .= " And CONCAT(title,keywords,description) REGEXP '{$keywords}' "; } } isset($vars['pic']) && ($whereSQL .= " AND `isPic`='1'"); switch ($vars['orderby']) { case "id": $orderSQL = " ORDER BY `id` {$by}"; break; case "hot": $orderSQL = " ORDER BY `hits` {$by}"; break; case "comment": $orderSQL = " ORDER BY `comments` {$by}"; break; case "pubdate": $orderSQL = " ORDER BY `pubdate` {$by}"; break; case "disorder": $orderSQL = " ORDER BY `orderNum` {$by}"; break; // case "rand": $orderSQL=" ORDER BY rand() $by"; break; // case "rand": $orderSQL=" ORDER BY rand() $by"; break; case "top": $orderSQL = " ORDER BY `top`,`orderNum` ASC"; break; default: $orderSQL = " ORDER BY `id` DESC"; } isset($vars['date']) && (list($iCMS->date['y'], $iCMS->date['m'], $iCMS->date['d']) = explode('-', $vars['date'])); if ($iCMS->date) { $day = empty($iCMS->date['d']) ? '01' : $iCMS->date['d']; $start = strtotime($iCMS->date['y'] . $iCMS->date['m'] . $day); $end = empty($iCMS->date['d']) ? $start + 86400 * $iCMS->date['total'] : $start + 86400; $whereSQL .= " AND `pubdate`<='{$end}' AND `pubdate`>='{$start}'"; } else { isset($vars['startdate']) && ($whereSQL .= " AND `pubdate`>='" . strtotime($vars['startdate']) . "'"); isset($vars['enddate']) && ($whereSQL .= " AND `pubdate`<='" . strtotime($vars['enddate']) . "'"); } isset($vars['where']) && ($whereSQL .= $vars['where']); if ($vars['action'] == 'search') { $whereSQL .= $iCMS->actionSQL; // }elseif($vars['action']=='vlink'){ // $this->countSQL = 'SELECT count(#iCMS@__article.id) FROM `#iCMS@__article`,`#iCMS@__vlink` WHERE #iCMS@__article.id = `indexId` AND `fid`=\''.$vars['fid'].'\' AND'; // $this->selectSQL= 'SELECT #iCMS@__article.* FROM `#iCMS@__article`,`#iCMS@__vlink` WHERE #iCMS@__article.id = `indexId` AND `fid`=\''.$vars['fid'].'\' AND'; // $orderSQL = " ORDER BY #iCMS@__vlink.indexId $by"; } elseif ($vars['action'] == 'tag') { if (empty($vars['tag'])) { return false; } if (is_array($vars['tag'])) { $_tCache = $vars['tag']; } else { $_tCache = $iCMS->getCache($iCMS->getTagKey($vars['tag'])); } if ($_tCache['id']) { $tidSQL = 'AND `tid`=\'' . $_tCache['id'] . '\''; } else { if ($_tCache) { foreach ($_tCache as $_tag) { if ($_tag) { $_tids[] = $_tag['id']; } } } if (empty($_tids)) { return false; } $tidSQL = 'AND `tid` in (' . implode(',', $_tids) . ')'; } $countSQL = 'SELECT count(#iCMS@__article.id) FROM `#iCMS@__article`,`#iCMS@__taglist` WHERE #iCMS@__article.id = `indexId` ' . $tidSQL . ' AND'; $selectSQL = 'SELECT #iCMS@__article.* FROM `#iCMS@__article`,`#iCMS@__taglist` WHERE #iCMS@__article.id = `indexId` ' . $tidSQL . ' AND'; $orderSQL = " ORDER BY #iCMS@__taglist.indexId {$by}"; $vars['indexId!'] && ($whereSQL .= getSQL($vars['indexId!'], '#iCMS@__article.id', 'not')); } $offset = 0; if ($vars['page']) { empty($countSQL) && ($countSQL = "SELECT count(*) FROM `#iCMS@__article` WHERE"); $total = iCMS_DB::getValue($countSQL . " {$whereSQL}"); // echo iCMS_DB::last_query; $pagenav = isset($vars['pagenav']) ? $vars['pagenav'] : "pagenav"; $pnstyle = isset($vars['pnstyle']) ? $vars['pnstyle'] : 0; $offset = $iCMS->multi(array('total' => $total, 'perpage' => $maxperpage, 'unit' => $iCMS->language('page:list'), 'url' => $iCMS->url, 'nowindex' => $GLOBALS['page'], 'pagenav' => $pagenav, 'pnstyle' => $pnstyle)); // $GLOBALS['cpn'] && $iCMS->_vars['pagenav'].='<span><a class="page_more" href="more.php?fid='.$ids.'" target="_self">'.$iCMS->language('page:more').'</a></span>'; //$iCMS->addto($pagenav,"----------------"); } $iscache = true; if ($vars['cache'] == false || isset($vars['page'])) { $iscache = false; $rs = ''; } else { $cacheName = 'list/' . md5($whereSQL . $orderSQL . $maxperpage); $rs = $iCMS->getCache($cacheName); } if (empty($rs)) { empty($selectSQL) && ($selectSQL = "SELECT id,fid,title,stitle,clink,url,source,author,editor,userid,pic,keywords,tags,description,related,pubdate,hits,good,bad,comments,top FROM `#iCMS@__article` WHERE"); $rs = iCMS_DB::getArray($selectSQL . " {$whereSQL} {$orderSQL} LIMIT {$offset} , {$maxperpage}"); //echo iCMS_DB::$last_query; //iCMS_DB::$last_query='explain '.iCMS_DB::$last_query; //$explain=iCMS_DB::getRow(iCMS_DB::$last_query); //var_dump($explain); $_count = count($rs); for ($i = 0; $i < $_count; $i++) { $rs[$i]['pic'] && ($rs[$i]['pic'] = uploadpath($rs[$i]['pic'], '+http')); $F = $forum[$rs[$i]['fid']]; $rs[$i]['sort']['name'] = $F['name']; $rs[$i]['sort']['url'] = $iCMS->iurl('forum', $F)->href; $rs[$i]['sort']['link'] = "<a href='{$rs[$i]['sort']['url']}'>{$rs[$i]['sort']['name']}</a>"; $rs[$i]['url'] = $iCMS->iurl('show', array($rs[$i], $F))->href; $rs[$i]['link'] = "<a href='{$rs[$i]['url']}'>{$rs[$i]['title']}</a>"; if ($rs[$i]['tags'] && isset($vars['tag'])) { $tagarray = explode(',', $rs[$i]['tags']); foreach ($tagarray as $tk => $tag) { $t = $iCMS->getTag($tag); if ($t) { $rs[$i]['tag'][$tk]['name'] = $tag; $rs[$i]['tag'][$tk]['url'] = $t['url']; $rs[$i]['taglink'] .= '<a href="' . $rs[$i]['tag'][$tk]['url'] . '" class="tag" target="_self">' . $tag . '</a> '; } } } } $iscache && $iCMS->SetCache($cacheName, $rs, $cacheTime); } return $rs; }
echo strtolower(getSQL("title", "menu")[0]); ?> </div></a> <a href="http://noge.tk/links/"><div id="links" class="menu_item"><?php echo strtolower(getSQL("title", "menu")[1]); ?> </div></a> <a href="https://github.com/santerinogelainen"><div id="github" class="menu_item"><?php echo strtolower(getSQL("title", "menu")[2]); ?> </div></a> </div> <h1> <?php echo "<span class='pictures'>" . substr(getSQL("title", "menu")[3], 0, 3) . "</span><span class='pictures'>" . substr(getSQL("title", "menu")[3], 3, -1) . "</span><span class='pictures'>" . substr(getSQL("title", "menu")[3], -1) . "</span>"; ?> </h1> <div id="content"> <?php include 'colors.php'; include 'instagram.php'; include 'vsco.php'; include 'tumblr.php'; include 'others.php'; ?> </div> <script src="script.js"></script> <script src="../menu.js"></script>
$mysqlhost = "localhost"; $mysql = new mysqli($mysqlhost, $mysqluser, $mysqlpass, $mysqlname); if ($mysql->connect_errno) { echo "database connection failure <!-- " . $mysql->connect_error . " -->"; die; } if (isset($_POST['data'])) { $data = json_decode($_POST['data'], true); if (isset($data['platform']) && $data['platform'] != "all") { $sql = getSQL($data['platform']); } else { $sql = getSQL(); } } if (!isset($sql)) { $sql = getSQL(); } function getSQL($platform = null) { global $mysql; if ($platform != null) { return "SELECT * FROM `apps` WHERE `platform` = '" . $mysql->real_escape_string($platform) . "'"; } else { return "SELECT * FROM `apps`"; } } $result = $mysql->query($sql); $json = array(); $i = 0; while ($r = $result->fetch_assoc()) { $json[$i]["name"] = $r['name'];
<?php $count = count(getSQL("title", "menu")) - 1; foreach (getSQL("title", "menu") as $value) { global $count; echo "<a href='/#" . getSQL("title", "menu")[$count] . "'><span class='link'>" . getSQL("title", "menu")[$count] . "</span></a>"; $count--; } ?> <svg id="hamburger" width="10%" height="60%" viewBox="0 0 600 600"> <rect x="77.5" y="95.5" width="445" height="109"/> <rect x="77.5" y="395.5" width="445" height="109"/> <rect x="77.5" y="245.5" width="445" height="109"/> </svg> <a href="/" id="logo_link"> <h1 class="noge"><?php echo getSQL("text", "text")[2]; ?> </h1> </a> </header> <div id="soon"><span>S</span><span>o</span><span>o</span><span>n</span><span>™</span></div> <script> $(document).ready(function(){ /* Menu hover background color changes */ $(".link").mouseover(function () { $(this).css("background-color", "rgba(0, 0, 0, 0.2)"); }); $(".link").mouseleave(function () { $(this).css("background-color", "inherit"); });
function iCMS_forums($vars, &$iCMS) { if (empty($vars['loop'])) { $id = (int) $vars['fid']; $_cache = $iCMS->getCache(array('system/forum.cache', 'system/forum.rootid')); $rs = $_cache['system/forum.cache'][$id]; empty($rs) && $iCMS->error('error:page'); if ($rs['url']) { return $iCMS->go($rs['url']); } $iurl = $iCMS->iurl('forum', $rs); $rs['url'] = $iurl->href; $rs['link'] = "<a href='{$rs['url']}'>{$rs['name']}</a>"; $rs['nav'] = $iCMS->shownav($rs['fid']); $rs['subid'] = $_cache['system/forum.rootid'][$id]; $rs['subids'] = implode(',', (array) $rs['subid']); return $rs; } $row = isset($vars['row']) ? (int) $vars['row'] : "100"; $cacheTime = isset($vars['time']) ? (int) $vars['time'] : "-1"; $status = isset($vars['status']) ? (int) $vars['status'] : "1"; $attr = isset($vars['attr']) ? (int) $vars['attr'] : "1"; $whereSQL = " WHERE `status`='{$status}' AND `attr`='{$attr}'"; isset($vars['mid']) && ($whereSQL .= " AND `mid` = '{$vars['mid']}'"); isset($vars['mode']) && ($whereSQL .= " AND `mode` = '{$vars['mode']}'"); isset($vars['fid']) && !isset($vars['type']) && ($whereSQL .= getSQL($vars['fid'], 'fid')); isset($vars['fid!']) && ($whereSQL .= getSQL($vars['fid!'], 'fid', 'not')); switch ($vars['type']) { case "top": $vars['fid'] && ($whereSQL .= getSQL($vars['fid'], 'fid')); $whereSQL .= " AND rootid='0'"; break; case "subtop": $vars['fid'] && ($whereSQL .= getSQL($vars['fid'], 'fid')); break; case "sub": $whereSQL .= getSQL(getfids($vars['fid']), 'fid'); break; case "subone": $whereSQL .= getSQL(getfids($vars['fid'], false), 'fid'); break; // case "allsub": // $whereSQL.= getSQL(getfids(),'fid'); // break; // case "allsub": // $whereSQL.= getSQL(getfids(),'fid'); // break; case "self": $parent = $iCMS->getCache('system/forum.parent', $vars['fid']); $whereSQL .= " AND `rootid`='{$parent}'"; //$whereSQL.=getSQL(getfids($parent,false),'rootid'); break; } $iscache = true; if ($vars['cache'] == false) { $iscache = false; $rs = ''; } else { $cacheName = 'forum/' . md5($whereSQL); $rs = $iCMS->getCache($cacheName); } if (empty($rs)) { $rs = iCMS_DB::getArray("SELECT * FROM `#iCMS@__forum`{$whereSQL} ORDER BY `orderNum`,`fid` ASC LIMIT {$row}"); //echo iCMS_DB::$last_query; //iCMS_DB::$last_query='explain '.iCMS_DB::$last_query; //$explain=iCMS_DB::getRow(iCMS_DB::$last_query); //var_dump($explain); $_count = count($rs); for ($i = 0; $i < $_count; $i++) { $rs[$i]['url'] = $iCMS->iurl('forum', $rs[$i])->href; $rs[$i]['link'] = "<a href='{$rs[$i]['url']}'>{$rs[$i]['name']}</a>"; $rs[$i]['mid'] = $rs[$i]['modelid']; if ($rs[$i]['metadata']) { $mdArray = array(); $rs[$i]['metadata'] = unserialize($rs[$i]['metadata']); foreach ($rs[$i]['metadata'] as $mdval) { $mdArray[$mdval['key']] = $mdval['value']; } $rs[$i]['metadata'] = $mdArray; } unset($rs[$i]['contentAttr']); } $iscache && $iCMS->setCache($cacheName, $rs, $cacheTime); } return $rs; }
$c++; } ?> </table> </div> <div id="website_c"> <table id="website_table"> <tr> <th colspan="2" id="website_table_header"> <?php echo getSQL("answer", "about_website", "id=0", true); ?> </th> </tr> <?php $c = 0; foreach (getSQL("id", "about_website", "id>0") as &$value) { echo "<tr class='website_row'>\n\t\t\t\t\t\t\t\t<td class='website_question'>" . getSQL("what", "about_website", "id>0")[$c] . "</td>\n\t\t\t\t\t\t\t\t<td class='website_answer'>" . getSQL("answer", "about_website", "id>0")[$c] . "</td>\n\t\t\t\t\t\t\t\t</tr>"; $c++; } ?> </table> </div> </div> </div> <script src="script.js"></script> <script src="../menu.js"></script> </body> </html>