本文整理汇总了PHP中ewiki_script函数的典型用法代码示例。如果您正苦于以下问题:PHP ewiki_script函数的具体用法?PHP ewiki_script怎么用?PHP ewiki_script使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ewiki_script函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ewiki_uservar_collect
function ewiki_uservar_collect($id, $data, $action)
{
global $ewiki_plugins, $ewiki_config;
if (!isset($GLOBALS['ewiki_auth_user'])) {
return;
}
//Authenticate on the UserInfo page that we will be submitting to.
if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth('UserInfo', $uu, "view")) {
return;
}
foreach ($ewiki_config["CollectedUserData"] as $checkVar => $uu) {
if (strlen(ewiki_get_uservar($checkVar)) == 0) {
$currVar = $checkVar;
break;
}
}
if (isset($currVar)) {
$o = ewiki_make_title($id, "User data update", 2);
$o .= "Our database does not include your {$currVar}, please enter it below:";
$o .= '<p><form method="post" action="' . ewiki_script('UserInfo') . '"><table border="1" cellpadding="1">';
$o .= '<tr><th>' . $currVar . '</th><td><input name="text_' . $currVar . '" type="text"></td></tr>';
$o .= '<tr><td></td><td><input value="Submit Changes" type="submit" name="submit_changeaccount" /></td></tr>';
$o .= '</table></form>';
return $o;
}
}
示例2: ewiki_edit_form_append_pageimgcntrl
function ewiki_edit_form_append_pageimgcntrl($id, $data, $action)
{
global $ewiki_config;
#-- fetch and asort images
$sorted = array();
$result = ewiki_db::GETALL(array("flags", "created", "meta"));
while ($row = $result->get()) {
if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_BINARY && strpos($row['meta']['Content-Type'], 'image/') === 0) {
if (isset($ewiki_config['image-galleries'][EWIKI_PAGE_LOGOCNTRL_GALLERY])) {
foreach ($ewiki_config['image-galleries'][EWIKI_PAGE_LOGOCNTRL_GALLERY] as $field => $value) {
if ($row['meta'][$field] != $value) {
continue 2;
}
}
}
if (!EWIKI_PROTECTED_MODE || EWIKI_PROTECTED_MODE_HIDING <= 0.5 || ewiki_auth($row["id"], $uu, "binary-get")) {
$sorted[$row["id"]] = substr($row['meta']["Content-Location"] . ' (' . $row["id"] . ')', 0, 70);
//echo("adding ".$row["id"].", ".$sorted[$row["id"]]."<br />");
}
}
}
arsort($sorted);
#-- start selector
$o = '
<br /><label for="pageimagecntrl">Choose Page Image (<A href="' . ewiki_script(EWIKI_PAGE_LOGOCNTRL_GALLERY) . '">view thumbnails</A>):</label>
<select id="pageimagecntrl" name="pageimagecntrl">' . '<option value="-1" ' . (!isset($data['meta']['pageimage']) || $data['meta']['pageimage'] == '' ? ' selected="selected"' : '') . '>None</option>';
foreach ($sorted as $image => $name) {
$o .= '<option value="' . htmlentities($image) . '"' . (isset($data['meta']['pageimage']) && $image == $data['meta']['pageimage'] ? ' selected="selected"' : '') . '>' . htmlentities($name) . '</option>';
}
$o .= "</select>\n";
return $o;
}
示例3: ewiki_page_wikiuserlogin
function ewiki_page_wikiuserlogin($id, $data, $action)
{
$o .= "<h2>{$id}</h2>\n";
if (empty($_GET["wikiauthor"])) {
$o .= '
<form action="' . ewiki_script("login", $id) . '" method="get">
your WikiName <input type="text" name="wikiauthor" size="20">
<br /><br />
<input type="submit" value="log in">
<input type="hidden" name="page" value="' . $id . '">
<br /><br />
<input type="checkbox" name="forever" value="1"> make cookie persistent forever
</form>
';
} else {
$o .= '
Your author name is now set to "' . $_GET["wikiauthor"] . '". Please go ahead and
start editing pages.
';
if ($_REQUEST["forever"]) {
setcookie("wikiauthor", $_GET["wikiauthor"]);
} else {
setcookie("wikiauthor", $_GET["wikiauthor"], time() * 1.2);
}
}
return $o;
}
示例4: ewiki_addpage
function ewiki_addpage($id, &$data, $version)
{
$o = ewiki_make_title($id, $id, 2);
#-- output page creation dialog
if (empty($_REQUEST["new_id"])) {
$o .= ewiki_t('<form action="' . ewiki_script("", $id) . '" method="POST" enctype="multipart/formdata"> ' . '_{name of the new page} <input type="text" name="new_id" size="26" value="">' . '<br />' . '<input type="submit" value="_{create}">' . '<br /><br />' . '<input type="checkbox" name="add_link_from" value="1" checked="checked">' . ' _{link it from} ' . '<input type="text" name="link_from" size="20" value="_{AddedPages}">' . '</form>');
} else {
$new_id = trim($_REQUEST["new_id"]);
#-- add a link to new page
if ($_REQUEST["add_link_from"] && ($from = $_REQUEST["link_from"])) {
$row = ewiki_db::GET($from);
if ($row && $row["version"]) {
if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
$row["version"]++;
$row["content"] .= "\n* [{$new_id}]";
ewiki_scan_wikiwords($row["content"], $row["refs"], "_STRIP_EMAIL=1");
$row["refs"] = "\n\n" . implode("\n", array_keys($row["refs"])) . "\n\n";
} else {
$row = false;
}
} else {
$row = array("id" => $from, "version" => 1, "flags" => EWIKI_DB_F_TEXT, "created" => time(), "lastmodified" => time(), "hits" => 0, "meta" => "", "content" => "\n* [{$new_id}]", "refs" => "\n\n{$new_id}\n\n");
}
if ($row) {
ewiki_db::WRITE($row);
}
}
#-- call edit <form>
$o = ewiki_page($new_id);
}
return $o;
}
示例5: ewiki_action_info_qdiff
function ewiki_action_info_qdiff($id, &$data, $action)
{
$CLK = "%c";
$o = ewiki_make_title($id, "history of '{$id}'", 2);
#-- walk through versions
$prev = (array) $data;
$ver = $data["version"] + 1;
while (--$ver >= 2) {
#-- get
if ($d = ewiki_db::GET($id, $ver - 1)) {
$curr = $prev;
$prev = $d;
$d = NULL;
} else {
continue;
}
#-- info header
$o .= '<table border="1">' . "\n" . '<tr class="qdiff-header"><td>' . '<b><a href="' . ewiki_script("", $id, "version={$ver}") . "\">version {$ver}</a></b>" . '</td><td>' . ewiki_author_html($curr["author"]) . '</td><td>' . strftime($CLK, $curr["lastmodified"]) . "</td></tr>\n";
#-- diff part
$diff = ewiki_stupid_diff($curr["content"], $prev["content"], $show_unchanged = 0, $magic_notes = 1);
$o .= '<td colspan="3">' . $diff;
$o .= "\n</td></tr>\n</table>\n<br />\n";
}
// add initial version:
$d = ewiki_db::GET($id, 1);
$o .= '<table border="1">' . "\n" . '<tr class="qdiff-header"><td>' . '<b><a href="' . ewiki_script("", $id, "version=" . $d["version"]) . "\">version " . $d["version"] . "</a></b>" . '</td><td>' . ewiki_author_html($d["author"]) . '</td><td>' . strftime($CLK, $d["lastmodified"]) . "</td></tr>\n";
#-- diff part
$o .= '<td colspan="3">' . nl2br($d["content"]);
$o .= "\n</td></tr>\n</table>\n<br />\n";
return $o;
}
示例6: ewiki_view_append_attachments
function ewiki_view_append_attachments($id, $data, $action)
{
$o = '<hr /><h4><a href="' . ewiki_script(EWIKI_ACTION_ATTACHMENTS, $id) . '">' . ewiki_t("ATTACHMENTS") . '</a></h4>';
$scan = 's:7:"section";' . serialize($id);
$result = ewiki_database("SEARCH", array("meta" => $scan));
#### BEGIN MOODLE CHANGES - show attachments link only if there are attachments.
#### - don't show the attachments on the content page.
if (count($result->entries) <= 0) {
$o = '';
}
// $ord = array();
// while ($row = $result->get()) {
// $ord[$row["id"]] = $row["created"];
// }
// arsort($ord);
//
// foreach ($ord as $id => $uu) {
// $row = ewiki_database("GET", array("id"=>$id));
// if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $row, "view")) {
// continue;
// }
// $o .= ewiki_entry_downloads($row, "*");
// }
#### END MOODLE CHANGES
return $o;
}
示例7: ewiki_page_wiki_dump_tarball
function ewiki_page_wiki_dump_tarball($id, $data, $action)
{
#-- return legacy page
if (empty($_REQUEST["download_tarball"])) {
$url = ewiki_script("", $id);
return ewiki_make_title($id, $id, 2) . ewiki_t(<<<END
_{WIKIDUMP}
<br /><br />
<form action="{$url}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="id" value="{$id}">
<input type="submit" name="download_tarball" value="_{download tarball}">
<br /><br />
<input type="checkbox" name="dump_images" value="1"> _{with images}<br />
<input type="checkbox" name="dump_virtual" value="1"> _{include virtual pages}<br />
<input type="checkbox" name="dump_fullhtml" value="1" checked> _{complete .html files}<br />
<input type="checkbox" name="dump_linksto" value="1"> _{with backlink pages}<br />
</form>
END
);
} else {
$di = $_REQUEST["dump_images"];
$fh = $_REQUEST["dump_fullhtml"];
$bl = $_REQUEST["dump_linksto"];
$vp = $_REQUEST["dump_virtual"];
$_REQUEST = $_GET = $_POST = array();
set_time_limit(180);
ewiki_page_wiki_dump_send($di, $fh, $vp, $bl);
}
}
示例8: ewiki_createpage
function ewiki_createpage($id, &$data, $version)
{
$o = ewiki_make_title($id, $id, 2);
#-- output page creation dialog
$o .= ewiki_t('<form action="' . ewiki_script("", "") . '" method="POST" enctype="multipart/formdata"> ' . '_{name of the new page} <input type="text" name="id" size="26" value="">' . '<br />' . '<input type="submit" value="_{create}">' . '</form>');
return $o;
}
示例9: ewiki_edit_form_append_updFormat
function ewiki_edit_form_append_updFormat($id, $data, $action)
{
global $ewiki_ring;
if (!ewiki_auth_perm_liveuser($id, $data, 'manage', $ewiki_ring, 0)) {
return '';
}
return ' <a href="' . ewiki_script('updformatheader', $id) . '">' . ewiki_t("UPDHEADERFORMAT") . '</a>';
}
示例10: ewiki_page_aboutplugins
function ewiki_page_aboutplugins($id, $data, $action)
{
global $ewiki_plugins;
$o = ewiki_make_title($id, $id, 2);
#-- plugin types
foreach (array("page", "action", "mpi") as $pclass) {
$o .= "<u>{$pclass} plugins</u><br />\n";
switch ($pclass) {
case "page":
$o .= "dynamically generated pages<br />\n";
break;
case "action":
$o .= "can be activated on each (real) page<br />\n";
break;
case "mpi":
$o .= "the markup plugins can be utilized to integrate dynamic content into pages<small> (loaded on demand, so rarely shown here)</small><br />\n";
break;
default:
}
if ($pf_a = $ewiki_plugins[$pclass]) {
ksort($pf_a);
if ($pclass == "action") {
$pf_a = array_merge($pf_a, $ewiki_plugins["action_always"]);
}
foreach ($pf_a as $i => $pf) {
switch ($pclass) {
case "page":
$i = '<a href="' . ewiki_script("", $i) . '">' . $i . '</a>';
break;
case "action":
$i = '<a href="' . ewiki_script($i, "Notepad") . '">' . $i . '</a>';
break;
case "mpi":
$i = '<a href="' . ewiki_script("mpi/{$i}") . '"><?plugin ' . $i . '?></a>';
break;
default:
}
$o .= "· <b>{$i}</b> <small>via {$pf}</small><br />\n";
}
}
$o .= "<br />\n";
}
#-- task plugins
$o .= "<u>task plugins</u> (core stuff)<br />\n";
$o .= "enhance the wiki engine internally, with widely varying functionality enhancements or changes<br />\n";
foreach ($ewiki_plugins as $i => $a) {
if (is_array($a)) {
foreach ($a as $n => $pf) {
if (is_int($n)) {
$o .= "· <b><tt>{$i}</tt></b> <small>via {$pf}</small><br />\n";
}
}
}
}
$o .= "<br />\n";
return $o;
}
示例11: ewiki_mpi_survey
function ewiki_mpi_survey($action, &$args, &$iii, &$s)
{
global $ewiki_id, $ewiki_plugins;
$o = "";
#-- load data page
if (!($df = $args["data"])) {
return;
}
unset($args["data"]);
unset($args["_"]);
unset($args[""]);
$data = ewiki_db::GET($df);
if (!$data["version"]) {
$data = ewiki_new_data($df, EWIKI_DB_F_BINARY);
$data["version"]--;
}
if ($data["flags"] != EWIKI_DB_F_BINARY) {
return;
}
$survey = unserialize($data["content"]);
#-- operation
$vote = @$_REQUEST[EWIKI_UP_SURVEY];
if ($vote == "\$") {
$action = "show";
}
if ($action == "html") {
#-- show entries
if (!$vote) {
$o = "\n" . '<form action="' . $_SERVER["REQUEST_URI"] . '" method="POST" enctype="multipart/form-data">' . '<input type="hidden" name="id" value="' . htmlentities($ewiki_id) . '">' . "\n";
foreach ($args as $name => $text) {
if (!$name || !$text || $name == "data") {
continue;
}
$o .= '<input type="radio" name="' . EWIKI_UP_SURVEY . '" value="' . htmlentities($name) . '"> ' . $text . "<br />\n";
}
$o .= '<input type="submit" value="vote">';
$o .= "\n</form>\n<br /><br />\n";
$o .= '<a href="' . ewiki_script("", $ewiki_id, array(EWIKI_UP_SURVEY => "\$")) . '">show results</a><br />';
}
#-- store an entry
if ($vote) {
$survey[$vote]++;
$data["content"] = serialize($survey);
$data["version"]++;
$data["lastmodified"] = time();
$data["author"] = ewiki_author();
ewiki_db::WRITE($data);
#-- show it
$action = "show";
}
}
if ($action == "show") {
$o .= $ewiki_plugins["view_stat"][0]($survey, $args);
}
return $o;
}
示例12: ewiki_view_append_backlinks
function ewiki_view_append_backlinks($id, $data, $action)
{
$pages = ewiki_get_backlinks($id);
$o = "";
foreach ($pages as $id) {
$o .= ' <a href="' . ewiki_script("", $id) . '">' . $id . '</a>';
}
$o && ($o = "<div class=\"wiki_backlinks\"><small>" . get_string('backlinks', 'wiki') . ":</small><br />{$o}</div>\n");
return $o;
}
示例13: ewiki_tcn_view_final_add_variants
function ewiki_tcn_view_final_add_variants(&$o, $id, &$data, &$action)
{
global $ewiki_variants;
if (count($ewiki_variants) >= 2) {
$add = '<div class="language-variants">';
foreach ($ewiki_variants as $v_id => $v_l) {
$add .= " <a href=\"" . ewiki_script($action, $v_id, array(EWIKI_UP_FORCE_LANG => $v_l)) . "\" class=\"lang {$v_l}\" lang=\"{$v_l}\">{$v_l}</a> ";
}
$add .= '</div>' . "\n";
$o = $add . $o;
}
}
示例14: ewiki_page_sitemap
function ewiki_page_sitemap($id = 0, $data = 0, $action = 0)
{
global $ewiki_config;
//**code hijacked from page_pageindex.php**
//creates a list of all of the valid wiki pages in the site
$str_null = NULL;
$a_validpages = ewiki_valid_pages(0, 1);
//**end of hijacked code**
//$time_end=getmicrotime();
//creates the title bar on top of page
if ($id == EWIKI_PAGE_SITEMAP) {
$o = ewiki_make_title($id, ewiki_t($id), 2);
foreach ($ewiki_config["SiteMap"]["RootList"] as $root) {
if (isset($a_validpages[$root])) {
$valid_root = TRUE;
$str_rootid = $root;
break;
}
}
} else {
$o = ewiki_make_title($id, ewiki_t("SMFOR") . " " . $id, 2);
if (isset($a_validpages[$id])) {
$valid_root = TRUE;
$str_rootid = $id;
}
}
$o .= "<p>" . ewiki_t("VIEWSMFOR") . " ";
foreach ($ewiki_config["SiteMap"]["RootList"] as $root) {
if (isset($a_validpages[$root])) {
$o .= '<a href="' . ewiki_script('sitemap/', $root) . '">' . $root . '</a> ';
}
}
$o .= "</p>";
//checks to see if the user is allowed to view the root page
if (!isset($a_validpages[$str_rootid])) {
$o .= ewiki_t("INVALIDROOT");
return $o;
}
//$timesitemap=getmicrotime();
$a_sitemap = ewiki_sitemap_create($str_rootid, $a_validpages, EWIKI_SITEMAP_DEPTH);
$timer = array();
$level = -1;
$fordump = 0;
$str_formatted = "<ul>\n<li><a href=\"" . EWIKI_SCRIPT . $str_rootid . "\">" . $str_rootid . "</a></li>";
$fin_level = format_sitemap($a_sitemap, $str_rootid, $str_formatted, $level, $timer, $fordump);
$str_formatted .= "</ul>" . str_pad("", $fin_level * 6, "</ul>\n");
$o .= $str_formatted;
//$timesitemap_end=getmicrotime();
//$o.="GetAll: ".($time_end-$time)."\n";
//$o.="SiteMap: ".($timesitemap_end-$timesitemap)."\n";
//$o.="Total: ".($timesitemap_end-$time);
return $o;
}
示例15: ewiki_view_append_blog
function ewiki_view_append_blog($id, $data, $action)
{
global $ewiki_config;
if (!calendar_exists(false)) {
return;
}
#-- conf
($n_num = $ewiki_config["wikinews_num"]) || ($n_num = 10);
($n_len = $ewiki_config["wikinews_len"]) || ($n_len = 512);
$o = '<div class="text-blog">' . ewiki_wikinews_summary($n_num, $n_len, '/^' . $id . EWIKI_NAME_SEP . '\\d{8}$/') . '</div>';
$o .= '<a href="' . ewiki_script("calendarlist", $id) . '">View all log entries.</a>';
return $o;
}