• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP ewiki_auth函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ewiki_auth函数的典型用法代码示例。如果您正苦于以下问题:PHP ewiki_auth函数的具体用法?PHP ewiki_auth怎么用?PHP ewiki_auth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ewiki_auth函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
    }
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:26,代码来源:collectuserdata.php


示例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;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:32,代码来源:pageimage.php


示例3: ewiki_announcements

function ewiki_announcements($id, $data, $action)
{
    global $ewiki_plugins, $ewiki_config;
    if (!isset($GLOBALS['ewiki_auth_user'])) {
        return;
    }
    $notifyDates = ewiki_get_uservar("NotifyDates", FALSE);
    if (!$notifyDates) {
        $notifyDates = $ewiki_config["DefaultNotify"];
    } else {
        $notifyDates = unserialize($notifyDates);
    }
    foreach ($notifyDates as $pageName => $date) {
        $data = ewiki_db::GET($pageName);
        if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($pageName, $data, "view")) {
            continue;
        }
        if ($data['lastmodified'] > $date) {
            $dispDate = $data['lastmodified'];
            $dispPage = $pageName;
            break;
        }
    }
    if (!isset($dispPage)) {
        return;
    }
    $notifyDates[$dispPage] = $dispDate;
    ewiki_set_uservar("NotifyDates", serialize($notifyDates));
    $o = ewiki_page('view/' . $dispPage);
    //page_final plugins have been run, unset them
    unset($ewiki_plugins["page_final"]);
    return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:33,代码来源:announcements.php


示例4: ewiki_powersearch

function ewiki_powersearch($q, $where = 'content')
{
    $q = ewiki_lowercase(preg_replace('/\\s*[\\000-\\040]+\\s*/', ' ', $q));
    $found = array();
    $scored = array();
    #-- initial scan
    foreach (explode(" ", $q) as $search) {
        if (empty($search)) {
            continue;
        }
        $result = ewiki_db::SEARCH($where, $search);
        while ($row = $result->get()) {
            if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
                $id = $row["id"];
                $content = strtolower($row[$where]);
                unset($row);
                #-- have a closer look
                $len1 = strlen($content) + 1;
                if (!isset($scored[$id])) {
                    $scored[$id] = 1;
                }
                $scored[$id] += 800 * (strlen($search) / $len1);
                $scored[$id] += 65 * (count(explode($search, $content)) - 2);
                $p = -1;
                while (($p = strpos($content, $search, $p + 1)) !== false) {
                    $scored[$id] += 80 * (1 - $p / $len1);
                }
            }
            #if-TXT
        }
    }
    #-- output results
    arsort($scored);
    $o = "<ol>\n";
    $n = 0;
    foreach ($scored as $id => $score) {
        #-- refetch page for top 10 entries (still cached by OS or DB)
        $row = $n < 10 ? ewiki_db::GET($id) : NULL;
        #-- check access rights in protected mode
        if (EWIKI_PROTECTED_MODE && !ewiki_auth($id, $row, "view", $ring = false, $force = 0)) {
            if (EWIKI_PROTECTED_MODE_HIDING) {
                continue;
            } else {
                $row["content"] = ewiki_t("FORBIDDEN");
            }
        }
        $o .= "<li>\n";
        $o .= '<div class="search-result ' . ($oe ^= 1 ? "odd" : "even") . '">' . '<a href="' . ewiki_script("", $id) . '">' . $id . "</a> " . "\n";
        #-- top 10 results are printed more verbosely
        if ($n++ < 10) {
            preg_match_all('/([_-\\w]+)/', $row["content"], $uu);
            $text = htmlentities(substr(implode(" ", $uu[1]), 0, 200));
            $o .= "<br />\n<small>{$text}\n" . "<br />" . strftime(ewiki_t("LASTCHANGED"), $row["lastmodified"]) . "<br /><br /></small>\n";
        }
        $o .= "</div>\n";
        $o .= "</li>\n";
    }
    $o .= "</ol>\n";
    return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:60,代码来源:powersearch.php


示例5: ewiki_page_wantedpages

function ewiki_page_wantedpages($id, $data, $action)
{
    #-- collect referenced pages
    $result = ewiki_db::GETALL(array("refs"));
    while ($row = $result->get()) {
        if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
            continue;
        }
        $refs .= $row["refs"];
    }
    #-- build array
    $refs = array_unique(explode("\n", $refs));
    #-- strip existing pages from array
    $refs = ewiki_db::FIND($refs);
    foreach ($refs as $id => $exists) {
        if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
            continue;
        }
        if (!$exists && !strstr($id, "://") && strlen(trim($id))) {
            $wanted[] = $id;
        }
    }
    #-- print out
    $o .= "<ul>\n";
    foreach ($wanted as $page) {
        $o .= "  <li>" . ewiki_link($page) . "</li>\n";
    }
    $o .= "<ul>\n";
    return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:30,代码来源:wantedpages.php


示例6: 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;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:33,代码来源:wordindex.php


示例7: ewiki_page_wiki_dump_tarball

function ewiki_page_wiki_dump_tarball($id = 0, $data = 0, $action = 0)
{
    #-- return legacy page
    if (empty($_REQUEST["download_tarball"])) {
        if ($action == "wikidump") {
            $url = ewiki_script("", "WikiDump");
            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="dump_id" value="{$id}">
<input type="hidden" name="dump_depth" value=1>
<input type="submit" name="download_tarball" value= "_{DOWNLOAD_ARCHIVE}">
<br /><br />
<input type="checkbox" name="dump_images" value="1" checked> _{with images}<br />
<input type="hidden" name="dump_fullhtml" value="1">
<input type="hidden" name="dump_virtual" value="0"><br />
Archive Format:
<select NAME="dump_arctype">
  <option VALUE="ZIP">ZIP
  <option VALUE="TAR">TAR
</select>

</form>
END
);
        } else {
            return "";
        }
    } else {
        $di = $_REQUEST["dump_images"];
        $fh = $_REQUEST["dump_fullhtml"];
        $vp = $_REQUEST["dump_virtual"];
        $rp = $_REQUEST["dump_id"];
        #-- $_REQUEST["dump_depth"]==100 will give a complete dump
        if ($_REQUEST["dump_depth"] > EWIKI_WIKIDUMP_MAXLEVEL && $_REQUEST["dump_depth"] != 100) {
            $dd = EWIKI_WIKIDUMP_MAXLEVEL;
        } else {
            $dd = $_REQUEST["dump_depth"];
        }
        $at = $_REQUEST["dump_arctype"];
        $al = 9;
        #$_REQUEST["dump_arclevel"];
        $_REQUEST = $_GET = $_POST = array();
        if (!ewiki_auth($rp, $str_null, "view")) {
            return ewiki_make_title($id, $id, 2) . "<p>You either do not have permission to access the page {$rp} or it does not exist.</p>";
        }
        ewiki_page_wiki_dump_send($di, $fh, $vp, $rp, $dd, $at, $al);
    }
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:50,代码来源:wikidump2.php


示例8: ewiki_subpage_list

function ewiki_subpage_list($id, $postfix = "")
{
    $_hiding = EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING;
    $result = ewiki_db::SEARCH("id", $id . $postfix);
    while ($row = $result->get()) {
        #-- retrieve and check rights if running in protected mode
        if ($_hiding) {
            if (!ewiki_auth($row["id"], $uu, 'view', $ring = false, $force = 0)) {
                continue;
            }
        }
        $pages[$row["id"]] = "";
    }
    return $pages;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:15,代码来源:subpagelist.php


示例9: ewiki_page_like

function ewiki_page_like($id, $data, $action)
{
    preg_match_all("/([" . EWIKI_CHARS_U . "][" . EWIKI_CHARS_L . "]+)/", $id, $words);
    $pages = array();
    foreach ($words[1] as $find) {
        $result = ewiki_db::SEARCH("id", $find);
        while ($row = $result->get()) {
            if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $row, "view")) {
                continue;
            }
            $pages[$row["id"]] = "";
        }
    }
    $o = ewiki_make_title($id, ewiki_t(strtoupper($action) . "_TITLE"), 3);
    $o .= ewiki_list_pages($pages, 0);
    return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:17,代码来源:like_pages.php


示例10: ewiki_page_random

function ewiki_page_random(&$id, &$data, $action)
{
    global $ewiki_plugins;
    $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) {
            $pages[] = $row["id"];
        }
    }
    $pages = array_merge($pages, $ewiki_plugins["page"]);
    $n = rand(0, count($pages));
    $id = $pages[$n];
    return ewiki_page($id);
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:17,代码来源:randompage.php


示例11: ewiki_page_wantedpages

function ewiki_page_wantedpages($id, $data, $action)
{
    $wanted = array();
    #-- collect referenced pages
    $result = ewiki_database("GETALL", array("refs"));
    while ($row = $result->get()) {
        if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
            continue;
        }
        $refs .= $row["refs"];
    }
    #-- build array
    $refs = array_unique(explode("\n", $refs));
    #-- strip existing pages from array
    $refs = ewiki_database("FIND", $refs);
    foreach ($refs as $id => $exists) {
        if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
            continue;
        }
        if (!$exists && !strstr($id, "://") && strlen(trim($id))) {
            $wanted[] = $id;
        }
    }
    // to prevent empty <ul></ul> getting printed out, we have to interate twice.
    // once to make sure the <ul></ul> is needed at all.
    // MDL-7861, <ul></ul> does not validate.
    $printul = false;
    foreach ($wanted as $page) {
        $link = ewiki_link_regex_callback(array($page, $page));
        if (strstr($link, "?</a>")) {
            $printul = true;
        }
    }
    #-- print out
    if ($printul) {
        $o .= "<ul>";
        foreach ($wanted as $page) {
            $link = ewiki_link_regex_callback(array($page, $page));
            if (strstr($link, "?</a>")) {
                $o .= "<li>" . $link . "</li>";
            }
        }
        $o .= "</ul>";
    }
    return $o;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:46,代码来源:wantedpages.php


示例12: 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_db::SEARCH("meta", $scan);
    $ord = array();
    while ($row = $result->get()) {
        $ord[$row["id"]] = $row["created"];
    }
    arsort($ord);
    foreach ($ord as $id => $uu) {
        $row = ewiki_db::GET($id);
        if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $row, "view")) {
            continue;
        }
        $o .= ewiki_entry_downloads($row, "*");
    }
    return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:19,代码来源:downloadlist.php


示例13: mkLiveWebNavBar

function mkLiveWebNavBar($navBarPage, $activePage)
{
    #-- fetch from db
    $data = ewiki_db::GET($navBarPage);
    #-- Authenticate, return nothing if authentication fails
    if (!ewiki_auth($navBarPage, $data, EWIKI_NAVBAR_ACTION, $ring = 3, $force = 0)) {
        return "";
    }
    #-- escape if navBarPage does not exist or was not retrieved.
    if (empty($data["content"])) {
        return "";
    }
    //echo(":".$data["content"].":");
    $o .= ewiki_navbar_format($data["content"], 1, urlencode($activePage));
    //Apply class only if we have a bar at all
    if ($o) {
        return " <div class='wikiNavBar' >\n" . $o . "\n</div>\n";
    }
    return "";
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:20,代码来源:navbar.php


示例14: ewiki_page_orphanedpages

function ewiki_page_orphanedpages($id, $data, $action)
{
    global $ewiki_links;
    $o = ewiki_make_title($id, ewiki_t($id), 2);
    $pages = array();
    $refs = array();
    $orphaned = array();
    #-- read database
    $db = ewiki_database("GETALL", array("refs", "flags"));
    $n = 0;
    while ($row = $db->get()) {
        $p = $row["id"];
        #-- remove self-reference
        $row["refs"] = str_replace("\n{$p}\n", "\n", $row["refs"]);
        #-- add to list of referenced pages
        $rf = explode("\n", trim($row["refs"]));
        $refs = array_merge($refs, $rf);
        if ($n++ > 299) {
            $refs = array_unique($refs);
            $n = 0;
        }
        // (clean-up only every 300th loop)
        #-- add page name
        if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
            $pages[] = $row["id"];
        }
    }
    $refs = array_unique($refs);
    #-- check pages to be referenced from somewhere
    foreach ($pages as $p) {
        if (!ewiki_in_array($p, $refs)) {
            if (!EWIKI_PROTECTED_MODE || EWIKI_PROTECTED_MODE_HIDING || ewiki_auth($p, $uu, "view")) {
                $orphaned[] = $p;
            }
        }
    }
    #-- output
    $o .= ewiki_list_pages($orphaned, 0);
    return $o;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:40,代码来源:orphanedpages.php


示例15: ewiki_page_index

function ewiki_page_index($id = 0, $data = 0, $action = 0, $args = array())
{
    global $ewiki_plugins;
    $o = ewiki_make_title($id, ewiki_t($id), 2);
    $sorted = array();
    $sorted = array_merge($sorted, array_keys($ewiki_plugins["page"]));
    $exclude = "\n" . implode("\n", preg_split("/\\s*[,;:\\|]\\s*/", $args["exclude"])) . "\n";
    $result = ewiki_database("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) {
            if (!stristr($exclude, "\n" . $row["id"] . "\n")) {
                $sorted[] = $row["id"];
            }
        }
    }
    natcasesort($sorted);
    $o .= ewiki_list_pages($sorted, 0, 0, $ewiki_plugins["list_dict"][0]);
    return $o;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:22,代码来源:pageindex.php


示例16: ewiki_print_control_line_fancy2

function ewiki_print_control_line_fancy2(&$html, $id, $data, $action)
{
    global $ewiki_plugins, $ewiki_t, $ewiki_config;
    #-- produce control links
    $cl = "";
    if (!empty($data["forced_version"])) {
        $cl = '<a href="' . ewiki_script("edit", $id, array("version" => $data["forced_version"], "edit" => "old")) . '">' . ewiki_t("OLDVERCOMEBACK") . "</a>";
    } else {
        foreach ($ewiki_config["action_links"]["view"] as $action => $title) {
            if (!empty($ewiki_plugins["action"][$action])) {
                if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($id, $data, $action)) {
                    continue;
                }
                $cl .= $ins[1] . '<a href="' . (strpos($action, "://") ? $action : ewiki_script($action, $id, $version ? array("version" => $version) : NULL)) . '">[' . ewiki_t($title) . ']</a> ' . $ins[2];
            }
        }
    }
    if ($data["lastmodified"] >= UNIX_MILLENNIUM) {
        $cl .= '<br />' . strftime(ewiki_t("LASTCHANGED"), @$data["lastmodified"]);
    }
    #-- output
    $html = '<div class="controlbox float_right small">' . "{$h2}\n" . '<div style="text-align:right">' . $cl . '</div>' . "</div>\n" . $html;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:23,代码来源:control2.php


示例17: ewiki_cache_generated_pages

function ewiki_cache_generated_pages($id, &$data, $action)
{
    global $ewiki_plugins, $ewiki_ring;
    $o = ewiki_make_title($id, $id, 1);
    if (empty($_REQUEST["generate_cache"])) {
        $o .= "Use this page plugin/tool to generate text database entries for\nall generated ('internal' or 'static') pages available, so those can later\nbe found using the search functions.<br /><br />";
        $o .= '<form action="' . ewiki_script("", $id) . '" method="POST" enctype="text/html">' . '<input type="hidden" name="id" value="' . $id . '">' . '<input type="submit" value="generate cache" name="generate_cache">' . '</form>';
    } elseif (!ewiki_auth($id, $data, $action, $ring = 0, "_FORCE_AUTH=1") || !isset($ewiki_ring) || $ewiki_ring > 0) {
        if (is_array($data)) {
            $data = "You'll need to be admin. See ewiki_auth() and _PROTECTED_MODE in the README.";
        }
        $o .= $data;
    } else {
        unset($_REQUEST["generate_cache"]);
        $o .= "generating cache versions from:<ul>\n";
        foreach ($ewiki_plugins["page"] as $pid => $pf) {
            #echo "$pid:";
            $d = ewiki_db::GET($pid);
            if (empty($d) || empty($d["content"])) {
                $d = array("id" => $pid, "version" => 1, "flags" => EWIKI_DB_F_TEXT, "created" => time(), "content" => "", "meta" => "", "hits" => 0, "refs" => "");
            }
            $d["last_modified"] = time();
            $d["hits"]++;
            $d["content"] = $pf($pid, $d, "view");
            //@ADD - transform <html> back to wikimarkup
            //       here?
            if (ewiki_db::WRITE($d, true)) {
                $o .= "<li>{$pid}</li>\n";
            }
            unset($d);
        }
        $o .= "</ul>";
        ewiki_log("page search cache was updated", 2);
    }
    return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:36,代码来源:page_searchcache.php


示例18: ewiki2_binary_page_handler

function ewiki2_binary_page_handler($id, &$data, $action)
{
    global $ewiki_plugins, $ewiki_errmsg;
    //echo("running handler");
    #-- however we do not handle _DISABLED or _SYSTEM entries
    if (empty($data["flags"]) || !($data["flags"] & EWIKI_DB_F_BINARY) || $data["flags"] & EWIKI_DB_F_SYSTEM || $data["flags"] & EWIKI_DB_F_DISABLED) {
        return ewiki_t("DISABLED");
    }
    #-- _PROTECTED_MODE
    # (Andy: can we print a login <form> once we reached here???)
    if (!ewiki_auth($id, $data, $action, $ring = false, $force = EWIKI_AUTO_LOGIN)) {
        //echo("not authenticated id".$id." action ".$action);
        return $ewiki_errmsg;
    }
    //echo("authenticated  id:".$id." action ".$action);
    #-- chain to one of the action_BINARY plugins
    if ($pf = $ewiki_plugins["action_binary"][$action]) {
        //echo("running ".$pf."()");
        return $pf($id, $data, $action);
    }
    #-- else let ?binary= return the requested 'page' entry
    //Consider binary view here
    //ewiki_binary($id);
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:24,代码来源:protmode.php


示例19: ewiki_valid_pages

function ewiki_valid_pages($bool_allowimages = 0, $virtual_pages = 0)
{
    //$time=getmicrotime();
    global $ewiki_plugins;
    $result = ewiki_database("GETALL", array("flags", "refs", "meta"));
    while ($row = $result->get()) {
        if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $str_null, "view")) {
            continue;
        }
        $isbinary = $row["meta"]["class"] == "image" || $row["meta"]["class"] == "file" ? true : false;
        if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT || ($bool_allowimages ? $isbinary : 0)) {
            $temp_refs = explode("\n", $row["refs"]);
            foreach ($temp_refs as $key => $value) {
                if (empty($value)) {
                    unset($temp_refs[$key]);
                }
            }
            if ($isbinary) {
                $a_validpages[$row["id"]] = $temp_array = array("refs" => $temp_refs, "type" => $row["meta"]["class"], "touched" => FALSE);
            } else {
                $a_validpages[$row["id"]] = $temp_array = array("refs" => $temp_refs, "type" => "page", "touched" => FALSE);
            }
            unset($temp_refs);
        }
    }
    if ($virtual_pages) {
        #-- include virtual pages to the sitemap.
        $virtual = array_keys($ewiki_plugins["page"]);
        foreach ($virtual as $vp) {
            if (!EWIKI_PROTECTED_MODE || !EWIKI_PROTECTED_MODE_HIDING || ewiki_auth($vp, $str_null, "view")) {
                $a_validpages[$vp] = array("refs" => array(), "type" => "page", "touched" => FALSE);
            }
        }
    }
    return $a_validpages;
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:36,代码来源:sitemap.php


示例20: while

#-- read database
$db = ewiki_db::GETALL(array("refs", "flags"));
$n = 0;
while ($row = $db->get()) {
    $p = $row["id"];
    #-- remove self-reference
    $row["refs"] = str_replace("\n{$p}\n", "\n", $row["refs"]);
    #-- add to list of referenced pages
    $rf = explode("\n", trim($row["refs"]));
    $refs = array_merge($refs, $rf);
    if ($n++ > 299) {
        $refs = array_unique($refs);
        $n = 0;
    }
    // (clean-up only every 300th loop)
    #-- add page name
    if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
        $pages[] = $row["id"];
    }
}
$refs = array_unique($refs);
#-- check pages to be referenced from somewhere
foreach ($pages as $p) {
    if (!ewiki_in_array($p, $refs)) {
        if (!EWIKI_PROTECTED_MODE || !EWIKI_PROTECTED_MODE_HIDING || ewiki_auth($p, $uu, "view")) {
            $orphaned[] = $p;
        }
    }
}
#-- output
echo ewiki_list_pages($orphaned, 0);
开发者ID:gpuenteallott,项目名称:rox,代码行数:31,代码来源:OrphanedPages.php



注:本文中的ewiki_auth函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ewiki_database函数代码示例发布时间:2022-05-15
下一篇:
PHP ew_WriteAuditTrail函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap