function HandleUpload($pagename) { global $FmtV, $UploadExtMax, $HandleUploadFmt, $PageStartFmt, $PageEndFmt, $PageUploadFmt; $page = RetrieveAuthPage($pagename, 'upload'); if (!$page) { Abort("?cannot upload to {$pagename}"); } SetPage($pagename, $page); $FmtV['$UploadName'] = MakeUploadName($pagename, @$_REQUEST['upname']); $upresult = @$_REQUEST['upresult']; $FmtV['$upext'] = @$_REQUEST['upext']; $FmtV['$upmax'] = @$_REQUEST['upmax']; $FmtV['$UploadResult'] = $upresult ? FmtPageName("<i>\$UploadName</i>: \$[UL{$upresult}]", $pagename) : ''; SDV($HandleUploadFmt, array(&$PageStartFmt, &$PageUploadFmt, &$PageEndFmt)); PrintFmt($pagename, $HandleUploadFmt); }
function HandleAttr($pagename) { global $PageAttrFmt; $page = RetrieveAuthPage($pagename, 'attr'); if (!$page) { Abort("?unable to read {$pagename}"); } SetPage($pagename, $page); SDV($PageAttrFmt, "<h1 class='wikiaction'>\$[\$PageName Attributes]</h1>\n <p>Enter new attributes for this page below. Leaving a field blank\n will leave the attribute unchanged. To clear an attribute, enter\n 'clear'.</p>"); SDV($HandleAttrFmt, array(&$PageStartFmt, &$PageAttrFmt, 'function:PrintAttrForm', &$PageEndFmt)); PrintFmt($pagename, $HandleAttrFmt); }
function FPagebar($SQL, $NowPage, $Num, $STR = "", $CSS = "", $Barnum = "10") { //if($CSS!='') $css=$CSS; //else $css="fpagebar"; $RES = DB_QUERY($SQL); $Total = mysql_num_rows($RES); $_SESSION['TP'] = $Total; if ($Total > 0) { $Total_page = ceil($Total / $Num); //$PageL='<span class="page_title">共 <span class="page_bar">'.$Total.'</span> 筆</span>'; //$PageR='<span class="page_title">共 <span class="page_bar">'.$Total_page.'</span> 頁</sapn>'; $mypage = SetPage($Total_page, $NowPage, $Barnum); #上下頁連結 //$FirstLink = '<a href="'.$_SERVER["PHP_SELF"]."?ipage=0".$STR.'" ><span class="page_pn"><< First</span></a> '; $BackLink = '<a href="' . $_SERVER["PHP_SELF"] . "?ipage=" . ($NowPage != 0 ? $NowPage - 1 : 0) . $STR . '" ><span class="page_pn">< Prev</span></a> '; $NextLink = ' <a href="' . $_SERVER["PHP_SELF"] . "?ipage=" . ($NowPage != $Total_page - 1 ? $NowPage + 1 : $NowPage) . $STR . '" ><span class="page_pn">Next ></span></a> '; //$LastLink = '<a href="'.$_SERVER["PHP_SELF"]."?ipage=".($Total_page-1).$STR.'" ><span class="page_pn">Last >></span></a> '; $restr = ' '; for ($p = $mypage['p']; $p <= $mypage['n']; $p++) { if ($p != $NowPage + 1) { $restr .= '<a href="' . $_SERVER["PHP_SELF"] . '?ipage=' . ($p - 1) . $STR . '" ><span class="page_num">' . $p . '</span></a> '; } else { $restr .= '<a href="' . $_SERVER["PHP_SELF"] . '?ipage=' . ($p - 1) . $STR . '"><span class="page_nums">' . $p . '</span></a> '; } } $PageBar = '<table width="100%" border="0"><tr><td width="18%">' . $PageL . '</td><td align="center">' . $FirstLink . $BackLink . $restr . $NextLink . $LastLink . '</td><td width="15%" align="right">' . $PageR . '</td></table>'; } return $PageBar; }