function popup() { $button = button("{add_mailman}", "AddMailManList()"); $list = GetList(); $html = "\n\t<div style='width:100%;text-align:right;padding:5px'>{$button}</div>\n\t<div style='width:99%;height:120px;overflow:auto' id='mailman_lists_div'>\n\t{$list}\n\t</div>\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function CheckUpdateUser() { $UserValues = ['Username', 'Password', 'Name', 'Email', 'Phone', 'Role']; if (CheckList($UserValues)) { $usr = GetList($UserValues); UpdateUser($usr[0], $usr[1], $usr[2], $usr[3], $usr[4], $usr[5]); header('Location: Admin.php'); } }
function CheckLogin() { $loginValues = ['Username', 'Password']; if (!CheckList($loginValues)) { return; } $login = GetList($loginValues); return VerifyLogin($login[0], $login[1]); }
function CreateAccountValues() { $AccountValues = ['Username', 'Password', 'Name', 'Phone', 'Email']; if (!CheckList($AccountValues)) { return false; } $account_values = GetList($AccountValues); CreateAccount($account_values[0], $account_values[1], $account_values[2], $account_values[3], $account_values[4], $account_values[5]); return true; }
function SearchHouses() { global $conn; $searchvals = ['Search', 'Bedrooms', 'Toilets', 'Garages', 'MaxPrice']; if (CheckList($searchvals)) { $vals = GetList($searchvals); $query = $conn->prepare("Select * FROM Houses Where Address LIKE CONCAT('%',:address, '%') AND Beds >= :beds AND Toilets >= :toilets AND Garages >= :garages AND Price <= :price"); $query->bindValue(':address', $vals[0]); $query->bindValue(':beds', $vals[1]); $query->bindValue(':toilets', $vals[2]); $query->bindValue(':garages', $vals[3]); $query->bindValue(':price', $vals[4]); $query->execute(); $res = $query->fetchAll(); $houses = array(); foreach ($res as $house) { $houses[] = new House($house); } return $houses; } return NULL; }
foreach ($parent_category_list as $catID) { if (in_array($catID, $HomeAwayGameCategoryIDList)) { $home_only = 1; #$home_only = 2; $disp_home_away = 1; } } } else { $disp_home_away = 1; } } if ($eventID == 599 || $eventID == 592 || $eventID == 339 || $eventID == 755) { $smarty->assign("EventName", $productions[0]['eventname'] . ' Playoffs'); $home_only = 0; } $productions = GetList($eventID, $eventName, $home_only, $categoryID, 70); $smarty->assign("Breadcrumbs", $breadcrumb_str); $smarty->assign("EventName", $eventName); $smarty->assign("EventIntroText", $eventIntroText); if (strlen($eventText) > 2) { $smarty->assign("EventText", $eventText); } if ($eventImagePathname != "") { $smarty->assign("EventImagePathname", $eventImagePathname); } else { $smarty->assign("EventImagePathname", ""); } if (is_array($productions)) { if ($eventID == 1124) { $smarty->assign("EventName", $productions[0]['eventname'] . ' 42'); $disp_home_away = 0;
if (empty($aid)) { exit('没指定评论文档的ID,不能进行操作!'); } include_once DEDEINC . '/memberlogin.class.php'; $cfg_ml = new MemberLogin(); if (empty($dopost)) { $dopost = ''; } $page = empty($page) ? 1 : intval($page); $pagesize = 10; /*---------------------- 获得指定页的评论内容 function getlist(){ } ----------------------*/ if ($dopost == 'getlist') { $totalcount = GetList($page); GetPageList($pagesize, $totalcount); exit; } else { if ($dopost == 'send') { require_once DEDEINC . '/charset.func.php'; //检查验证码 if ($cfg_feedback_ck == 'Y') { $svali = strtolower(trim(GetCkVdValue())); if (strtolower($validate) != $svali || $svali == '') { ResetVdValue(); echo '<font color="red">验证码错误,请点击验证码图片更新验证码!</font>'; exit; } } $arcRow = GetOneArchive($aid);
function GetList($dir) { global $dirdata, $j, $nowpath; !$j && ($j = 1); if ($dh = opendir($dir)) { while ($file = readdir($dh)) { $f = str_replace('//', '/', $dir . '/' . $file); if ($file != '.' && $file != '..' && is_dir($f)) { if (is_writable($f)) { $dirdata[$j]['filename'] = str_replace($nowpath, '', $f); $dirdata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f)); $dirdata[$j]['dirchmod'] = getChmod($f); $dirdata[$j]['dirperm'] = getPerms($f); $dirdata[$j]['dirlink'] = ue($dir); $dirdata[$j]['server_link'] = $f; $dirdata[$j]['client_link'] = ue($f); $j++; } GetList($f); } } closedir($dh); clearstatcache(); return $dirdata; } else { return array(); } }
if (CheckList($UserValues)) { $booking = GetList($UserValues); $enq = $booking[0]; DeleteEnquiry($enq); header("Location: index.php"); } } //Cancel Application (user) if ($Action == "CancelApp") { $UserValues = ['AppID']; if (CheckList($UserValues)) { $booking = GetList($UserValues); $app = $booking[0]; DeleteApplication($app); header("Location: Profile.php"); } } //Become property manager (Staff) if ($Action == "ManageProperty") { $UserValues = ['HouseID']; if (CheckList($UserValues)) { $booking = GetList($UserValues); $houseid = $booking[0]; if (CheckManager(Username(), $houseid)) { UnmanageProperty(Username(), $houseid); } else { ManageProperty(Username(), $houseid); } header("Location: HouseDisplay.php?HouseID={$houseid}"); } }
<?php session_start(); include_once "Sql.php"; include_once "Accounts.php"; include_once "HousesSQL.php"; $bookingValues = ['DateString', 'HouseID']; if (!CheckList($bookingValues)) { return; } if (!empty($_SESSION['Username'])) { echo "did something"; $Values = GetList($bookingValues); BookOpenHouse($Values[0], $_SESSION['Username'], $Values[1]); } function ShowBookings($Username) { $bookings = GetBookings($Username); echo "<div class='HouseList'>"; foreach ($bookings as $booking) { $date = $booking["Time"]; echo "<h1> {$date} </h1>"; PrintHouseByID($booking["HouseID"]); } echo "</div>"; } function GetBookings($Username) { $select = "Select * from Bookings Where UserID = '{$Username}'"; return GetResult($select); }
/** * @param $name * @return array|int|mixed|null|string */ public function __get($name) { global $zbp; switch ($name) { case 'Category': return $zbp->GetCategoryByID($this->CateID); break; case 'Author': return $zbp->GetMemberByID($this->AuthorID); break; case 'StatusName': return $zbp->lang['post_status_name'][$this->Status]; break; case 'Url': foreach ($GLOBALS['hooks']['Filter_Plugin_Post_Url'] as $fpname => &$fpsignal) { $fpsignal = PLUGIN_EXITSIGNAL_NONE; $fpreturn = $fpname($this); if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) { return $fpreturn; } } $u = new UrlRule($zbp->GetPostType_UrlRule($this->Type)); $u->Rules['{%id%}'] = $this->ID; if ($this->Alias) { $u->Rules['{%alias%}'] = $this->Alias; } else { if ($zbp->option['ZC_POST_ALIAS_USE_ID_NOT_TITLE'] == false) { $u->Rules['{%alias%}'] = rawurlencode($this->Title); } else { $u->Rules['{%alias%}'] = $this->ID; } } $u->Rules['{%year%}'] = $this->Time('Y'); $u->Rules['{%month%}'] = $this->Time('m'); $u->Rules['{%day%}'] = $this->Time('d'); if ($this->Category->Alias) { $u->Rules['{%category%}'] = $this->Category->Alias; } else { $u->Rules['{%category%}'] = rawurlencode($this->Category->Name); } if ($this->Author->Alias) { $u->Rules['{%author%}'] = $this->Author->Alias; } else { $u->Rules['{%author%}'] = rawurlencode($this->Author->Name); } return $u->Make(); break; case 'Tags': return $zbp->LoadTagsByIDString($this->Tag); break; case 'TagsCount': return substr_count($this->Tag, '{'); break; case 'TagsName': return $this->TagsToNameString(); case 'Template': $value = $this->data[$name]; if ($value == '') { $value = GetValueInArray($this->Category->GetData(), 'LogTemplate'); if ($value == '') { $value = $zbp->GetPostType_Template($this->Type); } } return $value; case 'CommentPostUrl': foreach ($GLOBALS['hooks']['Filter_Plugin_Post_CommentPostUrl'] as $fpname => &$fpsignal) { $fpreturn = $fpname($this); if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) { $fpsignal = PLUGIN_EXITSIGNAL_NONE; return $fpreturn; } } $key = '&key=' . $zbp->GetCmtKey($this->ID); return $zbp->host . 'zb_system/cmd.php?act=cmt&postid=' . $this->ID . $key; break; case 'ValidCodeUrl': return $zbp->validcodeurl . '?id=cmt'; break; case 'Prev': if ($this->_prev !== '') { return $this->_prev; } foreach ($GLOBALS['hooks']['Filter_Plugin_Post_Prev'] as $fpname => &$fpsignal) { $this->_prev = $fpname($this); if ($this->_prev !== '') { return $this->_prev; } } $articles = $zbp->GetPostList(array('*'), array(array('=', 'log_Type', 0), array('=', 'log_Status', 0), array('<', 'log_PostTime', $this->PostTime)), array('log_PostTime' => 'DESC'), array(1), null); if (count($articles) == 1) { $this->_prev = $articles[0]; } else { $this->_prev = null; } return $this->_prev; break; case 'Next': if ($this->_next !== '') { return $this->_next; } foreach ($GLOBALS['hooks']['Filter_Plugin_Post_Next'] as $fpname => &$fpsignal) { $this->_prev = $fpname($this); if ($this->_prev !== '') { return $this->_prev; } } $articles = $zbp->GetPostList(array('*'), array(array('=', 'log_Type', 0), array('=', 'log_Status', 0), array('>', 'log_PostTime', $this->PostTime)), array('log_PostTime' => 'ASC'), array(1), null); if (count($articles) == 1) { $this->_next = $articles[0]; } else { $this->_next = null; } return $this->_next; break; case 'RelatedList': foreach ($GLOBALS['hooks']['Filter_Plugin_Post_RelatedList'] as $fpname => &$fpsignal) { $fpreturn = $fpname($this); if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) { $fpsignal = PLUGIN_EXITSIGNAL_NONE; return $fpreturn; } } return GetList($zbp->option['ZC_RELATEDLIST_COUNT'], null, null, null, null, null, array('is_related' => $this->ID)); case 'TopType': $toptype = $this->Metas->toptype; if ($this->IsTop == true && $toptype == null) { $toptype = 'index'; } return $toptype; case 'TypeName': return $zbp->GetPostType_Name($this->Type); default: return parent::__get($name); break; } }
$quest_detail_id = $_REQUEST['quest_detail_id']; $add_id = $_REQUEST['add_id']; $name = $_REQUEST['name']; $note = $_REQUEST['note']; $answer = $_REQUEST['answer']; $quest_type_id = $_REQUEST['quest_type_id']; $quest_id1 = $_REQUEST['quest_id1']; $cat = $_REQUEST['cat']; $le_cat = $_REQUEST['le_cat']; switch ($action) { case 'get_add_page': $page = GetPage(GetList($add_id)); $data = array('page' => $page); break; case 'get_edit_page': $page = GetPage(GetList($quest_id, $quest_detail_id)); $data = array('page' => $page); break; case 'get_list': $count = $_REQUEST['count']; $hidden = $_REQUEST['hidden']; $rResult = mysql_query("SELECT \t`scenario`.`id`,\r\n \t\t\t\t`scenario`.`name`,\r\n \t\t\t\t`cat`.`name`,\r\n \t\t\t\t`le_cat`.`name`\r\n FROM \t`scenario`\r\n JOIN `scenario_category` AS `cat` ON `scenario`.`scenario_cat_id` = `cat`.`id`\r\n JOIN `scenario_category` AS `le_cat` ON `scenario`.`scenario_le_cat_id` = `le_cat`.`id`\r\n WHERE \t`scenario`.`actived` = 1"); $data = array("aaData" => array()); while ($aRow = mysql_fetch_array($rResult)) { $row = array(); for ($i = 0; $i < $count; $i++) { /* General output */ $row[] = $aRow[$i]; if ($i == $count - 1) { $row[] = '<input type="checkbox" name="check_' . $aRow[$hidden] . '" class="check" value="' . $aRow[$hidden] . '" />'; }
} //删除留言 if ($dopost == 'del') { if (!empty($aid)) { $aid = intval($aid); $dsql->ExecuteNoneQuery("Delete FROM `#@__member_guestbook` WHERE aid='{$aid}' And mid='" . $cfg_ml->M_ID . "'; "); } else { if (!empty($ids)) { $ids = preg_replace("#[^0-9,]#", '', $ids); if ($ids != '') { $dsql->ExecuteNoneQuery("Delete FROM `#@__member_guestbook` WHERE aid in({$ids}) And mid='" . $cfg_ml->M_ID . "'; "); } } } AjaxHead(); GetList($dsql, $pageno, $pagesize); exit; } //第一次进入这个页面 if ($dopost == '') { $row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__member_guestbook` WHERE mid='" . $cfg_ml->M_ID . "'; "); $totalRow = $row['dd']; include dirname(__FILE__) . "/templets/guestbook_admin.htm"; } /** * 获得特定的关键字列表 * * @access public * @param object $dsql 数据库操作类 * @param int $pageno 页面数 * @param int $pagesize 页面尺寸
function GetList($aid, $page = 1, $re = false) { global $gDB, $pagesize, $n, $x, $G; $pagesize = 10; $totalcount = $gDB->getCount(' select count(*) as count from cmt where aid = ' . $aid . ' and status = 1 '); $lou = empty($row['dd']) ? 0 : $totalcount; $startNum = $pagesize * ($page - 1); if ($startNum > $totalcount) { //echo "参数错误!"; //return $totalcount; if ($page == 1) { return ''; } return; } $aList = $gDB->select(' select * from cmt where aid = ' . $aid . ' and status = 1 order by ctime desc limit ' . $startNum . ', ' . $pagesize); $sStr = ''; foreach ($aList as $n => $a) { $a['cont'] = preg_replace('/\\[em(\\d{2})\\]/i', '<img src="/i/e/e1$1.gif" />', $a['cont']); $a['cont'] = preg_replace('/\\[em(\\d+)\\]/i', '<img src="/i/e/e$1.gif" />', $a['cont']); $n = $lou--; $curpage = empty($page) ? 1 : intval($page); $x = $n - ($curpage - 1) * $pagesize; $sStr .= '<p class="ps"><i' . ($a['good'] > 0 ? ' class="g"' : '') . '>' . date('m-d H:i', $a['ctime']) . '</i>' . (abs($x) + 1) . ' 楼 <em>' . (preg_match('/360/', $a['name']) || empty($a['name']) ? '游客' : $a['name']) . '</em><s>' . $a['cont'] . '</s></p>'; } $sStr .= GetPageList($page, $pagesize, $totalcount); return $sStr; if (!file_exists(DROOT . $G['xyx_cmt'])) { mkdir(DROOT . $G['xyx_cmt'], '0777'); } file_put_contents(DROOT . $G['xyx_cmt'] . $aid . '_' . $page . '.htm', $sStr); if (!file_exists(DROOT . $G['xyx_cmt'] . $aid . '_' . $page . '.htm')) { echo DROOT . $G['xyx_cmt'] . $aid . '_' . $page . '.htm' . ' - nofile<br />'; } if ($page == 1 && $re) { return $sStr; } $allpage = ceil($totalcount / $pagesize); if ($page < $allpage) { $page++; GetList($aid, $page); } }
<?php session_start(); include_once "Accounts.php"; include "SiteBanner.php"; echo "<div class='LoginBox'>"; if (CheckLogin()) { echo "Successfully Logged In"; $loginValues = ['Username', 'Password']; $login = GetList($loginValues); $User = GetUser($login[0]); $_SESSION['Username'] = $login[0]; $_SESSION['Role'] = $User['Role']; header('Location: Loading.php?Action=Login'); } else { if (!empty($_GET['Username'])) { echo '<h1>Invalid Login</h1>'; } } ?> <h1>Welcome, Please Login</h1> <form action="Login.php" method="get"> <div class="InputLine"><label>Username</label> <input name="Username" type="text"></input></div> <div class="InputLine"><label>Password</label> <input name="Password" type="password"></input></div> <button type="submit">Login</button> </form> </div> </Body> </HTML>
} // VERSION // Get required version $url = "http://api.steampowered.com/ISteamApps/UpToDateCheck/v0001?appid={$appid}&version=0"; $raw = json_decode(file_get_contents($url), true); if (isset($raw['response']['required_version'])) { $required_version = $raw['response']['required_version']; $version_schema = "{$paths['versions']}/{$required_version}/schema.json"; // Save schema if not present if (!file_exists($version_schema)) { $schema = file_get_contents("http://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v2/?key={$apikey}&appid={$appid}"); file_put_contents($version_schema, $schema); } } // SERVER LIST $list = GetList(); // MAPS function AddMap(&$maps, $map) { $map = str_replace('\\', '/', $map); $bn = strtolower(basename($map)); if (!isset($maps[$bn])) { $maps[$bn] = $map; ksort($maps); } } if (file_exists($maps_file)) { $maps = json_decode(file_get_contents($maps_file), TRUE); } else { $maps = array(); $files = glob("{$datapath}/maps/parsed/*.json");
$dom->load($html); function GetList($dom) { foreach ($dom->find('tr.product-row') as $row) { $tds = $row->find('td'); $pattern = '/[A-Z]+[0-9]+[A-Z]+([-][0-9]+[A-Z]+)?/'; $input = $tds[1]->plaintext; preg_match($pattern, $input, $matches); $uri = $tds[1]->find('a'); #print_r($uri); $record = array('Name' => $matches[0], 'URI' => 'http://ark.intel.com' . $uri[0]->href); $output[] = $record; } return $output; } $motherboards = GetList($dom); //print_r($motherboards); function ProductInfo($motherboards) { foreach ($motherboards as $mobo) { $html = scraperWiki::scrape($mobo['URI']); $dom = new simple_html_dom(); $dom->load($html); $specs = $dom->find('div#specifications', 0); $details = array(); $details['Name'] = $mobo['Name']; foreach ($specs->find('tbody tr') as $row) { $tds = $row->find('td'); if (count($tds) == 2) { $details[$tds[0]->plaintext] = $tds[1]->plaintext; }