📄 ewiki.php
字号:
m谩s adelante si piensa que es necesario.<br />", "EDIT_FORM_2" => "<br />Por favor no escriba cosas, que puedan enfadar a otras personas. Y por favor tenga en mente que usted no es del todo an贸nimo en Internet (encuentre m谩s sobre '<a href=\"http://google.com/search?q=my+computers+IP+address\">IP address</a>' de su computador con Google).", "BIN_IMGTOOLARGE" => "隆La gr谩fica es demasiado grande!", "BIN_NOIMG" => "隆No es un archivo con una gr谩fica (formato de archivo inaceptable)!", "FORBIDDEN" => "No est谩 autorizado para acceder a esta p谩gina.", )); # $ewiki_t["de"] = @array_merge(@$ewiki_t["de"], array( "EDITTHISPAGE" => "DieseSeite脛ndern", "APPENDTOPAGE" => "Erg盲nze", "BACKLINKS" => "Zur眉ckLinks", "PAGESLINKINGTO" => "Verweise zur Seite \$title", "PAGEHISTORY" => "SeitenInfo", "INFOABOUTPAGE" => "Informationen 眉ber Seite", "LIKEPAGES" => "脛hnliche Seiten", "NEWESTPAGES" => "Neueste Seiten", "LASTCHANGED" => "zuletzt ge盲ndert am %d.%m.%Y um %H:%M", "DISABLEDPAGE" => "Diese Seite kann momentan nicht angezeigt werden.", "ERRVERSIONSAVE" => "Entschuldige, aber w盲hrend Du an der Seite gearbeitet hast, hat bereits jemand anders eine ge盲nderte Fassung gespeichert. Damit nichts verloren geht, browse bitte zur眉ck und speichere Deine 脛nderungen in der Zwischenablage (Bearbeiten->Kopieren) um sie dann wieder an der richtigen Stelle einzuf眉gen, nachdem du die EditBoxSeite nocheinmal geladen hast.<br /> Vielen Dank f眉r Deine M眉he.", "ERRORSAVING" => "Beim Abspeichern ist ein Fehler aufgetreten. Bitte versuche es erneut.", "THANKSFORCONTRIBUTION" => "Vielen Dank f眉r Deinen Beitrag!", "CANNOTCHANGEPAGE" => "Diese Seite kann nicht ge盲ndert werden.", "OLDVERCOMEBACK" => "Diese alte Version der Seite wieder zur Aktuellen machen", "PREVIEW" => "Vorschau", "SAVE" => "Speichern", "CANCEL_EDIT" => "脛nderungenVerwerfen", "UPLOAD_PICTURE_BUTTON" => "Bild hochladen >>>", "EDIT_FORM_1" => "<a href=\"".EWIKI_SCRIPT."GuterStil\">GuterStil</a> ist es, ganz einfach das zu schreiben, was einem gerade in den Sinn kommt. Du solltest dich jetzt noch nicht so sehr darum k眉mmern, wie die Seite aussieht. Du kannst sp盲ter immernoch zur眉ckkommen und den Text mit <a href=\"".EWIKI_SCRIPT."FormatierungsRegeln\">WikiTextFormatierungsRegeln</a> aufputschen.<br />", "EDIT_FORM_2" => "<br />Bitte schreib keine Dinge, die andere Leute ver盲rgern k枚nnten. Und bedenke auch, da脽 es schnell auf dich zur眉ckfallen kann wenn du verschiedene andere Dinge sagst (mehr Informationen zur '<a href=\"http://google.de/search?q=computer+IP+adresse\">IP Adresse</a>' deines Computers findest du bei Google).", )); #-- InterWiki:Links $ewiki_config["interwiki"] = @array_merge( @$ewiki_config["interwiki"], array( "javascript" => "", # this actually protects from javascript: links "url" => "",# "self" => "this", "this" => EWIKI_SCRIPT, # better was absolute _URL to ewiki wrapper "jump" => "", "ErfurtWiki" => "http://erfurtwiki.sourceforge.net/?id=", "InterWiki" => "InterWikiSearch", "InterWikiSearch" => "http://sunir.org/apps/meta.pl?", "Wiki" => "WardsWiki", "WardsWiki" => "http://www.c2.com/cgi/wiki?", "WikiFind" => "http://c2.com/cgi/wiki?FindPage&value=", "WikiPedia" => "http://www.wikipedia.com/wiki.cgi?", "MeatBall" => "MeatballWiki", "MeatballWiki" => "http://www.usemod.com/cgi-bin/mb.pl?", "UseMod" => "http://www.usemod.com/cgi-bin/wiki.pl?", "PhpWiki" => "http://phpwiki.sourceforge.net/phpwiki/index.php3?", "LinuxWiki" => "http://linuxwiki.de/", "OpenWiki" => "http://openwiki.com/?", "Tavi" => "http://andstuff.org/tavi/", "TWiki" => "http://twiki.sourceforge.net/cgi-bin/view/", "MoinMoin" => "http://www.purl.net/wiki/moin/", "Google" => "http://google.com/search?q=", "ISBN" => "http://www.amazon.com/exec/obidos/ISBN=", "icq" => "http://www.icq.com/", ));#-------------------------------------------------------------------- main ---/* this is the main function, which you should preferrably call to integrate the ewiki into your web site; it chains to most other parts and plugins (including the edit box); if you do not supply the requested pages "$id" we will fetch it from the pre-defined possible URL parameters.*/function ewiki_page($id=false) { global $ewiki_links, $ewiki_plugins, $ewiki_ring, $ewiki_t, $ewiki_errmsg; #-- output var $o = ""; #-- selected page if (!isset($_REQUEST)) { $_REQUEST = @array_merge($_GET, $_POST); } if (!strlen($id)) { $id = ewiki_id(); } $id = format_string($id,true); #-- page action $action = EWIKI_DEFAULT_ACTION; if ($delim = strpos($id, EWIKI_ACTION_SEP_CHAR)) { $action = substr($id, 0, $delim); $id = substr($id, $delim + 1); } elseif (EWIKI_USE_ACTION_PARAM && isset($_REQUEST["action"])) { $action = $_REQUEST["action"]; } $GLOBALS["ewiki_id"] = $id; $GLOBALS["ewiki_title"] = ewiki_split_title($id); $GLOBALS["ewiki_action"] = $action; #-- fetch from db $dquery = array( "id" => $id ); if (!isset($_REQUEST["content"]) && ($dquery["version"] = @$_REQUEST["version"])) { $dquery["forced_version"] = $dquery["version"]; } $data = @array_merge($dquery, ewiki_database("GET", $dquery)); #-- stop here if page is not marked as _TEXT, # perform authentication then, and let only administrators proceed if (!empty($data["flags"]) && (($data["flags"] & EWIKI_DB_F_TYPE) != EWIKI_DB_F_TEXT)) { if (($data["flags"] & EWIKI_DB_F_BINARY) && ($pf = $ewiki_plugins["handler_binary"][0])) { return($pf($id, $data, $action)); //_BINARY entries handled separately } elseif (!EWIKI_PROTECTED_MODE || !ewiki_auth($id, $data, $action, 0, 1) && ($ewiki_ring!=0)) { return(ewiki_t("DISABLEDPAGE")); } } #-- pre-check if actions exist $pf_page = ewiki_array($ewiki_plugins["page"], $id); #-- edit <form> for non-existent pages if (($action==EWIKI_DEFAULT_ACTION) && empty($data["content"]) && empty($pf_page)) { if (EWIKI_AUTO_EDIT) { $action = "edit"; } else { $data["content"] = ewiki_t("DOESNOTEXIST"); } } #-- more initialization if ($pf_a = @$ewiki_plugins["page_init"]) { ksort($pf_a); foreach ($pf_a as $pf) { $o .= $pf($id, $data, $action); } unset($ewiki_plugins["page_init"]); } $pf_page = ewiki_array($ewiki_plugins["page"], $id); #-- require auth if (EWIKI_PROTECTED_MODE) { if (!ewiki_auth($id, $data, $action, $ring=false, $force=EWIKI_AUTO_LOGIN)) { return($o.=$ewiki_errmsg); } } #-- handlers $handler_o = ""; if ($pf_a = @$ewiki_plugins["handler"]) { ksort($pf_a); foreach ($pf_a as $pf) { if ($handler_o = $pf($id, $data, $action)) { break; } } } #-- finished by handler if ($handler_o) { $o .= $handler_o; } #-- actions that also work for static and internal pages elseif (($pf = @$ewiki_plugins["action_always"][$action]) && function_exists($pf)) { $o .= $pf($id, $data, $action); } #-- internal pages elseif ($pf_page && function_exists($pf_page)) { $o .= $pf_page($id, $data, $action); } #-- page actions else { $pf = @$ewiki_plugins["action"][$action]; #-- fallback to "view" action if (empty($pf) || !function_exists($pf)) { $pf = "ewiki_page_view"; $action = "view"; // we could also allow different (this is a // catch-all) view variants, but this would lead to some problems } $o .= $pf($id, $data, $action); } #-- error instead of page? if (empty($o) && $ewiki_errmsg) { $o = $ewiki_errmsg; } #-- html post processing if ($pf_a = $ewiki_plugins["page_final"]) { ksort($pf_a); foreach ($pf_a as $pf) { if ($action == 'edit' and $pf == 'ewiki_html_tag_balancer') { continue; // balancer breaks htmlarea buttons } $pf($o, $id, $data, $action); } } (EWIKI_ESCAPE_AT) && ($o = str_replace("@", "@", $o)); return($o);}#-- HTTP meta headersfunction ewiki_http_headers(&$o, $id, &$data, $action) { global $ewiki_t; if (EWIKI_HTTP_HEADERS && !headers_sent()) { if (!empty($data)) { if ($uu = @$data["id"]) @header('Content-Disposition: inline; filename="' . urlencode($uu) . '.html"'); if ($uu = @$data["version"]) @header('Content-Version: ' . $uu); if ($uu = @$data["lastmodified"]) @header('Last-Modified: ' . gmstrftime($ewiki_t["C"]["DATE"], $uu)); } if (EWIKI_NO_CACHE) { header('Expires: ' . gmstrftime($ewiki_t["C"]["DATE"], UNIX_MILLENNIUM)); header('Pragma: no-cache'); header('Cache-Control: no-cache, private, must-revalidate'); # change to "C-C: cache, must-revalidate" ?? # private only for authenticated users / _PROT_MODE } #-- ETag if ($data["version"] && ($etag=ewiki_etag($data)) || ($etag=md5($o))) { $weak = "W/" . urlencode($id) . "." . $data["version"]; header("ETag: \"$etag\""); ###, \"$weak\""); } }}function ewiki_etag(&$data) { return( urlencode($data["id"]) . ":" . dechex($data["version"]) . ":ewiki:" . dechex(crc32($data["content"]) & 0x7FFFBFFF) );}#-- encloses whole page output with a descriptive <div>function ewiki_page_css_container(&$o, &$id, &$data, &$action) { $o = "<div class=\"wiki $action " . strtr($id, ' ./ --_!"搂$%&()=?虏鲁{[]}`+#*;:,<>| @碌枚盲眉脰脛脺脽陇^掳芦禄\'\\', '- -----------------------------------------------') . "\">\n" . $o . "\n</div>\n";}function ewiki_split_title ($id='', $split=EWIKI_SPLIT_TITLE, $entities=1) { strlen($id) or ($id = $GLOBALS["ewiki_id"]); if ($split) { $id = preg_replace("/([".EWIKI_CHARS_L."])([".EWIKI_CHARS_U."]+)/", "$1 $2", $id); } return($entities ? s($id) : $id);}function ewiki_add_title(&$html, $id, &$data, $action, $go_action="links") { $html = ewiki_make_title($id, '', 1, $action, $go_action) . $html;}function ewiki_make_title($id='', $title='', $class=3, $action="view", $go_action="links", $may_split=1) { global $ewiki_config, $ewiki_plugins, $ewiki_title, $ewiki_id; #-- advanced handler if ($pf = @$ewiki_plugins["make_title"][0]) { return($pf($title, $class, $action, $go_action, $may_split)); } #-- disabled elseif (!$ewiki_config["print_title"]) { return(""); } #-- get id if (empty($id)) { $id = $ewiki_id; } #-- get title if (!strlen($title)) { $title = $ewiki_title; // already in &html; format } elseif ($ewiki_config["split_title"] && $may_split) { $title = ewiki_split_title($title, $ewiki_config["split_title"], 0&($title!=$ewiki_title)); } else { $title = s($title); } #-- title mangling if ($pf_a = @$ewiki_plugins["title_transform"]) { foreach ($pf_a as $pf) { $pf($id, $title, $go_action); } } #-- clickable link or simple headline if ($class <= $ewiki_config["print_title"]) { if ($uu = @$ewiki_config["link_title_action"][$action]) { $go_action = $uu; } if ($uu = @$ewiki_config["link_title_url"]) { $href = $uu; unset($ewiki_config["link_title_url"]); } else { $href = ewiki_script($go_action, $id); } $o = '<a href="' . $href . '">' . ($title) . '</a>'; } else { $o = $title; } return('<h2 class="page title">' . $o . '</h2>'."\n");}function ewiki_page_view($id, &$data, $action, $all=1) { global $ewiki_plugins, $ewiki_config; $o = ""; #-- render requested wiki page <-- goal !!! $render_args = array( "scan_links" => 1, "html" => (EWIKI_ALLOW_HTML||(@$data["flags"]&EWIKI_DB_F_HTML)), ); $o .= $ewiki_plugins["render"][0] ($data["content"], $render_args); if (!$all) { return($o); } #### MOODLE CHANGE /// Add Moodle filters to text porion of wiki. global $moodle_format; // from wiki/view.php $o = format_text($o, $moodle_format); $o.= "<br /><br />"; #-- control line + other per-page info stuff if ($pf_a = $ewiki_plugins["view_append"]) { ksort($pf_a); foreach ($pf_a as $n => $pf) { $o .= $pf($id, $data, $action); } } if ($pf_a = $ewiki_plugins["view_final"]) { ksort($pf_a); foreach ($pf_a as $n => $pf) { $pf($o, $id, $data, $action); } } if (!empty($_REQUEST["thankyou"]) && $ewiki_config["edit_thank_you"]) { $o = ewiki_t("THANKSFORCONTRIBUTION") . $o; } if (EWIKI_HIT_COUNTING) { ewiki_database("HIT", $data); } return($o);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -