本文整理汇总了PHP中ewiki_make_title函数的典型用法代码示例。如果您正苦于以下问题:PHP ewiki_make_title函数的具体用法?PHP ewiki_make_title怎么用?PHP ewiki_make_title使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ewiki_make_title函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: ewiki_page_recentchanges
function ewiki_page_recentchanges($recentchanges, $data, $action)
{
global $ewiki_plugins, $ewiki_links;
#-- start output
$ewiki_links = true;
$o = "";
$o .= ewiki_make_title($recentchanges, $recentchanges, 2);
#-- options
$minor_edits = $_GET["minor"] ? 1 : 0;
#-- select timeframe
if (($days = $_REQUEST["days"]) < 1) {
$days = 7;
}
$timeframe = time() - $days * 24 * 3600;
#-- fetch pages modified in given timeframe
$result = ewiki_db::GETALL(array("meta", "lastmodified", "author"));
$changes = array();
$meta = array();
while ($row = $result->get(0, 0x137, EWIKI_DB_F_TEXT)) {
if ($row["lastmodified"] >= $timeframe) {
#-- id->time array
$id = $row["id"];
$changes[$id] = $row["lastmodified"];
#-- collect also info for previous changes of current page
$meta[$id] = array();
ewiki_page_rc_more($row, $meta[$id], $timeframe, $minor_edits);
}
}
#-- sort results into date catalogue
arsort($changes);
$last_date = "";
$datestr = ewiki_t("DAY");
$e = array();
foreach ($changes as $id => $date) {
$date = strftime($datestr, $date);
if ($date != $last_date) {
$last_date = $date;
}
$e[$date][] = $id;
unset($changes[$id]);
}
#-- mk output
$o .= $ewiki_plugins["rc"][0]($e, $meta);
#-- add an <form>
if ($days == 7) {
$days = 30;
}
$url = ewiki_script("", $recentchanges);
$o .= ewiki_t(<<<EOT
<br />
<form action="{$url}" method="GET">
<input type="hidden" name="id" value="{$recentchanges}">
_{show last} <input type="text" name="days" value="{$days}" size="5">
<input type="submit" value="_{days}">
</form>
<br />
EOT
);
return $o;
}
示例3: 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;
}
}
示例4: ewiki_page_pluginstall
function ewiki_page_pluginstall($id, $data, $action)
{
global $ewiki_config, $ewiki_plugins;
$jpi_support = function_exists("js_compile") && function_exists("jsa_generate");
$jpi_access = XPI_EVERYBODY_JPI && $jsi_support;
#-- title
$o .= ewiki_make_title($id, $id, 2);
$o .= '<form action="' . $_SERVER["REQUEST_URI"] . '" method="POST" enctype="multipart/form-data">' . '<input type="hidden" name="id" value="' . htmlentities($id) . '">';
#-- pw, access
$access = 0;
$o .= ewiki_xpi_password($access, $jpi_access);
#-- upload & install
if ($access || $jpi_access) {
$o .= '<div class="xpi-upload"><h4>.xpi plugin upload</h4>';
#-- if filename received => upload+install
if ($xpi_install_fn = $_REQUEST["install_remote_xpi"] or $_REQUEST["install_xpi"] && ($xpi_install_fn = $_FILES["xpi_file"]["tmp_name"])) {
$o .= ewiki_xpi_install($xpi_install_fn, $access, $jsi_access, $jsi_support);
} else {
$o .= ewiki_xpi_show_remote_repository();
$o .= ewiki_xpi_upload_form();
}
$o .= '</div><br />';
}
#-- plugin control
$o .= ewiki_xpi_plugin_control_centre();
return $o;
}
示例5: ewiki_extract
function ewiki_extract($id, $data, $action)
{
global $ewiki_links, $ewiki_config, $ewiki_plugins, $ewiki_ring, $ewiki_title;
$extracttypes = $ewiki_config["extracttypes"][$action];
$o = ewiki_make_title($id, ewiki_t(strtoupper($action) . "FROM") . $ewiki_title, 2, $action, "", "_MAY_SPLIT=1");
//ignore any number of list markup tags in front of an @@{todotype},
//extract only the @@, the types, and their message
//or
//extract any header line
//1 2 3 4-Class 5 6
preg_match_all("/^(([-;:#\\* ]*)(@@(" . implode("|", $extracttypes) . ")(.*))|(!+.*))\$/im", $data["content"], $matches);
for ($index = 0; $index < sizeof($matches[0]); $index++) {
//a line will be either header or todo, concatenate the two sub expressions
$extractedContent .= $matches[3][$index] . $matches[6][$index] . "\n\n";
}
//Render extracted lines as a wiki page, this code extracted from ewiki_page
#-- render requested wiki page <-- goal !!!
$o .= "<div class='ewiki_page_todolist'>" . $ewiki_plugins["render"][0]($extractedContent . ewiki_t(strtoupper($action) . "POSTSCRIPT"), 1, EWIKI_ALLOW_HTML || @$data["flags"] & EWIKI_DB_F_HTML) . "</div>";
#-- 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) {
if (!preg_match('/_title/', $pf)) {
$pf($o, $id, $data, $action);
}
}
}
return $o;
}
示例6: 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;
}
示例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_page_wordindex
function ewiki_page_wordindex($id, $data, $action)
{
global $ewiki_plugins;
$o = ewiki_make_title($id, $id, 2);
$src = "";
$result = ewiki_db::GETALL(array("flags"));
while ($row = $result->get()) {
if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
continue;
}
if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
$src .= " " . $row["id"];
}
}
$src = ewiki_split_title($src, "SPLIT", 0);
$chars = strtr(EWIKI_CHARS_U . EWIKI_CHARS_L, "_", " ");
$src = preg_replace("/[^{$chars}]/", " ", $src);
$src = explode(" ", $src);
$src = array_unique($src);
//@ADD: word counting
unset($src[""]);
natcasesort($src);
$sorted = array();
foreach ($src as $i => $word) {
if (strlen($word) >= 2) {
$sorted[] = array(EWIKI_PAGE_POWERSEARCH, array("where" => "id", "q" => $word), $word, "");
}
}
unset($src);
$pf_list_pages = $ewiki_plugins["list_dict"][0];
$o .= ewiki_list_pages($sorted, $limit = 0, $vat = 1, $pf_list_pages);
return $o;
}
示例10: ewiki_page_liveuser_chprefs
/**
* changes user preferences based on form input
*
* @param mixed id
* @param mixed data
* @return mixed
*/
function ewiki_page_liveuser_chprefs($id, $data)
{
global $liveuser, $liveuserDB;
// if form was submitted, write
if (isset($_REQUEST['submit_prefs'])) {
return ewiki_t('CHPWFORM');
}
ob_start();
echo ewiki_make_title($id, $id, 2);
$results = $liveuserDB->getAll('SELECT * FROM ' . LW_PREFIX . '_prefs_fields');
foreach ($results as $result) {
if (isset($_REQUEST[$result['field_name']])) {
liveuser_pref_setPref($liveuser->getHandle(), $result['field_name'], $_REQUEST[$result['field_name']]);
}
}
echo '<form action="" method="post"><table border="1">';
foreach ($results as $result) {
echo '<tr><td>';
echo '<label for="' . $result['field_name'] . '">' . $result['field_name'] . '</label></td><td>';
echo '<input id="' . $result['field_name'] . '" name="' . $result['field_name'] . '" type="text" ';
echo ' value=' . liveuser_pref_getPref($liveuser->getHandle(), $result['field_name']) . '></td></tr>';
}
echo '<tr><td colspan="2"><input type="reset" text="Reset"><input type="submit"></td></tr></table></form>';
$o = ob_get_contents();
ob_end_clean();
return $o;
}
示例11: 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;
}
示例12: ewiki_page_gnu_diff_safemode
function ewiki_page_gnu_diff_safemode($id, &$data, $action)
{
#-- different operation modes of GNU diff:
$OPTIONS = " -B -u -U 50 ";
# $OPTIONS = " -B ";
# $OPTIONS = " -c ";
# $OPTIONS = " --side-by-side ";
#-- fetch old wiki source
if (($old_ver = ($new_ver = $data["version"]) - 1) > 0) {
$data0 = ewiki_db::GET($id, $old_ver);
}
$o = ewiki_make_title($id, "Differences between version {$new_ver} and {$old_ver} of »{$id}«");
#-- create temporary files from wikipages
$file0 = tempnam(EWIKI_TMP, "ewiki.diff.gnu.");
$f = fopen($file0, "w");
fwrite($f, $data0["content"]);
fclose($f);
$file1 = tempnam(EWIKI_TMP, "ewiki.diff.gnu.");
$f = fopen($file1, "w");
fwrite($f, $data["content"]);
fclose($f);
#-- parse thru GNU diff util
$fn = addslashes($id);
$OPTIONS .= " --label='{$fn} (version {$old_ver})' --label='{$fn} (version {$new_ver})' ";
//following lines replace the original
//$diff = shell_exec("diff $OPTIONS $file0 $file1");
$dfd = popen("diff {$OPTIONS} {$file0} {$file1}", "r");
$diff = "";
while (!feof($dfd)) {
$diff .= fread($dfd, 5000);
}
pclose($dfd);
//end of moderation
#-- remove temporary files
unlink($file0);
unlink($file1);
#-- encolor diff output
foreach (explode("\n", $diff) as $dl) {
$str = substr($dl, 1);
switch (substr($dl, 0, 1)) {
case "<":
case "-":
$o .= "<b>-</b><font color=\"#990000\"> <tt>{$str}</tt></font><br />\n";
break;
case ">":
case "+":
$o .= "<b>+</b><font color=\"#009900\"> <tt>{$str}</tt></font><br />\n";
break;
case "*":
case "-":
break;
default:
$o .= "<small><tt>{$dl}</tt></small><br />";
}
}
return $o;
}
示例13: ewiki_page_wikinews
function ewiki_page_wikinews($newsid, $data, $action)
{
global $ewiki_config;
#-- conf
($n_num = $ewiki_config["wikinews_num"]) || ($n_num = 10);
($n_len = $ewiki_config["wikinews_len"]) || ($n_len = 512);
($c_regex = $ewiki_config["wikinews_regex"]) || ($c_regex = false);
return ewiki_make_title($newsid, $newsid, 2) . ewiki_wikinews_summary($n_num, $n_len, $c_regex);
}
示例14: ewiki_password_status
function ewiki_password_status($id, &$data, $action)
{
global $liveuser;
$passwd_status = ewiki_get_uservar("passwdstatus", 'expired');
if ($passwd_status != 'good' && $id != "Logout" && $id != "ChangePassword" && $liveuser->isLoggedIn()) {
return ewiki_make_title($id, "Change Password:") . "<p>You password has expired</p>" . ewiki_t("CHPW_FORM");
}
return 0;
}
示例15: ewiki_page_ewikilog
function ewiki_page_ewikilog($id, $data, $action)
{
ob_start();
echo ewiki_make_title($id, $id, 2);
echo '<pre>';
readfile(EWIKI_LOGFILE);
echo '</pre>';
$o = ob_get_contents();
ob_end_clean();
return $o;
}