function ModSmarty($mod, $code) { $this->config(); $id = GetID('id'); $this->ID = $id; $this->code = $code; $this->mod = $mod; $this->assign('ID', $this->ID); $this->assign('mod', $this->mod); $this->assign('code', $this->code); $member = member($this->ID); $this->assign('member', $member); $this->Execute(); }
$sprink = new Sprinkles(); # TBD: this is expensive; cheapen! $active_username = $sprink->current_username(); if (!$active_username) { redirect($sprink->authorize_url('admin.php', false)); exit(0); } $existing_admin_users = $sprink->get_users(); if (!$sprink->user_is_admin()) { redirect('error.php'); exit(0); } sort($existing_admin_users); $admin_users_str = request_param('admin_users_str'); $admin_users = preg_split('/,\\s*|\\s+/', $admin_users_str); if (!member($active_username, $admin_users)) { array_push($bad_fields, 'admin_users_str'); } else { $admin_users = array_filter($admin_users); $existing_admin_usernames = array(); foreach ($existing_admin_users as $u) { array_push($existing_admin_usernames, $u['username']); } $new_admins = array_diff($admin_users, $existing_admin_usernames); } # TBD: Validate site links? if (!$bad_fields) { ## Save the settings # Save the site links. // $urls = request_param('link_url'); // $texts = request_param('link_text');
ResetVdValue(); ShowMsg("对不起,验证码输入错误!", "-1"); exit; } //验证邮箱,用户名 if (empty($mail) && empty($userid)) { showmsg('对不起,请输入用户名或邮箱', '-1'); exit; } elseif (!ereg("(.*)@(.*)\\.(.*)", $mail)) { showmsg('对不起,请输入正确的邮箱格式', '-1'); exit; } elseif (CheckUserID($userid, '', false) != 'ok') { ShowMsg("你输入的用户名 {$userid} 不合法!", "-1"); exit; } $member = member($mail, $userid); //以邮件方式取回密码; if ($type == 1) { //判断系统邮件服务是否开启 if ($cfg_sendmail_bysmtp == "Y") { sn($member['mid'], $userid, $member['email']); } else { showmsg('对不起邮件服务暂未开启,请联系管理员', 'login.php'); exit; } //以安全问题取回密码; } elseif ($type == 2) { if ($member['safequestion'] == 0) { showmsg('对不起您尚未设置安全密码,请通过邮件方式重设密码', 'login.php'); exit; }
<title>PHP基礎</title> </head> <boby> <?php //課題6:引き数に1つのid(数値)をとり、3人分のプロフィール(項目は課題5参照)を //あらかじめ関数内で定義しておく。引き数のid値により戻り値として返却する //プロフィールを誰のものにするか選択する。それ以降などは課題5と同じ扱いに function member($in) { $mem1 = array("1", "田中", "一月一日", "東京"); $mem2 = array("2", "鈴木", "二月二日", "大阪"); $mem3 = array("3", "佐藤", "三月三日", "福岡"); if ($in == 1) { $answer = $mem1; } elseif ($in == 2) { $answer = $mem2; } elseif ($in == 3) { $answer = $mem3; } else { $answer = false; } return $answer; } $serch = member(3); print "{$serch['1']}" . "{$serch['2']}" . "{$serch['3']}"; ?> </body> </html>
/** * 显示博文 */ public function showAction() { $id = get("id", "int"); $where['status'] = \Admin\Article\Type\Status::STATUS_ENABLE; $where['member_id'] = 1; $where['id'] = $id; $row = db()->Table('article')->getRow($where)->limit(0, 1)->done(); if (!empty($row['password'])) { $cookiePassword = addslashes(trim(cookie('xtt_logpwd_' . $row['id']))); if ($cookiePassword != $row['password']) { $this->getView()->assign(array('id' => $id, 'msg' => "")); return $this->getView()->display("checkpwd"); } } $config = new \Admin\Model\webConfigModel(); $webConfig = $config->getConfig(); if ($webConfig['ischkcomment']) { new \Common\Security\CommentVerSession(); } $model = new \Home\Model\homeModel(); $row['category'] = $model->getArticleCategory($row['category']); $tag = new \Admin\Model\articleModel(); //获取该文章标签 $tags = $tag->getTags($row['id'], true); if ($tags) { $row['tags'] = explode(",", $tags); } $row['author'] = member($row['member_id']); $row['content'] = stripslashes($row['content']); //加载评论 $commentWhere['status'] = \Admin\Comment\Type\Status::STATUS_ENABLE; $commentWhere['type'] = \Admin\Comment\Type\Type::TYPE_ARTICLE; $commentWhere['data'] = $id; $comments = db()->Table('comment')->getAll($commentWhere)->order("id " . $webConfig['comment_order'])->done(); //生成序列树 $comments = $this->sortOut($comments); $this->getView()->assign(array('blog' => $row, "comments" => $comments)); return $this->getView()->display(); }
function company_partition($company_hcard, $topics) { $company_urls = $company_hcard['url']; $company_topics = array(); $noncompany_topics = array(); foreach ($topics as $topic) { if (member($topic['company_url'], $company_urls)) { array_push($company_topics, $topic); } else { array_push($noncompany_topics, $topic); } } return array($company_topics, $noncompany_topics); }
<body> <div class="row notice text-center"> <p class="hidden-xs">Welcome to Casa Ghana Beta!! Rent, Buy , Sale or Share your properties. <a href="new-property" class="btn call-btn">List Yours</a></p> <ul class="list-inline "> <li><a href="mailto:info@casaghana.com" class="header-link"><i class="fa fa-envelope" style="color:#ee3853"></i> info@casaghana.com</a> </li> <li> <i class="fa fa-phone" style="color:#ee3853"></i> 054 092 0984</li> </ul> </div> <?php include 'functions.php'; casa_setup(); casa_tables(); include 'dbconnect.php'; include 'session.php'; include 'session-expire.php'; member(); logout_modal(); ?> <div class="navbar"> <div class="container-fluid"> <div class="navbar-header"> <div class="navbar-brand"> Casa Ghana </div> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
</head> <boby> <?php //課題10:先に$limit=2を定義しておき、課題9の処理のうち2人目($limitで定義した値の人数) //まででforeachのループを抜けるようにする function member() { $mem[1] = array("1", "田中", "一月一日", "東京"); $mem[2] = array("2", "鈴木", "二月二日", null); $mem[3] = array("3", "佐藤", "三月三日", "福岡"); return $mem; } $i = 1; $limit = 2; $out = member(); foreach ($out as $value) { if ($i > $limit) { break; } foreach ($value as $key => $x) { if ($x == null) { continue; } if ($key == 0) { continue; } print "{$x}" . "<br>"; } $i++; }
function vowelp($char) { return member(strtolower($char), ["a", "e", "i", "o", "u"]); }
<table class="table"> <thead> <tr> <td> <strong><h4>MEMBER REPORT</h4></strong> </td> </tr> </thead> <tr> <th> Total Members </th> <td><?php echo member()[1]; ?> </td> </tr> <tr> <th> Total No New Members </th> <td><?php echo member()[0]; ?> </td> </tr> </table> </div> </div>
/** * Turn an array of RTF tokens into HTML * RTF is more similar to a state machine than it is to a regular language. So traditional compilation via * AST parsing is a whole bunch of sadness because block terminators sometimes aren't block terminators. * Except of course when they are. * @param $array array * @return array */ public function getHTML($array) { $output = []; while ($array) { $token = array_shift($array); if ($token[0] != "\\") { $output[] = $this->outputText($token); } else { $commands = Rtf::SplitCommand($token); if ($commands) { switch ($commands[0]) { case "{": $output[] = "{"; break; case "}": $output[] = "}"; break; case "\\": $output[] = "\\"; break; case "b": $output[] = $this->tag("b", isset($commands[1]) ? $commands[1] : 1); break; case "emdash": $output[] = "⁚"; break; case "~": case "emspace": $output[] = " "; break; case "_": case "-": case "endash": $output[] = "-"; break; case "enspace": $output[] = " "; break; case "fi": break; case "i": $output[] = $this->tag("i", isset($commands[1]) ? $commands[1] : 1); break; case "ldblquote": case "rdblquote": $output[] = ""e;"; break; case "line": $output[] = "<br>"; break; case "lquote": $output[] = "«"; break; case "pagebb": case "pagebreak": $output[] = "<pagebreak />"; break; case "plain": $output[] = $this->clearTags(); break; case "qc": $output[] = $this->attr("text-align", "center"); break; case "qj": $output[] = $this->attr("text-align", "justify"); break; case "ql": $output[] = $this->attr("text-align", "left"); break; case "qr": $output[] = $this->attr("text-align", "right"); break; case "rquote": $output[] = "»"; break; case "scaps": $output[] = $this->attr("font-variant", "small-caps"); break; case "sub": $output[] = $this->tag("sub", true); break; case "super": $output[] = $this->tag("super", true); break; case "tab": $output[] = "\t"; break; case "ul": $output[] = $this->tag("u", true); break; case "cellx": case "intbl": case "trleft": break; case "trowd": $output[] = $this->endOutput(); array_unshift($array, "\\trowd"); $block = new RTFBlock(); $output[] = $block->handleTable($array); break; case "par": $output[] = $this->endOutput(); if ($array && !member($array[0], ["\\pard", "\\par"])) { // Yeah this isn't technically right, but considering that \par can mean lots of things, it'll do, pig, it'll do. $output[] = "<br>"; } break; case "pard": $block = new RTFBlock(); $tokens = []; while ($array && !member($array[0], ["\\par", "\\pard"])) { $tokens[] = array_shift($array); } $output[] = $this->endOutput(); $output[] = $block->getHTML($tokens); $this->attrs = $block->attrs; break; case "cb": if (isset($commands[1]) && isset(self::$colours[$commands[1]])) { $colour = self::$colours[$commands[1]]; $output[] = $this->attr("background", "#" . dechex($colour[0] * 65536 + $colour[1] * 256 + $colour[2])); } break; case "cf": if (isset($commands[1]) && isset(self::$colours[$commands[1]])) { $colour = self::$colours[$commands[1]]; $output[] = $this->attr("color", "#" . dechex($colour[0] * 65536 + $colour[1] * 256 + $colour[2])); // if the luma is too white, then we should tint the background too if (1 - ($colour[0] * 0.299 + $colour[1] * 0.587 + $colour[2] * 0.114) < 0.1) { $output[] = $this->attr("background", "#aaa"); } } break; case "f": if (isset($commands[1]) && isset(self::$fonts[$commands[1]])) { $output[] = $this->attr("font-family", self::$fonts[$commands[1]]); } break; case "fs": if (isset($commands[1])) { $output[] = $this->attr("font-size", $commands[1] / 2 . "pt"); } break; case "li": if (isset($commands[1])) { $output[] = $this->attr("padding-left", $commands[1] / 20 . "pt"); } break; case "ri": if (isset($commands[1])) { $output[] = $this->attr("padding-right", $commands[1] / 20 . "pt"); } break; case "sa": if (isset($commands[1])) { $output[] = $this->attr("padding-bottom", $commands[1] / 20 . "pt"); } break; case "sb": if (isset($commands[1])) { $output[] = $this->attr("padding-top", $commands[1] / 20 . "pt"); } break; default: if ($commands) { $output[] = "\\" . $commands[0]; } } } } } return [$output, $this->endOutput()]; }
private function tokeniseDirective($directive) { $list = []; $length = strlen($directive); $i = 0; while ($i < $length) { if (member($directive[$i], [" ", "\t", "\r", "\n", ","])) { $i++; } else { if ($directive[$i] == "\"" || $directive[$i] == "'") { $pos = strpos($directive, $directive[$i], $i + 1); if ($pos === false) { $pos = $length; } $list[] = substr($directive, $i, $pos - $i); $i = $pos + 1; } else { if (strpos(",()", $directive[$i]) !== false) { $list[] = $directive[$i++]; } else { $offset = strcspn($directive, "(), ", $i); // MB okay, $directives should be ASCII anyway $list[] = substr($directive, $i, $offset); $i += $offset; } } } } return $list; }
$GLOBALS["VERBOSE"] = true; ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); ini_set('error_prepend_string', null); ini_set('error_append_string', null); } if ($argv[1] == "--backup-md5") { backup_md5($argv[2]); die; } if ($argv[1] == "--accounts") { accounts(); die; } if ($argv[1] == "--member") { member($argv[2]); die; } if ($argv[1] == "--check") { checkTask($argv[2]); die; } if ($argv[1] == "--folders") { mailboxes_folders($argv[2]); die; } if ($argv[1] == "--schedules") { mailboxes_schedules(); die; } function backup_md5($md5)
if (empty($_POST) === false && empty($error) === true) { $query_data = array('name' => $_POST['name'], 'branch' => $_POST['branch'], 'queryfor' => $_POST['queryfor'], 'query' => $_POST['query'], 'email' => $_POST['email'], 'branch' => $_POST['branch'], 'year' => $_POST['year']); print_r($query_data); query_data($query_data); header('location:contact.php?success'); exit; } else { if (empty($error) === false) { echo output_errors($error); } } ?> <div align="left" style="padding:20px; margin-left:30px; height:60px;" onmouseover="JOIN US AND HELP OTHERS"> <?php if (member($user_data['username']) === true) { ?> <a href="members_form.php" style="text-decoration:none"> <h3>Join a member</h3></a> <?php } else { ?> <a href="request.php" style="text-decoration:none"> <h3>Send Request to Join us as member</h3></a> <?php } ?> ?>
function get_trust() { global $ingame, $trusted, $pilotname; $browser = $_SERVER["HTTP_USER_AGENT"]; if (Check2()) { // check for trust if ($_SERVER["HTTP_EVE_TRUSTED"] == 'no') { // request trust from client through headers header("eve.trustMe:" . $corpURL . "::This page requires " . $corpURL . " to be in the trusted websites in order to show all content. If you do not have this site on trusted, some content will not be displayed correctly!"); $trusted = false; } else { $trusted = true; // Is in Chaos Faction? if ($_SERVER["HTTP_EVE_corp"] != $corp) { echo "This Data is restricted to members of " . $corp; } else { // Identify User $sql = "SELECT\r\n MemberID,\r\n Name,\r\n Division,\r\n RankCorp\r\n FROM\r\n MembersMain\r\n WHERE\r\n Name = '" . $_SERVER["HTTP_EVE_CHARNAME"] . "'"; $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { $myname = $row['Name']; $mydivision = $row['Division']; $myrankcorp = $row['RankCorp']; $myid = $row['MemberID']; } if ($myname == "") { echo "<b><center>You have not been added to the DB yet, please contact a Division 1 Officer!</center></b>"; } else { // Start the table and create the array with Corprelated stuff.... if ($myrankcorp < "3") { $canedit = true; echo "<form action=\"add.php\" method=\"post\" target=\"_self\">"; echo "<input type=\"submit\" value=\" Add new Person to DB \"></form>"; echo "<form action=\"member.php?deldisp=only\" method=\"post\" target=\"_self\">"; echo "<input type=\"submit\" value=\" Deleted Only \"></form>"; echo "<form action=\"member.php?deldisp=no\" method=\"post\" target=\"_self\">"; echo "<input type=\"submit\" value=\" Active Only \"></form>"; echo "<form action=\"member.php?deldisp=merge\" method=\"post\" target=\"_self\">"; echo "<input type=\"submit\" value=\" Merged Display \"></form><br>"; } else { if ($mydivision == "1" and $myrankcorp < "5") { $canedit = true; echo "<form action=\"add.php\" method=\"post\" target=\"_self\">"; echo "<input type=\"submit\" value=\" Add new Person to DB \"></form>"; echo "<form action=\"member.php?deldisp=only\" method=\"post\" target=\"_self\">"; echo "<input type=\"submit\" value=\" Deleted Only \"></form>"; echo "<form action=\"member.php?deldisp=no\" method=\"post\" target=\"_self\">"; echo "<input type=\"submit\" value=\" Active Only \"></form>"; echo "<form action=\"member.php?deldisp=merge\" method=\"post\" target=\"_self\">"; echo "<input type=\"submit\" value=\" Merged Display \"></form><br>"; } } echo "<table width=\"100%\">"; echo "<colgroup>"; echo "<col width=\"9%\">"; echo "<col width=\"7%\">"; echo "<col width=\"15%\">"; echo "<col width=\"7%\">"; echo "<col width=\"10%\">"; echo "<col width=\"*\">"; echo "</colgroup>"; //Initiate Header Row echo "<tr><td><a href=\"member.php?sort=DateJoined\">Date Joined</a></td><td><a href=\"member.php?sort=Vacation\">FLAG</a></td><td><b><a href=\"member.php?sort=Name\">Name</a></b></td><td><a href=\"member.php?sort=RankCorp\">RankCorp</a></td><td><a href=\"member.php?sort=Division\">Division</a></td></tr>"; //auf if ($_GET["deldisp"] != "") { if ($_GET["deldisp"] == "only") { //sort if ($_GET["sort"] == "") { $sql = "SELECT\r\n MemberID,\r\n Name,\r\n Division,\r\n LastUpdate,\r\n DateJoined,\r\n Vacation,\r\n RankCorp,\r\n Deleted\r\n FROM\r\n MembersMain\r\n WHERE\r\n Deleted = '1'\r\n ORDER BY\r\n Name ASC;"; } else { $sql = "SELECT\r\n MemberID,\r\n Name,\r\n Division,\r\n LastUpdate,\r\n DateJoined,\r\n Vacation,\r\n RankCorp,\r\n Deleted\r\n FROM\r\n MembersMain\r\n WHERE\r\n Deleted = '1'\r\n ORDER BY\r\n " . $_GET["sort"] . " ASC,\r\n Name ASC;"; } } if ($_GET["deldisp"] == "merge") { if ($_GET["sort"] == "") { $sql = "SELECT\r\n MemberID,\r\n Name,\r\n Division,\r\n DateJoined,\r\n LastUpdate,\r\n Vacation,\r\n RankCorp,\r\n Deleted\r\n FROM\r\n MembersMain\r\n ORDER BY\r\n Name ASC;"; } else { $sql = "SELECT\r\n MemberID,\r\n Name,\r\n Division,\r\n LastUpdate,\r\n DateJoined,\r\n Vacation,\r\n RankCorp,\r\n Deleted\r\n FROM\r\n MembersMain\r\n ORDER BY\r\n " . $_GET["sort"] . " ASC,\r\n Name ASC;"; } } if ($_GET["deldisp"] == "no") { if ($_GET["sort"] == "") { $sql = "SELECT\r\n MemberID,\r\n Name,\r\n Division,\r\n LastUpdate,\r\n DateJoined,\r\n Vacation,\r\n RankCorp,\r\n Deleted\r\n FROM\r\n MembersMain\r\n WHERE\r\n Deleted = '0'\r\n ORDER BY\r\n Name ASC;"; } else { $sql = "SELECT\r\n MemberID,\r\n Name,\r\n Division,\r\n DateJoined,\r\n Vacation,\r\n RankCorp,\r\n Deleted,\r\n LastUpdate\r\n FROM\r\n MembersMain\r\n WHERE\r\n Deleted = '0'\r\n ORDER BY\r\n " . $_GET["sort"] . " ASC,\r\n Name ASC;"; } } } else { if ($_GET["sort"] == "") { $sql = "SELECT\r\n MemberID,\r\n Name,\r\n Division,\r\n DateJoined,\r\n LastUpdate,\r\n Vacation,\r\n RankCorp,\r\n Deleted\r\n FROM\r\n MembersMain\r\n WHERE\r\n Deleted = '0'\r\n ORDER BY\r\n Name ASC;"; } else { $sql = "SELECT\r\n MemberID,\r\n Name,\r\n Division,\r\n DateJoined,\r\n Vacation,\r\n RankCorp,\r\n Deleted,\r\n LastUpdate\r\n FROM\r\n MembersMain\r\n WHERE\r\n Deleted = '0'\r\n ORDER BY\r\n " . $_GET["sort"] . " ASC,\r\n Name ASC;"; } } $Div = array("Null", "Recruiting", "Chaos Marines", "Mining", "Production", "POS", "Unassigned"); $RankCorp = array("null", "CEO", "Vice CEO", "Director", "Officer", "Pilot", "Cadet"); $statMemberCount = 0; // This is where the part starts where the data is filtered and displayed according to roles and flags... $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { //Statistics $statMemberCount = $statMemberCount + 1; if ($myrankcorp < "4") { $viewdata = true; } else { if ($mydivision == $row['Division'] and $myrankcorp == "4") { $viewdata = true; } else { $viewdata = false; } } member($row['RankCorp'], $row['Division'], $row['LastUpdate'], $row['Vacation'], $canedit, $row['MemberID'], $row['Name'], $row['DateJoined'], $viewdata, $mydivision); //Display } echo "</table><br>Total Members: " . $statMemberCount . "<br><hr>Legend:"; echo "<br><font color=\"#F5B800\">Self</font><br><font color=\"#33FF66\">My Division</font><br><font color=\"#CCFF00\">Unassigned after 14Days</font><br><font color=\"#CC0000\">Inactive for 10Days</font><hr>"; } } } } }