<li class="active"><a href="index.php">blog</a></li> <li><a href="edit.html">edit</a></li> <!-- <li><a href="cloud.html">cloud</a></li> --> <li><a href="shell/shell.html">shell</a></li> <li><a href="about.html">about</a></li> <li><a href="sign.html">sign</a></li> <li><a href="countdown/countdown.html">countdown</a></li> </ul> <?php ob_start(); require_once 'public.func.php'; include_once 'messageModel.class.php'; $_SESSION['isFlash'] = 1; $_SESSION['flashTime'] = time(); if (isOnline()) { $userName = $_SESSION['userName']; $msgModel = new messageModel(); $msg = $msgModel->getUnReadMsgNum(); echo <<<EOF <div class="navbar-about-me"> <button class="navbar-messages btn btn-info" type="button" onclick="readMes()"> <span class="fa fa-bell"> </span> <span class="badge">{$msg}</span> </button> <img class="navbar-head-img img-circle" alt="40x40" src="img/headPic.jpg" style="cursor:pointer"> </div> EOF; ob_end_flush(); } ?>
print '</div>'; } /*END DELETE_BUTTON*/ /*RECYCLE_BUTTON*/ if ($post['user_id'] !== $sess['user_id']) { print '<div class="recycle">'; print '<form method="POST"> <input type="hidden" name="post_id" value="' . $post['post_id'] . '"> <button type="submit" name="recycle"><img src="img/recycle.png"> Recycle</button> </form>'; print '</div>'; } /*END RECYCLE_BUTTON*/ /*POST*/ print '<div class="profile_img">' . getProfilePic($post['user_id'], '50px') . '</div>'; print isOnline($post['active']); print '<h4>' . $post['f_name'] . ' ' . $post['l_name'] . ' </h4>'; print '<h3>' . atLink($post['username']) . ': </h3>'; print '<p class="post_post">' . atLink($post['post']) . '</p>'; if ($post['post_pic']) { print '<img src="userIMG/' . $post['user_id'] . '/' . $post['post_pic'] . '" class="post_img">'; } print '<div class="time_stamp"><p>' . printTime($post['time_stamp']) . '</p></div>'; /*REPLY_FORM*/ print '<div class="reply"> <form method="POST" action="#' . $post['post_id'] . '"> <input type="hidden" name="post_id" value="' . $post['post_id'] . '"> <input type="text" name="comment" value="' . $post['username'] . '"> <input type="submit" name="postComment" value="Reply" class="button"> </form> </div>';
// //得到发送邮件对象Swift_Mailer对象 // $mailer=Swift_Mailer::newInstance($transport); // //得到邮件信息对象 // $msg=Swift_Message::newInstance(); // //设置管理员的信息 // $msg->setFrom(array('*****@*****.**'=>'Meet Better Me')); // //将邮件发给谁 // $msg->setTo($email); // //设置邮件主题 // $msg->setSubject('网站有人发博客啦!'); // $str = $title; // $msg->setBody("博客标题为——{$str}",'text/html','utf-8'); // try{ // $mailer->send($msg); // }catch(Swift_ConnectionException $e){ // // echo $e.getMessage(); // } if (!isOnline()) { echo json_encode("暂不开放注册,但您写的博客也会展示在首页"); } else { echo json_encode("博客已更新!"); } } } else { echo json_encode("博客内容小于100字!"); } break; default: # code... break; }
case 23: //查看黑名单 var_dump(getBlacklist("zhangsan")); break; case 24: //往黑名单中加人 $usernames = array("usernames" => array("zhangsan", "lisi")); var_dump(addUserForBlacklist("wangwu", $usernames)); break; case 25: //从黑名单中减人 var_dump(deleteUserFromBlacklist("zhangsan", "lisi")); break; case 26: //查看用户是否在线 var_dump(isOnline("zhangsan")); break; case 27: //查看用户离线消息数 var_dump(getOfflineMessages("zhangsan")); break; case 28: //查看某条消息的离线状态 var_dump(getOfflineMessageStatus("zhangsan", "77225969013752296_pd7J8-20-c3104")); break; case 29: //禁用用户账号----- var_dump(deactiveUser("zhangsan")); break; case 30: //解禁用户账号-----
} if (empty($token) || isOnline($cid)) { pushMessageToSingle(createDownMessage($title, $content, $ptitle, $pcontent, $dtitle, $durl), $cid); } else { $payload = json_encode(array('type' => 'down', 'ptitle' => $ptitle, 'pcontent' => $pcontent, 'durl' => $durl)); apnMessageToSingle($token, $content, $payload); } break; case 'tran': checkTitleContent(); // Payload content if (!isset($_POST['payload'])) { echo 'Invalid payload content!'; return; } $payload = $_POST['payload']; if (empty($payload)) { echo 'Empty payload content!'; return; } if (empty($token) || empty($content) || isOnline($cid)) { pushMessageToSingle(createTranMessage($payload), $cid); } else { apnMessageToSingle($token, $content, $payload); } break; default: echo 'Unsupported push type!'; return; break; }
<hr/> <?php function gzUncompressFile($srcName, $dstName) { $sfp = gzopen($srcName, "rb"); $fp = fopen($dstName, "w"); while (!gzeof($sfp)) { $string = gzread($sfp, 4096); fwrite($fp, $string, strlen($string)); } gzclose($sfp); fclose($fp); } if (!isOnline() && !$Config['override_connect_detect']) { echo '<P>You are not currently connected to the Internet.</P>'; echo '<P><A HREF="index.php?form=menu">Return to the main menu.</A></P>'; includeFooter(); die; } $api_passed = false; $ch = curl_init(); $data = array('user' => $Config['my_call'], 'api_key' => $Config['api_key'], 'req' => 'roster'); $opt_array = array(CURLOPT_URL => 'http://dev.wx4akq.org/ops/xml_query.php', CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $data); curl_setopt_array($ch, $opt_array); // Set a timeout for slow connections - Bug #36 set_time_limit(120); $result = curl_exec($ch); curl_close($ch); $xml = simplexml_load_string($result);
</div> </div> <button type="submit" name="litter" class="button">GO!</button> </form> </div> <?php print '<div id="profile">'; print getProfilePic($get['user_id'], '150px'); print '<br>'; print '<h2>' . $get['f_name'] . ' ' . $get['l_name'] . '</h2>'; print '<h3> ' . $get['username'] . '</h3>'; isOnline($get['active']); if (!$get['active']) { print '<p>(Last here: ' . printTime($get['last_in']) . ')</p>'; } /* FOLLOW */ $following = getFollowing($get['user_id']); $followers = getFollowers($get['user_id']); if ($sess['user_id'] !== $get['user_id']) { if (checkFollowing($sess['user_id'], $get['user_id'])) { print '<form method="POST"> <input type="hidden" name="id" value="' . $get['user_id'] . '"> <button type="submit" name="unfollow" class="button">Unfollow</button> </form>'; } else { print '<form method="POST"> <input type="hidden" name="id" value="' . $get['user_id'] . '">
<?php require __DIR__ . "/functions.php"; if (empty($_POST["function"]) && empty($_GET["function"])) { die; } $input = empty($_POST["function"]) ? $_GET : $_POST; $function = strip_tags($input["function"]); $result = []; switch ($function) { case "ping": $ip = strip_tags($input["ip"]); $port = (int) $input["port"]; $result["status"] = isOnline($ip, $port); break; case "start": $ip = strip_tags($input["ip"]); $port = (int) $input["port"]; $computer = getComputerByIp($ip, $port); startComputer($computer["mac"]); break; case "shutdown": $ip = strip_tags($input["ip"]); $port = (int) $input["port"]; $computer = getComputerByIp($ip, $port); shutdownComputer($ip, $computer["mac"], $computer["username"], $computer["password"]); break; } die(json_encode($result));
updateFile("online", $servers[$i]['id'], true); } } else { if (isOnline($status) && $count != -1 && $count > 1550) { updateFile("online (full)", $servers[$i]['id'], false); } elseif (isOnline($status) && $count != -1 && $count >= 0) { updateFile("online (timeout)", $servers[$i]['id'], false); } elseif (isOnline($status) && $count == -1) { updateFile("offline", $servers[$i]['id'], true); } elseif ($status == "offline" && $count != -1 && $count >= 0) { updateFile("online (timeout)", $servers[$i]['id'], true); } elseif ($status == "offline" && $count != -1 && $count > 1550) { updateFile("online (full)", $servers[$i]['id'], true); } elseif ($status == "offline" && $count == -1) { updateFile("offline", $servers[$i]['id'], false); } elseif (isOnline($status)) { updateFile("offline", $servers[$i]['id'], true); } elseif ($status == "offline") { updateFile("offline", $servers[$i]['id'], false); } else { updateFile("offline", $servers[$i]['id'], true); } } } //update the last check time $filename = $absolute_cache_path . "lastcheck.txt"; $myfile = fopen($filename, "w"); $newtime = new DateTime('now'); fwrite($myfile, $newtime->format('Y-m-d H:i:s')); fclose($myfile); echo "Done!";